intelicoreact 1.3.9 → 1.3.11

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 (251) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +23 -15
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +23 -15
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +124 -69
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +36 -27
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +39 -23
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +246 -110
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +85 -44
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +414 -246
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +9 -5
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +165 -93
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +64 -39
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +132 -51
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +73 -34
  14. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +75 -54
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +110 -67
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +71 -27
  17. package/dist/Atomic/FormElements/Input/Input.js +253 -161
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +102 -48
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +40 -27
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +68 -22
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +170 -104
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +57 -32
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +302 -184
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +157 -85
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +16 -11
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +193 -76
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +58 -34
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +12 -8
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +964 -554
  30. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  31. package/dist/Atomic/FormElements/InputMask/functions.js +43 -17
  32. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +404 -268
  33. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  34. package/dist/Atomic/FormElements/InputMask2/functions.js +43 -17
  35. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +459 -299
  36. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  37. package/dist/Atomic/FormElements/InputMask3/functions.js +43 -17
  38. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +113 -53
  39. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +118 -64
  40. package/dist/Atomic/FormElements/Label/Label.js +23 -13
  41. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +349 -217
  42. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +47 -25
  43. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +207 -133
  44. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +61 -29
  45. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +42 -20
  46. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +33 -22
  47. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +43 -20
  48. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +101 -54
  49. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +102 -59
  50. package/dist/Atomic/FormElements/RangeList/RangeList.js +150 -89
  51. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +29 -23
  52. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +300 -135
  53. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +571 -381
  54. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +24 -14
  55. package/dist/Atomic/FormElements/Switcher/Switcher.js +29 -24
  56. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +47 -25
  57. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +32 -20
  58. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +55 -32
  59. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +42 -22
  60. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +33 -23
  61. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +120 -51
  62. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
  63. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +46 -23
  64. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +409 -251
  65. package/dist/Atomic/FormElements/Text/Text.js +53 -47
  66. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +31 -21
  67. package/dist/Atomic/FormElements/Textarea/Textarea.js +27 -16
  68. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +128 -68
  69. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +36 -25
  70. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +70 -33
  71. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +124 -58
  72. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
  73. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +80 -48
  74. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +42 -32
  75. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +60 -40
  76. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +3 -2
  77. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +69 -50
  78. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  79. package/dist/Atomic/Layout/Header/Header.js +48 -21
  80. package/dist/Atomic/Layout/MainMenu/MainMenu.js +79 -36
  81. package/dist/Atomic/Layout/Spinner/Spinner.js +14 -8
  82. package/dist/Atomic/UI/Accordion/Accordion.js +48 -18
  83. package/dist/Atomic/UI/Accordion/AccordionItem.js +60 -35
  84. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +106 -49
  85. package/dist/Atomic/UI/AccordionText/AccordionText.js +37 -13
  86. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +94 -48
  87. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +50 -22
  88. package/dist/Atomic/UI/Alert/Alert.js +44 -20
  89. package/dist/Atomic/UI/Arrow/Arrow.js +35 -15
  90. package/dist/Atomic/UI/Box/Box.js +21 -14
  91. package/dist/Atomic/UI/Button/Button.js +38 -26
  92. package/dist/Atomic/UI/Button/Button.scss +12 -5
  93. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +31 -22
  94. package/dist/Atomic/UI/Chart/Chart.js +86 -45
  95. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +24 -14
  96. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +22 -13
  97. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +113 -68
  98. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +140 -158
  99. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +42 -26
  100. package/dist/Atomic/UI/Chart/partial/utils.js +48 -20
  101. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +42 -22
  102. package/dist/Atomic/UI/DateTime/DateTime.js +38 -23
  103. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +36 -12
  104. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +21 -5
  105. package/dist/Atomic/UI/DoubleString/DoubleString.js +50 -27
  106. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +63 -15
  107. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +157 -62
  108. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +110 -47
  109. package/dist/Atomic/UI/Hint/Hint.js +94 -49
  110. package/dist/Atomic/UI/Modal/Modal.js +179 -149
  111. package/dist/Atomic/UI/Modal/ModalHOC.js +21 -12
  112. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +12 -7
  113. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +21 -17
  114. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +151 -93
  115. package/dist/Atomic/UI/ModalBackup/Modal.js +90 -65
  116. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
  117. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
  118. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
  119. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +62 -32
  120. package/dist/Atomic/UI/NavLine/NavLine.js +211 -120
  121. package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
  122. package/dist/Atomic/UI/PageTitle/PageTitle.js +17 -13
  123. package/dist/Atomic/UI/PieChart/PieChart.js +21 -11
  124. package/dist/Atomic/UI/Price/Price.js +13 -10
  125. package/dist/Atomic/UI/PriceRange/PriceRange.js +11 -7
  126. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +56 -27
  127. package/dist/Atomic/UI/Status/Status.js +30 -19
  128. package/dist/Atomic/UI/Table/Partials/TdCell.js +71 -28
  129. package/dist/Atomic/UI/Table/Partials/TdHeader.js +16 -7
  130. package/dist/Atomic/UI/Table/Partials/TdRow.js +65 -29
  131. package/dist/Atomic/UI/Table/Partials/TdTitle.js +40 -16
  132. package/dist/Atomic/UI/Table/Table.js +47 -27
  133. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +48 -18
  134. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +19 -9
  135. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +8 -5
  136. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +47 -25
  137. package/dist/Atomic/UI/Tag/Tag.js +48 -20
  138. package/dist/Atomic/UI/TagList/TagList.js +150 -80
  139. package/dist/Atomic/UI/UserBox/UserBox.js +26 -14
  140. package/dist/Classes/AbortableFetch.js +422 -283
  141. package/dist/Classes/AnimatedHandler.js +56 -44
  142. package/dist/Classes/RESTAPI/index.js +433 -154
  143. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +428 -290
  144. package/dist/Classes/RESTAPI/partials/ApiBase.js +67 -24
  145. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +275 -57
  146. package/dist/Classes/RESTAPI/partials/ApiUtils.js +377 -146
  147. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +403 -155
  148. package/dist/Classes/RESTAPI/partials/Utils.js +135 -81
  149. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
  150. package/dist/Classes/RESTAPI/partials/_utils.js +395 -101
  151. package/dist/Constants/index.constants.js +15 -8
  152. package/dist/Functions/Portal.js +33 -14
  153. package/dist/Functions/customEventListener.js +20 -5
  154. package/dist/Functions/fieldValueFormatters.js +211 -148
  155. package/dist/Functions/hooks/useFormFieldsChangesManager.js +137 -75
  156. package/dist/Functions/locale/createTranslator.js +27 -13
  157. package/dist/Functions/operations.js +49 -35
  158. package/dist/Functions/presets/inputMaskPresets.js +27 -25
  159. package/dist/Functions/presets/inputPresets.js +22 -19
  160. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
  161. package/dist/Functions/schemas.js +15 -6
  162. package/dist/Functions/useClickOutside.js +7 -3
  163. package/dist/Functions/useDebounce.js +25 -11
  164. package/dist/Functions/useFieldFocus.js +67 -42
  165. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +54 -35
  166. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +95 -74
  167. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +91 -55
  168. package/dist/Functions/useFormTools/functions/General.js +99 -80
  169. package/dist/Functions/useFormTools/functions/RenderFields.js +72 -45
  170. package/dist/Functions/useFormTools/functions/usePrevious.js +7 -3
  171. package/dist/Functions/useFormTools/index.js +598 -382
  172. package/dist/Functions/useInputHighlightError.js +52 -27
  173. package/dist/Functions/useIsMobile.js +36 -13
  174. package/dist/Functions/useLocalStorage.js +22 -7
  175. package/dist/Functions/useLocationParams.js +27 -16
  176. package/dist/Functions/useMetaInfo.js +50 -19
  177. package/dist/Functions/useMouseUpOutside.js +5 -2
  178. package/dist/Functions/useOnlineStatus.js +26 -7
  179. package/dist/Functions/usePasswordChecker.js +77 -42
  180. package/dist/Functions/usePrevious.js +7 -3
  181. package/dist/Functions/useResize.js +32 -12
  182. package/dist/Functions/useScrollTo.js +20 -6
  183. package/dist/Functions/useToggle.js +30 -10
  184. package/dist/Functions/utils.js +366 -186
  185. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +32 -21
  186. package/dist/Molecular/CustomIcons/components/AlertCircle.js +32 -21
  187. package/dist/Molecular/CustomIcons/components/AppStore.js +36 -25
  188. package/dist/Molecular/CustomIcons/components/Arrow.js +42 -31
  189. package/dist/Molecular/CustomIcons/components/ArrowDown.js +24 -13
  190. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +27 -16
  191. package/dist/Molecular/CustomIcons/components/ArrowRight.js +27 -16
  192. package/dist/Molecular/CustomIcons/components/ArrowUp.js +24 -13
  193. package/dist/Molecular/CustomIcons/components/Bell.js +22 -11
  194. package/dist/Molecular/CustomIcons/components/Button.js +22 -11
  195. package/dist/Molecular/CustomIcons/components/Campaigns.js +23 -12
  196. package/dist/Molecular/CustomIcons/components/Check.js +23 -12
  197. package/dist/Molecular/CustomIcons/components/Check2.js +22 -11
  198. package/dist/Molecular/CustomIcons/components/ChevronDown.js +22 -11
  199. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +22 -11
  200. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +22 -11
  201. package/dist/Molecular/CustomIcons/components/ChevronRight.js +22 -11
  202. package/dist/Molecular/CustomIcons/components/ChevronUp.js +22 -11
  203. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +37 -26
  204. package/dist/Molecular/CustomIcons/components/Close.js +24 -13
  205. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +49 -38
  206. package/dist/Molecular/CustomIcons/components/Delete.js +23 -12
  207. package/dist/Molecular/CustomIcons/components/Edit.js +22 -11
  208. package/dist/Molecular/CustomIcons/components/Email.js +40 -29
  209. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +30 -19
  210. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +38 -27
  211. package/dist/Molecular/CustomIcons/components/Flows.js +22 -11
  212. package/dist/Molecular/CustomIcons/components/Gift.js +27 -16
  213. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +36 -25
  214. package/dist/Molecular/CustomIcons/components/GooglePlay.js +36 -25
  215. package/dist/Molecular/CustomIcons/components/HelpCircle.js +25 -14
  216. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +26 -15
  217. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +25 -14
  218. package/dist/Molecular/CustomIcons/components/Home.js +25 -14
  219. package/dist/Molecular/CustomIcons/components/Home2.js +28 -17
  220. package/dist/Molecular/CustomIcons/components/Key.js +30 -19
  221. package/dist/Molecular/CustomIcons/components/Landers.js +26 -15
  222. package/dist/Molecular/CustomIcons/components/Lock.js +22 -11
  223. package/dist/Molecular/CustomIcons/components/Mail.js +30 -19
  224. package/dist/Molecular/CustomIcons/components/Mastercard.js +72 -61
  225. package/dist/Molecular/CustomIcons/components/Minus.js +35 -24
  226. package/dist/Molecular/CustomIcons/components/Offers.js +23 -12
  227. package/dist/Molecular/CustomIcons/components/Pause.js +35 -24
  228. package/dist/Molecular/CustomIcons/components/PayPal.js +49 -38
  229. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +36 -25
  230. package/dist/Molecular/CustomIcons/components/Phone.js +37 -26
  231. package/dist/Molecular/CustomIcons/components/Play.js +35 -24
  232. package/dist/Molecular/CustomIcons/components/Plus.js +35 -24
  233. package/dist/Molecular/CustomIcons/components/Profile.js +27 -16
  234. package/dist/Molecular/CustomIcons/components/QRCode.js +37 -26
  235. package/dist/Molecular/CustomIcons/components/Rectangle.js +22 -11
  236. package/dist/Molecular/CustomIcons/components/Revert.js +25 -14
  237. package/dist/Molecular/CustomIcons/components/Star.js +21 -10
  238. package/dist/Molecular/CustomIcons/components/Star2.js +23 -12
  239. package/dist/Molecular/CustomIcons/components/TrafficSources.js +25 -14
  240. package/dist/Molecular/CustomIcons/components/Trash.js +22 -11
  241. package/dist/Molecular/CustomIcons/components/TrashRed.js +22 -11
  242. package/dist/Molecular/CustomIcons/components/Triggers.js +22 -11
  243. package/dist/Molecular/CustomIcons/components/User.js +27 -16
  244. package/dist/Molecular/CustomIcons/components/Visa.js +38 -27
  245. package/dist/Molecular/CustomIcons/components/X.js +22 -11
  246. package/dist/Molecular/CustomIcons/index.js +183 -61
  247. package/dist/Molecular/FormElement/FormElement.js +27 -18
  248. package/dist/Molecular/InputAddress/InputAddress.js +312 -176
  249. package/dist/Molecular/InputPassword/InputPassword.js +39 -15
  250. package/dist/index.js +3 -1
  251. package/package.json +1 -1
