intelicoreact 1.4.22 → 1.4.23

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 -29
  62. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +96 -195
  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 +4 -20
  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 +39 -42
  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 = [],
@@ -121,13 +101,11 @@ const TagsDropdown = _ref => {
121
101
  delay: 600
122
102
  });
123
103
  const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
124
-
125
104
  const setSearchValueInterceptor = value => {
126
105
  setSearchValue(value);
127
106
  setIsValueDeleted(searchValue !== value && value === "");
128
107
  searchValueRef.current = value;
129
108
  };
130
-
131
109
  const [options, setOptions] = (0, _react.useState)([]);
132
110
  const [editingOption, setEditingOption] = (0, _react.useState)(null);
133
111
  const [localOptionsStore, setLocalOptionsStore] = (0, _react.useState)({});
@@ -135,9 +113,9 @@ const TagsDropdown = _ref => {
135
113
  const getRandomIndex = (min, max) => {
136
114
  return Math.floor(Math.random() * (max - min + 1)) + min;
137
115
  };
138
-
139
116
  const randomIndex = getRandomIndex(0, COLORS.length - 1);
140
- return COLORS[randomIndex]; // eslint-disable-next-line react-hooks/exhaustive-deps
117
+ return COLORS[randomIndex];
118
+ // eslint-disable-next-line react-hooks/exhaustive-deps
141
119
  }, [options.length]);
142
120
  const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => {
143
121
  const checkUniqAndPush = (acc, item) => {
@@ -147,142 +125,117 @@ const TagsDropdown = _ref => {
147
125
  } = _ref2;
148
126
  return value === (item === null || item === void 0 ? void 0 : item.value);
149
127
  });
150
-
151
128
  if (isExist !== -1) {
152
129
  acc[isExist] = item;
153
130
  } else {
154
131
  acc.push(item);
155
132
  }
156
133
  };
157
-
158
134
  if (item.groupName) {
159
135
  var _item$list;
160
-
161
- (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.map(item => checkUniqAndPush(acc, item));
136
+ (_item$list = item.list) === null || _item$list === void 0 || _item$list.map(item => checkUniqAndPush(acc, item));
162
137
  } else {
163
138
  checkUniqAndPush(acc, item);
164
139
  }
165
-
166
140
  return acc;
167
141
  }, isUseLocalOptionsStore ? (_Object$keys = Object.keys(localOptionsStore)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(value => ({
168
142
  value,
169
143
  label: localOptionsStore === null || localOptionsStore === void 0 ? void 0 : localOptionsStore[value]
170
- })) : []); // --- GENERAL FUNCTIONS BEGIN --- //
144
+ })) : []);
171
145
 
146
+ // --- GENERAL FUNCTIONS BEGIN --- //
172
147
  const handleClickOutside = e => {
173
148
  var _editOptionModalRef$c, _getListContainer, _customTriggerRef$cur, _customTriggerRef$cur2;
174
-
175
149
  const {
176
150
  target
177
151
  } = e;
178
-
179
152
  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)) {
180
153
  saveEditingOption();
181
154
  } 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)) {
182
155
  setIsOpen(false);
183
- onDropdownListClose === null || onDropdownListClose === void 0 ? void 0 : onDropdownListClose(e);
156
+ onDropdownListClose === null || onDropdownListClose === void 0 || onDropdownListClose(e);
184
157
  }
185
158
  };
186
-
187
159
  const closeList = e => {
188
160
  var _inputRef$current;
189
-
190
161
  handleClickOutside(e);
191
- 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();
162
+ 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();
192
163
  };
193
-
194
164
  const isTargetInParent = target => {
195
165
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
196
-
197
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 ? void 0 : target.tagName) === "line") return false;
198
- 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.indexOf("".concat(RC, "__trigger"))) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
167
+ 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.indexOf("".concat(RC, "__trigger"))) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
199
168
  return false;
200
169
  };
201
-
202
170
  const isItemMatchesSearch = item => {
203
171
  const title = item.title || item.label;
204
172
  return searchValue.length ? title === null || title === void 0 ? void 0 : title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
205
- }; // --- GENERAL FUNCTIONS END --- //
206
-
173
+ };
174
+ // --- GENERAL FUNCTIONS END --- //
207
175
 
