intelicoreact 1.3.7 → 1.3.9

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 +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 +27 -71
  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 +21 -44
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +104 -170
  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 +303 -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 +251 -409
  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 +25 -33
  91. package/dist/Atomic/UI/Button/Button.scss +6 -4
  92. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
  93. package/dist/Atomic/UI/Chart/Chart.js +45 -86
  94. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
  95. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
  96. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
  97. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
  98. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
  99. package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
  100. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
  101. package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
  102. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +12 -36
  103. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
  104. package/dist/Atomic/UI/DoubleString/DoubleString.js +27 -50
  105. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
  106. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
  107. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
  108. package/dist/Atomic/UI/Hint/Hint.js +49 -94
  109. package/dist/Atomic/UI/Modal/Modal.js +149 -179
  110. package/dist/Atomic/UI/Modal/ModalHOC.js +12 -21
  111. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
  112. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
  113. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +93 -151
  114. package/dist/Atomic/UI/ModalBackup/Modal.js +65 -90
  115. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +12 -21
  116. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +6 -11
  117. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +15 -19
  118. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
  119. package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
  120. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  121. package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
  122. package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
  123. package/dist/Atomic/UI/Price/Price.js +10 -13
  124. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
  125. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +27 -56
  126. package/dist/Atomic/UI/Status/Status.js +19 -30
  127. package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
  128. package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
  129. package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
  130. package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
  131. package/dist/Atomic/UI/Table/Table.js +27 -47
  132. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
  133. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
  134. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -8
  135. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +25 -47
  136. package/dist/Atomic/UI/Tag/Tag.js +20 -48
  137. package/dist/Atomic/UI/TagList/TagList.js +80 -150
  138. package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
  139. package/dist/Classes/AbortableFetch.js +283 -422
  140. package/dist/Classes/AnimatedHandler.js +44 -56
  141. package/dist/Classes/RESTAPI/index.js +154 -433
  142. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
  143. package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
  144. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +57 -275
  145. package/dist/Classes/RESTAPI/partials/ApiUtils.js +146 -377
  146. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +155 -403
  147. package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
  148. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  149. package/dist/Classes/RESTAPI/partials/_utils.js +101 -395
  150. package/dist/Constants/index.constants.js +8 -15
  151. package/dist/Functions/Portal.js +14 -33
  152. package/dist/Functions/customEventListener.js +5 -20
  153. package/dist/Functions/fieldValueFormatters.js +148 -211
  154. package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
  155. package/dist/Functions/locale/createTranslator.js +13 -27
  156. package/dist/Functions/operations.js +35 -49
  157. package/dist/Functions/presets/inputMaskPresets.js +25 -27
  158. package/dist/Functions/presets/inputPresets.js +19 -22
  159. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  160. package/dist/Functions/schemas.js +6 -15
  161. package/dist/Functions/useClickOutside.js +3 -7
  162. package/dist/Functions/useDebounce.js +11 -25
  163. package/dist/Functions/useFieldFocus.js +42 -67
  164. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
  165. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
  166. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
  167. package/dist/Functions/useFormTools/functions/General.js +80 -99
  168. package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
  169. package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
  170. package/dist/Functions/useFormTools/index.js +382 -598
  171. package/dist/Functions/useInputHighlightError.js +27 -52
  172. package/dist/Functions/useIsMobile.js +13 -36
  173. package/dist/Functions/useLocalStorage.js +7 -22
  174. package/dist/Functions/useLocationParams.js +16 -27
  175. package/dist/Functions/useMetaInfo.js +19 -50
  176. package/dist/Functions/useMouseUpOutside.js +2 -5
  177. package/dist/Functions/useOnlineStatus.js +7 -26
  178. package/dist/Functions/usePasswordChecker.js +42 -77
  179. package/dist/Functions/usePrevious.js +3 -7
  180. package/dist/Functions/useResize.js +12 -32
  181. package/dist/Functions/useScrollTo.js +6 -20
  182. package/dist/Functions/useToggle.js +10 -30
  183. package/dist/Functions/utils.js +186 -366
  184. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
  185. package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
  186. package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
  187. package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
  188. package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
  189. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
  190. package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
  191. package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
  192. package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
  193. package/dist/Molecular/CustomIcons/components/Button.js +11 -22
  194. package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
  195. package/dist/Molecular/CustomIcons/components/Check.js +12 -23
  196. package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
  197. package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
  198. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
  199. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
  200. package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
  201. package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
  202. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
  203. package/dist/Molecular/CustomIcons/components/Close.js +13 -24
  204. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
  205. package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
  206. package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
  207. package/dist/Molecular/CustomIcons/components/Email.js +29 -40
  208. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
  209. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
  210. package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
  211. package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
  212. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
  213. package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
  214. package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
  215. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
  216. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
  217. package/dist/Molecular/CustomIcons/components/Home.js +14 -25
  218. package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
  219. package/dist/Molecular/CustomIcons/components/Key.js +19 -30
  220. package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
  221. package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
  222. package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
  223. package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
  224. package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
  225. package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
  226. package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
  227. package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
  228. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
  229. package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
  230. package/dist/Molecular/CustomIcons/components/Play.js +24 -35
  231. package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
  232. package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
  233. package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
  234. package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
  235. package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
  236. package/dist/Molecular/CustomIcons/components/Star.js +10 -21
  237. package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
  238. package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
  239. package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
  240. package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
  241. package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
  242. package/dist/Molecular/CustomIcons/components/User.js +16 -27
  243. package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
  244. package/dist/Molecular/CustomIcons/components/X.js +11 -22
  245. package/dist/Molecular/CustomIcons/index.js +61 -183
  246. package/dist/Molecular/FormElement/FormElement.js +18 -27
  247. package/dist/Molecular/InputAddress/InputAddress.js +176 -312
  248. package/dist/Molecular/InputPassword/InputPassword.js +15 -39
  249. package/dist/index.js +1 -3
  250. package/package.json +1 -1
  251. 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,113 @@ 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, _cn7;