@@ -1,155 +1,254 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
4
7
  Object.defineProperty(exports, "__esModule", {
5
8
  value: true
6
9
  });
7
10
  exports.default = void 0;
11
+
8
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
16
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
+
18
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
+
9
20
  var _react = _interopRequireWildcard(require("react"));
21
+
10
22
  var _reactDom = require("react-dom");
23
+
11
24
  var _classnames = _interopRequireDefault(require("classnames"));
25
+
12
26
  var _reactFeather = require("react-feather");
27
+
13
28
  var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
29
+
14
30
  var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
31
+
15
32
  var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
33
+
16
34
  var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
35
+
17
36
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
18
- var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
37
+
38
+ var _useIsMobile2 = _interopRequireDefault(require("../../../Functions/useIsMobile"));
39
+
19
40
  require("./TagsDropdown.scss");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
- const RC = 'tags-dropdown';
23
- const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
24
- const TagsDropdown = _ref => {
25
- var _dropdownListWrapperR, _dropdownListRef$curr5, _dropdownListRef$curr6;
26
- let {
27
- options,
28
- chosenOptions = [],
29
- onChange,
30
- className,
31
- tagClassname,
32
- onKeyPress = () => {},
33
- placeholder,
34
- label,
35
- isLabelBold,
36
- hint,
37
- hintSide,
38
- disabled,
39
- isValuesInTags,
40
- error,
41
- isNotValidateASCII = false,
42
- noTagsWrap = false,
43
- headerContent = null,
44
- footerContent = null,
45
- selectAllButtonRef = null,
46
- unselectAllButtonRef = null,
47
- closeOnSelect = false,
48
- closeOnRemove = false,
49
- closeOnRemoveAll = false,
50
- closeOnSelectAll = false,
51
- closeOnSelectMobile = false,
52
- closeOnRemoveMobile = false,
53
- closeOnRemoveAllMobile = false,
54
- closeOnSelectAllMobile = false,
55
- fieldKey,
56
- id,
57
- noOptionsText = 'No options available',
58
- mobileSearchPlaceholder,
59
- isSearchable = true,
60
- attributesOfNativeInput = {},
61
- withMobileLogic,
62
- minItemsForShowMobileSearch = MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH
63
- } = _ref;
64
- const {
65
- isMobile: isMobileProp
66
- } = (0, _useIsMobile.default)();
67
- const isMobile = isMobileProp && withMobileLogic;
68
- const [dropdownId, setDropdownId] = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2));
69
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
70
- const [searchValue, setSearchValue] = (0, _react.useState)('');
71
- const dropdownRef = (0, _react.useRef)(null);
72
- const dropdownListRef = (0, _react.useRef)(null);
73
- const dropdownListWrapperRef = (0, _react.useRef)(null);
74
- const inputRef = (0, _react.useRef)(null);
75
- const wrapperRef = (0, _react.useRef)(null);
76
- const [initListHeight, setInitListHeight] = (0, _react.useState)(null);
77
- const [isScrollableList, setIsScrollableList] = (0, _react.useState)(null);
78
- const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, _react.useState)(false);
79
- const [scrollTop, setScrollTop] = (0, _react.useState)(0);
80
- const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
81
- const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => [...acc, ...(item.groupName ? item.list : [item])], []);
82
- const handleClickOutside = _ref2 => {
41
+
42
+ 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); }
43
+
44
+ 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; }
45
+
46
+ 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; }
47
+
48
+ 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; }
49
+
50
+ var RC = 'tags-dropdown';
51
+ var MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
52
+
53
+ var TagsDropdown = function TagsDropdown(_ref) {
54
+ var _dropdownListWrapperR, _dropdownListWrapperR2, _dropdownListRef$curr5, _dropdownListRef$curr6, _cn8;
55
+
56
+ var options = _ref.options,
57
+ _ref$chosenOptions = _ref.chosenOptions,
58
+ chosenOptions = _ref$chosenOptions === void 0 ? [] : _ref$chosenOptions,
59
+ onChange = _ref.onChange,
60
+ className = _ref.className,
61
+ tagClassname = _ref.tagClassname,
62
+ _ref$onKeyPress = _ref.onKeyPress,
63
+ onKeyPress = _ref$onKeyPress === void 0 ? function () {} : _ref$onKeyPress,
64
+ placeholder = _ref.placeholder,
65
+ label = _ref.label,
66
+ isLabelBold = _ref.isLabelBold,
67
+ hint = _ref.hint,
68
+ hintSide = _ref.hintSide,
69
+ disabled = _ref.disabled,
70
+ isValuesInTags = _ref.isValuesInTags,
71
+ error = _ref.error,
72
+ _ref$isNotValidateASC = _ref.isNotValidateASCII,
73
+ isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
74
+ _ref$noTagsWrap = _ref.noTagsWrap,
75
+ noTagsWrap = _ref$noTagsWrap === void 0 ? false : _ref$noTagsWrap,
76
+ _ref$headerContent = _ref.headerContent,
77
+ headerContent = _ref$headerContent === void 0 ? null : _ref$headerContent,
78
+ _ref$footerContent = _ref.footerContent,
79
+ footerContent = _ref$footerContent === void 0 ? null : _ref$footerContent,
80
+ _ref$selectAllButtonR = _ref.selectAllButtonRef,
81
+ selectAllButtonRef = _ref$selectAllButtonR === void 0 ? null : _ref$selectAllButtonR,
82
+ _ref$unselectAllButto = _ref.unselectAllButtonRef,
83
+ unselectAllButtonRef = _ref$unselectAllButto === void 0 ? null : _ref$unselectAllButto,
84
+ _ref$closeOnSelect = _ref.closeOnSelect,
85
+ closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
86
+ _ref$closeOnRemove = _ref.closeOnRemove,
87
+ closeOnRemove = _ref$closeOnRemove === void 0 ? false : _ref$closeOnRemove,
88
+ _ref$closeOnRemoveAll = _ref.closeOnRemoveAll,
89
+ closeOnRemoveAll = _ref$closeOnRemoveAll === void 0 ? false : _ref$closeOnRemoveAll,
90
+ _ref$closeOnSelectAll = _ref.closeOnSelectAll,
91
+ closeOnSelectAll = _ref$closeOnSelectAll === void 0 ? false : _ref$closeOnSelectAll,
92
+ _ref$closeOnSelectMob = _ref.closeOnSelectMobile,
93
+ closeOnSelectMobile = _ref$closeOnSelectMob === void 0 ? false : _ref$closeOnSelectMob,
94
+ _ref$closeOnRemoveMob = _ref.closeOnRemoveMobile,
95
+ closeOnRemoveMobile = _ref$closeOnRemoveMob === void 0 ? false : _ref$closeOnRemoveMob,
96
+ _ref$closeOnRemoveAll2 = _ref.closeOnRemoveAllMobile,
97
+ closeOnRemoveAllMobile = _ref$closeOnRemoveAll2 === void 0 ? false : _ref$closeOnRemoveAll2,
98
+ _ref$closeOnSelectAll2 = _ref.closeOnSelectAllMobile,
99
+ closeOnSelectAllMobile = _ref$closeOnSelectAll2 === void 0 ? false : _ref$closeOnSelectAll2,
100
+ fieldKey = _ref.fieldKey,
101
+ id = _ref.id,
102
+ _ref$noOptionsText = _ref.noOptionsText,
103
+ noOptionsText = _ref$noOptionsText === void 0 ? 'No options available' : _ref$noOptionsText,
104
+ mobileSearchPlaceholder = _ref.mobileSearchPlaceholder,
105
+ _ref$isSearchable = _ref.isSearchable,
106
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
107
+ _ref$attributesOfNati = _ref.attributesOfNativeInput,
108
+ attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati,
109
+ withMobileLogic = _ref.withMobileLogic,
110
+ _ref$minItemsForShowM = _ref.minItemsForShowMobileSearch,
111
+ minItemsForShowMobileSearch = _ref$minItemsForShowM === void 0 ? MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH : _ref$minItemsForShowM;
112
+
113
+ var _useIsMobile = (0, _useIsMobile2.default)(),
114
+ isMobileProp = _useIsMobile.isMobile;
115
+
116
+ var isMobile = isMobileProp && withMobileLogic;
117
+
118
+ var _useState = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2)),
119
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
120
+ dropdownId = _useState2[0],
121
+ setDropdownId = _useState2[1];
122
+
123
+ var _useState3 = (0, _react.useState)(false),
124
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
125
+ isOpen = _useState4[0],
126
+ setIsOpen = _useState4[1];
127
+
128
+ var _useState5 = (0, _react.useState)(''),
129
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
130
+ searchValue = _useState6[0],
131
+ setSearchValue = _useState6[1];
132
+
133
+ var dropdownRef = (0, _react.useRef)(null);
134
+ var dropdownListRef = (0, _react.useRef)(null);
135
+ var dropdownListWrapperRef = (0, _react.useRef)(null);
136
+ var inputRef = (0, _react.useRef)(null);
137
+ var wrapperRef = (0, _react.useRef)(null);
138
+
139
+ var _useState7 = (0, _react.useState)(null),
140
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
141
+ initListHeight = _useState8[0],
142
+ setInitListHeight = _useState8[1];
143
+
144
+ var _useState9 = (0, _react.useState)(null),
145
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
146
+ isScrollableList = _useState10[0],
147
+ setIsScrollableList = _useState10[1];
148
+
149
+ var _useState11 = (0, _react.useState)(false),
150
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
151
+ isFixedMaxHeight = _useState12[0],
152
+ setIsFixedMaxHeight = _useState12[1];
153
+
154
+ var _useState13 = (0, _react.useState)(0),
155
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
156
+ scrollTop = _useState14[0],
157
+ setScrollTop = _useState14[1];
158
+
159
+ var _useState15 = (0, _react.useState)(1),
160
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
161
+ scrollHeight = _useState16[0],
162
+ setScrollHeight = _useState16[1];
163
+
164
+ var singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce(function (acc, item) {
165
+ return [].concat((0, _toConsumableArray2.default)(acc), (0, _toConsumableArray2.default)(item.groupName ? item.list : [item]));
166
+ }, []);
167
+
168
+ var handleClickOutside = function handleClickOutside(_ref2) {
83
169
  var _getListContainer;
84
- let {
85
- target
86
- } = _ref2;
87
- if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) /* && !isTargetInParent(target) */) {
170
+
171
+ var target = _ref2.target;
172
+
173
+ if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target))
174
+ /* && !isTargetInParent(target) */
175
+ ) {
88
176
  setIsOpen(false);
89
177
  setSearchValue('');
90
178
  }
