intelicoreact 1.4.18 → 1.4.19

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 (255) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +1 -9
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -10
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +4 -24
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -10
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +2 -14
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +5 -54
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +3 -21
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +51 -144
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -7
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +25 -91
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +3 -15
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +15 -29
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +5 -15
  14. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +19 -35
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +9 -38
  17. package/dist/Atomic/FormElements/Input/Input.js +25 -60
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +16 -46
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
  30. package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
  31. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
  32. package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
  33. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +44 -137
  34. package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
  35. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
  36. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
  37. package/dist/Atomic/FormElements/Label/Label.js +1 -9
  38. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
  39. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
  40. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
  41. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
  42. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
  43. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
  44. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
  45. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
  46. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
  47. package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
  48. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
  49. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
  50. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
  51. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
  52. package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
  53. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
  54. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
  55. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
  56. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
  57. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
  58. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
  59. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  60. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
  61. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +8 -30
  62. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +96 -187
  63. package/dist/Atomic/FormElements/Text/Text.js +10 -16
  64. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
  65. package/dist/Atomic/FormElements/Textarea/Textarea.js +3 -17
  66. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
  67. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
  68. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
  69. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
  70. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
  71. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
  72. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
  73. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
  74. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
  75. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  76. package/dist/Atomic/Layout/Header/Header.js +3 -15
  77. package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
  78. package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
  79. package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
  80. package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
  81. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
  82. package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -15
  83. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
  84. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
  85. package/dist/Atomic/UI/Alert/Alert.js +3 -19
  86. package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
  87. package/dist/Atomic/UI/Box/Box.js +3 -9
  88. package/dist/Atomic/UI/Button/Button.js +2 -11
  89. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
  90. package/dist/Atomic/UI/Chart/Chart.js +4 -29
  91. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
  92. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
  93. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
  94. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
  95. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
  96. package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
  97. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
  98. package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
  99. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
  100. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
  101. package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -17
  102. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
  103. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
  104. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
  105. package/dist/Atomic/UI/Hint/Hint.js +5 -31
  106. package/dist/Atomic/UI/Modal/Modal.js +6 -28
  107. package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
  108. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
  109. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
  110. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
  111. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
  112. package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
  113. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  114. package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
  115. package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
  116. package/dist/Atomic/UI/Price/Price.js +3 -8
  117. package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
  118. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
  119. package/dist/Atomic/UI/Status/Status.js +1 -8
  120. package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
  121. package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
  122. package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
  123. package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
  124. package/dist/Atomic/UI/Table/Table.js +1 -12
  125. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
  126. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
  127. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
  128. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
  129. package/dist/Atomic/UI/Tag/Tag.js +7 -19
  130. package/dist/Atomic/UI/TagList/TagList.js +20 -38
  131. package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
  132. package/dist/Classes/AbortableFetch.js +36 -93
  133. package/dist/Classes/AnimatedHandler.js +3 -7
  134. package/dist/Classes/RESTAPI/index.js +44 -53
  135. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
  136. package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
  137. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
  138. package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
  139. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
  140. package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
  141. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  142. package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
  143. package/dist/Constants/index.constants.js +8 -15
  144. package/dist/Functions/Portal.js +5 -16
  145. package/dist/Functions/customEventListener.js +4 -17
  146. package/dist/Functions/fieldValueFormatters.js +43 -83
  147. package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
  148. package/dist/Functions/locale/createTranslator.js +4 -9
  149. package/dist/Functions/operations.js +12 -22
  150. package/dist/Functions/presets/inputMaskPresets.js +9 -11
  151. package/dist/Functions/presets/inputPresets.js +8 -11
  152. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  153. package/dist/Functions/schemas.js +6 -13
  154. package/dist/Functions/useBodyScrollLock.js +1 -6
  155. package/dist/Functions/useClickOutside.js +0 -4
  156. package/dist/Functions/useDebounce.js +2 -7
  157. package/dist/Functions/useFieldFocus.js +6 -18
  158. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
  159. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
  160. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
  161. package/dist/Functions/useFormTools/functions/General.js +18 -28
  162. package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
  163. package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
  164. package/dist/Functions/useFormTools/index.js +85 -144
  165. package/dist/Functions/useInputHighlightError.js +3 -12
  166. package/dist/Functions/useIsMobile.js +7 -13
  167. package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
  168. package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
  169. package/dist/Functions/useLocalStorage.js +1 -9
  170. package/dist/Functions/useLocationParams.js +4 -5
  171. package/dist/Functions/useMediaQuery.js +3 -9
  172. package/dist/Functions/useMetaInfo.js +3 -10
  173. package/dist/Functions/useMouseUpOutside.js +0 -3
  174. package/dist/Functions/useOnlineStatus.js +1 -9
  175. package/dist/Functions/usePasswordChecker.js +4 -20
  176. package/dist/Functions/usePrevious.js +1 -5
  177. package/dist/Functions/useResize.js +2 -10
  178. package/dist/Functions/useScrollTo.js +2 -7
  179. package/dist/Functions/useToggle.js +1 -5
  180. package/dist/Functions/utils.js +56 -131
  181. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
  182. package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
  183. package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
  184. package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
  185. package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
  186. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
  187. package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
  188. package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
  189. package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
  190. package/dist/Molecular/CustomIcons/components/Button.js +2 -9
  191. package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
  192. package/dist/Molecular/CustomIcons/components/Check.js +2 -9
  193. package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
  194. package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
  195. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
  196. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
  197. package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
  198. package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
  199. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
  200. package/dist/Molecular/CustomIcons/components/Close.js +2 -9
  201. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
  202. package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
  203. package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
  204. package/dist/Molecular/CustomIcons/components/Email.js +2 -9
  205. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
  206. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
  207. package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
  208. package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
  209. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
  210. package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
  211. package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
  212. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
  213. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
  214. package/dist/Molecular/CustomIcons/components/Home.js +2 -9
  215. package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
  216. package/dist/Molecular/CustomIcons/components/Key.js +2 -9
  217. package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
  218. package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
  219. package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
  220. package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
  221. package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
  222. package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
  223. package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
  224. package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
  225. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
  226. package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
  227. package/dist/Molecular/CustomIcons/components/Play.js +2 -9
  228. package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
  229. package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
  230. package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
  231. package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
  232. package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
  233. package/dist/Molecular/CustomIcons/components/Star.js +2 -9
  234. package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
  235. package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
  236. package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
  237. package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
  238. package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
  239. package/dist/Molecular/CustomIcons/components/User.js +2 -9
  240. package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
  241. package/dist/Molecular/CustomIcons/components/X.js +2 -9
  242. package/dist/Molecular/CustomIcons/index.js +0 -122
  243. package/dist/Molecular/FormElement/FormElement.js +1 -12
  244. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
  245. package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
  246. package/dist/Molecular/InputAddress/InputAddress.js +65 -114
  247. package/dist/Molecular/InputPassword/InputPassword.js +5 -19
  248. package/dist/index.js +0 -2
  249. package/package.json +1 -1
  250. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
  251. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  252. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  253. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  254. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  255. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