439
-
440
- var filteredOptions = getFilteredOptions(options);
308
+ const getListMarkUp = () => {
309
+ const filteredOptions = getFilteredOptions(options);
441
310
  return /*#__PURE__*/_react.default.createElement("div", {
442
311
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
443
312
  ref: wrapperRef,
444
- onClick: isMobile ? onWrapperClick : function () {}
313
+ onClick: isMobile ? onWrapperClick : () => {}
445
314
  }, /*#__PURE__*/_react.default.createElement("div", {
446
315
  ref: dropdownListWrapperRef,
447
- className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), (0, _defineProperty2.default)({}, "".concat(RC, "__selector-wrapper--fixed-height"), isFixedMaxHeight && isMobile))
316
+ className: (0, _classnames.default)("".concat(RC, "__selector-wrapper"), {
317
+ ["".concat(RC, "__selector-wrapper--fixed-height")]: isFixedMaxHeight && isMobile
318
+ })
448
319
  }, 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))
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
+ })
450
324
  }, isMobile && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
451
325
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
452
326
  }, /*#__PURE__*/_react.default.createElement("div", {
453
327
  className: (0, _classnames.default)("".concat(RC, "__label"))
454
328
  }, label), /*#__PURE__*/_react.default.createElement("div", {
455
329
  className: (0, _classnames.default)("".concat(RC, "__close-icon")),
456
- onClick: function onClick(e) {
330
+ onClick: e => {
457
331
  e.stopPropagation();
458
332
  setIsOpen(false);
459
333
  }
460
334
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
461
- onClick: function onClick(e) {
335
+ onClick: e => {
462
336
  e.stopPropagation();
463
337
  setIsOpen(false);
464
338
  }
@@ -467,12 +341,10 @@ var TagsDropdown = function TagsDropdown(_ref) {
467
341
  }, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
468
342
  className: "".concat(RC, "__input"),
469
343
  value: searchValue,
470
- onChange: function onChange(v) {
471
- return setSearchValue(v);
472
- },
344
+ onChange: v => setSearchValue(v),
473
345
  placeholder: mobileSearchPlaceholder || 'Search',
474
346
  withDelete: true,
475
- onMouseDown: function onMouseDown(e) {
347
+ onMouseDown: e => {
476
348
  if (!isOpen) {
477
349
  setIsSearchInputFocused(true);
478
350
  setIsOpen(true);
@@ -483,39 +355,34 @@ var TagsDropdown = function TagsDropdown(_ref) {
483
355
  }, headerContent)) : null, /*#__PURE__*/_react.default.createElement("div", {
484
356
  ref: dropdownListRef,
485
357
  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.length) > 0 ? filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(function (option) {
487
- var _option$groupName, _option$groupName$toS, _option$list2;
488
-
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;
489
360
  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()),
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()),
491
362
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
492
363
  }, /*#__PURE__*/_react.default.createElement("span", {
493
364
  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);
365
+ }, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(item => getMarkupForElement(item))) : getMarkupForElement(option);
497
366
  }) : /*#__PURE__*/_react.default.createElement("div", {
498
367
  className: "".concat(RC, "__no-options")
499
368
  }, noOptionsText)), footerContent || isMobile ? /*#__PURE__*/_react.default.createElement("div", {
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))
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
+ })
501
373
  }, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