91
179
  };
92
- const deleteChosen = value => {
180
+
181
+ var deleteChosen = function deleteChosen(value) {
93
182
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
94
- onChange(chosenOptions.filter(item => item !== value), 'chosenOptions');
183
+ onChange(chosenOptions.filter(function (item) {
184
+ return item !== value;
185
+ }), 'chosenOptions');
95
186
  };
96
- const onChangeHandler = item => {
187
+
188
+ var onChangeHandler = function onChangeHandler(item) {
97
189
  if (item !== null && item !== void 0 && item.isFreezed) return false;
190
+
98
191
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
99
192
  if (item.closeOnOptionSelect) setIsOpen(false);
100
193
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
194
+
101
195
  setSearchValue('');
102
- if (chosenOptions.some(el => el === item.value)) {
196
+
197
+ if (chosenOptions.some(function (el) {
198
+ return el === item.value;
199
+ })) {
103
200
  deleteChosen(item.value);
104
201
  return null;
105
202
  }
106
- onChange([...chosenOptions, item.value], 'chosenOptions');
203
+
204
+ onChange([].concat((0, _toConsumableArray2.default)(chosenOptions), [item.value]), 'chosenOptions');
107
205
  return null;
108
206
  };
109
- const onSearchHandler = name => {
110
- let inputValue = name;
207
+
208
+ var onSearchHandler = function onSearchHandler(name) {
209
+ var inputValue = name;
111
210
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
112
211
  setSearchValue(inputValue);
113
212
  };
114
- const onWrapperClick = e => {
213
+
214
+ var onWrapperClick = function onWrapperClick(e) {
115
215
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
116
216
  e.stopPropagation();
117
217
  e.preventDefault();
118
218
  setIsOpen(false);
119
219
  }
120
220
  };
121
- const getMarkupForElement = item => {
221
+
222
+ var getMarkupForElement = function getMarkupForElement(item) {
122
223
  var _title$toString;
123
- const {
124
- description
125
- } = item;
126
- const title = item.title || item.label;
127
- const hightlightSearchValue = title => {
224
+
225
+ var description = item.description;
226
+ var title = item.title || item.label;
227
+
228
+ var hightlightSearchValue = function hightlightSearchValue(title) {
128
229
  var _title$toLowerCase;
129
- const index = (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue.toLowerCase());
230
+
231
+ var index = (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue.toLowerCase());
130
232
  if (index === -1) return title;
131
233
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title.substring(0, index), /*#__PURE__*/_react.default.createElement("span", {
132
234
  className: "search-match"
133
235
  }, title.substring(index, index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))), title.substring(index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length)));
134
236
  };
237
+
135
238
  return /*#__PURE__*/_react.default.createElement("button", {
136
- key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, '_'),
137
- onClick: e => {
239
+ key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, '_'),
240
+ onClick: function onClick(e) {
138
241
  e.preventDefault();
139
242
  e.stopPropagation();
140
243
  onChangeHandler(item);
141
244
  },
142
- className: (0, _classnames.default)("".concat(RC, "__list-item"), {
143
- ["".concat(RC, "__list-item_active")]: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value)
144
- }, {
145
- ["".concat(RC, "__list-item_disabled")]: item.disabled
146
- }, {
147
- ["".concat(RC, "__list-item_freezed")]: item === null || item === void 0 ? void 0 : item.isFreezed
148
- }, item.className)
245
+ 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) {
246
+ return value === item.value;
247
+ })), (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), item.className)
149
248
  }, !isMobile && /*#__PURE__*/_react.default.createElement("span", {
150
- className: (0, _classnames.default)("".concat(RC, "__active-icon"), {
151
- ["".concat(RC, "__active-icon_active")]: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value)
152
- })
249
+ 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) {
250
+ return value === item.value;
251
+ })))
153
252
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, {
154
253
  width: 16,
155
254
  height: 16,
@@ -161,63 +260,73 @@ const TagsDropdown = _ref => {
161
260
  }, hightlightSearchValue(title)), description && /*#__PURE__*/_react.default.createElement("span", {
162
261
  className: (0, _classnames.default)("".concat(RC, "__list-item-description"))
163
262
  }, description)), isMobile && /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