@@ -1,51 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _react = _interopRequireWildcard(require("react"));
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _reactDom = require("react-dom");
17
-
18
12
  var _reactFeather = require("react-feather");
19
-
20
13
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
21
-
22
14
  var _useDebounce = require("../../../Functions/useDebounce");
23
-
24
15
  var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
25
-
26
16
  var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
27
-
28
17
  var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
29
-
30
18
  var _Button = _interopRequireDefault(require("../../UI/Button/Button"));
31
-
32
19
  var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
33
-
34
20
  var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
35
-
36
21
  require("./TagsDropdown.scss");
37
-
38
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
-
40
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
-
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
42
24
  const RC = "tags-dropdown";
43
25
  const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
44
26
  const COLORS = ["#F1F0F0", "#E3E2E0", "#EEDFDA", "#F9DEC9", "#FDECC8", "#DBECDB", "#D3E4EF", "#E8DEEE", "#F4E0E9", "#FFE2DD", "#D3EFED", "#ECEEDE"];
45
-
46
27
  const TagsDropdown = _ref => {
47
- var _Object$keys, _dropdownListWrapperR2, _dropdownListWrapperR3, _dropdownListRef$curr7, _dropdownListRef$curr8;
48
-
28
+ var _Object$keys, _dropdownListWrapperR2, _dropdownListRef$curr7, _dropdownListRef$curr8;
49
29
  let {
50
30
  options: optionsProp,
51
31
  chosenOptions = [],
@@ -119,13 +99,11 @@ const TagsDropdown = _ref => {
119
99
  searchValue,
120
100
  delay: 600
121
101
  });
122
-
123
102
  const setSearchValueInterceptor = value => {
124
103
  setSearchValue(value);
125
104
  setIsValueDeleted(searchValue !== value && value === "");
126
105
  searchValueRef.current = value;
127
106
  };
128
-
129
107
  const [options, setOptions] = (0, _react.useState)([]);
130
108
  const [editingOption, setEditingOption] = (0, _react.useState)(null);
131
109
  const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
@@ -134,9 +112,9 @@ const TagsDropdown = _ref => {
134
112
  const getRandomIndex = (min, max) => {
135
113
  return Math.floor(Math.random() * (max - min + 1)) + min;
136
114
  };
137
-
138
115
  const randomIndex = getRandomIndex(0, COLORS.length - 1);
139
- return COLORS[randomIndex]; // eslint-disable-next-line react-hooks/exhaustive-deps
116
+ return COLORS[randomIndex];
117
+ // eslint-disable-next-line react-hooks/exhaustive-deps
140
118
  }, [options.length]);