208
176
  const prepareOptions = options => {
209
177
  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();
210
178
  };
211
-
212
179
  const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
213
180
  if (option.groupName) {
214
181
  var _option$list;
215
-
216
- 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));
217
-
182
+ const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
218
183
  if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
219
- result.push({ ...option,
184
+ result.push({
185
+ ...option,
220
186
  list: filteredGroupItems
221
187
  });
222
188
  }
223
189
  } else if (isItemMatchesSearch(option)) {
224
190
  result.push(option);
225
191
  }
226
-
227
192
  return result;
228
193
  }, []);
229
-
230
194
  const getTotalOptions = (0, _react.useCallback)(() => {
231
195
  return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
232
196
  if (item !== null && item !== void 0 && item.list) {
233
197
  var _item$list2;
234
-
235
- result += (item === null || item === void 0 ? void 0 : (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
198
+ result += (item === null || item === void 0 || (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
236
199
  } else {
237
200
  ++result;
238
201
  }
239
-
240
202
  return result;
241
203
  }, 0);
242
204
  }, [options]);
243
-
244
205
  const deleteChosen = value => {
245
206
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
246
-
247
207
  if (isUseLocalOptionsStore) {
248
- setLocalOptionsStore(options => ({ ...options,
208
+ setLocalOptionsStore(options => ({
209
+ ...options,
249
210
  [value]: undefined
250
211
  }));
251
212
  }
252
-
253
213
  onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
254
214
  };
255
-
256
215
  const onChangeHandler = item => {
257
216
  if (item !== null && item !== void 0 && item.isFreezed) return false;
258
-
259
217
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
260
218
  if (item.closeOnOptionSelect) setIsOpen(false);
261
219
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
262
-
263
220
  setSearchValueInterceptor("");
264
-
265
221
  if (chosenOptions.some(el => el === item.value)) {
266
222
  deleteChosen(item.value);
267
223
  return null;
268
224
  }
269
-
270
225
  if (isUseLocalOptionsStore) {
271
- setLocalOptionsStore(options => ({ ...options,
226
+ setLocalOptionsStore(options => ({
227
+ ...options,
272
228
  [item === null || item === void 0 ? void 0 : item.value]: item === null || item === void 0 ? void 0 : item.label
273
229
  }));
274
230
  }
275
-
276
231
  onChange([...chosenOptions, item.value], "chosenOptions");
277
232
  return null;
278
233
  };
279
-
280
234
  const onSearchHandler = name => {
281
235
  let inputValue = name;
282
236
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
283
237
  setSearchValueInterceptor(inputValue);
284
238
  };
285
-
286
239
  const onWrapperClick = e => {
287
240
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
288
241
  e.stopPropagation();
@@ -290,10 +243,8 @@ const TagsDropdown = _ref => {
290
243
  setIsOpen(false);
291
244
  }
292
245
  };
293
-
294
246
  const selectAllItems = () => {
295
247
  var _prepareOptions;
296
-
297
248
  const preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(_ref3 => {
298
249
  let {
299
250
  isFreezed,
@@ -301,7 +252,6 @@ const TagsDropdown = _ref => {
301
252
  } = _ref3;
302
253
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
303
254
  });
304
-
305
255
  if (isUseLocalOptionsStore) {
306
256
  setLocalOptionsStore(options => preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.reduce((result, _ref4) => {
307
257
  let {
@@ -312,7 +262,6 @@ const TagsDropdown = _ref => {
312
262
  return result;
313
263
  }, options));
314
264
  }
315
-
316
265
  onChange([...chosenOptions, ...((preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.map(_ref5 => {
317
266
  let {
318
267
  value
@@ -321,79 +270,66 @@ const TagsDropdown = _ref => {
321
270
  })) || [])], "chosenOptions");
322
271
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
323
272
  };
324
-
325
273
  const unselectAllItems = () => {
326
274
  if (isUseLocalOptionsStore) setLocalOptionsStore({});
327
275
  onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
328
- var _prepareOptions2, _prepareOptions2$find;
329
-
330
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(_ref6 => {
276
+ var _prepareOptions2;
277
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref6 => {
331
278
  let {
332
279
  value
333
280
  } = _ref6;
334
281
  return value === item;
335
- })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
282
+ })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
336
283
  }), "chosenOptions");
337
284
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
338
285
  };
339
-
340
286
  const doScrollCallback = (0, _react.useCallback)(e => {
341
287
  if (doLiveSearchRequest && typeof doLiveSearchRequest === "function") {
342
288
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
343
289
  doLiveSearchRequest(searchValueRef.current, true);
344
290
  }
345
291
  }
346
- }, [options]); // --- LIST CONTAINER FUNCTIONS BEGIN --- //
292
+ }, [options]);
347
293
 
294
+ // --- LIST CONTAINER FUNCTIONS BEGIN --- //
348
295
  const getParentNode = () => {
349
296
  var _ref7, _document$querySelect;
350
-
351
297
  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");
352
298
  };
353
-
354
299
  const initListContainer = () => {
355
300
  const dropdownList = document.createElement("div");
356
301
  dropdownList.setAttribute("id", dropdownId);
357
302
  dropdownList.classList.add("tags-dropdown__container");
358
-
359
303
  if (isMobile) {
360
304
  dropdownList.addEventListener("click", e => {
361
305
  if (e.target.id === dropdownId) setIsOpen(false);
362
306
  });
363
307
  }
364
-
365
308
  if (isMobile) {
366
309
  var _getParentNode;
367
-
368
310
  try {
369
311
  var _document$getElementB;
370
-
371
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove(); // eslint-disable-next-line no-empty
312
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
313
+ // eslint-disable-next-line no-empty
372
314
  } catch (e) {}
373
-
374
315
  const dropdownMobileListWrapper = document.createElement("div");
375
316
  dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
376
317
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
377
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
378
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
318
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
319
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
379
320
  } else {
380
321
  var _getParentNode2;
381
-
382
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
322
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
383
323
  }
384
324
  };
385
-
386
325
  const getListContainer = () => {
387
326
  return document.getElementById(dropdownId);
388
327
  };
389
-
390
328
  const getListContainerWrapper = () => {
391
329
  return document.getElementById("mlw-".concat(dropdownId));
392
330
  };
393
-
394
331
  const setListContainerStyles = () => {
395
- 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;
396
-
332
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
397
333
  const lc = getListContainer();
398
334
  if (!lc || !isOpen) return false;
399
335
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
@@ -402,44 +338,42 @@ const TagsDropdown = _ref => {
402
338
  height,
403
339
  left,
404
340
  top
405
- } = (_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$ : {};
341
+ } = (_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$ : {};
406
342
  const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
407
343
  const dl = lc.getElementsByClassName("tags-dropdown__list")[0];
408
344
  const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__header")[0];
409
345
  const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__footer")[0];
410
- 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);
411
- 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);
346
+ 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);
347
+ 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);
412
348
  if (initListHeight === null) setInitListHeight(maxHeight);
413
349
  const toTop = top - margin;
414
350
  const toBottom = windowHeight - top - height - margin * 2;
415
- const dlHeight = dl === null || dl === void 0 ? void 0 : (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
416
- let swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
351
+ const dlHeight = dl === null || dl === void 0 || (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
352
+ let swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
417
353
  const controlsHeight = swHeight - dlHeight;
418
354
  if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
419
- 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);
355
+ 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);
420
356
  const listPos = toTop < toBottom || toBottom >= swHeight ? "bottom" : "top";
421
357
  if (swHeight > (listPos === "top" ? toTop : toBottom)) swHeight = (listPos === "top" ? toTop : toBottom) - 3 * margin;
422
358
  lc.style.minWidth = "".concat(width, "px");
423
359
  lc.style.left = "".concat(left, "px");
424
360
  lc.style.top = "".concat(listPos === "bottom" ? top + height : top - swHeight - 2 * margin, "px");
425
-
426
361
  if (isMobile) {
427
362
  dl.style.maxHeight = "".concat(maxSwHeight, "px");
428
363
  }
429
364
  };
430
-
431
365
  const renderListContainer = () => {
432
366
  const lc = getListContainer();
433
- if (!lc) return null; // eslint-disable-next-line no-use-before-define
367
+ if (!lc) return null;
434
368
 
369
+ // eslint-disable-next-line no-use-before-define
435
370
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
436
- }; // --- LIST CONTAINER FUNCTIONS END --- //
437
- // --- CREATABLE LOGIC BEGIN --- //
438
-
371
+ };
372
+ // --- LIST CONTAINER FUNCTIONS END --- //
439
373
 
374
+ // --- CREATABLE LOGIC BEGIN --- //
440
375
  const onOptionCreateClick = () => {
441
376
  var _onOptionCreate;
442
-
443
377
  const newOption = {
444
378
  label: searchValue,
445
379
  style: {
@@ -450,7 +384,6 @@ const TagsDropdown = _ref => {
450
384
  };
451
385
  ((_onOptionCreate = onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption)) !== null && _onOptionCreate !== void 0 ? _onOptionCreate : new Promise(r => r())).then(result => {
452
386
  var _result$id;
453
-
454
387
  const tempId = Math.random().toString(16).slice(2);
455
388
  newOption.value = (_result$id = result === null || result === void 0 ? void 0 : result.id) !== null && _result$id !== void 0 ? _result$id : tempId;
456
389
  setOptions(state => [...state, newOption]);
@@ -461,16 +394,13 @@ const TagsDropdown = _ref => {
461
394
  });
462
395
  });
463
396
  };
464
-
465
397
  const onOptionEditClick = (e, item) => {
466
- e === null || e === void 0 ? void 0 : e.preventDefault();
467
- e === null || e === void 0 ? void 0 : e.stopPropagation();
398
+ e === null || e === void 0 || e.preventDefault();
399
+ e === null || e === void 0 || e.stopPropagation();
468
400
  setEditingOption((editingOption === null || editingOption === void 0 ? void 0 : editingOption.value) === (item === null || item === void 0 ? void 0 : item.value) ? null : item);
469
401
  };
470
-
471
402
  const onOptionDeleteClick = () => {
472
403
  var _onOptionDelete;
473
-
474
404
  ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(r => r())).then(() => {
475
405
  deleteChosen(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
476
406
  setOptions(options => options.filter(_ref8 => {
@@ -482,24 +412,21 @@ const TagsDropdown = _ref => {
482
412
  setEditingOption(null);
483
413
  });
484
414
  };
485
-
486
415
  const saveEditingOption = () => {
487
- onOptionEdit === null || onOptionEdit === void 0 ? void 0 : onOptionEdit(editingOption);
416
+ onOptionEdit === null || onOptionEdit === void 0 || onOptionEdit(editingOption);
488
417
  setOptions(options => options.map(option => {
489
418
  if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
490
- const tmp = { ...editingOption
419
+ const tmp = {
420
+ ...editingOption
491
421
  };
492
422
  setEditingOption(null);
493
423
  return tmp;
494
424
  }
495
-
496
425
  return option;
497
426
  }));
498
427
  };
499
-
500
428
  const setEditOptionModalStyles = () => {
501
429
  var _editingOption$ref, _el$getBoundingClient, _dropdownListWrapperR;
502
-
503
430
  if (!editingOption || !(editOptionModalRef !== null && editOptionModalRef !== void 0 && editOptionModalRef.current)) return null;
504
431
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
505
432
  const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
@@ -507,7 +434,7 @@ const TagsDropdown = _ref => {
507
434
  windowHeight,
508
435
  windowWidth
509
436
  });
510
- const el = editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
437
+ const el = editingOption === null || editingOption === void 0 || (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
511
438
  const {
512
439
  top,
513
440
  bottom,
@@ -516,13 +443,14 @@ const TagsDropdown = _ref => {
516
443
  width,
517
444
  height
518
445
  } = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {};
519
- const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
520
-
446
+ const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
521
447
  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) {
522
448
  editOptionModalRef.current.style.left = "".concat(width - 50, "px");
523
449
  } else {
524
450
  editOptionModalRef.current.style.right = "".concat(right - width - 12, "px");
525
- } // console.log(containerPosition.top, {
451
+ }
452
+
453
+ // console.log(containerPosition.top, {
526
454
  // top,
527
455
  // bottom,
528
456
  // left,
@@ -531,14 +459,14 @@ const TagsDropdown = _ref => {
531
459
  // height,
532
460
  // });
533
461
 
462
+ editOptionModalRef.current.style.top = "".concat(top - height, "px");
534
463
 
535
- editOptionModalRef.current.style.top = "".concat(top - height, "px"); // if (containerPosition?.top + top <= 173) {
464
+ // if (containerPosition?.top + top <= 173) {
536
465
  // editOptionModalRef.current.style.top = `${top - height}px`;
537
466
  // } else {
538
467
  // editOptionModalRef.current.style.bottom = `${bottom - height}px`;
539
468
  // }
540
469
  };
541
-
542
470
  const renderEditOptionModal = () => {
543
471
  return /*#__PURE__*/_react.default.createElement("div", {
544
472
  ref: editOptionModalRef,
@@ -547,7 +475,8 @@ const TagsDropdown = _ref => {
547
475
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
548
476
  }, /*#__PURE__*/_react.default.createElement(_Input.default, {
549
477
  value: editingOption.label,
550
- onChange: v => setEditingOption(state => ({ ...state,
478
+ onChange: v => setEditingOption(state => ({
479
+ ...state,
551
480
  label: v
552
481
  })),
553
482
  onKeyDown: keyCode => {
@@ -566,35 +495,33 @@ const TagsDropdown = _ref => {
566
495
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section-colors"))
567
496
  }, COLORS.map(color => {
568
497
  var _editingOption$style;
569
-
570
498
  return /*#__PURE__*/_react.default.createElement("div", {
571
499
  className: "color-block",
572
500
  style: {
573
501
  backgroundColor: color
574
502
  },
575
- onClick: () => setEditingOption(state => ({ ...state,
576
- style: { ...state.style,
503
+ onClick: () => setEditingOption(state => ({
504
+ ...state,
505
+ style: {
506
+ ...state.style,
577
507
  backgroundColor: color
578
508
  }
579
509
  }))
580
- }, (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);
510
+ }, (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);
581
511
  }))));
582
- }; // --- CREATABLE LOGIC END --- //
583
- // --- RENDER FUNCTIONS BEGIN --- //
584
-
512
+ };
513
+ // --- CREATABLE LOGIC END --- //
585
514
 
515
+ // --- RENDER FUNCTIONS BEGIN --- //
586
516
  const getMarkupForElement = item => {
587
517
  var _title$toString, _item$customMobileIco;
588
-
589
518
  const {
590
519
  description
591
520
  } = item;
592
521
  const title = item.title || item.label;
593
-
594
522
  const hightlightSearchValue = title => {
595
523
  var _title$toLowerCase;
596
-
597
- const index = title === null || title === void 0 ? void 0 : (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
524
+ const index = title === null || title === void 0 || (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase());
598
525
  if (index === -1) return title;
599
526
  return /*#__PURE__*/_react.default.createElement("pre", {
600
527
  className: "inherit-styles"
@@ -602,10 +529,9 @@ const TagsDropdown = _ref => {
602
529
  className: "search-match bg--yellow"
603
530
  }, 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))));
604
531
  };
605
-
606
532
  return /*#__PURE__*/_react.default.createElement("button", {
607
533
  ref: item === null || item === void 0 ? void 0 : item.ref,
608
- key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
534
+ key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
609
535
  onClick: e => {
610
536
  e.preventDefault();
611
537
  e.stopPropagation();
@@ -653,10 +579,8 @@ const TagsDropdown = _ref => {
653
579
  }
654
580
  }) : "");
655
581
  };
656
-
657
582
  const getListMarkUp = () => {
658
583
  var _filteredOptions$filt, _filteredOptions$filt2;
659
-
660
584
  const filteredOptions = getFilteredOptions(options);
661
585
  return /*#__PURE__*/_react.default.createElement("div", {
662
586
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -715,10 +639,9 @@ const TagsDropdown = _ref => {
715
639
  ref: dropdownListRef,
716
640
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
717
641
  }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
718
- var _option$groupName, _option$groupName$toS, _option$list2;
719
-
642
+ var _option$groupName, _option$list2;
720
643
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
721
- 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()),
644
+ 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()),
722
645
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
723
646
  }, /*#__PURE__*/_react.default.createElement("span", {
724
647
  className: "".concat(RC, "-group__name")
@@ -758,7 +681,6 @@ const TagsDropdown = _ref => {
758
681
  isNoDismiss: true
759
682
  }))));
760
683
  };
761
-
762
684
  const renderSearchInput = () => {
763
685
  return /*#__PURE__*/_react.default.createElement(_Input.default, {
764
686
  ref: inputRef,
@@ -768,7 +690,8 @@ const TagsDropdown = _ref => {
768
690
  value: searchValue,
769
691
  onChange: onSearchHandler,
770
692
  placeholder: placeholder || "Select from list",
771
- attributesOfNativeInput: { ...attributesOfNativeInput,
693
+ attributesOfNativeInput: {
694
+ ...attributesOfNativeInput,
772
695
  onKeyDown: e => {
773
696
  if (e.keyCode === 13 && withCreateLogic && singleLevelOptions.every(_ref13 => {
774
697
  let {
@@ -778,21 +701,17 @@ const TagsDropdown = _ref => {
778
701
  })) {
779
702
  onOptionCreateClick();
780
703
  }
781
-
782
704
  onKeyPress(e, searchValue);
783
705
  },
784
706
  onFocus: e => {
785
707
  var _e$target;
786
-
787
- if (isMobile) e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.blur();
708
+ if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
788
709
  }
789
710
  }
790
711
  });
791
712
  };
792
-
793
713
  const renderDropdownTrigger = (0, _react.useCallback)(() => {
794
714
  var _renderCustomTrigger;
795
-
796
715
  const renderDefaultDropdownTrigger = () => {
797
716
  return /*#__PURE__*/_react.default.createElement("div", {
798
717
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
@@ -803,7 +722,6 @@ const TagsDropdown = _ref => {
803
722
  let {
804
723
  target
805
724
  } = _ref14;
806
-
807
725
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") {
808
726
  setIsOpen(true);
809
727
  } else if (isTargetInParent(target)) {
@@ -848,7 +766,6 @@ const TagsDropdown = _ref => {
848
766
  className: "color--text"
849
767
  })));
850
768
  };
851
-
852
769
  return (_renderCustomTrigger = renderCustomTrigger === null || renderCustomTrigger === void 0 ? void 0 : renderCustomTrigger({
853
770
  chosenOptions,
854
771
  singleLevelOptions,
@@ -858,25 +775,23 @@ const TagsDropdown = _ref => {
858
775
  isOpen,
859
776
  setIsOpen
860
777
  })) !== null && _renderCustomTrigger !== void 0 ? _renderCustomTrigger : renderDefaultDropdownTrigger();
861
- }, [chosenOptions, singleLevelOptions, inputRef, isOpen]); // --- RENDER FUNCTIONS END --- //
778
+ }, [chosenOptions, singleLevelOptions, inputRef, isOpen]);
779
+ // --- RENDER FUNCTIONS END --- //
862
780
 
863
781
  (0, _react.useLayoutEffect)(() => {
864
782
  initListContainer();
865
783
  return () => {
866
784
  var _getListContainer2, _getListContainerWrap;
867
-
868
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
869
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
785
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
786
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
870
787
  };
871
788
  }, []);
872
789
  (0, _react.useLayoutEffect)(() => {
873
790
  var _getListContainer3;
874
-
875
791
  const onResize = () => {
876
792
  setListContainerStyles();
877
793
  setEditOptionModalStyles();
878
794
  };
879
-
880
795
  if (!isMobile) {
881
796
  window.addEventListener("resize", onResize);
882
797
  window.addEventListener("mousewheel", closeList);
@@ -890,28 +805,27 @@ const TagsDropdown = _ref => {
890
805
  window.removeEventListener("touchmove", closeList);
891
806
  window.removeEventListener("mouseup", handleClickOutside);
892
807
  }
893
-
894
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
808
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
895
809
  return () => {
896
810
  var _getListContainer4;
897
-
898
811
  window.removeEventListener("resize", onResize);
899
812
  window.removeEventListener("mousewheel", closeList);
900
813
  window.removeEventListener("mouseup", handleClickOutside);
901
814
  window.removeEventListener("scroll", closeList);
902
815
  window.removeEventListener("touchmove", closeList);
903
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
816
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
904
817
  };
905
818
  }, [getListContainer, isMobile]);
906
819
  (0, _react.useLayoutEffect)(() => {
907
820
  setListContainerStyles();
908
821
  setEditOptionModalStyles();
909
- }, [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]);
822
+ }, [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]);
910
823
  (0, _react.useEffect)(() => {
911
824
  if (isUseLocalOptionsStore && chosenOptions.length !== Object.keys(localOptionsStore).length) {
912
825
  options.map(option => {
913
826
  if (!(localOptionsStore !== null && localOptionsStore !== void 0 && localOptionsStore[option === null || option === void 0 ? void 0 : option.value])) {
914
- setLocalOptionsStore(options => ({ ...options,
827
+ setLocalOptionsStore(options => ({
828
+ ...options,
915
829
  [option === null || option === void 0 ? void 0 : option.value]: option === null || option === void 0 ? void 0 : option.label
916
830
  }));
917
831
  }
@@ -920,20 +834,16 @@ const TagsDropdown = _ref => {
920
834
  }, [chosenOptions, isUseLocalOptionsStore]);
921
835
  (0, _react.useEffect)(() => {
922
836
  var _selectAllButtonRef$c, _unselectAllButtonRef;
923
-
924
837
  const fn = isOpen ? "addEventListener" : "removeEventListener";
925
- selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
926
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
927
-
838
+ selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
839
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
928
840
  if (isOpen) {
929
841
  var _getListContainer5, _inputRef$current2, _inputRef$current2$fo;
930
-
931
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add("tags-dropdown__container--opened");
932
- 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);
842
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add("tags-dropdown__container--opened");
843
+ 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);
933
844
  } else {
934
845
  var _getListContainer6;
935
-
936
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove("tags-dropdown__container--opened");
846
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove("tags-dropdown__container--opened");
937
847
  if (withSearchInputInList) setSearchValueInterceptor("");
938
848
  }
939
849
  }, [isOpen]);
@@ -941,45 +851,38 @@ const TagsDropdown = _ref => {
941
851
  const setScrollTopValue = e => {
942
852
  setScrollTop(parseInt(e.target.scrollTop, 10));
943
853
  };
944
-
945
854
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
946
855
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
947
-
948
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
949
- 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));
950
-
856
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 || _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
857
+ 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));
951
858
  if (isScrollableList === null) {
952
859
  var _dropdownListRef$curr4, _dropdownListRef$curr5;
953
-
954
- 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));
860
+ 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));
955
861
  }
956
862
  }
957
-
958
863
  if (isOpen && dropdownListRef && dropdownListRef.current) {
959
864
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
960
865
  }
961
-
962
866
  return () => {
963
867
  var _dropdownListRef$curr6;
964
-
965
868
  removeEventListener("scroll", doScrollCallback);
966
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
869
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 || _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
967
870
  };
968
- }, [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]);
871
+ }, [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]);
969
872
  (0, _react.useEffect)(() => {
970
873
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
971
874
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
972
-
973
- 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));
875
+ 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));
974
876
  }
975
877
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
976
878
  (0, _react.useEffect)(() => {
977
879
  if (isSearchable && useLiveSearch && (debouncedSearchTerm || isValueDeleted || isOpen)) {
978
- doLiveSearchRequest === null || doLiveSearchRequest === void 0 ? void 0 : doLiveSearchRequest(debouncedSearchTerm);
880
+ doLiveSearchRequest === null || doLiveSearchRequest === void 0 || doLiveSearchRequest(debouncedSearchTerm);
979
881
  }
980
882
  }, [isOpen, debouncedSearchTerm, isValueDeleted]);
981
883
  (0, _react.useEffect)(() => {
982
- setOptions(optionsProp.map(option => ({ ...option,
884
+ setOptions(optionsProp.map(option => ({
885
+ ...option,
983
886
  ref: /*#__PURE__*/(0, _react.createRef)()
984
887
  })));
985
888
  }, [optionsProp]);
@@ -1003,6 +906,4 @@ const TagsDropdown = _ref => {
1003
906
  onClick: onActionCancelClick
1004
907
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isOpen && renderListContainer());
1005
908
  };
1006
-
1007
- var _default = TagsDropdown;
1008
- exports.default = _default;
909
+ var _default = exports.default = TagsDropdown;