164
- value: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value),
165
- onChange: v => {
263
+ value: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(function (value) {
264
+ return value === item.value;
265
+ }),
266
+ onChange: function onChange(v) {
166
267
  onChangeHandler(item);
167
268
  }
168
269
  }));
169
270
  };
170
- const prepareOptions = options => {
171
- 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();
271
+
272
+ var prepareOptions = function prepareOptions(options) {
273
+ return options === null || options === void 0 ? void 0 : options.map(function (option) {
274
+ return option !== null && option !== void 0 && option.groupName ? option === null || option === void 0 ? void 0 : option.list : option;
275
+ }).flat();
172
276
  };
173
- const selectAllItems = e => {
174
- var _prepareOptions;
175
- onChange([...chosenOptions, ...(((_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 || (_prepareOptions = _prepareOptions.filter(_ref3 => {
176
- let {
177
- isFreezed,
178
- value
179
- } = _ref3;
277
+
278
+ var selectAllItems = function selectAllItems(e) {
279
+ var _prepareOptions, _prepareOptions$filte;
280
+
281
+ onChange([].concat((0, _toConsumableArray2.default)(chosenOptions), (0, _toConsumableArray2.default)(((_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : (_prepareOptions$filte = _prepareOptions.filter(function (_ref3) {
282
+ var isFreezed = _ref3.isFreezed,
283
+ value = _ref3.value;
180
284
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== 'open_modal';
181
- })) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.map(_ref4 => {
182
- let {
183
- value
184
- } = _ref4;
285
+ })) === null || _prepareOptions$filte === void 0 ? void 0 : _prepareOptions$filte.map(function (_ref4) {
286
+ var value = _ref4.value;
185
287
  return value;
186
- })) || [])], 'chosenOptions');
288
+ })) || [])), 'chosenOptions');
187
289
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
188
290
  };
189
- const unselectAllItems = e => {
190
- onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
191
- var _prepareOptions2;
192
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref5 => {
193
- let {
194
- value
195
- } = _ref5;
291
+
292
+ var unselectAllItems = function unselectAllItems(e) {
293
+ onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(function (item) {
294
+ var _prepareOptions2, _prepareOptions2$find;
295
+
296
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(function (_ref5) {
297
+ var value = _ref5.value;
196
298
  return value === item;
197
- })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
299
+ })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
198
300
  }), 'chosenOptions');
199
301
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
200
302
  };
201
- const getParentNode = () => {
303
+
304
+ var getParentNode = function getParentNode() {
202
305
  var _document$querySelect;
306
+
203
307
  return (_document$querySelect = document.querySelector('div#root')) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector('div#app');
204
308
  };
205
- const initListContainer = () => {
206
- const dropdownList = document.createElement('div');
309
+
310
+ var initListContainer = function initListContainer() {
311
+ var dropdownList = document.createElement('div');
207
312
  dropdownList.setAttribute('id', dropdownId);
208
313
  dropdownList.classList.add('tags-dropdown__container');
314
+
209
315
  if (isMobile) {
210
- dropdownList.addEventListener('click', e => {
316
+ dropdownList.addEventListener('click', function (e) {
211
317
  if (e.target.id === dropdownId) setIsOpen(false);
212
318
  });
213
319
  }
320
+
214
321
  if (isMobile) {
215
322
  try {
216
323
  var _document$getElementB;
217
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
324
+
325
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
218
326
  } catch (e) {}
327
+
219
328
  ;
220
- const dropdownMobileListWrapper = document.createElement('div');
329
+ var dropdownMobileListWrapper = document.createElement('div');
221
330
  dropdownMobileListWrapper.classList.add('tags-dropdown-mobile');
222
331
  dropdownMobileListWrapper.setAttribute('id', "mlw-".concat(dropdownId));
223
332
  dropdownMobileListWrapper.append(dropdownList);
@@ -226,113 +335,130 @@ const TagsDropdown = _ref => {
226
335
  getParentNode().append(dropdownList);
227
336
  }
228
337
  };
229
- const getListContainer = () => {
338
+
339
+ var getListContainer = function getListContainer() {
230
340
  return document.getElementById(dropdownId);
231
341
  };
232
- const getListContainerWrapper = () => {
342
+
343
+ var getListContainerWrapper = function getListContainerWrapper() {
233
344
  return document.getElementById("mlw-".concat(dropdownId));
234
345
  };
235
- const setListContainerStyles = () => {
236
- var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
237
- const lc = getListContainer();
346
+
347
+ var setListContainerStyles = function setListContainerStyles() {
348
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
349
+
350
+ var lc = getListContainer();
238
351
  if (!lc || !isOpen) return false;
239
- const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
240
- const {
241
- width,
242
- height,
243
- left,
244
- top
245
- } = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 || (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
246
- const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
247
- const dl = lc.getElementsByClassName('tags-dropdown__list')[0];
248
- const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName('tags-dropdown__header')[0];
249
- const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName('tags-dropdown__footer')[0];
250
- const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace('px', '')) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0);
251
- const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 || (_getComputedStyle2 = _getComputedStyle2.maxHeight) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.replace('px', '')) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0);
352
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
353
+
354
+ 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$ : {},
355
+ width = _ref6.width,
356
+ height = _ref6.height,
357
+ left = _ref6.left,
358
+ top = _ref6.top;
359
+
360
+ var sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
361
+ var dl = lc.getElementsByClassName('tags-dropdown__list')[0];
362
+ var lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName('tags-dropdown__header')[0];
363
+ var lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName('tags-dropdown__footer')[0];
364
+ var margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 ? void 0 : (_getComputedStyle$mar2 = _getComputedStyle.marginTop) === null || _getComputedStyle$mar2 === void 0 ? void 0 : _getComputedStyle$mar2.replace('px', '')) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0);
365
+ var maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 ? void 0 : (_getComputedStyle2$ma = _getComputedStyle2.maxHeight) === null || _getComputedStyle2$ma === void 0 ? void 0 : _getComputedStyle2$ma.replace('px', '')) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0);
252
366
  if (initListHeight === null) setInitListHeight(maxHeight);
253
- const toTop = top - margin;
254
- const toBottom = windowHeight - top - height - margin * 2;
255
- const dlHeight = dl === null || dl === void 0 || (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
256
- let swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
257
- const controlsHeight = swHeight - dlHeight;
367
+ var toTop = top - margin;
368
+ var toBottom = windowHeight - top - height - margin * 2;
369
+ var dlHeight = dl === null || dl === void 0 ? void 0 : (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
370
+ var swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
371
+ var controlsHeight = swHeight - dlHeight;
258
372
  if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
259
- const maxSwHeight = isMobile ? (sw === null || sw === void 0 || (_sw$getBoundingClient2 = sw.getBoundingClientRect()) === null || _sw$getBoundingClient2 === void 0 ? void 0 : _sw$getBoundingClient2.height) - (lh === null || lh === void 0 || (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) - (lf === null || lf === void 0 || (_lf$getBoundingClient = lf.getBoundingClientRect()) === null || _lf$getBoundingClient === void 0 ? void 0 : _lf$getBoundingClient.height) : toTop - margin >= maxHeight || toBottom - margin >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
260
- const listPos = toTop < toBottom || toBottom >= swHeight ? 'bottom' : 'top';
373
+ var maxSwHeight = isMobile ? (sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient2 = sw.getBoundingClientRect()) === null || _sw$getBoundingClient2 === void 0 ? void 0 : _sw$getBoundingClient2.height) - (lh === null || lh === void 0 ? void 0 : (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) - (lf === null || lf === void 0 ? void 0 : (_lf$getBoundingClient = lf.getBoundingClientRect()) === null || _lf$getBoundingClient === void 0 ? void 0 : _lf$getBoundingClient.height) : toTop - margin >= maxHeight || toBottom - margin >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
374
+ var listPos = toTop < toBottom || toBottom >= swHeight ? 'bottom' : 'top';
261
375
  if (swHeight > (listPos === 'top' ? toTop : toBottom)) swHeight = (listPos === 'top' ? toTop : toBottom) - 3 * margin;
262
376
  lc.style.minWidth = "".concat(width, "px");
263
377
  lc.style.left = "".concat(left, "px");
264
378
  lc.style.top = "".concat(listPos === 'bottom' ? top + height : top - swHeight - 2 * margin, "px");
265
379
  dl.style.maxHeight = "".concat(isMobile ? maxSwHeight : maxSwHeight - controlsHeight, "px");
266
380
  };
267
- const renderListContainer = () => {
268
- const lc = getListContainer();
381
+
382
+ var renderListContainer = function renderListContainer() {
383
+ var lc = getListContainer();
269
384
  if (!lc) return null;
270
385
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
271
386
  };
272
- const isTargetInParent = target => {
387
+
388
+ var isTargetInParent = function isTargetInParent(target) {
273
389
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
390
+
274
391
  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;
275
- if ((target === null || target === void 0 ? void 0 : target.tagName) === 'svg' && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== 'tag__button' || (target === null || target === void 0 || (_target$className = target.className) === null || _target$className === void 0 || (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, 'tag__label')) !== -1 || (target === null || target === void 0 || (_target$className2 = target.className) === null || _target$className2 === void 0 || (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, 'tag-list_wrapper')) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "".concat(RC, "__trigger") || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
392
+ if ((target === null || target === void 0 ? void 0 : target.tagName) === 'svg' && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== 'tag__button' || (target === null || target === void 0 ? void 0 : (_target$className = target.className) === null || _target$className === void 0 ? void 0 : (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, 'tag__label')) !== -1 || (target === null || target === void 0 ? void 0 : (_target$className2 = target.className) === null || _target$className2 === void 0 ? void 0 : (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, 'tag-list_wrapper')) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "".concat(RC, "__trigger") || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
276
393
  return false;
277
394
  };
278
- const isItemMatchesSearch = item => {
279
- const title = item.title || item.label;
395
+
396
+ var isItemMatchesSearch = function isItemMatchesSearch(item) {
397
+ var title = item.title || item.label;
280
398
  return searchValue.length ? title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '') : true;
281
399
  };
282
- const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
283
- if (option.groupName) {
284
- var _option$list;
285
- const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
286
- if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
287
- result.push({
288
- ...option,
289
- list: filteredGroupItems
400
+
401
+ var getFilteredOptions = function getFilteredOptions(options) {
402
+ return options === null || options === void 0 ? void 0 : options.reduce(function (result, option) {
403
+ if (option.groupName) {
404
+ var _option$list;
405
+
406
+ 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) {
407
+ return isItemMatchesSearch(item);
290
408
  });
409
+
410
+ if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
411
+ result.push(_objectSpread(_objectSpread({}, option), {}, {
412
+ list: filteredGroupItems
413
+ }));
414
+ }
415
+ } else if (isItemMatchesSearch(option)) {
416
+ result.push(option);
291
417
  }
292
- } else if (isItemMatchesSearch(option)) {
293
- result.push(option);
294
- }
295
- return result;
296
- }, []);
297
- const getTotalOptions = (0, _react.useCallback)(() => {
298
- return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
418
+
419
+ return result;
420
+ }, []);
421
+ };
422
+
423
+ var getTotalOptions = (0, _react.useCallback)(function () {
424
+ return options === null || options === void 0 ? void 0 : options.reduce(function (result, item) {
299
425
  if (item !== null && item !== void 0 && item.list) {
300
426
  var _item$list;
301
- result += (item === null || item === void 0 || (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || 0;
427
+
428
+ result += (item === null || item === void 0 ? void 0 : (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || 0;
302
429
  } else {
303
430
  ++result;
304
431
  }
432
+
305
433
  return result;
306
434
  }, 0);
307
435
  }, [options]);
308
- const getListMarkUp = () => {
309
- const filteredOptions = getFilteredOptions(options);
436
+
437
+ var getListMarkUp = function getListMarkUp() {
438
+ var _cn6, _cn7;
439
+
440
+ var filteredOptions = getFilteredOptions(options);
310
441
  return /*#__PURE__*/_react.default.createElement("div", {
311
442
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
312
443
  ref: wrapperRef,
313
- onClick: isMobile ? onWrapperClick : () => {}
444
+ onClick: isMobile ? onWrapperClick : function () {}
314
445
  }, /*#__PURE__*/_react.default.createElement("div", {
315
446
  ref: dropdownListWrapperRef,
316
- className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), {
317
- ["".concat(RC, "__selector-wrapper--fixed-height")]: isFixedMaxHeight && isMobile
318
- })
447
+ className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), (0, _defineProperty2.default)({}, "".concat(RC, "__selector-wrapper--fixed-height"), isFixedMaxHeight && isMobile))
319
448
  }, headerContent || isMobile ? /*#__PURE__*/_react.default.createElement("div", {
320
- className: (0, _classnames.default)("".concat(RC, "__header"), {
321
- ["".concat(RC, "__header-with-shadow")]: isScrollableList && isMobile,
322
- ["".concat(RC, "__header-with-shadow-hidden")]: scrollTop === 0
323
- })
449
+ className: (0, _classnames.default)("".concat(RC, "__header"), (_cn6 = {}, (0, _defineProperty2.default)(_cn6, "".concat(RC, "__header-with-shadow"), isScrollableList && isMobile), (0, _defineProperty2.default)(_cn6, "".concat(RC, "__header-with-shadow-hidden"), scrollTop === 0), _cn6))
324
450
  }, isMobile && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
325
451
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
326
452
  }, /*#__PURE__*/_react.default.createElement("div", {
327
453
  className: (0, _classnames.default)("".concat(RC, "__label"))
328
454
  }, label), /*#__PURE__*/_react.default.createElement("div", {
329
455
  className: (0, _classnames.default)("".concat(RC, "__close-icon")),
330
- onClick: e => {
456
+ onClick: function onClick(e) {
331
457
  e.stopPropagation();
332
458
  setIsOpen(false);
333
459
  }
334
460
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
335
- onClick: e => {
461
+ onClick: function onClick(e) {
336
462
  e.stopPropagation();
337
463
  setIsOpen(false);
338
464
  }
@@ -341,10 +467,12 @@ const TagsDropdown = _ref => {
341
467
  }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
342
468
  className: "".concat(RC, "__input"),
343
469
  value: searchValue,
344
- onChange: v => setSearchValue(v),
470
+ onChange: function onChange(v) {
471
+ return setSearchValue(v);
472
+ },
345
473
  placeholder: mobileSearchPlaceholder || 'Search',
346
474
  withDelete: true,
347
- onMouseDown: e => {
475
+ onMouseDown: function onMouseDown(e) {
348
476
  if (!isOpen) {
349
477
  setIsSearchInputFocused(true);
350
478
  setIsOpen(true);
@@ -355,34 +483,39 @@ const TagsDropdown = _ref => {
355
483
  }, headerContent)) : null, /*#__PURE__*/_react.default.createElement("div", {
356
484
  ref: dropdownListRef,
357
485
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : '', " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : '')
358
- }, (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) > 0 ? filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
359
- var _option$groupName, _option$list2;
486
+ }, (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) > 0 ? filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(function (option) {
487
+ var _option$groupName, _option$groupName$toS, _option$list2;
488
+
360
489
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
361
- key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 || (_option$groupName = _option$groupName.toString()) === null || _option$groupName === void 0 ? void 0 : _option$groupName.replace(/ /g, '_').concat(Date.now()),
490
+ 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()),
362
491
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
363
492
  }, /*#__PURE__*/_react.default.createElement("span", {
364
493
  className: "".concat(RC, "-group__name")
365
- }, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(item => getMarkupForElement(item))) : getMarkupForElement(option);
494
+ }, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(function (item) {
495
+ return getMarkupForElement(item);
496
+ })) : getMarkupForElement(option);
366
497
  }) : /*#__PURE__*/_react.default.createElement("div", {
367
498
  className: "".concat(RC, "__no-options")
368
499
  }, noOptionsText)), footerContent || isMobile ? /*#__PURE__*/_react.default.createElement("div", {
369
- className: (0, _classnames.default)("".concat(RC, "__footer"), {
370
- ["".concat(RC, "__footer-with-shadow")]: isMobile && isScrollableList,
371
- ["".concat(RC, "__footer-with-shadow-hidden")]: scrollTop === scrollHeight
372
- })
500
+ className: (0, _classnames.default)("".concat(RC, "__footer"), (_cn7 = {}, (0, _defineProperty2.default)(_cn7, "".concat(RC, "__footer-with-shadow"), isMobile && isScrollableList), (0, _defineProperty2.default)(_cn7, "".concat(RC, "__footer-with-shadow-hidden"), scrollTop === scrollHeight), _cn7))
373
501
  }, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
374
- onClick: () => setIsOpen(false)
502
+ onClick: function onClick() {
503
+ return setIsOpen(false);
504
+ }
375
505
  }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : '')) : null));
376
506
  };
377
- const closeList = e => {
507
+
508
+ var closeList = function closeList(e) {
378
509
  var _inputRef$current;
510
+
379
511
  handleClickOutside(e);
380
- inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
512
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
381
513
  };
382
- (0, _react.useLayoutEffect)(() => {
514
+
515
+ (0, _react.useLayoutEffect)(function () {
383
516
  initListContainer();
384
517
  }, []);
385
- (0, _react.useLayoutEffect)(() => {
518
+ (0, _react.useLayoutEffect)(function () {
386
519
  if (!isMobile) {
387
520
  window.addEventListener('resize', setListContainerStyles);
388
521
  window.addEventListener('mousewheel', closeList);
@@ -392,128 +525,151 @@ const TagsDropdown = _ref => {
392
525
  window.removeEventListener('mousewheel', closeList);
393
526
  window.removeEventListener('mouseup', handleClickOutside);
394
527
  }
395
- return () => {
528
+
529
+ return function () {
396
530
  window.removeEventListener('resize', setListContainerStyles);
397
531
  window.removeEventListener('mousewheel', closeList);
398
532
  window.removeEventListener('mouseup', handleClickOutside);
399
533
  };
400
534
  }, [getListContainer]);
401
- (0, _react.useLayoutEffect)(() => {
535
+ (0, _react.useLayoutEffect)(function () {
402
536
  setListContainerStyles();
403
- }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 || (_dropdownListWrapperR = _dropdownListWrapperR.getBoundingClientRect()) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.height]);
404
- (0, _react.useEffect)(() => {
537
+ }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : (_dropdownListWrapperR2 = _dropdownListWrapperR.getBoundingClientRect()) === null || _dropdownListWrapperR2 === void 0 ? void 0 : _dropdownListWrapperR2.height]);
538
+ (0, _react.useEffect)(function () {
405
539
  if (!isMobile) {
406
540
  document.addEventListener('click', handleClickOutside, true);
407
541
  } else {
408
542
  document.removeEventListener('click', handleClickOutside, true);
409
543
  }
410
- return () => document.removeEventListener('click', handleClickOutside, true);
544
+
545
+ return function () {
546
+ return document.removeEventListener('click', handleClickOutside, true);
547
+ };
411
548
  }, [isMobile]);
412
- (0, _react.useEffect)(() => {
549
+ (0, _react.useEffect)(function () {
413
550
  var _selectAllButtonRef$c, _unselectAllButtonRef;
414
- const fn = isOpen ? 'addEventListener' : 'removeEventListener';
415
- selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]('click', selectAllItems, true);
416
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]('click', unselectAllItems, true);
551
+
552
+ var fn = isOpen ? 'addEventListener' : 'removeEventListener';
553
+ selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]('click', selectAllItems, true);
554
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]('click', unselectAllItems, true);
555
+
417
556
  if (isOpen) {
418
557
  var _getListContainer2;
419
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.classList.add('tags-dropdown__container--opened');
558
+
559
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.classList.add('tags-dropdown__container--opened');
420
560
  } else {
421
561
  var _getListContainer3;
422
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.classList.remove('tags-dropdown__container--opened');
562
+
563
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.classList.remove('tags-dropdown__container--opened');
423
564
  }
424
565
  }, [isOpen]);
425
- (0, _react.useEffect)(() => {
566
+ (0, _react.useEffect)(function () {
426
567
  if (isOpen && isMobile, dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
427
568
  var _dropdownListRef$curr, _dropdownListRef$curr2;
428
- setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
569
+
570
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
571
+
429
572
  if (isScrollableList === null) {
430
573
  var _dropdownListRef$curr3, _dropdownListRef$curr4;
431
- setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
574
+
575
+ setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
432
576
  }
433
577
  }
434
- }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
435
- (0, _react.useEffect)(() => {
436
- const setScrollTopValue = e => {
578
+ }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
579
+ (0, _react.useEffect)(function () {
580
+ var setScrollTopValue = function setScrollTopValue(e) {
437
581
  setScrollTop(parseInt(e.target.scrollTop));
438
582
  };
583
+
439
584
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
440
585
  var _dropdownListRef$curr7;
441
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener('scroll', setScrollTopValue);
586
+
587
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.addEventListener('scroll', setScrollTopValue);
442
588
  }
443
- return () => {
589
+
590
+ return function () {
444
591
  var _dropdownListRef$curr8;
445
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener('scroll', setScrollTopValue);
592
+
593
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.removeEventListener('scroll', setScrollTopValue);
446
594
  };
447
595
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
448
- (0, _react.useEffect)(() => {
596
+ (0, _react.useEffect)(function () {
449
597
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
450
598
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
451
- setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight)));
599
+
600
+ setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight)));
452
601
  }
453
602
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
454
- (0, _react.useEffect)(() => {
455
- return () => {
603
+ (0, _react.useEffect)(function () {
604
+ return function () {
456
605
  var _getListContainer4, _getListContainerWrap;
457
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.remove();
458
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
606
+
607
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.remove();
608
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
459
609
  };
460
610
  }, []);
461
611
  return /*#__PURE__*/_react.default.createElement("div", {
462
- className: (0, _classnames.default)(RC, className, {
463
- ["".concat(RC, "_disabled")]: disabled,
464
- ["".concat(RC, "-mobile")]: isMobile
465
- }),
612
+ className: (0, _classnames.default)(RC, className, (_cn8 = {}, (0, _defineProperty2.default)(_cn8, "".concat(RC, "_disabled"), disabled), (0, _defineProperty2.default)(_cn8, "".concat(RC, "-mobile"), isMobile), _cn8)),
466
613
  ref: dropdownRef
467
614
  }, /*#__PURE__*/_react.default.createElement("div", {
468
615
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
469
616
  'tags-dropdown__error': error
470
617
  }),
471
- onClick: _ref6 => {
472
- let {
473
- target
474
- } = _ref6;
618
+ onClick: function onClick(_ref7) {
619
+ var target = _ref7.target;
475
620
  if ((target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT') setIsOpen(true);else if (isTargetInParent(target)) {
476
- setIsOpen(isOpen => !isOpen);
621
+ setIsOpen(function (isOpen) {
622
+ return !isOpen;
623
+ });
477
624
  }
478
625
  }
479
626
  }, noTagsWrap ? /*#__PURE__*/_react.default.createElement(_TagList.default, {
480
- items: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map((value, i) => {
481
- const tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(el => el.value === value);
482
- 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);
627
+ items: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(function (value, i) {
628
+ var tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(function (el) {
629
+ return el.value === value;
630
+ });
631
+ 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);
483
632
  return {
484
- value,
485
- label,
633
+ value: value,
634
+ label: label,
486
635
  id: i
487
636
  };
488
637
  }),
489
638
  disableShowMore: true
490
- }) : chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(value => {
491
- const tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(el => el.value === value);
492
- 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);
639
+ }) : chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.map(function (value) {
640
+ var tag = singleLevelOptions === null || singleLevelOptions === void 0 ? void 0 : singleLevelOptions.find(function (el) {
641
+ return el.value === value;
642
+ });
643
+ 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);
493
644
  return /*#__PURE__*/_react.default.createElement(_Tag.default, {
494
645
  key: value,
495
646
  className: (0, _classnames.default)(tagClassname, {
496
647
  'tag_with-btn': !(tag !== null && tag !== void 0 && tag.isFreezed)
497
648
  }),
498
649
  label: label,
499
- removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : () => deleteChosen(value),
650
+ removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : function () {
651
+ return deleteChosen(value);
652
+ },
500
653
  isNoDismiss: false
501
654
  });
502
655
  }), chosenOptions.length === 0 || !noTagsWrap ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
503
656
  ref: inputRef,
504
657
  className: "".concat(RC, "__input"),
505
658
  value: searchValue,
506
- onChange: e => onSearchHandler(e.target.value),
659
+ onChange: function onChange(e) {
660
+ return onSearchHandler(e.target.value);
661
+ },
507
662
  placeholder: placeholder || 'Select from list',
508
- onKeyDown: e => onKeyPress(e, searchValue),
509
- onFocus: e => {
663
+ onKeyDown: function onKeyDown(e) {
664
+ return onKeyPress(e, searchValue);
665
+ },
666
+ onFocus: function onFocus(e) {
510
667
  var _e$target;
511
- if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
668
+
669
+ if (isMobile) e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.blur();
512
670
  }
513
671
  }, attributesOfNativeInput)) : '', isOpen && renderListContainer(), /*#__PURE__*/_react.default.createElement("span", {
514
- className: (0, _classnames.default)("".concat(RC, "__arrow"), {
515
- ["".concat(RC, "__arrow_active")]: isOpen
516
- })
672
+ className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen))
517
673
  }, isMobile ? /*#__PURE__*/_react.default.createElement(_reactFeather.Code, {
518
674
  className: "mobile-icon"
519
675
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
@@ -522,4 +678,6 @@ const TagsDropdown = _ref => {
522
678
  className: "color--text"
523
679
  }))));
524
680
  };
525
- var _default = exports.default = TagsDropdown;
681
+
682
+ var _default = TagsDropdown;
683
+ exports.default = _default;