intelicoreact 1.3.21 → 1.3.22

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