141
119
  const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => {
142
120
  const checkUniqAndPush = (acc, item) => {
@@ -146,135 +124,113 @@ const TagsDropdown = _ref => {
146
124
  } = _ref2;
147
125
  return value === (item === null || item === void 0 ? void 0 : item.value);
148
126
  });
149
-
150
127
  if (isExist !== -1) {
151
128
  acc[isExist] = item;
152
129
  } else {
153
130
  acc.push(item);
154
131
  }
155
132
  };
156
-
157
133
  if (item.groupName) {
158
134
  var _item$list;
159
-
160
- (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.map(item => checkUniqAndPush(acc, item));
135
+ (_item$list = item.list) === null || _item$list === void 0 || _item$list.map(item => checkUniqAndPush(acc, item));
161
136
  } else {
162
137
  checkUniqAndPush(acc, item);
163
138
  }
164
-
165
139
  return acc;
166
140
  }, (_Object$keys = Object.keys(localOptionsStore)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(value => ({
167
141
  value,
168
142
  label: localOptionsStore === null || localOptionsStore === void 0 ? void 0 : localOptionsStore[value]
169
- }))); // --- GENERAL FUNCTIONS BEGIN --- //
143
+ })));
170
144
 
145
+ // --- GENERAL FUNCTIONS BEGIN --- //
171
146
  const handleClickOutside = e => {
172
147
  var _editOptionModalRef$c, _getListContainer, _customTriggerRef$cur, _customTriggerRef$cur2;
173
-
174
148
  const {
175
149
  target
176
150
  } = e;
177
-
178
151
  if (editOptionModalRef.current && !((_editOptionModalRef$c = editOptionModalRef.current) !== null && _editOptionModalRef$c !== void 0 && _editOptionModalRef$c.contains(target)) && !document.getElementById(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value).contains(target)) {
179
152
  saveEditingOption();
180
153
  } else if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && isOpen && (!(customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) || !(customTriggerRef !== null && customTriggerRef !== void 0 && (_customTriggerRef$cur = customTriggerRef.current) !== null && _customTriggerRef$cur !== void 0 && _customTriggerRef$cur.contains(target))) || customTriggerRef !== null && customTriggerRef !== void 0 && (_customTriggerRef$cur2 = customTriggerRef.current) !== null && _customTriggerRef$cur2 !== void 0 && _customTriggerRef$cur2.isEqualNode(target)) {
181
154
  setIsOpen(false);
182
- onDropdownListClose === null || onDropdownListClose === void 0 ? void 0 : onDropdownListClose(e);
155
+ onDropdownListClose === null || onDropdownListClose === void 0 || onDropdownListClose(e);
183
156
  }
184
157
  };
