intelicoreact 1.4.83 → 1.4.85

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 (273) 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 +85 -141
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +62 -79
  16. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +4 -0
  17. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +75 -126
  18. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
  19. package/dist/Atomic/FormElements/Input/Input.js +160 -256
  20. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
  21. package/dist/Atomic/FormElements/InputColor/InputColor.js +26 -41
  22. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +38 -76
  23. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +109 -177
  24. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
  25. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
  26. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
  27. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
  28. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +77 -194
  29. package/dist/Atomic/FormElements/InputLink/InputLink.js +32 -58
  30. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
  31. package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
  32. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  33. package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
  34. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
  35. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  36. package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
  37. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +299 -459
  38. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  39. package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
  40. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +51 -113
  41. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
  42. package/dist/Atomic/FormElements/Label/Label.js +14 -24
  43. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
  44. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
  45. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
  46. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
  47. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
  48. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
  49. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
  50. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
  51. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
  52. package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
  53. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
  54. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +148 -326
  55. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +389 -588
  56. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
  57. package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
  58. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +23 -41
  59. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
  60. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
  61. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
  62. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
  63. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
  64. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  65. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
  66. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +47 -98
  67. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +485 -713
  68. package/dist/Atomic/FormElements/Text/Text.js +47 -53
  69. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
  70. package/dist/Atomic/FormElements/Textarea/Textarea.js +31 -47
  71. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
  72. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
  73. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
  74. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -123
  75. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
  76. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
  77. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
  78. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
  79. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
  80. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  81. package/dist/Atomic/Layout/Header/Header.js +21 -48
  82. package/dist/Atomic/Layout/MainMenu/MainMenu.js +35 -77
  83. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
  84. package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
  85. package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
  86. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +48 -104
  87. package/dist/Atomic/UI/AccordionText/AccordionText.js +21 -54
  88. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +47 -92
  89. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
  90. package/dist/Atomic/UI/Alert/Alert.js +22 -51
  91. package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
  92. package/dist/Atomic/UI/Box/Box.js +14 -21
  93. package/dist/Atomic/UI/Button/Button.js +26 -35
  94. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
  95. package/dist/Atomic/UI/Chart/Chart.js +45 -86
  96. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
  97. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
  98. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
  99. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
  100. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
  101. package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
  102. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
  103. package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
  104. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +13 -37
  105. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
  106. package/dist/Atomic/UI/DoubleString/DoubleString.js +34 -63
  107. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
  108. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
  109. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
  110. package/dist/Atomic/UI/Hint/Hint.js +67 -122
  111. package/dist/Atomic/UI/Hint/partial/_utils.js +52 -0
  112. package/dist/Atomic/UI/Hint/partials/_utils.js +14 -29
  113. package/dist/Atomic/UI/Modal/Modal.js +147 -184
  114. package/dist/Atomic/UI/Modal/ModalHOC.js +15 -26
  115. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
  116. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
  117. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +99 -161
  118. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
  119. package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
  120. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  121. package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
  122. package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
  123. package/dist/Atomic/UI/Price/Price.js +10 -13
  124. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
  125. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +28 -58
  126. package/dist/Atomic/UI/Status/Status.js +19 -30
  127. package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
  128. package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
  129. package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
  130. package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
  131. package/dist/Atomic/UI/Table/Table.js +27 -47
  132. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
  133. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
  134. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -6
  135. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +22 -39
  136. package/dist/Atomic/UI/Tag/Tag.js +59 -94
  137. package/dist/Atomic/UI/TagList/TagList.js +81 -144
  138. package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
  139. package/dist/Atomic/UI/WizardStepper/constructor.js +7 -15
  140. package/dist/Atomic/UI/WizardStepper/index.js +1 -5
  141. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +20 -26
  142. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
  143. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +26 -39
  144. package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
  145. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +23 -42
  146. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
  147. package/dist/Atomic/UI/WizardStepper/ui/icons.js +40 -49
  148. package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
  149. package/dist/Classes/AbortableFetch.js +283 -422
  150. package/dist/Classes/AnimatedHandler.js +44 -56
  151. package/dist/Classes/RESTAPI/index.js +158 -441
  152. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
  153. package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
  154. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +83 -353
  155. package/dist/Classes/RESTAPI/partials/ApiUtils.js +161 -403
  156. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +159 -400
  157. package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
  158. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  159. package/dist/Classes/RESTAPI/partials/_utils.js +103 -398
  160. package/dist/Constants/index.constants.js +8 -15
  161. package/dist/Functions/Portal.js +14 -33
  162. package/dist/Functions/customEventListener.js +9 -24
  163. package/dist/Functions/fieldValueFormatters.js +147 -209
  164. package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
  165. package/dist/Functions/locale/createTranslator.js +13 -28
  166. package/dist/Functions/operations.js +35 -49
  167. package/dist/Functions/presets/inputMaskPresets.js +25 -27
  168. package/dist/Functions/presets/inputPresets.js +19 -22
  169. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  170. package/dist/Functions/schemas.js +6 -15
  171. package/dist/Functions/useBodyScrollLock.js +4 -9
  172. package/dist/Functions/useClickOutside.js +3 -7
  173. package/dist/Functions/useDebounce.js +11 -25
  174. package/dist/Functions/useFieldFocus.js +42 -67
  175. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
  176. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
  177. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
  178. package/dist/Functions/useFormTools/functions/General.js +80 -99
  179. package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
  180. package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
  181. package/dist/Functions/useFormTools/index.js +380 -592
  182. package/dist/Functions/useInputHighlightError.js +27 -52
  183. package/dist/Functions/useIsMobile.js +15 -39
  184. package/dist/Functions/useKeyPress/useHandleKeyPress.js +10 -15
  185. package/dist/Functions/useKeyPress/useKeyPress.js +18 -35
  186. package/dist/Functions/useLocalStorage.js +7 -22
  187. package/dist/Functions/useLocationParams.js +16 -27
  188. package/dist/Functions/useMediaQuery.js +10 -27
  189. package/dist/Functions/useMetaInfo.js +19 -50
  190. package/dist/Functions/useMouseUpOutside.js +2 -5
  191. package/dist/Functions/useOnlineStatus.js +7 -26
  192. package/dist/Functions/usePasswordChecker.js +42 -77
  193. package/dist/Functions/usePrevious.js +3 -7
  194. package/dist/Functions/useResize.js +12 -32
  195. package/dist/Functions/useScrollTo.js +6 -20
  196. package/dist/Functions/useToggle.js +10 -30
  197. package/dist/Functions/utils.js +188 -386
  198. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
  199. package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
  200. package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
  201. package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
  202. package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
  203. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
  204. package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
  205. package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
  206. package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
  207. package/dist/Molecular/CustomIcons/components/Button.js +11 -22
  208. package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
  209. package/dist/Molecular/CustomIcons/components/Check.js +12 -23
  210. package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
  211. package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
  212. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
  213. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
  214. package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
  215. package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
  216. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
  217. package/dist/Molecular/CustomIcons/components/Close.js +13 -24
  218. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
  219. package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
  220. package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
  221. package/dist/Molecular/CustomIcons/components/Email.js +29 -40
  222. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
  223. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
  224. package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
  225. package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
  226. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
  227. package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
  228. package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
  229. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
  230. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
  231. package/dist/Molecular/CustomIcons/components/Home.js +14 -25
  232. package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
  233. package/dist/Molecular/CustomIcons/components/Key.js +19 -30
  234. package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
  235. package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
  236. package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
  237. package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
  238. package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
  239. package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
  240. package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
  241. package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
  242. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
  243. package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
  244. package/dist/Molecular/CustomIcons/components/Play.js +24 -35
  245. package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
  246. package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
  247. package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
  248. package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
  249. package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
  250. package/dist/Molecular/CustomIcons/components/Star.js +10 -21
  251. package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
  252. package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
  253. package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
  254. package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
  255. package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
  256. package/dist/Molecular/CustomIcons/components/User.js +16 -27
  257. package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
  258. package/dist/Molecular/CustomIcons/components/X.js +11 -22
  259. package/dist/Molecular/CustomIcons/index.js +61 -183
  260. package/dist/Molecular/FormElement/FormElement.js +19 -28
  261. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +91 -112
  262. package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -37
  263. package/dist/Molecular/InputAddress/InputAddress.js +176 -312
  264. package/dist/Molecular/InputPassword/InputPassword.js +15 -39
  265. package/dist/index.js +1 -3
  266. package/package.json +1 -1
  267. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -119
  268. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  269. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  270. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  271. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  272. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
  273. package/dist/Functions/presets/inputMaskPreset.js +0 -176
@@ -1,406 +1,260 @@
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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
15
-
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
-
18
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
-
20
9
  var _react = _interopRequireWildcard(require("react"));
21
-
22
10
  var _classnames = _interopRequireDefault(require("classnames"));
23
-
24
11
  var _reactDom = require("react-dom");
25
-
26
12
  var _reactFeather = require("react-feather");
27
-
28
13
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
29
-
30
14
  var _useDebounce = require("../../../Functions/useDebounce");
31
-
32
- var _useIsMobile2 = _interopRequireDefault(require("../../../Functions/useIsMobile"));
33
-
15
+ var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
34
16
  var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
35
-
36
17
  var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
37
-
38
18
  var _Button = _interopRequireDefault(require("../../UI/Button/Button"));
39
-
40
19
  var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
41
-
42
20
  var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
43
-
44
21
  require("./TagsDropdown.scss");
