intelicoreact 1.4.81 → 1.4.83

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