185
-
186
158
  const closeList = e => {
187
159
  var _inputRef$current;
188
-
189
160
  handleClickOutside(e);
190
- if (!e.target.isEqualNode(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
161
+ if (!e.target.isEqualNode(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
191
162
  };
192
-
193
163
  const isTargetInParent = target => {
194
164
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
195
-
196
165
  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;
197
- 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;
166
+ 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;
198
167
  return false;
199
168
  };
200
-
201
169
  const isItemMatchesSearch = item => {
202
170
  const title = item.title || item.label;
203
171
  return searchValue.length ? title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
204
- }; // --- GENERAL FUNCTIONS END --- //
205
-
172
+ };
173
+ // --- GENERAL FUNCTIONS END --- //
206
174
 
207
175
  const prepareOptions = options => {
208
176
  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();
209
177
  };
210
-
211
178
  const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
212
179
  if (option.groupName) {
213
180
  var _option$list;
214
-
215
- const filteredGroupItems = option === null || option === void 0 ? void 0 : (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
216
-
181
+ const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
217
182
  if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
218
- result.push({ ...option,
183
+ result.push({
184
+ ...option,
219
185
  list: filteredGroupItems
220
186
  });
221
187
  }
222
188
  } else if (isItemMatchesSearch(option)) {
223
189
  result.push(option);
224
190
  }
225
-
226
191
  return result;
227
192
  }, []);
228
-
229
193
  const getTotalOptions = (0, _react.useCallback)(() => {
230
194
  return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
231
195
  if (item !== null && item !== void 0 && item.list) {
232
196
  var _item$list2;
233
-
234
- result += (item === null || item === void 0 ? void 0 : (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
197
+ result += (item === null || item === void 0 || (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
235
198
  } else {
236
199
  ++result;
237
200
  }
238
-
239
201
  return result;
240
202
  }, 0);
241
203
  }, [options]);
242
-
243
204
  const deleteChosen = value => {
244
205
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
245
- setLocalOptionsStore(options => ({ ...options,
206
+ setLocalOptionsStore(options => ({
207
+ ...options,
246
208
  [value]: undefined
247
209
  }));
248
210
  onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
249
211
  };
250
-
251
212
  const onChangeHandler = item => {
252
213
  if (item !== null && item !== void 0 && item.isFreezed) return false;
253
-
254
214
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
255
215
  if (item.closeOnOptionSelect) setIsOpen(false);
256
216
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
257
-
258
217
  setSearchValueInterceptor("");
259
-
260
218
  if (chosenOptions.some(el => el === item.value)) {
261
219
  deleteChosen(item.value);
262
220
  return null;
263
221
  }
264
-
265
- setLocalOptionsStore(options => ({ ...options,
222
+ setLocalOptionsStore(options => ({
223
+ ...options,
266
224
  [item === null || item === void 0 ? void 0 : item.value]: item === null || item === void 0 ? void 0 : item.label
267
225
  }));
268
226
  onChange([...chosenOptions, item.value], "chosenOptions");
269
227
  return null;
270
228
  };
271
-
272
229
  const onSearchHandler = name => {
273
230
  let inputValue = name;
274
231
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
275
232
  setSearchValueInterceptor(inputValue);
276
233
  };
277
-
278
234
  const onWrapperClick = e => {
279
235
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
280
236
  e.stopPropagation();
@@ -282,10 +238,8 @@ const TagsDropdown = _ref => {
282
238
  setIsOpen(false);
283
239
  }
284
240
  };
285
-
286
241
  const selectAllItems = () => {
287
242
  var _prepareOptions;
288
-
289
243
  const preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(_ref3 => {
290
244
  let {
291
245
  isFreezed,
@@ -309,79 +263,66 @@ const TagsDropdown = _ref => {
309
263
  })) || [])], "chosenOptions");
310
264
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
311
265
  };
312
-
313
266
  const unselectAllItems = () => {
314
267
  setLocalOptionsStore({});
315
268
  onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
316
- var _prepareOptions2, _prepareOptions2$find;
317
-
318
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(_ref6 => {
269
+ var _prepareOptions2;
270
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref6 => {
319
271
  let {
320
272
  value
321
273
  } = _ref6;
322
274
  return value === item;
323
- })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
275
+ })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
324
276
  }), "chosenOptions");
325
277
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
326
278
  };
327
-
328
279
  const doScrollCallback = (0, _react.useCallback)(e => {
329
280
  if (doLiveSearchRequest && typeof doLiveSearchRequest === "function") {
330
281
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
331
282
  doLiveSearchRequest(searchValueRef.current, true);
332
283
  }
333
284
  }
334
- }, [options]); // --- LIST CONTAINER FUNCTIONS BEGIN --- //
285
+ }, [options]);
335
286
 
287
+ // --- LIST CONTAINER FUNCTIONS BEGIN --- //
336
288
  const getParentNode = () => {
337
289
  var _ref7, _document$querySelect;
338
-
339
290
  return (_ref7 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref7 !== void 0 ? _ref7 : document.querySelector("div#storybook-root");
340
291
  };
341
-
342
292
  const initListContainer = () => {
343
293
  const dropdownList = document.createElement("div");
344
294
  dropdownList.setAttribute("id", dropdownId);
345
295
  dropdownList.classList.add("tags-dropdown__container");
346
-
347
296
  if (isMobile) {
348
297
  dropdownList.addEventListener("click", e => {
349
298
  if (e.target.id === dropdownId) setIsOpen(false);
350
299
  });
351
300
  }
352
-
353
301
  if (isMobile) {
354
302
  var _getParentNode;
355
-
356
303
  try {
357
304
  var _document$getElementB;
358
-
359
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove(); // eslint-disable-next-line no-empty
305
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
306
+ // eslint-disable-next-line no-empty
360
307
  } catch (e) {}
361
-
362
308
  const dropdownMobileListWrapper = document.createElement("div");
363
309
  dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
364
310
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
365
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
366
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
311
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
312
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
367
313
  } else {
368
314
  var _getParentNode2;
369
-
370
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
315
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
371
316
  }
372
317
  };
373
-
374
318
  const getListContainer = () => {
375
319
  return document.getElementById(dropdownId);
376
320
  };
377
-
378
321
  const getListContainerWrapper = () => {
379
322
  return document.getElementById("mlw-".concat(dropdownId));
380
323
  };
381
-
382
324
  const setListContainerStyles = () => {
383
- 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;
384
-
325
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
385
326
  const lc = getListContainer();
386
327
  if (!lc || !isOpen) return false;
387
328
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
@@ -390,41 +331,40 @@ const TagsDropdown = _ref => {
390
331
  height,
391
332
  left,
392
333
  top
393
- } = (_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$ : {};
334
+ } = (_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$ : {};
394
335
  const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
395
336
  const dl = lc.getElementsByClassName("tags-dropdown__list")[0];
396
337
  const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__header")[0];
397
338
  const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__footer")[0];
398
- const 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, 10);
399
- const 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, 10);
339
+ 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, 10);
340
+ 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, 10);
400
341
  if (initListHeight === null) setInitListHeight(maxHeight);
401
342
  const toTop = top - margin;
402
343
  const toBottom = windowHeight - top - height - margin * 2;
403
- const dlHeight = dl === null || dl === void 0 ? void 0 : (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
404
- let swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
344
+ const dlHeight = dl === null || dl === void 0 || (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
345
+ let swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
405
346
  const controlsHeight = swHeight - dlHeight;
406
347
  if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
407
- const maxSwHeight = (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);
348
+ const maxSwHeight = (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);
408
349
  const listPos = toTop < toBottom || toBottom >= swHeight ? "bottom" : "top";
409
350
  if (swHeight > (listPos === "top" ? toTop : toBottom)) swHeight = (listPos === "top" ? toTop : toBottom) - 3 * margin;
410
351
  lc.style.minWidth = "".concat(width, "px");
411
352
  lc.style.left = "".concat(left, "px");
412
353
  lc.style.top = "".concat(listPos === "bottom" ? top + height : top - swHeight - 2 * margin, "px");
413
-
414
354
  if (isMobile) {
415
355
  dl.style.maxHeight = "".concat(maxSwHeight, "px");
416
356
  }
417
357
  };
418
-
419
358
  const renderListContainer = () => {
420
359
  const lc = getListContainer();
421
- if (!lc) return null; // eslint-disable-next-line no-use-before-define
360
+ if (!lc) return null;
422
361
 
362
+ // eslint-disable-next-line no-use-before-define
423
363
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
424
- }; // --- LIST CONTAINER FUNCTIONS END --- //
425
- // --- CREATABLE LOGIC BEGIN --- //
426
-
364
+ };
365
+ // --- LIST CONTAINER FUNCTIONS END --- //
427
366
 
367
+ // --- CREATABLE LOGIC BEGIN --- //
428
368
  const onOptionCreateClick = () => {
429
369
  const tempId = Math.random().toString(16).slice(2);
430
370
  const newOption = {
@@ -442,18 +382,15 @@ const TagsDropdown = _ref => {
442
382
  value: tempId,
443
383
  label: searchValue
444
384
  });
445
- onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption);
385
+ onOptionCreate === null || onOptionCreate === void 0 || onOptionCreate(newOption);
446
386
  };