45
-
46
- 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); }
47
-
48
- 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; }
49
-
50
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
51
-
52
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
53
-
54
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
55
-
56
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
57
-
58
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
59
-
60
- var RC = "tags-dropdown";
61
- var MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
62
- var COLORS = ["#F1F0F0", "#E3E2E0", "#EEDFDA", "#F9DEC9", "#FDECC8", "#DBECDB", "#D3E4EF", "#E8DEEE", "#F4E0E9", "#FFE2DD", "#D3EFED", "#ECEEDE"];
63
-
64
- var TagsDropdown = function TagsDropdown(_ref) {
65
- var _Object$keys, _dropdownListWrapperR2, _dropdownListWrapperR3, _dropdownListRef$curr8, _dropdownListRef$curr9, _cn12;
66
-
67
- var optionsProp = _ref.options,
68
- _ref$chosenOptions = _ref.chosenOptions,
69
- chosenOptions = _ref$chosenOptions === void 0 ? [] : _ref$chosenOptions,
70
- onChange = _ref.onChange,
71
- className = _ref.className,
72
- tagClassname = _ref.tagClassname,
73
- listClassName = _ref.listClassName,
74
- _ref$onKeyPress = _ref.onKeyPress,
75
- onKeyPress = _ref$onKeyPress === void 0 ? function () {} : _ref$onKeyPress,
76
- placeholder = _ref.placeholder,
77
- label = _ref.label,
78
- disabled = _ref.disabled,
79
- isValuesInTags = _ref.isValuesInTags,
80
- error = _ref.error,
81
- _ref$isNotValidateASC = _ref.isNotValidateASCII,
82
- isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
83
- _ref$noTagsWrap = _ref.noTagsWrap,
84
- noTagsWrap = _ref$noTagsWrap === void 0 ? false : _ref$noTagsWrap,
85
- _ref$headerContent = _ref.headerContent,
86
- headerContent = _ref$headerContent === void 0 ? null : _ref$headerContent,
87
- _ref$footerContent = _ref.footerContent,
88
- footerContent = _ref$footerContent === void 0 ? null : _ref$footerContent,
89
- _ref$selectAllButtonR = _ref.selectAllButtonRef,
90
- selectAllButtonRef = _ref$selectAllButtonR === void 0 ? null : _ref$selectAllButtonR,
91
- _ref$unselectAllButto = _ref.unselectAllButtonRef,
92
- unselectAllButtonRef = _ref$unselectAllButto === void 0 ? null : _ref$unselectAllButto,
93
- _ref$closeOnSelect = _ref.closeOnSelect,
94
- closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
95
- _ref$closeOnRemove = _ref.closeOnRemove,
96
- closeOnRemove = _ref$closeOnRemove === void 0 ? false : _ref$closeOnRemove,
97
- _ref$closeOnRemoveAll = _ref.closeOnRemoveAll,
98
- closeOnRemoveAll = _ref$closeOnRemoveAll === void 0 ? false : _ref$closeOnRemoveAll,
99
- _ref$closeOnSelectAll = _ref.closeOnSelectAll,
100
- closeOnSelectAll = _ref$closeOnSelectAll === void 0 ? false : _ref$closeOnSelectAll,
101
- _ref$closeOnSelectMob = _ref.closeOnSelectMobile,
102
- closeOnSelectMobile = _ref$closeOnSelectMob === void 0 ? false : _ref$closeOnSelectMob,
103
- _ref$closeOnRemoveMob = _ref.closeOnRemoveMobile,
104
- closeOnRemoveMobile = _ref$closeOnRemoveMob === void 0 ? false : _ref$closeOnRemoveMob,
105
- _ref$closeOnRemoveAll2 = _ref.closeOnRemoveAllMobile,
106
- closeOnRemoveAllMobile = _ref$closeOnRemoveAll2 === void 0 ? false : _ref$closeOnRemoveAll2,
107
- _ref$closeOnSelectAll2 = _ref.closeOnSelectAllMobile,
108
- closeOnSelectAllMobile = _ref$closeOnSelectAll2 === void 0 ? false : _ref$closeOnSelectAll2,
109
- fieldKey = _ref.fieldKey,
110
- id = _ref.id,
111
- _ref$noOptionsText = _ref.noOptionsText,
112
- noOptionsText = _ref$noOptionsText === void 0 ? "No options available" : _ref$noOptionsText,
113
- mobileSearchPlaceholder = _ref.mobileSearchPlaceholder,
114
- _ref$isSearchable = _ref.isSearchable,
115
- isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
116
- useLiveSearch = _ref.useLiveSearch,
117
- doLiveSearchRequest = _ref.doRequest,
118
- _ref$attributesOfNati = _ref.attributesOfNativeInput,
119
- attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati,
120
- _ref$isUseLocalOption = _ref.isUseLocalOptionsStore,
121
- isUseLocalOptionsStore = _ref$isUseLocalOption === void 0 ? true : _ref$isUseLocalOption,
122
- _ref$isDefaultOpened = _ref.isDefaultOpened,
123
- isDefaultOpened = _ref$isDefaultOpened === void 0 ? false : _ref$isDefaultOpened,
124
- withMobileLogic = _ref.withMobileLogic,
125
- withCreateLogic = _ref.withCreateLogic,
126
- withActions = _ref.withActions,
127
- withSearchInputInList = _ref.withSearchInputInList,
128
- renderOptionsAsTags = _ref.renderOptionsAsTags,
129
- _ref$minItemsForShowM = _ref.minItemsForShowMobileSearch,
130
- minItemsForShowMobileSearch = _ref$minItemsForShowM === void 0 ? MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH : _ref$minItemsForShowM,
131
- onOptionCreate = _ref.onOptionCreate,
132
- onOptionEdit = _ref.onOptionEdit,
133
- onOptionDelete = _ref.onOptionDelete,
134
- onActionConfirmClick = _ref.onActionConfirmClick,
135
- onActionCancelClick = _ref.onActionCancelClick,
136
- onDropdownListClose = _ref.onDropdownListClose,
137
- customTriggerRef = _ref.customTriggerRef,
138
- renderCustomTrigger = _ref.renderCustomTrigger,
139
- recalculateListContainerStylesTrigger = _ref.recalculateListContainerStylesTrigger;
140
- var inputRef = (0, _react.useRef)(null);
141
- var wrapperRef = (0, _react.useRef)(null);
142
- var dropdownRef = (0, _react.useRef)(null);
143
- var dropdownListRef = (0, _react.useRef)(null);
144
- var editOptionModalRef = (0, _react.useRef)(null);
145
- var dropdownListWrapperRef = (0, _react.useRef)(null);
146
-
147
- var _useIsMobile = (0, _useIsMobile2.default)(),
148
- isMobileProp = _useIsMobile.isMobile;
149
-
150
- var isMobile = isMobileProp && withMobileLogic && window.screen.width <= 768;
151
-
152
- var _useState = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2)),
153
- _useState2 = (0, _slicedToArray2.default)(_useState, 1),
154
- dropdownId = _useState2[0];
155
-
156
- var _useState3 = (0, _react.useState)(false),
157
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
158
- isOpen = _useState4[0],
159
- setIsOpen = _useState4[1];
160
-
161
- var _useState5 = (0, _react.useState)(0),
162
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
163
- windowScrollTop = _useState6[0],
164
- setWindowScrollTop = _useState6[1];
165
-
166
- var _useState7 = (0, _react.useState)(null),
167
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
168
- listPos = _useState8[0],
169
- setListPos = _useState8[1];
170
-
171
- var _useState9 = (0, _react.useState)(null),
172
- _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
173
- initListHeight = _useState10[0],
174
- setInitListHeight = _useState10[1];
175
-
176
- var _useState11 = (0, _react.useState)(null),
177
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
178
- isScrollableList = _useState12[0],
179
- setIsScrollableList = _useState12[1];
180
-
181
- var _useState13 = (0, _react.useState)(false),
182
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
183
- isFixedMaxHeight = _useState14[0],
184
- setIsFixedMaxHeight = _useState14[1];
185
-
186
- var _useState15 = (0, _react.useState)(0),
187
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
188
- scrollTop = _useState16[0],
189
- setScrollTop = _useState16[1];
190
-
191
- var _useState17 = (0, _react.useState)(1),
192
- _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
193
- scrollHeight = _useState18[0],
194
- setScrollHeight = _useState18[1];
195
-
196
- var searchValueRef = (0, _react.useRef)(null);
197
-
198
- var _useState19 = (0, _react.useState)(""),
199
- _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
200
- searchValue = _useState20[0],
201
- setSearchValue = _useState20[1];
202
-
203
- var debouncedSearchTerm = (0, _useDebounce.useDebounce)({
204
- searchValue: searchValue,
22
+ 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); }
23
+ 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; }
24
+ const RC = "tags-dropdown";
25
+ const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
26
+ const COLORS = ["#F1F0F0", "#E3E2E0", "#EEDFDA", "#F9DEC9", "#FDECC8", "#DBECDB", "#D3E4EF", "#E8DEEE", "#F4E0E9", "#FFE2DD", "#D3EFED", "#ECEEDE"];
27
+ const TagsDropdown = _ref => {
28
+ var _Object$keys, _dropdownListWrapperR2, _dropdownListRef$curr8, _dropdownListRef$curr9;
29
+ let {
30
+ options: optionsProp,
31
+ chosenOptions = [],
32
+ onChange,
33
+ className,
34
+ tagClassname,
35
+ listClassName,
36
+ onKeyPress = () => {},
37
+ placeholder,
38
+ label,
39
+ disabled,
40
+ isValuesInTags,
41
+ error,
42
+ isNotValidateASCII = false,
43
+ noTagsWrap = false,
44
+ headerContent = null,
45
+ footerContent = null,
46
+ selectAllButtonRef = null,
47
+ unselectAllButtonRef = null,
48
+ closeOnSelect = false,
49
+ closeOnRemove = false,
50
+ closeOnRemoveAll = false,
51
+ closeOnSelectAll = false,
52
+ closeOnSelectMobile = false,
53
+ closeOnRemoveMobile = false,
54
+ closeOnRemoveAllMobile = false,
55
+ closeOnSelectAllMobile = false,
56
+ fieldKey,
57
+ id,
58
+ noOptionsText = "No options available",
59
+ mobileSearchPlaceholder,
60
+ isSearchable = true,
61
+ useLiveSearch,
62
+ doRequest: doLiveSearchRequest,
63
+ attributesOfNativeInput = {},
64
+ isUseLocalOptionsStore = true,
65
+ isDefaultOpened = false,
66
+ withMobileLogic,
67
+ withCreateLogic,
68
+ withActions,
69
+ withSearchInputInList,
70
+ renderOptionsAsTags,
71
+ minItemsForShowMobileSearch = MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH,
72
+ onOptionCreate,
73
+ onOptionEdit,
74
+ onOptionDelete,
75
+ onActionConfirmClick,
76
+ onActionCancelClick,
77
+ onDropdownListClose,
78
+ customTriggerRef,
79
+ renderCustomTrigger,
80
+ recalculateListContainerStylesTrigger
81
+ } = _ref;
82
+ const inputRef = (0, _react.useRef)(null);
83
+ const wrapperRef = (0, _react.useRef)(null);
84
+ const dropdownRef = (0, _react.useRef)(null);
85
+ const dropdownListRef = (0, _react.useRef)(null);
86
+ const editOptionModalRef = (0, _react.useRef)(null);
87
+ const dropdownListWrapperRef = (0, _react.useRef)(null);
88
+ const {
89
+ isMobile: isMobileProp
90
+ } = (0, _useIsMobile.default)();
91
+ const isMobile = isMobileProp && withMobileLogic && window.screen.width <= 768;
92
+ const [dropdownId] = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2));
93
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
94
+ const [windowScrollTop, setWindowScrollTop] = (0, _react.useState)(0);
95
+ const [listPos, setListPos] = (0, _react.useState)(null);
96
+ const [initListHeight, setInitListHeight] = (0, _react.useState)(null);
97
+ const [isScrollableList, setIsScrollableList] = (0, _react.useState)(null);
98
+ const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, _react.useState)(false);
99
+ const [scrollTop, setScrollTop] = (0, _react.useState)(0);
100
+ const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
101
+ const searchValueRef = (0, _react.useRef)(null);
102
+ const [searchValue, setSearchValue] = (0, _react.useState)("");
103
+ const debouncedSearchTerm = (0, _useDebounce.useDebounce)({
104
+ searchValue,
205
105
  delay: 600
206
106
  });