502
- onClick: function onClick() {
503
- return setIsOpen(false);
504
- }
374
+ onClick: () => setIsOpen(false)
505
375
  }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : '')) : null));
506
376
  };
507
-
508
- var closeList = function closeList(e) {
377
+ const closeList = e => {
509
378
  var _inputRef$current;
510
-
511
379
  handleClickOutside(e);
512
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
380
+ inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
513
381
  };
514
-
515
- (0, _react.useLayoutEffect)(function () {
382
+ (0, _react.useLayoutEffect)(() => {
516
383
  initListContainer();
517
384
  }, []);
518
- (0, _react.useLayoutEffect)(function () {
385
+ (0, _react.useLayoutEffect)(() => {
519
386
  if (!isMobile) {
520
387
  window.addEventListener('resize', setListContainerStyles);
521
388
  window.addEventListener('mousewheel', closeList);
@@ -525,151 +392,128 @@ var TagsDropdown = function TagsDropdown(_ref) {
525
392
  window.removeEventListener('mousewheel', closeList);
526
393
  window.removeEventListener('mouseup', handleClickOutside);
527
394
  }
528
-
529
- return function () {
395
+ return () => {
530
396
  window.removeEventListener('resize', setListContainerStyles);
531
397
  window.removeEventListener('mousewheel', closeList);
532
398
  window.removeEventListener('mouseup', handleClickOutside);
533
399
  };
534
400
  }, [getListContainer]);
535
- (0, _react.useLayoutEffect)(function () {
401
+ (0, _react.useLayoutEffect)(() => {
536
402
  setListContainerStyles();
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 () {
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)(() => {
539
405
  if (!isMobile) {
540
406
  document.addEventListener('click', handleClickOutside, true);
541
407
  } else {
542
408
  document.removeEventListener('click', handleClickOutside, true);
543
409
  }
544
-
545
- return function () {
546
- return document.removeEventListener('click', handleClickOutside, true);
547
- };
410
+ return () => document.removeEventListener('click', handleClickOutside, true);
548
411
  }, [isMobile]);
549
- (0, _react.useEffect)(function () {
412
+ (0, _react.useEffect)(() => {
550
413
  var _selectAllButtonRef$c, _unselectAllButtonRef;
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
-
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);
556
417
  if (isOpen) {
557
418
  var _getListContainer2;
558
-
559
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.classList.add('tags-dropdown__container--opened');
419
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.classList.add('tags-dropdown__container--opened');
560
420
  } else {
561
421
  var _getListContainer3;
562
-
563
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.classList.remove('tags-dropdown__container--opened');
422
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.classList.remove('tags-dropdown__container--opened');
564
423
  }
565
424
  }, [isOpen]);
566
- (0, _react.useEffect)(function () {
425
+ (0, _react.useEffect)(() => {
567
426
  if (isOpen && isMobile, dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
568
427
  var _dropdownListRef$curr, _dropdownListRef$curr2;
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
-
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));
572
429
  if (isScrollableList === null) {
573
430
  var _dropdownListRef$curr3, _dropdownListRef$curr4;
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));
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));
576
432
  }
577
433
  }
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) {
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 => {
581
437
  setScrollTop(parseInt(e.target.scrollTop));
582
438
  };
583
-
584
439
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
585
440
  var _dropdownListRef$curr7;
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);
441
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener('scroll', setScrollTopValue);
588
442
  }
589
-
590
- return function () {
443
+ return () => {
591
444
  var _dropdownListRef$curr8;
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);
445
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener('scroll', setScrollTopValue);
594
446
  };
595
447
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
596
- (0, _react.useEffect)(function () {
448
+ (0, _react.useEffect)(() => {
597
449
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
598
450
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
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)));
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)));
601
452
  }
602
453
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
603
- (0, _react.useEffect)(function () {
604
- return function () {
454
+ (0, _react.useEffect)(() => {
455
+ return () => {
605
456
  var _getListContainer4, _getListContainerWrap;
606
-
607
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.remove();
608
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
457
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.remove();
458
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
609
459
  };
610
460
  }, []);
611
461
  return /*#__PURE__*/_react.default.createElement("div", {
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)),
462
+ className: (0, _classnames.default)(RC, className, {
463
+ ["".concat(RC, "_disabled")]: disabled,
464
+ ["".concat(RC, "-mobile")]: isMobile
465
+ }),
613
466
  ref: dropdownRef
614
467
  }, /*#__PURE__*/_react.default.createElement("div", {
615
468
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
616
469
  'tags-dropdown__error': error
617
470
  }),
618
- onClick: function onClick(_ref7) {
619
- var target = _ref7.target;
471
+ onClick: _ref6 => {
472
+ let {
473
+ target
474
+ } = _ref6;
620
475
  if ((target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT') setIsOpen(true);else if (isTargetInParent(target)) {
621
- setIsOpen(function (isOpen) {
622
- return !isOpen;
623
- });
476
+ setIsOpen(isOpen => !isOpen);
624
477
  }
625
478
  }
626
479
  }, noTagsWrap ? /*#__PURE__*/_react.default.createElement(_TagList.default, {
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);
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);
632
483
  return {
633
- value: value,
634
- label: label,
484
+ value,
485
+ label,
635
486
  id: i
636
487
  };
637
488
  }),
638
489
  disableShowMore: true
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);
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);
644
493
  return /*#__PURE__*/_react.default.createElement(_Tag.default, {
645
494
  key: value,
646
495
  className: (0, _classnames.default)(tagClassname, {
647
496
  'tag_with-btn': !(tag !== null && tag !== void 0 && tag.isFreezed)
648
497
  }),
649
498
  label: label,
650
- removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : function () {
651
- return deleteChosen(value);
652
- },
499
+ removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : () => deleteChosen(value),
653
500
  isNoDismiss: false
654
501
  });
655
502
  }), chosenOptions.length === 0 || !noTagsWrap ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
656
503
  ref: inputRef,
657
504
  className: "".concat(RC, "__input"),
658
505
  value: searchValue,
659
- onChange: function onChange(e) {
660
- return onSearchHandler(e.target.value);
661
- },
506
+ onChange: e => onSearchHandler(e.target.value),
662
507
  placeholder: placeholder || 'Select from list',
663
- onKeyDown: function onKeyDown(e) {
664
- return onKeyPress(e, searchValue);
665
- },
666
- onFocus: function onFocus(e) {
508
+ onKeyDown: e => onKeyPress(e, searchValue),
509
+ onFocus: e => {
667
510
  var _e$target;
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();
511
+ if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
670
512
  }
671
513
  }, attributesOfNativeInput)) : '', isOpen && renderListContainer(), /*#__PURE__*/_react.default.createElement("span", {
672
- className: (0, _classnames.default)("".concat(RC, "__arrow"), (0, _defineProperty2.default)({}, "".concat(RC, "__arrow_active"), isOpen))
514
+ className: (0, _classnames.default)("".concat(RC, "__arrow"), {
515
+ ["".concat(RC, "__arrow_active")]: isOpen
516
+ })
673
517
  }, isMobile ? /*#__PURE__*/_react.default.createElement(_reactFeather.Code, {
674
518
  className: "mobile-icon"
675
519
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
@@ -678,6 +522,4 @@ var TagsDropdown = function TagsDropdown(_ref) {
678
522
  className: "color--text"
679
523
  }))));
680
524
  };
681
-
682
- var _default = TagsDropdown;
683
- exports.default = _default;
525
+ var _default = exports.default = TagsDropdown;