447
-
448
387
  const onOptionEditClick = (e, item) => {
449
- e === null || e === void 0 ? void 0 : e.preventDefault();
450
- e === null || e === void 0 ? void 0 : e.stopPropagation();
388
+ e === null || e === void 0 || e.preventDefault();
389
+ e === null || e === void 0 || e.stopPropagation();
451
390
  setEditingOption((editingOption === null || editingOption === void 0 ? void 0 : editingOption.value) === (item === null || item === void 0 ? void 0 : item.value) ? null : item);
452
391
  };
453
-
454
392
  const onOptionDeleteClick = () => {
455
393
  var _onOptionDelete;
456
-
457
394
  ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(r => r())).then(() => {
458
395
  deleteChosen(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
459
396
  setOptions(options => options.filter(_ref8 => {
@@ -465,24 +402,21 @@ const TagsDropdown = _ref => {
465
402
  setEditingOption(null);
466
403
  });
467
404
  };
468
-
469
405
  const saveEditingOption = () => {
470
- onOptionEdit === null || onOptionEdit === void 0 ? void 0 : onOptionEdit(editingOption);
406
+ onOptionEdit === null || onOptionEdit === void 0 || onOptionEdit(editingOption);
471
407
  setOptions(options => options.map(option => {
472
408
  if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
473
- const tmp = { ...editingOption
409
+ const tmp = {
410
+ ...editingOption
474
411
  };
475
412
  setEditingOption(null);
476
413
  return tmp;
477
414
  }
478
-
479
415
  return option;
480
416
  }));
481
417
  };
482
-
483
418
  const setEditOptionModalStyles = () => {
484
419
  var _editingOption$ref, _el$getBoundingClient, _dropdownListWrapperR;
485
-
486
420
  if (!editingOption || !(editOptionModalRef !== null && editOptionModalRef !== void 0 && editOptionModalRef.current)) return null;
487
421
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
488
422
  const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
@@ -490,7 +424,7 @@ const TagsDropdown = _ref => {
490
424
  windowHeight,
491
425
  windowWidth
492
426
  });
493
- const el = editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
427
+ const el = editingOption === null || editingOption === void 0 || (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
494
428
  const {
495
429
  top,
496
430
  bottom,
@@ -499,13 +433,14 @@ const TagsDropdown = _ref => {
499
433
  width,
500
434
  height
501
435
  } = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {};
502
- const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
503
-
436
+ const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
504
437
  if ((containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.right) > (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.left) || (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.right) >= 182) {
505
438
  editOptionModalRef.current.style.left = "".concat(width - 50, "px");
506
439
  } else {
507
440
  editOptionModalRef.current.style.right = "".concat(right - width - 12, "px");
508
- } // console.log(containerPosition.top, {
441
+ }
442
+
443
+ // console.log(containerPosition.top, {
509
444
  // top,
510
445
  // bottom,
511
446
  // left,
@@ -514,14 +449,14 @@ const TagsDropdown = _ref => {
514
449
  // height,
515
450
  // });
516
451
 
452
+ editOptionModalRef.current.style.top = "".concat(top - height, "px");
517
453
 
518
- editOptionModalRef.current.style.top = "".concat(top - height, "px"); // if (containerPosition?.top + top <= 173) {
454
+ // if (containerPosition?.top + top <= 173) {
519
455
  // editOptionModalRef.current.style.top = `${top - height}px`;
520
456
  // } else {
521
457
  // editOptionModalRef.current.style.bottom = `${bottom - height}px`;
522
458
  // }
523
459
  };
524
-
525
460
  const renderEditOptionModal = () => {
526
461
  return /*#__PURE__*/_react.default.createElement("div", {
527
462
  ref: editOptionModalRef,
@@ -530,7 +465,8 @@ const TagsDropdown = _ref => {
530
465
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
531
466
  }, /*#__PURE__*/_react.default.createElement(_Input.default, {
532
467
  value: editingOption.label,
533
- onChange: v => setEditingOption(state => ({ ...state,
468
+ onChange: v => setEditingOption(state => ({
469
+ ...state,
534
470
  label: v
535
471
  })),
536
472
  onKeyDown: keyCode => {
@@ -549,34 +485,32 @@ const TagsDropdown = _ref => {
549
485
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section-colors"))
550
486
  }, COLORS.map(color => {
551
487
  var _editingOption$style;
552
-
553
488
  return /*#__PURE__*/_react.default.createElement("div", {
554
489
  className: "color-block",
555
490
  style: {
556
491
  backgroundColor: color
557
492
  },
558
- onClick: () => setEditingOption(state => ({ ...state,
559
- style: { ...state.style,
493
+ onClick: () => setEditingOption(state => ({
494
+ ...state,
495
+ style: {
496
+ ...state.style,
560
497
  backgroundColor: color
561
498
  }
562
499
  }))
563
- }, (editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$style = editingOption.style) === null || _editingOption$style === void 0 ? void 0 : _editingOption$style.backgroundColor) === color ? /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null) : null);
500
+ }, (editingOption === null || editingOption === void 0 || (_editingOption$style = editingOption.style) === null || _editingOption$style === void 0 ? void 0 : _editingOption$style.backgroundColor) === color ? /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null) : null);
564
501
  }))));
565
- }; // --- CREATABLE LOGIC END --- //
566
- // --- RENDER FUNCTIONS BEGIN --- //
567
-
502
+ };
503
+ // --- CREATABLE LOGIC END --- //
568
504
 
505
+ // --- RENDER FUNCTIONS BEGIN --- //
569
506
  const getMarkupForElement = item => {
570
507
  var _title$toString, _item$customMobileIco;
571
-
572
508
  const {
573
509
  description
574
510
  } = item;
575
511
  const title = item.title || item.label;
576
-
577
512
  const hightlightSearchValue = title => {
578
513
  var _title$toLowerCase;
579
-
580
514
  const index = (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue.toLowerCase());
581
515
  if (index === -1) return title;
582
516
  return /*#__PURE__*/_react.default.createElement("pre", {
@@ -585,10 +519,9 @@ const TagsDropdown = _ref => {
585
519
  className: "search-match bg--yellow"
586
520
  }, title.substring(index, index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))), /*#__PURE__*/_react.default.createElement("span", null, title.substring(index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))));
587
521
  };
588
-
589
522
  return /*#__PURE__*/_react.default.createElement("button", {
590
523
  ref: item === null || item === void 0 ? void 0 : item.ref,
591
- key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
524
+ key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
592
525
  onClick: e => {
593
526
  e.preventDefault();
594
527
  e.stopPropagation();
@@ -636,10 +569,8 @@ const TagsDropdown = _ref => {
636
569
  }
637
570
  }) : "");
638
571
  };
639
-
640
572
  const getListMarkUp = () => {
641
573
  var _filteredOptions$filt, _filteredOptions$filt2;
642
-
643
574
  const filteredOptions = getFilteredOptions(options);
644
575
  return /*#__PURE__*/_react.default.createElement("div", {
645
576
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -698,10 +629,9 @@ const TagsDropdown = _ref => {
698
629
  ref: dropdownListRef,
699
630
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
700
631
  }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
701
- var _option$groupName, _option$groupName$toS, _option$list2;
702
-
632
+ var _option$groupName, _option$list2;
703
633
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
704
- 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()),
634
+ 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()),
705
635
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
706
636
  }, /*#__PURE__*/_react.default.createElement("span", {
707
637
  className: "".concat(RC, "-group__name")
@@ -741,7 +671,6 @@ const TagsDropdown = _ref => {
741
671
  isNoDismiss: true
742
672
  }))));
743
673
  };
744
-
745
674
  const renderSearchInput = () => {
746
675
  return /*#__PURE__*/_react.default.createElement(_Input.default, {
747
676
  ref: inputRef,
@@ -751,7 +680,8 @@ const TagsDropdown = _ref => {
751
680
  value: searchValue,
752
681
  onChange: onSearchHandler,
753
682
  placeholder: placeholder || "Select from list",
754
- attributesOfNativeInput: { ...attributesOfNativeInput,
683
+ attributesOfNativeInput: {
684
+ ...attributesOfNativeInput,
755
685
  onKeyDown: e => {
756
686
  if (e.keyCode === 13 && withCreateLogic && singleLevelOptions.every(_ref13 => {
757
687
  let {
@@ -761,21 +691,17 @@ const TagsDropdown = _ref => {
761
691
  })) {
762
692
  onOptionCreateClick();
763
693
  }
764
-
765
694
  onKeyPress(e, searchValue);
766
695
  },
767
696
  onFocus: e => {
768
697
  var _e$target;
769
-
770
- if (isMobile) e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.blur();
698
+ if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
771
699
  }
772
700
  }
773
701
  });
774
702
  };
775
-
776
703
  const renderDropdownTrigger = (0, _react.useCallback)(() => {
777
704
  var _renderCustomTrigger;
778
-
779
705
  const renderDefaultDropdownTrigger = () => {
780
706
  return /*#__PURE__*/_react.default.createElement("div", {
781
707
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
@@ -828,7 +754,6 @@ const TagsDropdown = _ref => {
828
754
  className: "color--text"
829
755
  })));
830
756
  };
831
-
832
757
  return (_renderCustomTrigger = renderCustomTrigger === null || renderCustomTrigger === void 0 ? void 0 : renderCustomTrigger({
833
758
  chosenOptions,
834
759
  singleLevelOptions,
@@ -838,25 +763,23 @@ const TagsDropdown = _ref => {
838
763
  isOpen,
839
764
  setIsOpen
840
765
  })) !== null && _renderCustomTrigger !== void 0 ? _renderCustomTrigger : renderDefaultDropdownTrigger();
841
- }, [chosenOptions, singleLevelOptions, inputRef, isOpen]); // --- RENDER FUNCTIONS END --- //
766
+ }, [chosenOptions, singleLevelOptions, inputRef, isOpen]);
767
+ // --- RENDER FUNCTIONS END --- //
842
768
 
843
769
  (0, _react.useLayoutEffect)(() => {
844
770
  initListContainer();
845
771
  return () => {
846
772
  var _getListContainer2, _getListContainerWrap;
847
-
848
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
849
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
773
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
774
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
850
775
  };
851
776
  }, []);
852
777
  (0, _react.useLayoutEffect)(() => {
853
778
  var _getListContainer3;
854
-
855
779
  const onResize = () => {
856
780
  setListContainerStyles();
857
781
  setEditOptionModalStyles();
858
782
  };
859
-
860
783
  if (!isMobile) {
861
784
  window.addEventListener("resize", onResize);
862
785
  window.addEventListener("mousewheel", closeList);
@@ -870,28 +793,27 @@ const TagsDropdown = _ref => {
870
793
  window.removeEventListener("touchmove", closeList);
871
794
  window.removeEventListener("mouseup", handleClickOutside);
872
795
  }
873
-
874
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
796
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
875
797
  return () => {
876
798
  var _getListContainer4;
877
-
878
799
  window.removeEventListener("resize", onResize);
879
800
  window.removeEventListener("mousewheel", closeList);
880
801
  window.removeEventListener("mouseup", handleClickOutside);
881
802
  window.removeEventListener("scroll", closeList);
882
803
  window.removeEventListener("touchmove", closeList);
883
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
804
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
884
805
  };
885
806
  }, [getListContainer, isMobile]);
886
807
  (0, _react.useLayoutEffect)(() => {
887
808
  setListContainerStyles();
888
809
  setEditOptionModalStyles();
889
- }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 ? void 0 : (_dropdownListWrapperR3 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR3 === void 0 ? void 0 : _dropdownListWrapperR3.height, recalculateListContainerStylesTrigger]);
810
+ }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR2 = dropdownListWrapperRef.current) === null || _dropdownListWrapperR2 === void 0 || (_dropdownListWrapperR2 = _dropdownListWrapperR2.getBoundingClientRect()) === null || _dropdownListWrapperR2 === void 0 ? void 0 : _dropdownListWrapperR2.height, recalculateListContainerStylesTrigger]);
890
811
  (0, _react.useEffect)(() => {
891
812
  if (chosenOptions.length !== Object.keys(localOptionsStore).length) {
892
813
  options.map(option => {
893
814
  if (!(localOptionsStore !== null && localOptionsStore !== void 0 && localOptionsStore[option === null || option === void 0 ? void 0 : option.value])) {
894
- setLocalOptionsStore(options => ({ ...options,
815
+ setLocalOptionsStore(options => ({
816
+ ...options,
895
817
  [option === null || option === void 0 ? void 0 : option.value]: option === null || option === void 0 ? void 0 : option.label
896
818
  }));
897
819
  }
@@ -900,20 +822,16 @@ const TagsDropdown = _ref => {
900
822
  }, [chosenOptions]);
901
823
  (0, _react.useEffect)(() => {
902
824
  var _selectAllButtonRef$c, _unselectAllButtonRef;
903
-
904
825
  const fn = isOpen ? "addEventListener" : "removeEventListener";
905
- selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
906
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
907
-
826
+ selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
827
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
908
828
  if (isOpen) {
909
829
  var _getListContainer5, _inputRef$current2, _inputRef$current2$fo;
910
-
911
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add("tags-dropdown__container--opened");
912
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$fo = _inputRef$current2.focus) === null || _inputRef$current2$fo === void 0 ? void 0 : _inputRef$current2$fo.call(_inputRef$current2);
830
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add("tags-dropdown__container--opened");
831
+ inputRef === null || inputRef === void 0 || (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || (_inputRef$current2$fo = _inputRef$current2.focus) === null || _inputRef$current2$fo === void 0 || _inputRef$current2$fo.call(_inputRef$current2);
913
832
  } else {
914
833
  var _getListContainer6;
915
-
916
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove("tags-dropdown__container--opened");
834
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove("tags-dropdown__container--opened");
917
835
  if (withSearchInputInList) setSearchValueInterceptor("");
918
836
  }
919
837
  }, [isOpen]);
@@ -921,45 +839,38 @@ const TagsDropdown = _ref => {
921
839
  const setScrollTopValue = e => {
922
840
  setScrollTop(parseInt(e.target.scrollTop, 10));
923
841
  };
924
-
925
842
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
926
843
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
927
-
928
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
929
- setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.clientHeight));
930
-
844
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 || _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
845
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.clientHeight));
931
846
  if (isScrollableList === null) {
932
847
  var _dropdownListRef$curr4, _dropdownListRef$curr5;
933
-
934
- setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.clientHeight));
848
+ setIsFixedMaxHeight((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.clientHeight));
935
849
  }
936
850
  }
937
-
938
851
  if (isOpen && dropdownListRef && dropdownListRef.current) {
939
852
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
940
853
  }
941
-
942
854
  return () => {
943
855
  var _dropdownListRef$curr6;
944
-
945
856
  removeEventListener("scroll", doScrollCallback);
946
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
857
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 || _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
947
858
  };
948
- }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.clientHeight]);
859
+ }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.clientHeight]);
949
860
  (0, _react.useEffect)(() => {
950
861
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
951
862
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
952
-
953
- 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), 10));
863
+ 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), 10));
954
864
  }
955
865
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
956
866
  (0, _react.useEffect)(() => {
957
867
  if (isSearchable && useLiveSearch && (debouncedSearchTerm || isValueDeleted || isOpen)) {
958
- doLiveSearchRequest === null || doLiveSearchRequest === void 0 ? void 0 : doLiveSearchRequest(debouncedSearchTerm);
868
+ doLiveSearchRequest === null || doLiveSearchRequest === void 0 || doLiveSearchRequest(debouncedSearchTerm);
959
869
  }
960
870
  }, [isOpen, debouncedSearchTerm, isValueDeleted]);
961
871
  (0, _react.useEffect)(() => {
962
- setOptions(optionsProp.map(option => ({ ...option,
872
+ setOptions(optionsProp.map(option => ({
873
+ ...option,
963
874
  ref: /*#__PURE__*/(0, _react.createRef)()
964
875
  })));
965
876
  }, [optionsProp]);
@@ -983,6 +894,4 @@ const TagsDropdown = _ref => {
983
894
  onClick: onActionCancelClick
984
895
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isOpen && renderListContainer());
985
896
  };
986
-
987
- var _default = TagsDropdown;
988
- exports.default = _default;
897
+ var _default = exports.default = TagsDropdown;