207
-
208
- var _useState21 = (0, _react.useState)(false),
209
- _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
210
- isValueDeleted = _useState22[0],
211
- setIsValueDeleted = _useState22[1];
212
-
213
- var setSearchValueInterceptor = function setSearchValueInterceptor(value) {
107
+ const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
108
+ const setSearchValueInterceptor = value => {
214
109
  setSearchValue(value);
215
110
  setIsValueDeleted(searchValue !== value && value === "");
216
111
  searchValueRef.current = value;
217
112
  };
218
-
219
- var editingOptionInputRef = (0, _react.useRef)(null);
220
-
221
- var _useState23 = (0, _react.useState)([]),
222
- _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
223
- options = _useState24[0],
224
- setOptions = _useState24[1];
225
-
226
- var _useState25 = (0, _react.useState)(null),
227
- _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
228
- editingOption = _useState26[0],
229
- setEditingOptionState = _useState26[1];
230
-
231
- var setEditingOption = function setEditingOption(data) {
232
- setEditingOptionState(function (editingOption) {
233
- return !data ? data : _objectSpread(_objectSpread(_objectSpread({}, editingOption !== null && editingOption !== void 0 ? editingOption : {}), typeof data === "function" ? data === null || data === void 0 ? void 0 : data(editingOption) : data), {}, {
234
- isChanged: Boolean(editingOption)
235
- });
113
+ const editingOptionInputRef = (0, _react.useRef)(null);
114
+ const [options, setOptions] = (0, _react.useState)([]);
115
+ const [editingOption, setEditingOptionState] = (0, _react.useState)(null);
116
+ const setEditingOption = data => {
117
+ setEditingOptionState(editingOption => !data ? data : {
118
+ ...(editingOption !== null && editingOption !== void 0 ? editingOption : {}),
119
+ ...(typeof data === "function" ? data === null || data === void 0 ? void 0 : data(editingOption) : data),
120
+ isChanged: Boolean(editingOption)
236
121
  });
237
122
  };
238
-
239
- var isEditingOptionError = (0, _react.useMemo)(function () {
123
+ const isEditingOptionError = (0, _react.useMemo)(() => {
240
124
  if (!editingOption) return false;
241
- return options.filter(function (_ref2) {
242
- var value = _ref2.value;
125
+ return options.filter(_ref2 => {
126
+ let {
127
+ value
128
+ } = _ref2;
243
129
  return value !== editingOption.value;
244
- }).some(function (_ref3) {
245
- var label = _ref3.label;
130
+ }).some(_ref3 => {
131
+ let {
132
+ label
133
+ } = _ref3;
246
134
  return label === editingOption.label;
247
135
  }) ? true : null;
248
136
  }, [options, editingOption]);
249
-
250
- var _useState27 = (0, _react.useState)({}),
251
- _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
252
- localOptionsStore = _useState28[0],
253
- setLocalOptionsStore = _useState28[1];
254
-
255
- var randomColorForNewOption = (0, _react.useMemo)(function () {
256
- var getRandomIndex = function getRandomIndex(min, max) {
137
+ const [localOptionsStore, setLocalOptionsStore] = (0, _react.useState)({});
138
+ const randomColorForNewOption = (0, _react.useMemo)(() => {
139
+ const getRandomIndex = (min, max) => {
257
140
  return Math.floor(Math.random() * (max - min + 1)) + min;
258
141
  };
259
-
260
- var randomIndex = getRandomIndex(0, COLORS.length - 1);
261
- return COLORS[randomIndex]; // eslint-disable-next-line react-hooks/exhaustive-deps
142
+ const randomIndex = getRandomIndex(0, COLORS.length - 1);
143
+ return COLORS[randomIndex];
144
+ // eslint-disable-next-line react-hooks/exhaustive-deps
262
145
  }, [options.length]);
263
- var singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce(function (acc, item) {
264
- var checkUniqAndPush = function checkUniqAndPush(acc, item) {
265
- var isExist = acc === null || acc === void 0 ? void 0 : acc.findIndex(function (_ref4) {
266
- var value = _ref4.value;
146
+ const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => {
147
+ const checkUniqAndPush = (acc, item) => {
148
+ const isExist = acc === null || acc === void 0 ? void 0 : acc.findIndex(_ref4 => {
149
+ let {
150
+ value
151
+ } = _ref4;
267
152
  return value === (item === null || item === void 0 ? void 0 : item.value);
268
153
  });
269
-
270
154
  if (isExist !== -1) {
271
155
  acc[isExist] = item;
272
156
  } else {
273
157
  acc.push(item);
274
158
  }
275
159
  };
276
-
277
160
  if (item.groupName) {
278
161
  var _item$list;
279
-
280
- (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.map(function (item) {
281
- return checkUniqAndPush(acc, item);
282
- });
162
+ (_item$list = item.list) === null || _item$list === void 0 || _item$list.map(item => checkUniqAndPush(acc, item));
283
163
  } else {
284
164
  checkUniqAndPush(acc, item);
285
165
  }
286
-
287
166
  return acc;
288
- }, isUseLocalOptionsStore ? (_Object$keys = Object.keys(localOptionsStore)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(function (value) {
289
- return {
290
- value: value,
291
- label: localOptionsStore === null || localOptionsStore === void 0 ? void 0 : localOptionsStore[value]
292
- };
293
- }) : []);
294
-
295
- var deleteChosen = function deleteChosen(value) {
167
+ }, isUseLocalOptionsStore ? (_Object$keys = Object.keys(localOptionsStore)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(value => ({
168
+ value,
169
+ label: localOptionsStore === null || localOptionsStore === void 0 ? void 0 : localOptionsStore[value]
170
+ })) : []);
171
+ const deleteChosen = value => {
296
172
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
297
-
298
173
  if (isUseLocalOptionsStore) {
299
- setLocalOptionsStore(function (options) {
300
- return _objectSpread(_objectSpread({}, options), {}, (0, _defineProperty2.default)({}, value, undefined));
301
- });
174
+ setLocalOptionsStore(options => ({
175
+ ...options,
176
+ [value]: undefined
177
+ }));
302
178
  }
179
+ onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
180
+ };
303
181
 
304
- onChange(chosenOptions.filter(function (item) {
305
- return item !== value;
306
- }), "chosenOptions");
307
- }; // --- LIST CONTAINER FUNCTIONS BEGIN --- //
308
-
309
-
310
- var getParentNode = function getParentNode() {
182
+ // --- LIST CONTAINER FUNCTIONS BEGIN --- //
183
+ const getParentNode = () => {
311
184
  var _ref5, _document$querySelect;
312
-
313
185
  return (_ref5 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref5 !== void 0 ? _ref5 : document.querySelector("div#storybook-root");
314
186
  };
315
-
316
- var initListContainer = function initListContainer() {
317
- var dropdownList = document.createElement("div");
187
+ const initListContainer = () => {
188
+ const dropdownList = document.createElement("div");
318
189
  dropdownList.setAttribute("id", dropdownId);
319
190
  dropdownList.classList.add("tags-dropdown__container");
320
191
  listClassName && dropdownList.classList.add(listClassName);
321
-
322
192
  if (isMobile) {
323
- dropdownList.addEventListener("click", function (e) {
193
+ dropdownList.addEventListener("click", e => {
324
194
  if (e.target.id === dropdownId) setIsOpen(false);
325
195
  });
326
196
  }
327
-
328
197
  if (isMobile) {
329
198
  var _getParentNode;
330
-
331
199
  try {
332
200
  var _document$getElementB;
333
-
334
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove(); // eslint-disable-next-line no-empty
201
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
202
+ // eslint-disable-next-line no-empty
335
203
  } catch (e) {}
336
-
337
- var dropdownMobileListWrapper = document.createElement("div");
204
+ const dropdownMobileListWrapper = document.createElement("div");
338
205
  dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
339
206
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
340
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
341
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
207
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
208
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
342
209
  } else {
343
210
  var _getParentNode2;
344
-
345
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
211
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
346
212
  }
347
213
  };
348
-
349
- var getListContainer = function getListContainer() {
214
+ const getListContainer = () => {
350
215
  return document.getElementById(dropdownId);
351
216
  };
352
-
353
- var getListContainerWrapper = function getListContainerWrapper() {
217
+ const getListContainerWrapper = () => {
354
218
  return document.getElementById("mlw-".concat(dropdownId));
355
219
  };
356
-
357
- var setListContainerStyles = function setListContainerStyles() {
358
- var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _selectorWrapper$getB, _listHeader$getBoundi, _listHeader$getBoundi2, _listFooter$getBoundi, _listFooter$getBoundi2;
359
-
360
- var listContainer = getListContainer();
220
+ const setListContainerStyles = () => {
221
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _selectorWrapper$getB, _listHeader$getBoundi, _listHeader$getBoundi2, _listFooter$getBoundi, _listFooter$getBoundi2;
222
+ const listContainer = getListContainer();
361
223
  if (!listContainer || !isOpen) return false;
362
- var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
363
-
364
- var _ref6 = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 ? void 0 : (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {},
365
- width = _ref6.width,
366
- height = _ref6.height,
367
- left = _ref6.left,
368
- top = _ref6.top;
369
-
370
- var selectorWrapper = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
371
- var dropdownList = listContainer.getElementsByClassName("tags-dropdown__list")[0];
372
- var listHeader = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__header")[0];
373
- var listFooter = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__footer")[0];
374
- var margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(selectorWrapper)) === null || _getComputedStyle === void 0 ? void 0 : (_getComputedStyle$mar2 = _getComputedStyle.marginTop) === null || _getComputedStyle$mar2 === void 0 ? void 0 : _getComputedStyle$mar2.replace("px", "")) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0, 10);
375
- var selectorWrapperHeight = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : (_selectorWrapper$getB = selectorWrapper.getBoundingClientRect()) === null || _selectorWrapper$getB === void 0 ? void 0 : _selectorWrapper$getB.height;
376
- var maxSelectorWrapperHeight = 500 - ((_listHeader$getBoundi = listHeader === null || listHeader === void 0 ? void 0 : (_listHeader$getBoundi2 = listHeader.getBoundingClientRect()) === null || _listHeader$getBoundi2 === void 0 ? void 0 : _listHeader$getBoundi2.height) !== null && _listHeader$getBoundi !== void 0 ? _listHeader$getBoundi : 0) - ((_listFooter$getBoundi = listFooter === null || listFooter === void 0 ? void 0 : (_listFooter$getBoundi2 = listFooter.getBoundingClientRect()) === null || _listFooter$getBoundi2 === void 0 ? void 0 : _listFooter$getBoundi2.height) !== null && _listFooter$getBoundi !== void 0 ? _listFooter$getBoundi : 0);
377
-
224
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
225
+ const {
226
+ width,
227
+ height,
228
+ left,
229
+ top
230
+ } = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 || (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
231
+ const selectorWrapper = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
232
+ const dropdownList = listContainer.getElementsByClassName("tags-dropdown__list")[0];
233
+ const listHeader = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__header")[0];
234
+ const listFooter = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__footer")[0];
235
+ const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(selectorWrapper)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace("px", "")) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0, 10);
236
+ let selectorWrapperHeight = selectorWrapper === null || selectorWrapper === void 0 || (_selectorWrapper$getB = selectorWrapper.getBoundingClientRect()) === null || _selectorWrapper$getB === void 0 ? void 0 : _selectorWrapper$getB.height;
237
+ const maxSelectorWrapperHeight = 500 - ((_listHeader$getBoundi = listHeader === null || listHeader === void 0 || (_listHeader$getBoundi2 = listHeader.getBoundingClientRect()) === null || _listHeader$getBoundi2 === void 0 ? void 0 : _listHeader$getBoundi2.height) !== null && _listHeader$getBoundi !== void 0 ? _listHeader$getBoundi : 0) - ((_listFooter$getBoundi = listFooter === null || listFooter === void 0 || (_listFooter$getBoundi2 = listFooter.getBoundingClientRect()) === null || _listFooter$getBoundi2 === void 0 ? void 0 : _listFooter$getBoundi2.height) !== null && _listFooter$getBoundi !== void 0 ? _listFooter$getBoundi : 0);
378
238
  if (!isMobile || !withMobileLogic) {
379
- var _getComputedStyle2, _dropdownListMaxHeigh, _customTriggerRef$cur, _customTriggerRef$cur2, _customTriggerRef$cur3;
380
-
381
- var dropdownListMaxHeightInPx = (_getComputedStyle2 = getComputedStyle(dropdownList)) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.maxHeight;
382
- var maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_dropdownListMaxHeigh = dropdownListMaxHeightInPx === null || dropdownListMaxHeightInPx === void 0 ? void 0 : dropdownListMaxHeightInPx.replace("px", "")) !== null && _dropdownListMaxHeigh !== void 0 ? _dropdownListMaxHeigh : 0, 10);
239
+ var _getComputedStyle2, _dropdownListMaxHeigh, _customTriggerRef$cur, _customTriggerRef$cur2;
240
+ const dropdownListMaxHeightInPx = (_getComputedStyle2 = getComputedStyle(dropdownList)) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.maxHeight;
241
+ const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_dropdownListMaxHeigh = dropdownListMaxHeightInPx === null || dropdownListMaxHeightInPx === void 0 ? void 0 : dropdownListMaxHeightInPx.replace("px", "")) !== null && _dropdownListMaxHeigh !== void 0 ? _dropdownListMaxHeigh : 0, 10);
383
242
  if (initListHeight === null && !isNaN(maxHeight)) setInitListHeight(maxHeight);
384
243
  if (selectorWrapperHeight > maxHeight && !isNaN(maxHeight)) selectorWrapperHeight = maxHeight - 2 * margin;
385
- var toTop = renderCustomTrigger ? top - margin - ((_customTriggerRef$cur = customTriggerRef === null || customTriggerRef === void 0 ? void 0 : (_customTriggerRef$cur2 = customTriggerRef.current) === null || _customTriggerRef$cur2 === void 0 ? void 0 : (_customTriggerRef$cur3 = _customTriggerRef$cur2.getBoundingClientRect()) === null || _customTriggerRef$cur3 === void 0 ? void 0 : _customTriggerRef$cur3.height) !== null && _customTriggerRef$cur !== void 0 ? _customTriggerRef$cur : 0) : top - margin;
386
- var toBottom = windowHeight - top - height - margin * 2;
387
- var listPosition = listPos;
388
-
244
+ const toTop = renderCustomTrigger ? top - margin - ((_customTriggerRef$cur = customTriggerRef === null || customTriggerRef === void 0 || (_customTriggerRef$cur2 = customTriggerRef.current) === null || _customTriggerRef$cur2 === void 0 || (_customTriggerRef$cur2 = _customTriggerRef$cur2.getBoundingClientRect()) === null || _customTriggerRef$cur2 === void 0 ? void 0 : _customTriggerRef$cur2.height) !== null && _customTriggerRef$cur !== void 0 ? _customTriggerRef$cur : 0) : top - margin;
245
+ const toBottom = windowHeight - top - height - margin * 2;
246
+ let listPosition = listPos;
389
247
  if (!listPos && options.length) {
390
248
  listPosition = toTop < toBottom || toBottom >= selectorWrapperHeight ? "bottom" : "top";
391
249
  setListPos(listPosition);
392
250
  }
393
-
394
251
  if (selectorWrapperHeight > (listPosition === "top" ? toTop : toBottom)) {
395
252
  selectorWrapperHeight = (listPosition === "top" ? toTop : toBottom) - 3 * margin;
396
-
397
253
  if (selectorWrapperHeight < 200) {
398
254
  selectorWrapperHeight = 200;
399
255
  }
400
-
401
256
  selectorWrapper.style.maxHeight = "".concat(selectorWrapperHeight, "px");
402
257
  }
403
-
404
258
  listContainer.style.minWidth = "".concat(width, "px");
405
259
  listContainer.style.left = "".concat(left, "px");
406
260
  listContainer.style.top = "".concat(listPosition === "bottom" ? top + height : top - selectorWrapperHeight - 2 * margin, "px");
@@ -408,128 +262,109 @@ var TagsDropdown = function TagsDropdown(_ref) {
408
262
  dropdownList.style.maxHeight = "".concat(maxSelectorWrapperHeight, "px");
409
263
  }
410
264
  };
265
+ const renderListContainer = () => {
266
+ const lc = getListContainer();
267
+ if (!lc) return null;
411
268
 
412
- var renderListContainer = function renderListContainer() {
413
- var lc = getListContainer();
414
- if (!lc) return null; // eslint-disable-next-line no-use-before-define
415
-
269
+ // eslint-disable-next-line no-use-before-define
416
270
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
417
- }; // --- LIST CONTAINER FUNCTIONS END --- //
418
- // --- CREATABLE LOGIC BEGIN --- //
419
-
271
+ };
272
+ // --- LIST CONTAINER FUNCTIONS END --- //
420
273
 
421
- var onOptionCreateClick = function onOptionCreateClick() {
274
+ // --- CREATABLE LOGIC BEGIN --- //
275
+ const onOptionCreateClick = () => {
422
276
  var _onOptionCreate;
423
-
424
- var newOption = {
277
+ const newOption = {
425
278
  label: searchValue,
426
279
  style: {
427
280
  backgroundColor: randomColorForNewOption
428
281
  },
429
282
  isEditable: true,
430
283
  ref: /*#__PURE__*/(0, _react.createRef)()
431
- }; // eslint-disable-next-line no-promise-executor-return
284
+ };
432
285
 
433
- ((_onOptionCreate = onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption)) !== null && _onOptionCreate !== void 0 ? _onOptionCreate : new Promise(function (r) {
434
- return r();
435
- })).then(function (result) {
286
+ // eslint-disable-next-line no-promise-executor-return
287
+ ((_onOptionCreate = onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption)) !== null && _onOptionCreate !== void 0 ? _onOptionCreate : new Promise(r => r())).then(result => {
436
288
  var _result$id;
437
-
438
- var tempId = Math.random().toString(16).slice(2);
289
+ const tempId = Math.random().toString(16).slice(2);
439
290
  newOption.value = (_result$id = result === null || result === void 0 ? void 0 : result.id) !== null && _result$id !== void 0 ? _result$id : tempId;
440
- setOptions(function (state) {
441
- return [].concat((0, _toConsumableArray2.default)(state), [newOption]);
442
- });
291
+ setOptions(state => [...state, newOption]);
443
292
  setSearchValue("");
444
293
  onChangeHandler(newOption);
445
294
  });
446
295
  };
447
-
448
- var onOptionEditClick = function onOptionEditClick(e, item) {
449
- e === null || e === void 0 ? void 0 : e.preventDefault();
450
- e === null || e === void 0 ? void 0 : e.stopPropagation();
296
+ const onOptionEditClick = (e, item) => {
297
+ e === null || e === void 0 || e.preventDefault();
298
+ e === null || e === void 0 || e.stopPropagation();
451
299
  setEditingOption((editingOption === null || editingOption === void 0 ? void 0 : editingOption.value) === (item === null || item === void 0 ? void 0 : item.value) ? null : item);
452
300
  };
453
-
454
- var onOptionDeleteClick = function onOptionDeleteClick() {
301
+ const onOptionDeleteClick = () => {
455
302
  var _onOptionDelete;
456
-
457
303
  // eslint-disable-next-line no-promise-executor-return
458
- ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(function (r) {
459
- return r();
460
- })).then(function () {
304
+ ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(r => r())).then(() => {
461
305
  deleteChosen(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
462
- setOptions(function (options) {
463
- return options.filter(function (_ref7) {
464
- var value = _ref7.value;
465
- return value !== (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
466
- });
467
- });
306
+ setOptions(options => options.filter(_ref6 => {
307
+ let {
308
+ value
309
+ } = _ref6;
310
+ return value !== (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
311
+ }));
468
312
  setEditingOption(null);
469
313
  });
470
314
  };
471
-
472
- var saveEditingOption = function saveEditingOption() {
315
+ const saveEditingOption = () => {
473
316
  if (!(editingOption !== null && editingOption !== void 0 && editingOption.isChanged) || isEditingOptionError) {
474
317
  setEditingOption(null);
475
318
  return false;
476
319
  }
477
-
478
- onOptionEdit === null || onOptionEdit === void 0 ? void 0 : onOptionEdit(editingOption);
479
- setOptions(function (options) {
480
- return options.map(function (option) {
481
- if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
482
- var tmp = _objectSpread({}, editingOption);
483
-
484
- setEditingOption(null);
485
- return tmp;
486
- }
487
-
488
- return option;
489
- });
490
- });
320
+ onOptionEdit === null || onOptionEdit === void 0 || onOptionEdit(editingOption);
321
+ setOptions(options => options.map(option => {
322
+ if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
323
+ const tmp = {
324
+ ...editingOption
325
+ };
326
+ setEditingOption(null);
327
+ return tmp;
328
+ }
329
+ return option;
330
+ }));
491
331
  };
492
-
493
- var setEditOptionModalStyles = function setEditOptionModalStyles() {
332
+ const setEditOptionModalStyles = () => {
494
333
  var _editingOption$ref, _el$getBoundingClient, _dropdownListWrapperR, _positionClasses, _positionClasses2;
495
-
496
334
  if (!editingOption || !(editOptionModalRef !== null && editOptionModalRef !== void 0 && editOptionModalRef.current)) return null;
497
- var modalSize = 200;
498
- var _window = window,
499
- scrollX = _window.scrollX,
500
- scrollY = _window.scrollY;
501
- var positionClasses = {
335
+ const modalSize = 200;
336
+ const {
337
+ scrollX,
338
+ scrollY
339
+ } = window;
340
+ const positionClasses = {
502
341
  left: "modal-left",
503
342
  right: "modal-right",
504
343
  top: "modal-top",
505
344
  bottom: "modal-bottom"
506
345
  };
507
- var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
508
- var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
509
- var el = editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
510
-
511
- var _ref8 = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {},
512
- x = _ref8.x,
513
- y = _ref8.y,
514
- width = _ref8.width,
515
- height = _ref8.height;
516
-
517
- var containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
518
- var distanceToRight = windowWidth - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.x) - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.width);
519
- var distanceToBottom = windowHeight - y - scrollY - height;
520
- Object.values(positionClasses).map(function (className) {
521
- return editOptionModalRef.current.classList.remove(className);
522
- });
346
+ const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
347
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
348
+ const el = editingOption === null || editingOption === void 0 || (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
349
+ const {
350
+ x,
351
+ y,
352
+ width,
353
+ height
354
+ } = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {};
355
+ const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
356
+ const distanceToRight = windowWidth - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.x) - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.width);
357
+ const distanceToBottom = windowHeight - y - scrollY - height;
358
+ Object.values(positionClasses).map(className => editOptionModalRef.current.classList.remove(className));
523
359
  editOptionModalRef.current.classList.add((_positionClasses = positionClasses === null || positionClasses === void 0 ? void 0 : positionClasses[distanceToRight < modalSize ? "left" : "right"]) !== null && _positionClasses !== void 0 ? _positionClasses : "");
524
360
  editOptionModalRef.current.classList.add((_positionClasses2 = positionClasses === null || positionClasses === void 0 ? void 0 : positionClasses[distanceToBottom < modalSize ? "top" : "bottom"]) !== null && _positionClasses2 !== void 0 ? _positionClasses2 : "");
525
- var xTranslate = distanceToRight < modalSize ? "calc(-100% + 7px)" : "-35px";
526
- var yTranslate = distanceToBottom < modalSize ? "calc(-100% - ".concat(height + 10, "px)") : "10px";
361
+ const xTranslate = distanceToRight < modalSize ? "calc(-100% + 7px)" : "-35px";
362
+ const yTranslate = distanceToBottom < modalSize ? "calc(-100% - ".concat(height + 10, "px)") : "10px";
527
363
  editOptionModalRef.current.style.left = "".concat(x + scrollX + width, "px");
528
364
  editOptionModalRef.current.style.top = "".concat(y + scrollY + height, "px");
529
365
  editOptionModalRef.current.style.transform = "translate(".concat(xTranslate, ", ").concat(yTranslate, ")");
530
366
  };
531
-
532
- var renderEditOptionModal = function renderEditOptionModal() {
367
+ const renderEditOptionModal = () => {
533
368
  return /*#__PURE__*/_react.default.createElement("div", {
534
369
  key: "editOptionModal".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value),
535
370
  ref: editOptionModalRef,
@@ -538,15 +373,12 @@ var TagsDropdown = function TagsDropdown(_ref) {
538
373
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
539
374
  }, /*#__PURE__*/_react.default.createElement(_Input.default, {
540
375
  value: editingOption.label,
541
- onChange: function onChange(v) {
542
- return setEditingOption(function (state) {
543
- return _objectSpread(_objectSpread({}, state), {}, {
544
- label: v
545
- });
546
- });
547
- },
376
+ onChange: v => setEditingOption(state => ({
377
+ ...state,
378
+ label: v
379
+ })),
548
380
  error: isEditingOptionError,
549
- onKeyDown: function onKeyDown(keyCode) {
381
+ onKeyDown: keyCode => {
550
382
  if (keyCode === 13) saveEditingOption();
551
383
  },
552
384
  symbolsLimit: "50",
@@ -562,211 +394,182 @@ var TagsDropdown = function TagsDropdown(_ref) {
562
394
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
563
395
  }, /*#__PURE__*/_react.default.createElement("h3", null, "Colors"), /*#__PURE__*/_react.default.createElement("div", {
564
396
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section-colors"))
565
- }, COLORS.map(function (color) {
397
+ }, COLORS.map(color => {
566
398
  var _editingOption$style;
567
-
568
399
  return /*#__PURE__*/_react.default.createElement("div", {
569
400
  key: color,
570
401
  className: "color-block",
571
402
  style: {
572
403
  backgroundColor: color
573
404
  },
574
- onClick: function onClick() {
575
- return setEditingOption(function (state) {
576
- return _objectSpread(_objectSpread({}, state), {}, {
577
- style: _objectSpread(_objectSpread({}, state.style), {}, {
578
- backgroundColor: color
579
- })
580
- });
581
- });
582
- }
583
- }, (editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$style = editingOption.style) === null || _editingOption$style === void 0 ? void 0 : _editingOption$style.backgroundColor) === color ? /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null) : null);
405
+ onClick: () => setEditingOption(state => ({
406
+ ...state,
407
+ style: {
408
+ ...state.style,
409
+ backgroundColor: color
410
+ }
411
+ }))
412
+ }, (editingOption === null || editingOption === void 0 || (_editingOption$style = editingOption.style) === null || _editingOption$style === void 0 ? void 0 : _editingOption$style.backgroundColor) === color ? /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null) : null);
584
413
  }))));
585
- }; // --- CREATABLE LOGIC END --- //
586
- // --- GENERAL FUNCTIONS BEGIN --- //
587
-
414
+ };
415
+ // --- CREATABLE LOGIC END --- //
588
416
 
589
- var handleClickOutside = function handleClickOutside(e) {
417
+ // --- GENERAL FUNCTIONS BEGIN --- //
418
+ const handleClickOutside = e => {
590
419
  var _getListContainer, _editOptionModalRef$c;
591
-
592
- var target = e.target;
593
-
594
- if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current // &&
420
+ const {
421
+ target
422
+ } = e;
423
+ if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current
424
+ // &&
595
425
  // (
596
426
  // customTriggerRef?.current ? customTriggerRef?.current?.contains(target) : true
597
427
  // )
598
428
  ) {
599
429
  setIsOpen(false);
600
- onDropdownListClose === null || onDropdownListClose === void 0 ? void 0 : onDropdownListClose(e);
430
+ onDropdownListClose === null || onDropdownListClose === void 0 || onDropdownListClose(e);
601
431
  } else if (editOptionModalRef.current && !((_editOptionModalRef$c = editOptionModalRef.current) !== null && _editOptionModalRef$c !== void 0 && _editOptionModalRef$c.contains(target))) {
602
- var _document, _document$getElementB2, _document$getElementB3, _document$getElementB4;
603
-
604
- if (!((_document = document) !== null && _document !== void 0 && (_document$getElementB2 = _document.getElementById) !== null && _document$getElementB2 !== void 0 && (_document$getElementB3 = _document$getElementB2.call(_document, "editTrigger".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value))) !== null && _document$getElementB3 !== void 0 && (_document$getElementB4 = _document$getElementB3.contains) !== null && _document$getElementB4 !== void 0 && _document$getElementB4.call(_document$getElementB3, target))) saveEditingOption();
432
+ var _document, _document$getElementB2, _document$getElementB3;
433
+ if (!((_document = document) !== null && _document !== void 0 && (_document$getElementB2 = _document.getElementById) !== null && _document$getElementB2 !== void 0 && (_document$getElementB2 = _document$getElementB2.call(_document, "editTrigger".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value))) !== null && _document$getElementB2 !== void 0 && (_document$getElementB3 = _document$getElementB2.contains) !== null && _document$getElementB3 !== void 0 && _document$getElementB3.call(_document$getElementB2, target))) saveEditingOption();
605
434
  }
606
435
  };
607
-
608
- var closeList = function closeList(e) {
436
+ const closeList = e => {
609
437
  var _inputRef$current;
610
-
611
438
  handleClickOutside(e);
612
- if (!e.target.isEqualNode(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
439
+ if (!e.target.isEqualNode(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
613
440
  };
614
-
615
- var isTargetInParent = function isTargetInParent(target) {
441
+ const isTargetInParent = target => {
616
442
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
617
-
618
443
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) === "tag__button" || (target === null || target === void 0 ? void 0 : target.tagName) === "line") return false;
619
- if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== "tag__button" || (target === null || target === void 0 ? void 0 : (_target$className = target.className) === null || _target$className === void 0 ? void 0 : (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, "tag__label")) !== -1 || (target === null || target === void 0 ? void 0 : (_target$className2 = target.className) === null || _target$className2 === void 0 ? void 0 : (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, "tag-list_wrapper")) !== -1 || (target === null || target === void 0 ? void 0 : target.className.indexOf("".concat(RC, "__trigger"))) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
444
+ if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== "tag__button" || (target === null || target === void 0 || (_target$className = target.className) === null || _target$className === void 0 || (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, "tag__label")) !== -1 || (target === null || target === void 0 || (_target$className2 = target.className) === null || _target$className2 === void 0 || (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, "tag-list_wrapper")) !== -1 || (target === null || target === void 0 ? void 0 : target.className.indexOf("".concat(RC, "__trigger"))) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
620
445
  return false;
621
446
  };
622
-
623
- var isItemMatchesSearch = function isItemMatchesSearch(item) {
447
+ const isItemMatchesSearch = item => {
624
448
  if (item.isHiddenInList) return false;
625
- var title = item.title || item.label;
449
+ const title = item.title || item.label;
626
450
  return searchValue.length ? title === null || title === void 0 ? void 0 : title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
627
- }; // --- GENERAL FUNCTIONS END --- //
628
-
629
-
630
- var prepareOptions = function prepareOptions(options) {
631
- return options === null || options === void 0 ? void 0 : options.map(function (option) {
632
- return option !== null && option !== void 0 && option.groupName ? option === null || option === void 0 ? void 0 : option.list : option;
633
- }).flat();
634
451
  };
452
+ // --- GENERAL FUNCTIONS END --- //
635
453
 
636
- var getFilteredOptions = function getFilteredOptions(options) {
637
- return options === null || options === void 0 ? void 0 : options.reduce(function (result, option) {
638
- if (option.groupName) {
639
- var _option$list;
640
-
641
- var filteredGroupItems = option === null || option === void 0 ? void 0 : (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(function (item) {
642
- return isItemMatchesSearch(item);
454
+ const prepareOptions = options => {
455
+ return options === null || options === void 0 ? void 0 : options.map(option => option !== null && option !== void 0 && option.groupName ? option === null || option === void 0 ? void 0 : option.list : option).flat();
456
+ };
457
+ const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
458
+ if (option.groupName) {
459
+ var _option$list;
460
+ const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
461
+ if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
462
+ result.push({
463
+ ...option,
464
+ list: filteredGroupItems
643
465
  });
644
-
645
- if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
646
- result.push(_objectSpread(_objectSpread({}, option), {}, {
647
- list: filteredGroupItems
648
- }));
649
- }
650
- } else if (isItemMatchesSearch(option)) {
651
- result.push(option);
652
466
  }
653
-
654
- return result;
655
- }, []);
656
- };
657
-
658
- var getTotalOptions = (0, _react.useCallback)(function () {
659
- return options === null || options === void 0 ? void 0 : options.reduce(function (result, item) {
467
+ } else if (isItemMatchesSearch(option)) {
468
+ result.push(option);
469
+ }
470
+ return result;
471
+ }, []);
472
+ const getTotalOptions = (0, _react.useCallback)(() => {
473
+ return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
660
474
  if (item !== null && item !== void 0 && item.list) {
661
475
  var _item$list2;
662
-
663
- result += (item === null || item === void 0 ? void 0 : (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
476
+ result += (item === null || item === void 0 || (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
664
477
  } else {
665
478
  ++result;
666
479
  }
667
-
668
480
  return result;
669
481
  }, 0);
670
482
  }, [options]);
671
-
672
- var onChangeHandler = function onChangeHandler(item) {
483
+ const onChangeHandler = item => {
673
484
  if (item !== null && item !== void 0 && item.isFreezed) return false;
674
-
675
485
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
676
486
  if (item.closeOnOptionSelect) setIsOpen(false);
677
487
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
678
-
679
488
  setSearchValueInterceptor("");
680
-
681
- if (chosenOptions.some(function (el) {
682
- return el === item.value;
683
- })) {
489
+ if (chosenOptions.some(el => el === item.value)) {
684
490
  deleteChosen(item.value);
685
491
  return null;
686
492
  }
687
-
688
493
  if (isUseLocalOptionsStore) {
689
- setLocalOptionsStore(function (options) {
690
- return _objectSpread(_objectSpread({}, options), {}, (0, _defineProperty2.default)({}, item === null || item === void 0 ? void 0 : item.value, item === null || item === void 0 ? void 0 : item.label));
691
- });
494
+ setLocalOptionsStore(options => ({
495
+ ...options,
496
+ [item === null || item === void 0 ? void 0 : item.value]: item === null || item === void 0 ? void 0 : item.label
497
+ }));
692
498
  }
693
-
694
- onChange([].concat((0, _toConsumableArray2.default)(chosenOptions), [item.value]), "chosenOptions");
499
+ onChange([...chosenOptions, item.value], "chosenOptions");
695
500
  return null;
696
501
  };
697
-
698
- var onSearchHandler = function onSearchHandler(name) {
699
- var inputValue = name;
502
+ const onSearchHandler = name => {
503
+ let inputValue = name;
700
504
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
701
505
  setSearchValueInterceptor(inputValue);
702
506
  };
703
-
704
- var onWrapperClick = function onWrapperClick(e) {
507
+ const onWrapperClick = e => {
705
508
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
706
509
  e.stopPropagation();
707
510
  e.preventDefault();
708
511
  setIsOpen(false);
709
512
  }
710
513
  };
711
-
712
- var selectAllItems = function selectAllItems() {
514
+ const selectAllItems = () => {
713
515
  var _prepareOptions;
714
-
715
- var preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(function (_ref9) {
716
- var isFreezed = _ref9.isFreezed,
717
- value = _ref9.value;
516
+ const preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(_ref7 => {
517
+ let {
518
+ isFreezed,
519
+ value
520
+ } = _ref7;
718
521
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
719
522
  });
720
-
721
523
  if (isUseLocalOptionsStore) {
722
- setLocalOptionsStore(function (options) {
723
- return preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.reduce(function (result, _ref10) {
724
- var value = _ref10.value,
725
- label = _ref10.label;
726
- result[value] = label;
727
- return result;
728
- }, options);
729
- });
524
+ setLocalOptionsStore(options => preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.reduce((result, _ref8) => {
525
+ let {
526
+ value,
527
+ label
528
+ } = _ref8;
529
+ result[value] = label;
530
+ return result;
531
+ }, options));
730
532
  }
731
-
732
- onChange([].concat((0, _toConsumableArray2.default)(chosenOptions), (0, _toConsumableArray2.default)((preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.map(function (_ref11) {
733
- var value = _ref11.value;
533
+ onChange([...chosenOptions, ...((preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.map(_ref9 => {
534
+ let {
535
+ value
536
+ } = _ref9;
734
537
  return value;
735
- })) || [])), "chosenOptions");
538
+ })) || [])], "chosenOptions");
736
539
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
737
540
  };
738
-
739
- var unselectAllItems = function unselectAllItems() {
541
+ const unselectAllItems = () => {
740
542
  if (isUseLocalOptionsStore) setLocalOptionsStore({});
741
- onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(function (item) {
742
- var _prepareOptions2, _prepareOptions2$find;
743
-
744
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(function (_ref12) {
745
- var value = _ref12.value;
543
+ onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
544
+ var _prepareOptions2;
545
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref10 => {
546
+ let {
547
+ value
548
+ } = _ref10;
746
549
  return value === item;
747
- })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
550
+ })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
748
551
  }), "chosenOptions");
749
552
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
750
553
  };
751
-
752
- var doScrollCallback = (0, _react.useCallback)(function (e) {
554
+ const doScrollCallback = (0, _react.useCallback)(e => {
753
555
  if (doLiveSearchRequest && typeof doLiveSearchRequest === "function") {
754
556
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
755
557
  doLiveSearchRequest(searchValueRef.current, true);
756
558
  }
757
559
  }
758
- }, [options]); // --- RENDER FUNCTIONS BEGIN --- //
759
-
760
- var getMarkupForElement = function getMarkupForElement(item) {
761
- var _item$customMobileIco;
560
+ }, [options]);
762
561
 
763
- var description = item.description;
764
- var title = item.title || item.label;
562
+ // --- RENDER FUNCTIONS BEGIN --- //
765
563
 
766
- var hightlightSearchValue = function hightlightSearchValue(title) {
564
+ const getMarkupForElement = item => {
565
+ var _item$customMobileIco;
566
+ const {
567
+ description
568
+ } = item;
569
+ const title = item.title || item.label;
570
+ const hightlightSearchValue = title => {
767
571
  var _title$toLowerCase;
768
-
769
- var index = title === null || title === void 0 ? void 0 : (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
572
+ const index = title === null || title === void 0 || (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
770
573
  if (index === -1) return title;
771
574
  return /*#__PURE__*/_react.default.createElement("pre", {
772
575
  className: "inherit-styles"
@@ -774,22 +577,27 @@ var TagsDropdown = function TagsDropdown(_ref) {
774
577
  className: "search-match bg--yellow"
775
578
  }, title.substring(index, index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))), /*#__PURE__*/_react.default.createElement("span", null, title.substring(index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))));
776
579
  };
777
-
778
580
  return /*#__PURE__*/_react.default.createElement("button", {
779
581
  ref: item === null || item === void 0 ? void 0 : item.ref,
780
582
  key: "".concat(RC, "__list-item-").concat(item.id || item.value),
781
- onClick: function onClick(e) {
583
+ onClick: e => {
782
584
  e.preventDefault();
783
585
  e.stopPropagation();
784
586
  onChangeHandler(item);
785
587
  },
786
- className: (0, _classnames.default)("".concat(RC, "__list-item"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-item_active"), chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(function (value) {
787
- return value === item.value;
788
- })), (0, _defineProperty2.default)({}, "".concat(RC, "__list-item_disabled"), item.disabled), (0, _defineProperty2.default)({}, "".concat(RC, "__list-item_freezed"), item === null || item === void 0 ? void 0 : item.isFreezed), (0, _defineProperty2.default)({}, "".concat(RC, "__list-item--editing"), (item === null || item === void 0 ? void 0 : item.value) === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)), item.className)
588
+ className: (0, _classnames.default)("".concat(RC, "__list-item"), {
589
+ ["".concat(RC, "__list-item_active")]: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value)
590
+ }, {
591
+ ["".concat(RC, "__list-item_disabled")]: item.disabled
592
+ }, {
593
+ ["".concat(RC, "__list-item_freezed")]: item === null || item === void 0 ? void 0 : item.isFreezed
594
+ }, {
595
+ ["".concat(RC, "__list-item--editing")]: (item === null || item === void 0 ? void 0 : item.value) === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)
596
+ }, item.className)
789
597
  }, !isMobile && /*#__PURE__*/_react.default.createElement("span", {
790
- className: (0, _classnames.default)("".concat(RC, "__active-icon"), (0, _defineProperty2.default)({}, "".concat(RC, "__active-icon_active"), chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(function (value) {
791
- return value === item.value;
792
- })))
598
+ className: (0, _classnames.default)("".concat(RC, "__active-icon"), {
599
+ ["".concat(RC, "__active-icon_active")]: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value)
600
+ })
793
601
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, {
794
602
  width: 16,
795
603
  height: 16,
@@ -811,72 +619,55 @@ var TagsDropdown = function TagsDropdown(_ref) {
811
619
  }, description)), !isMobile && (item === null || item === void 0 ? void 0 : item.isEditable) && onOptionEdit && onOptionDelete && /*#__PURE__*/_react.default.createElement("div", {
812
620
  id: "editTrigger".concat(item === null || item === void 0 ? void 0 : item.value),
813
621
  className: (0, _classnames.default)("".concat(RC, "__list-item-edit-trigger")),
814
- onClick: function onClick(e) {
815
- return onOptionEditClick(e, item);
816
- }
622
+ onClick: e => onOptionEditClick(e, item)
817
623
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.MoreHorizontal, null)), isMobile ? (_item$customMobileIco = item === null || item === void 0 ? void 0 : item.customMobileIcon) !== null && _item$customMobileIco !== void 0 ? _item$customMobileIco : /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
818
- value: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(function (value) {
819
- return value === item.value;
820
- }),
821
- onChange: function onChange() {
624
+ value: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value),
625
+ onChange: () => {
822
626
  onChangeHandler(item);
823
627
  }
824
628
  }) : "");
825
629
  };
826
-
827
- var getListMarkUp = function getListMarkUp() {
828
- var _cn7, _filteredOptions$filt, _filteredOptions$filt2, _cn8, _document$getElementB5;
829
-
830
- var filteredOptions = getFilteredOptions(options);
831
- var arrToPrint = [];
832
-
833
- var _iterator = _createForOfIteratorHelper(filteredOptions),
834
- _step;
835
-
836
- try {
837
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
838
- var option = _step.value;
839
-
840
- if (option.groupName) {
841
- var _option$groupName, _option$groupName$toS, _option$list2;
842
-
843
- arrToPrint.push( /*#__PURE__*/_react.default.createElement("div", {
844
- key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 ? void 0 : (_option$groupName$toS = _option$groupName.toString()) === null || _option$groupName$toS === void 0 ? void 0 : _option$groupName$toS.replace(/ /g, "_").concat(Date.now()),
845
- className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
846
- }, /*#__PURE__*/_react.default.createElement("span", {
847
- className: "".concat(RC, "-group__name")
848
- }, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(function (item) {
849
- return getMarkupForElement(item);
850
- })));
851
- } else arrToPrint.push(getMarkupForElement(option));
852
- }
853
- } catch (err) {
854
- _iterator.e(err);
855
- } finally {
856
- _iterator.f();
630
+ const getListMarkUp = () => {
631
+ var _filteredOptions$filt, _filteredOptions$filt2, _document$getElementB4;
632
+ const filteredOptions = getFilteredOptions(options);
633
+ const arrToPrint = [];
634
+ for (const option of filteredOptions) {
635
+ if (option.groupName) {
636
+ var _option$groupName, _option$list2;
637
+ arrToPrint.push( /*#__PURE__*/_react.default.createElement("div", {
638
+ key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 || (_option$groupName = _option$groupName.toString()) === null || _option$groupName === void 0 ? void 0 : _option$groupName.replace(/ /g, "_").concat(Date.now()),
639
+ className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
640
+ }, /*#__PURE__*/_react.default.createElement("span", {
641
+ className: "".concat(RC, "-group__name")
642
+ }, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(item => getMarkupForElement(item))));
643
+ } else arrToPrint.push(getMarkupForElement(option));
857
644
  }
858
-
859
645
  return /*#__PURE__*/_react.default.createElement("div", {
860
646
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
861
647
  ref: wrapperRef,
862
- onClick: isMobile ? onWrapperClick : function () {}
648
+ onClick: isMobile ? onWrapperClick : () => {}
863
649
  }, /*#__PURE__*/_react.default.createElement("div", {
864
650
  ref: dropdownListWrapperRef,
865
- className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), (0, _defineProperty2.default)({}, "".concat(RC, "__selector-wrapper--fixed-height"), isFixedMaxHeight && isMobile))
651
+ className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), {
652
+ ["".concat(RC, "__selector-wrapper--fixed-height")]: isFixedMaxHeight && isMobile
653
+ })
866
654
  }, headerContent || isMobile ? /*#__PURE__*/_react.default.createElement("div", {
867
- className: (0, _classnames.default)("".concat(RC, "__header"), (_cn7 = {}, (0, _defineProperty2.default)(_cn7, "".concat(RC, "__header-with-shadow"), isScrollableList && isMobile), (0, _defineProperty2.default)(_cn7, "".concat(RC, "__header-with-shadow-hidden"), scrollTop === 0), _cn7))
655
+ className: (0, _classnames.default)("".concat(RC, "__header"), {
656
+ ["".concat(RC, "__header-with-shadow")]: isScrollableList && isMobile,
657
+ ["".concat(RC, "__header-with-shadow-hidden")]: scrollTop === 0
658
+ })
868
659
  }, isMobile && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
869
660
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
870
661
  }, /*#__PURE__*/_react.default.createElement("div", {
871
662
  className: (0, _classnames.default)("".concat(RC, "__label"))
872
663
  }, label), /*#__PURE__*/_react.default.createElement("div", {
873
664
  className: (0, _classnames.default)("".concat(RC, "__close-icon")),
874
- onClick: function onClick(e) {
665
+ onClick: e => {
875
666
  e.stopPropagation();
876
667
  setIsOpen(false);
877
668
  }
878
669
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
879
- onClick: function onClick(e) {
670
+ onClick: e => {
880
671
  e.stopPropagation();
881
672
  setIsOpen(false);
882
673
  }
@@ -885,12 +676,10 @@ var TagsDropdown = function TagsDropdown(_ref) {
885
676
  }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
886
677
  className: "".concat(RC, "__input"),
887
678
  value: searchValue,
888
- onChange: function onChange(v) {
889
- return setSearchValueInterceptor(v);
890
- },
679
+ onChange: v => setSearchValueInterceptor(v),
891
680
  placeholder: mobileSearchPlaceholder || "Search",
892
681
  withDelete: true,
893
- onMouseDown: function onMouseDown() {
682
+ onMouseDown: () => {
894
683
  if (!isOpen) {
895
684
  setIsOpen(true);
896
685
  }
@@ -899,30 +688,39 @@ var TagsDropdown = function TagsDropdown(_ref) {
899
688
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
900
689
  }, headerContent)) : null, withSearchInputInList && /*#__PURE__*/_react.default.createElement("div", {
901
690
  className: (0, _classnames.default)("".concat(RC, "__input-list-wrapper"))
902
- }, renderSearchInput()), withCreateLogic && onOptionCreate && searchValue && filteredOptions.length && singleLevelOptions.every(function (_ref13) {
903
- var label = _ref13.label;
691
+ }, renderSearchInput()), withCreateLogic && onOptionCreate && searchValue && filteredOptions.length && singleLevelOptions.every(_ref11 => {
692
+ let {
693
+ label
694
+ } = _ref11;
904
695
  return (label === null || label === void 0 ? void 0 : label.toLowerCase()) !== (searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
905
696
  }) ? /*#__PURE__*/_react.default.createElement("div", {
906
697
  className: (0, _classnames.default)("".concat(RC, "__creatable-helper"))
907
698
  }, "Select an option or create one") : null, /*#__PURE__*/_react.default.createElement("div", {
908
699
  ref: dropdownListRef,
909
700
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
910
- }, arrToPrint, ((_filteredOptions$filt = filteredOptions.filter(function (_ref14) {
911
- var value = _ref14.value;
701
+ }, arrToPrint, ((_filteredOptions$filt = filteredOptions.filter(_ref12 => {
702
+ let {
703
+ value
704
+ } = _ref12;
912
705
  return value !== "open_modal";
913
706
  })) === null || _filteredOptions$filt === void 0 ? void 0 : _filteredOptions$filt.length) === 0 && (!withCreateLogic || !searchValue) ? /*#__PURE__*/_react.default.createElement("div", {
914
707
  className: "".concat(RC, "__no-options")
915
- }, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(function (_ref15) {
916
- var value = _ref15.value;
708
+ }, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(_ref13 => {
709
+ let {
710
+ value
711
+ } = _ref13;
917
712
  return value !== "open_modal";
918
713
  })) === null || _filteredOptions$filt2 === void 0 ? void 0 : _filteredOptions$filt2.length) > 0 ? /*#__PURE__*/_react.default.createElement("div", {
919
- className: (0, _classnames.default)("".concat(RC, "__footer"), (_cn8 = {}, (0, _defineProperty2.default)(_cn8, "".concat(RC, "__footer-with-shadow"), isMobile && isScrollableList), (0, _defineProperty2.default)(_cn8, "".concat(RC, "__footer-with-shadow-hidden"), scrollTop === scrollHeight), _cn8))
714
+ className: (0, _classnames.default)("".concat(RC, "__footer"), {
715
+ ["".concat(RC, "__footer-with-shadow")]: isMobile && isScrollableList,
716
+ ["".concat(RC, "__footer-with-shadow-hidden")]: scrollTop === scrollHeight
717
+ })
920
718
  }, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
921
- onClick: function onClick() {
922
- return setIsOpen(false);
923
- }
924
- }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null, editingOption && /*#__PURE__*/(0, _reactDom.createPortal)(renderEditOptionModal(), (_document$getElementB5 = document.getElementById("app")) !== null && _document$getElementB5 !== void 0 ? _document$getElementB5 : document.body), withCreateLogic && onOptionCreate && searchValue && singleLevelOptions.every(function (_ref16) {
925
- var label = _ref16.label;
719
+ onClick: () => setIsOpen(false)
720
+ }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null, editingOption && /*#__PURE__*/(0, _reactDom.createPortal)(renderEditOptionModal(), (_document$getElementB4 = document.getElementById("app")) !== null && _document$getElementB4 !== void 0 ? _document$getElementB4 : document.body), withCreateLogic && onOptionCreate && searchValue && singleLevelOptions.every(_ref14 => {
721
+ let {
722
+ label
723
+ } = _ref14;
926
724
  return (label === null || label === void 0 ? void 0 : label.toLowerCase()) !== (searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
927
725
  }) && /*#__PURE__*/_react.default.createElement("div", {
928
726
  className: (0, _classnames.default)("".concat(RC, "__create-option")),
@@ -935,73 +733,70 @@ var TagsDropdown = function TagsDropdown(_ref) {
935
733
  isNoDismiss: true
936
734
  }))));
937
735
  };
938
-
939
- var renderSearchInput = function renderSearchInput() {
736
+ const renderSearchInput = () => {
940
737
  return /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
941
738
  ref: inputRef,
942
- className: (0, _classnames.default)("".concat(RC, "__input"), (0, _defineProperty2.default)({}, "".concat(RC, "__input--in-list"), withSearchInputInList)),
739
+ className: (0, _classnames.default)("".concat(RC, "__input"), {
740
+ ["".concat(RC, "__input--in-list")]: withSearchInputInList
741
+ }),
943
742
  value: searchValue,
944
743
  onChange: onSearchHandler,
945
744
  placeholder: placeholder || "Select from list",
946
- attributesOfNativeInput: _objectSpread(_objectSpread({}, attributesOfNativeInput), {}, {
947
- onKeyDown: function onKeyDown(e) {
948
- if (e.keyCode === 13 && withCreateLogic && onOptionCreate && singleLevelOptions.every(function (_ref17) {
949
- var label = _ref17.label;
745
+ attributesOfNativeInput: {
746
+ ...attributesOfNativeInput,
747
+ onKeyDown: e => {
748
+ if (e.keyCode === 13 && withCreateLogic && onOptionCreate && singleLevelOptions.every(_ref15 => {
749
+ let {
750
+ label
751
+ } = _ref15;
950
752
  return (label === null || label === void 0 ? void 0 : label.toLowerCase()) !== (searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
951
753
  })) {
952
754
  onOptionCreateClick();
953
755
  }
954
-
955
756
  onKeyPress(e, searchValue);
956
- } // onFocus: (e) => {
757
+ }
758
+ // onFocus: (e) => {
957
759
  // if (isMobile) e?.target?.blur();
958
760
  // },
959
-
960
- })
761
+ }
961
762
  }, withCreateLogic ? {
962
763
  symbolsLimit: 50
963
764
  } : {}));
964
765
  };
965
-
966
- var renderDropdownTrigger = (0, _react.useCallback)(function () {
766
+ const renderDropdownTrigger = (0, _react.useCallback)(() => {
967
767
  var _renderCustomTrigger;
968
-
969
- var renderDefaultDropdownTrigger = function renderDefaultDropdownTrigger() {
768
+ const renderDefaultDropdownTrigger = () => {
970
769
  return /*#__PURE__*/_react.default.createElement("div", {
971
- className: (0, _classnames.default)("".concat(RC, "__trigger"), (0, _defineProperty2.default)({
972
- "tags-dropdown__error": error
973
- }, "".concat(RC, "__trigger--with-actions"), withActions)),
974
- onClick: function onClick(_ref18) {
975
- var target = _ref18.target;
976
-
770
+ className: (0, _classnames.default)("".concat(RC, "__trigger"), {
771
+ "tags-dropdown__error": error,
772
+ ["".concat(RC, "__trigger--with-actions")]: withActions
773
+ }),
774
+ onClick: _ref16 => {
775
+ let {
776
+ target
777
+ } = _ref16;
977
778
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") {
978
779
  setIsOpen(true);
979
780
  } else if (isTargetInParent(target)) {
980
- setIsOpen(function (isOpen) {
981
- return !isOpen;
982
- });
781
+ setIsOpen(isOpen => !isOpen);
983
782
  }
984
783
  }
985
784
  }, noTagsWrap ? /*#__PURE__*/_react.default.createElement(_TagList.default, {
986
- items: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(function (value, i) {
987
- var tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(function (el) {
988
- return el.value == value;
989
- });
990
- var label = isValuesInTags ? tag === null || tag === void 0 ? void 0 : tag.value : (tag === null || tag === void 0 ? void 0 : tag.label) || (tag === null || tag === void 0 ? void 0 : tag.name) || (tag === null || tag === void 0 ? void 0 : tag.title);
785
+ items: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map((value, i) => {
786
+ const tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(el => el.value == value);
787
+ const label = isValuesInTags ? tag === null || tag === void 0 ? void 0 : tag.value : (tag === null || tag === void 0 ? void 0 : tag.label) || (tag === null || tag === void 0 ? void 0 : tag.name) || (tag === null || tag === void 0 ? void 0 : tag.title);
991
788
  return {
992
- value: value,
993
- label: label,
789
+ value,
790
+ label,
994
791
  id: i,
995
792
  className: tag === null || tag === void 0 ? void 0 : tag.labelClassName,
996
793
  style: tag === null || tag === void 0 ? void 0 : tag.style
997
794
  };
998
795
  }),
999
796
  disableShowMore: true
1000
- }) : chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(function (value) {
1001
- var tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(function (el) {
1002
- return el.value == value;
1003
- });
1004
- var label = isValuesInTags ? tag === null || tag === void 0 ? void 0 : tag.value : (tag === null || tag === void 0 ? void 0 : tag.label) || (tag === null || tag === void 0 ? void 0 : tag.name) || (tag === null || tag === void 0 ? void 0 : tag.title);
797
+ }) : chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(value => {
798
+ const tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(el => el.value == value);
799
+ const label = isValuesInTags ? tag === null || tag === void 0 ? void 0 : tag.value : (tag === null || tag === void 0 ? void 0 : tag.label) || (tag === null || tag === void 0 ? void 0 : tag.name) || (tag === null || tag === void 0 ? void 0 : tag.title);
1005
800
  return /*#__PURE__*/_react.default.createElement(_Tag.default, {
1006
801
  key: value,
1007
802
  className: (0, _classnames.default)(tagClassname, tag === null || tag === void 0 ? void 0 : tag.labelClassName, {
@@ -1009,13 +804,13 @@ var TagsDropdown = function TagsDropdown(_ref) {
1009
804
  }),
1010
805
  label: label,
1011
806
  style: tag === null || tag === void 0 ? void 0 : tag.style,
1012
- removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : function () {
1013
- return deleteChosen(value);
1014
- },
807
+ removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : () => deleteChosen(value),
1015
808
  isNoDismiss: false
1016
809
  });
1017
810
  }), chosenOptions.length === 0 || !noTagsWrap ? renderSearchInput() : "", /*#__PURE__*/_react.default.createElement("span", {
1018
- className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen))
811
+ className: (0, _classnames.default)("".concat(RC, "__arrow"), {
812
+ ["".concat(RC, "__arrow_active")]: isOpen
813
+ })
1019
814
  }, isMobile ? /*#__PURE__*/_react.default.createElement(_reactFeather.Code, {
1020
815
  className: "mobile-icon"
1021
816
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
@@ -1024,31 +819,29 @@ var TagsDropdown = function TagsDropdown(_ref) {
1024
819
  className: "color--text"
1025
820
  })));
1026
821
  };
1027
-
1028
822
  return (_renderCustomTrigger = renderCustomTrigger === null || renderCustomTrigger === void 0 ? void 0 : renderCustomTrigger({
1029
- chosenOptions: chosenOptions,
1030
- singleLevelOptions: singleLevelOptions,
1031
- deleteChosen: deleteChosen,
1032
- inputRef: inputRef,
1033
- onSearchHandler: onSearchHandler,
1034
- isOpen: isOpen,
1035
- setIsOpen: setIsOpen
823
+ chosenOptions,
824
+ singleLevelOptions,
825
+ deleteChosen,
826
+ inputRef,
827
+ onSearchHandler,
828
+ isOpen,
829
+ setIsOpen
1036
830
  })) !== null && _renderCustomTrigger !== void 0 ? _renderCustomTrigger : renderDefaultDropdownTrigger();
1037
- }, [chosenOptions, singleLevelOptions, inputRef, isOpen]); // --- RENDER FUNCTIONS END --- //
831
+ }, [chosenOptions, singleLevelOptions, inputRef, isOpen]);
832
+ // --- RENDER FUNCTIONS END --- //
1038
833
 
1039
- (0, _react.useLayoutEffect)(function () {
834
+ (0, _react.useLayoutEffect)(() => {
1040
835
  initListContainer();
1041
836
  if (isDefaultOpened && !isMobileProp) setIsOpen(true);
1042
- return function () {
837
+ return () => {
1043
838
  var _getListContainer2, _getListContainerWrap;
1044
-
1045
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
1046
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
839
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
840
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
1047
841
  };
1048
842
  }, []);
1049
- (0, _react.useLayoutEffect)(function () {
843
+ (0, _react.useLayoutEffect)(() => {
1050
844
  var _getListContainer3;
1051
-
1052
845
  if (!isMobile) {
1053
846
  window.addEventListener("mousewheel", closeList);
1054
847
  window.addEventListener("wheel", closeList);
@@ -1060,148 +853,129 @@ var TagsDropdown = function TagsDropdown(_ref) {
1060
853
  window.removeEventListener("touchmove", closeList);
1061
854
  window.removeEventListener("mouseup", handleClickOutside);
1062
855
  }
1063
-
1064
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
1065
- return function () {
856
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
857
+ return () => {
1066
858
  var _getListContainer4;
1067
-
1068
859
  window.removeEventListener("mousewheel", closeList);
1069
860
  window.removeEventListener("mouseup", handleClickOutside);
1070
861
  window.removeEventListener("wheel", closeList);
1071
862
  window.removeEventListener("touchmove", closeList);
1072
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
863
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
1073
864
  };
1074
865
  }, [getListContainer, isMobile]);
1075
- (0, _react.useLayoutEffect)(function () {
866
+ (0, _react.useLayoutEffect)(() => {
1076
867
  if (isOpen) {
1077
868
  setListContainerStyles();
1078
869
  setEditOptionModalStyles();
1079
870
  }
1080
- }, [isOpen, optionsProp, chosenOptions, searchValue, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 ? void 0 : (_dropdownListWrapperR3 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR3 === void 0 ? void 0 : _dropdownListWrapperR3.height, recalculateListContainerStylesTrigger]);
1081
- (0, _react.useEffect)(function () {
871
+ }, [isOpen, optionsProp, chosenOptions, searchValue, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 || (_dropdownListWrapperR2 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR2 === void 0 ? void 0 : _dropdownListWrapperR2.height, recalculateListContainerStylesTrigger]);
872
+ (0, _react.useEffect)(() => {
1082
873
  if (isUseLocalOptionsStore && chosenOptions.length !== Object.keys(localOptionsStore).length) {
1083
- options.map(function (option) {
874
+ options.map(option => {
1084
875
  if (!(localOptionsStore !== null && localOptionsStore !== void 0 && localOptionsStore[option === null || option === void 0 ? void 0 : option.value])) {
1085
- setLocalOptionsStore(function (options) {
1086
- return _objectSpread(_objectSpread({}, options), {}, (0, _defineProperty2.default)({}, option === null || option === void 0 ? void 0 : option.value, option === null || option === void 0 ? void 0 : option.label));
1087
- });
876
+ setLocalOptionsStore(options => ({
877
+ ...options,
878
+ [option === null || option === void 0 ? void 0 : option.value]: option === null || option === void 0 ? void 0 : option.label
879
+ }));
1088
880
  }
1089
881
  });
1090
882
  }
1091
883
  }, [chosenOptions, isUseLocalOptionsStore]);
1092
- (0, _react.useEffect)(function () {
884
+ (0, _react.useEffect)(() => {
1093
885
  var _selectAllButtonRef$c, _unselectAllButtonRef;
1094
-
1095
- var windowScrollEventHandler = function windowScrollEventHandler(e) {
886
+ const windowScrollEventHandler = e => {
1096
887
  setWindowScrollTop(window.scrollY);
1097
888
  };
1098
-
1099
- var fn = isOpen ? "addEventListener" : "removeEventListener";
1100
- selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
1101
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
1102
-
889
+ const fn = isOpen ? "addEventListener" : "removeEventListener";
890
+ selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
891
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
1103
892
  if (isOpen) {
1104
893
  var _getListContainer5;
1105
-
1106
894
  if (!isMobile || !withMobileLogic) window.removeEventListener("scroll", windowScrollEventHandler);
1107
-
1108
895
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
1109
896
  customTriggerRef.current.style.pointerEvents = "none";
1110
897
  }
1111
-
1112
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add("tags-dropdown__container--opened");
1113
-
898
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add("tags-dropdown__container--opened");
1114
899
  if (!isMobile) {
1115
900
  var _inputRef$current2, _inputRef$current2$fo;
1116
-
1117
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$fo = _inputRef$current2.focus) === null || _inputRef$current2$fo === void 0 ? void 0 : _inputRef$current2$fo.call(_inputRef$current2);
901
+ inputRef === null || inputRef === void 0 || (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || (_inputRef$current2$fo = _inputRef$current2.focus) === null || _inputRef$current2$fo === void 0 || _inputRef$current2$fo.call(_inputRef$current2);
1118
902
  } else {
1119
903
  var _inputRef$current3, _inputRef$current3$bl;
1120
-
1121
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : (_inputRef$current3$bl = _inputRef$current3.blur) === null || _inputRef$current3$bl === void 0 ? void 0 : _inputRef$current3$bl.call(_inputRef$current3);
904
+ inputRef === null || inputRef === void 0 || (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || (_inputRef$current3$bl = _inputRef$current3.blur) === null || _inputRef$current3$bl === void 0 || _inputRef$current3$bl.call(_inputRef$current3);
1122
905
  }
1123
906
  } else {
1124
907
  var _getListContainer6;
1125
-
1126
908
  if (!isMobile || !withMobileLogic) window.addEventListener("scroll", windowScrollEventHandler);
1127
-
1128
909
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
1129
910
  customTriggerRef.current.style.pointerEvents = "auto";
1130
911
  }
1131
-
1132
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove("tags-dropdown__container--opened");
912
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove("tags-dropdown__container--opened");
1133
913
  if (withSearchInputInList) setSearchValueInterceptor("");
1134
914
  setListPos(null);
1135
915
  setSearchValue("");
1136
916
  }
1137
917
  }, [isOpen]);
1138
- (0, _react.useEffect)(function () {
1139
- var setScrollTopValue = function setScrollTopValue(e) {
918
+ (0, _react.useEffect)(() => {
919
+ const setScrollTopValue = e => {
1140
920
  setScrollTop(parseInt(e.target.scrollTop, 10));
1141
921
  };
1142
-
1143
- var preventWindowScrolling = function preventWindowScrolling(e) {
922
+ const preventWindowScrolling = e => {
1144
923
  e.preventDefault();
1145
924
  window.scrollTo({
1146
925
  top: windowScrollTop
1147
926
  });
1148
927
  };
1149
-
1150
928
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
1151
929
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
1152
-
1153
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
1154
- setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.clientHeight));
1155
-
930
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 || _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
931
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.clientHeight));
1156
932
  if (isScrollableList === null) {
1157
933
  var _dropdownListRef$curr4, _dropdownListRef$curr5;
1158
-
1159
- setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.clientHeight));
934
+ setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.clientHeight));
1160
935
  }
1161
936
  }
1162
-
1163
937
  if (isOpen && dropdownListRef && dropdownListRef.current) {
1164
938
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
1165
939
  if (!isMobile || !withMobileLogic) window.addEventListener("scroll", preventWindowScrolling);
1166
940
  }
1167
-
1168
- return function () {
941
+ return () => {
1169
942
  var _dropdownListRef$curr6, _dropdownListRef$curr7;
1170
-
1171
943
  if (!isMobile || !withMobileLogic) window.removeEventListener("scroll", preventWindowScrolling);
1172
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.removeEventListener("scroll", doScrollCallback);
1173
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.removeEventListener("scroll", setScrollTopValue);
944
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 || _dropdownListRef$curr6.removeEventListener("scroll", doScrollCallback);
945
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.removeEventListener("scroll", setScrollTopValue);
1174
946
  };
1175
- }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.clientHeight]);
1176
- (0, _react.useEffect)(function () {
947
+ }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.clientHeight]);
948
+ (0, _react.useEffect)(() => {
1177
949
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
1178
950
  var _dropdownListRef$curr10, _dropdownListRef$curr11;
1179
-
1180
- setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr11 = dropdownListRef.current) === null || _dropdownListRef$curr11 === void 0 ? void 0 : _dropdownListRef$curr11.clientHeight), 10));
951
+ setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr11 = dropdownListRef.current) === null || _dropdownListRef$curr11 === void 0 ? void 0 : _dropdownListRef$curr11.clientHeight), 10));
1181
952
  }
1182
953
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
1183
- (0, _react.useEffect)(function () {
954
+ (0, _react.useEffect)(() => {
1184
955
  if (isSearchable && useLiveSearch && (debouncedSearchTerm || isValueDeleted || isOpen)) {
1185
- doLiveSearchRequest === null || doLiveSearchRequest === void 0 ? void 0 : doLiveSearchRequest(debouncedSearchTerm);
956
+ doLiveSearchRequest === null || doLiveSearchRequest === void 0 || doLiveSearchRequest(debouncedSearchTerm);
1186
957
  }
1187
958
  }, [isOpen, debouncedSearchTerm, isValueDeleted]);
1188
- (0, _react.useEffect)(function () {
1189
- setOptions(optionsProp.map(function (option) {
1190
- return _objectSpread(_objectSpread({}, option), {}, {
1191
- ref: /*#__PURE__*/(0, _react.createRef)()
1192
- });
1193
- }));
959
+ (0, _react.useEffect)(() => {
960
+ setOptions(optionsProp.map(option => ({
961
+ ...option,
962
+ ref: /*#__PURE__*/(0, _react.createRef)()
963
+ })));
1194
964
  }, [optionsProp]);
1195
- (0, _react.useEffect)(function () {
965
+ (0, _react.useEffect)(() => {
1196
966
  if (editingOption) {
1197
967
  var _editingOptionInputRe, _editingOptionInputRe2;
1198
-
1199
968
  setEditOptionModalStyles();
1200
- editingOptionInputRef === null || editingOptionInputRef === void 0 ? void 0 : (_editingOptionInputRe = editingOptionInputRef.current) === null || _editingOptionInputRe === void 0 ? void 0 : (_editingOptionInputRe2 = _editingOptionInputRe.focus) === null || _editingOptionInputRe2 === void 0 ? void 0 : _editingOptionInputRe2.call(_editingOptionInputRe);
969
+ editingOptionInputRef === null || editingOptionInputRef === void 0 || (_editingOptionInputRe = editingOptionInputRef.current) === null || _editingOptionInputRe === void 0 || (_editingOptionInputRe2 = _editingOptionInputRe.focus) === null || _editingOptionInputRe2 === void 0 || _editingOptionInputRe2.call(_editingOptionInputRe);
1201
970
  }
1202
971
  }, [editingOption === null || editingOption === void 0 ? void 0 : editingOption.value]);
1203
972
  return /*#__PURE__*/_react.default.createElement("div", {
1204
- className: (0, _classnames.default)(RC, className, (_cn12 = {}, (0, _defineProperty2.default)(_cn12, "".concat(RC, "_disabled"), disabled), (0, _defineProperty2.default)(_cn12, "".concat(RC, "-mobile"), isMobile), (0, _defineProperty2.default)(_cn12, "".concat(RC, "--focused"), isOpen && !(customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) && !isMobile), (0, _defineProperty2.default)(_cn12, "".concat(RC, "--custom-trigger"), Boolean(customTriggerRef === null || customTriggerRef === void 0 ? void 0 : customTriggerRef.current)), _cn12)),
973
+ className: (0, _classnames.default)(RC, className, {
974
+ ["".concat(RC, "_disabled")]: disabled,
975
+ ["".concat(RC, "-mobile")]: isMobile,
976
+ ["".concat(RC, "--focused")]: isOpen && !(customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) && !isMobile,
977
+ ["".concat(RC, "--custom-trigger")]: Boolean(customTriggerRef === null || customTriggerRef === void 0 ? void 0 : customTriggerRef.current)
978
+ }),
1205
979
  ref: dropdownRef
1206
980
  }, renderDropdownTrigger(), withActions && /*#__PURE__*/_react.default.createElement("div", {
1207
981
  className: (0, _classnames.default)("".concat(RC, "__actions"))
@@ -1213,6 +987,4 @@ var TagsDropdown = function TagsDropdown(_ref) {
1213
987
  onClick: onActionCancelClick
1214
988
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isOpen && renderListContainer());
1215
989
  };
1216
-
1217
- var _default = TagsDropdown;
1218
- exports.default = _default;
990
+ var _default = exports.default = TagsDropdown;