intelicoreact 1.4.34 → 1.4.36

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 +52 -145
  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 +6 -23
  62. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +105 -214
  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 -16
  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 +19 -35
  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 +9 -24
  130. package/dist/Atomic/UI/TagList/TagList.js +18 -39
  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 = [],
@@ -122,24 +102,21 @@ const TagsDropdown = _ref => {
122
102
  delay: 600
123
103
  });
124
104
  const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
125
-
126
105
  const setSearchValueInterceptor = value => {
127
106
  setSearchValue(value);
128
107
  setIsValueDeleted(searchValue !== value && value === "");
129
108
  searchValueRef.current = value;
130
109
  };
131
-
132
110
  const editingOptionInputRef = (0, _react.useRef)(null);
133
111
  const [options, setOptions] = (0, _react.useState)([]);
134
112
  const [editingOption, setEditingOptionState] = (0, _react.useState)(null);
135
-
136
113
  const setEditingOption = data => {
137
- setEditingOptionState(editingOption => !data ? data : { ...(editingOption !== null && editingOption !== void 0 ? editingOption : {}),
114
+ setEditingOptionState(editingOption => !data ? data : {
115
+ ...(editingOption !== null && editingOption !== void 0 ? editingOption : {}),
138
116
  ...(typeof data === "function" ? data === null || data === void 0 ? void 0 : data(editingOption) : data),
139
117
  isChanged: Boolean(editingOption)
140
118
  });
141
119
  };
142
-
143
120
  const isEditingOptionError = (0, _react.useMemo)(() => {
144
121
  if (!editingOption) return false;
145
122
  return options.filter(_ref2 => {
@@ -159,9 +136,9 @@ const TagsDropdown = _ref => {
159
136
  const getRandomIndex = (min, max) => {
160
137
  return Math.floor(Math.random() * (max - min + 1)) + min;
161
138
  };
162
-
163
139
  const randomIndex = getRandomIndex(0, COLORS.length - 1);
164
- return COLORS[randomIndex]; // eslint-disable-next-line react-hooks/exhaustive-deps
140
+ return COLORS[randomIndex];
141
+ // eslint-disable-next-line react-hooks/exhaustive-deps
165
142
  }, [options.length]);
166
143
  const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => {
167
144
  const checkUniqAndPush = (acc, item) => {
@@ -171,90 +148,73 @@ const TagsDropdown = _ref => {
171
148
  } = _ref4;
172
149
  return value === (item === null || item === void 0 ? void 0 : item.value);
173
150
  });
174
-
175
151
  if (isExist !== -1) {
176
152
  acc[isExist] = item;
177
153
  } else {
178
154
  acc.push(item);
179
155
  }
180
156
  };
181
-
182
157
  if (item.groupName) {
183
158
  var _item$list;
184
-
185
- (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.map(item => checkUniqAndPush(acc, item));
159
+ (_item$list = item.list) === null || _item$list === void 0 || _item$list.map(item => checkUniqAndPush(acc, item));
186
160
  } else {
187
161
  checkUniqAndPush(acc, item);
188
162
  }
189
-
190
163
  return acc;
191
164
  }, isUseLocalOptionsStore ? (_Object$keys = Object.keys(localOptionsStore)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(value => ({
192
165
  value,
193
166
  label: localOptionsStore === null || localOptionsStore === void 0 ? void 0 : localOptionsStore[value]
194
167
  })) : []);
195
-
196
168
  const deleteChosen = value => {
197
169
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
198
-
199
170
  if (isUseLocalOptionsStore) {
200
- setLocalOptionsStore(options => ({ ...options,
171
+ setLocalOptionsStore(options => ({
172
+ ...options,
201
173
  [value]: undefined
202
174
  }));
203
175
  }
204
-
205
176
  onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
206
- }; // --- LIST CONTAINER FUNCTIONS BEGIN --- //
207
-
177
+ };
208
178
 
179
+ // --- LIST CONTAINER FUNCTIONS BEGIN --- //
209
180
  const getParentNode = () => {
210
181
  var _ref5, _document$querySelect;
211
-
212
182
  return (_ref5 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref5 !== void 0 ? _ref5 : document.querySelector("div#storybook-root");
213
183
  };
214
-
215
184
  const initListContainer = () => {
216
185
  const dropdownList = document.createElement("div");
217
186
  dropdownList.setAttribute("id", dropdownId);
218
187
  dropdownList.classList.add("tags-dropdown__container");
219
-
220
188
  if (isMobile) {
221
189
  dropdownList.addEventListener("click", e => {
222
190
  if (e.target.id === dropdownId) setIsOpen(false);
223
191
  });
224
192
  }
225
-
226
193
  if (isMobile) {
227
194
  var _getParentNode;
228
-
229
195
  try {
230
196
  var _document$getElementB;
231
-
232
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove(); // eslint-disable-next-line no-empty
197
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
198
+ // eslint-disable-next-line no-empty
233
199
  } catch (e) {}
234
-
235
200
  const dropdownMobileListWrapper = document.createElement("div");
236
201
  dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
237
202
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
238
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
239
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
203
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
204
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
240
205
  } else {
241
206
  var _getParentNode2;
242
-
243
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
207
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
244
208
  }
245
209
  };
246
-
247
210
  const getListContainer = () => {
248
211
  return document.getElementById(dropdownId);
249
212
  };
250
-
251
213
  const getListContainerWrapper = () => {
252
214
  return document.getElementById("mlw-".concat(dropdownId));
253
215
  };
254
-
255
216
  const setListContainerStyles = () => {
256
- var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
257
-
217
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
258
218
  const lc = getListContainer();
259
219
  if (!lc || !isOpen) return false;
260
220
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
@@ -263,42 +223,40 @@ const TagsDropdown = _ref => {
263
223
  height,
264
224
  left,
265
225
  top
266
- } = (_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$ : {};
226
+ } = (_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$ : {};
267
227
  const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
268
228
  const dl = lc.getElementsByClassName("tags-dropdown__list")[0];
269
229
  const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__header")[0];
270
230
  const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__footer")[0];
271
- 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);
272
- 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);
231
+ 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);
232
+ 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);
273
233
  if (initListHeight === null) setInitListHeight(maxHeight);
274
234
  const toTop = top - margin;
275
235
  const toBottom = windowHeight - top - height - margin * 2;
276
- let swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
236
+ let swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
277
237
  if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
278
- 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);
238
+ 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);
279
239
  const listPos = toTop < toBottom || toBottom >= swHeight ? "bottom" : "top";
280
240
  if (swHeight > (listPos === "top" ? toTop : toBottom)) swHeight = (listPos === "top" ? toTop : toBottom) - 3 * margin;
281
241
  lc.style.minWidth = "".concat(width, "px");
282
242
  lc.style.left = "".concat(left, "px");
283
243
  lc.style.top = "".concat(listPos === "bottom" ? top + height : top - swHeight - 2 * margin, "px");
284
-
285
244
  if (isMobile) {
286
245
  dl.style.maxHeight = "".concat(maxSwHeight, "px");
287
246
  }
288
247
  };
289
-
290
248
  const renderListContainer = () => {
291
249
  const lc = getListContainer();
292
- if (!lc) return null; // eslint-disable-next-line no-use-before-define
250
+ if (!lc) return null;
293
251
 
252
+ // eslint-disable-next-line no-use-before-define
294
253
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
295
- }; // --- LIST CONTAINER FUNCTIONS END --- //
296
- // --- CREATABLE LOGIC BEGIN --- //
297
-
254
+ };
255
+ // --- LIST CONTAINER FUNCTIONS END --- //
298
256
 
257
+ // --- CREATABLE LOGIC BEGIN --- //
299
258
  const onOptionCreateClick = () => {
300
259
  var _onOptionCreate;
301
-
302
260
  const newOption = {
303
261
  label: searchValue,
304
262
  style: {
@@ -306,11 +264,11 @@ const TagsDropdown = _ref => {
306
264
  },
307
265
  isEditable: true,
308
266
  ref: /*#__PURE__*/(0, _react.createRef)()
309
- }; // eslint-disable-next-line no-promise-executor-return
267
+ };
310
268
 
269
+ // eslint-disable-next-line no-promise-executor-return
311
270
  ((_onOptionCreate = onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption)) !== null && _onOptionCreate !== void 0 ? _onOptionCreate : new Promise(r => r())).then(result => {
312
271
  var _result$id;
313
-
314
272
  const tempId = Math.random().toString(16).slice(2);
315
273
  newOption.value = (_result$id = result === null || result === void 0 ? void 0 : result.id) !== null && _result$id !== void 0 ? _result$id : tempId;
316
274
  setOptions(state => [...state, newOption]);
@@ -318,16 +276,13 @@ const TagsDropdown = _ref => {
318
276
  onChangeHandler(newOption);
319
277
  });
320
278
  };
321
-
322
279
  const onOptionEditClick = (e, item) => {
323
- e === null || e === void 0 ? void 0 : e.preventDefault();
324
- e === null || e === void 0 ? void 0 : e.stopPropagation();
280
+ e === null || e === void 0 || e.preventDefault();
281
+ e === null || e === void 0 || e.stopPropagation();
325
282
  setEditingOption((editingOption === null || editingOption === void 0 ? void 0 : editingOption.value) === (item === null || item === void 0 ? void 0 : item.value) ? null : item);
326
283
  };
327
-
328
284
  const onOptionDeleteClick = () => {
329
285
  var _onOptionDelete;
330
-
331
286
  // eslint-disable-next-line no-promise-executor-return
332
287
  ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(r => r())).then(() => {
333
288
  deleteChosen(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
@@ -340,29 +295,25 @@ const TagsDropdown = _ref => {
340
295
  setEditingOption(null);
341
296
  });
342
297
  };
343
-
344
298
  const saveEditingOption = () => {
345
299
  if (!(editingOption !== null && editingOption !== void 0 && editingOption.isChanged) || isEditingOptionError) {
346
300
  setEditingOption(null);
347
301
  return false;
348
302
  }
349
-
350
- onOptionEdit === null || onOptionEdit === void 0 ? void 0 : onOptionEdit(editingOption);
303
+ onOptionEdit === null || onOptionEdit === void 0 || onOptionEdit(editingOption);
351
304
  setOptions(options => options.map(option => {
352
305
  if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
353
- const tmp = { ...editingOption
306
+ const tmp = {
307
+ ...editingOption
354
308
  };
355
309
  setEditingOption(null);
356
310
  return tmp;
357
311
  }
358
-
359
312
  return option;
360
313
  }));
361
314
  };
362
-
363
315
  const setEditOptionModalStyles = () => {
364
316
  var _editingOption$ref, _el$getBoundingClient, _dropdownListWrapperR, _positionClasses, _positionClasses2;
365
-
366
317
  if (!editingOption || !(editOptionModalRef !== null && editOptionModalRef !== void 0 && editOptionModalRef.current)) return null;
367
318
  const modalSize = 200;
368
319
  const {
@@ -377,14 +328,14 @@ const TagsDropdown = _ref => {
377
328
  };
378
329
  const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
379
330
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
380
- const el = editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
331
+ const el = editingOption === null || editingOption === void 0 || (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
381
332
  const {
382
333
  x,
383
334
  y,
384
335
  width,
385
336
  height
386
337
  } = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {};
387
- const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
338
+ const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
388
339
  const distanceToRight = windowWidth - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.x) - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.width);
389
340
  const distanceToBottom = windowHeight - y - scrollY - height;
390
341
  Object.values(positionClasses).map(className => editOptionModalRef.current.classList.remove(className));
@@ -396,7 +347,6 @@ const TagsDropdown = _ref => {
396
347
  editOptionModalRef.current.style.top = "".concat(y + scrollY + height, "px");
397
348
  editOptionModalRef.current.style.transform = "translate(".concat(xTranslate, ", ").concat(yTranslate, ")");
398
349
  };
399
-
400
350
  const renderEditOptionModal = () => {
401
351
  return /*#__PURE__*/_react.default.createElement("div", {
402
352
  key: "editOptionModal".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value),
@@ -406,7 +356,8 @@ const TagsDropdown = _ref => {
406
356
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
407
357
  }, /*#__PURE__*/_react.default.createElement(_Input.default, {
408
358
  value: editingOption.label,
409
- onChange: v => setEditingOption(state => ({ ...state,
359
+ onChange: v => setEditingOption(state => ({
360
+ ...state,
410
361
  label: v
411
362
  })),
412
363
  error: isEditingOptionError,
@@ -428,132 +379,113 @@ const TagsDropdown = _ref => {
428
379
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section-colors"))
429
380
  }, COLORS.map(color => {
430
381
  var _editingOption$style;
431
-
432
382
  return /*#__PURE__*/_react.default.createElement("div", {
433
383
  key: color,
434
384
  className: "color-block",
435
385
  style: {
436
386
  backgroundColor: color
437
387
  },
438
- onClick: () => setEditingOption(state => ({ ...state,
439
- style: { ...state.style,
388
+ onClick: () => setEditingOption(state => ({
389
+ ...state,
390
+ style: {
391
+ ...state.style,
440
392
  backgroundColor: color
441
393
  }
442
394
  }))
443
- }, (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);
395
+ }, (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);
444
396
  }))));
445
- }; // --- CREATABLE LOGIC END --- //
446
- // --- GENERAL FUNCTIONS BEGIN --- //
447
-
397
+ };
398
+ // --- CREATABLE LOGIC END --- //
448
399
 
400
+ // --- GENERAL FUNCTIONS BEGIN --- //
449
401
  const handleClickOutside = e => {
450
402
  var _getListContainer, _editOptionModalRef$c;
451
-
452
403
  const {
453
404
  target
454
405
  } = e;
455
-
456
- if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current // &&
406
+ if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current
407
+ // &&
457
408
  // (
458
409
  // customTriggerRef?.current ? customTriggerRef?.current?.contains(target) : true
459
410
  // )
460
411
  ) {
461
412
  setIsOpen(false);
462
- onDropdownListClose === null || onDropdownListClose === void 0 ? void 0 : onDropdownListClose(e);
413
+ onDropdownListClose === null || onDropdownListClose === void 0 || onDropdownListClose(e);
463
414
  } else if (editOptionModalRef.current && !((_editOptionModalRef$c = editOptionModalRef.current) !== null && _editOptionModalRef$c !== void 0 && _editOptionModalRef$c.contains(target))) {
464
- var _document, _document$getElementB2, _document$getElementB3, _document$getElementB4;
465
-
466
- if (!((_document = document) !== null && _document !== void 0 && (_document$getElementB2 = _document.getElementById) !== null && _document$getElementB2 !== void 0 && (_document$getElementB3 = _document$getElementB2.call(_document, "editTrigger".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value))) !== null && _document$getElementB3 !== void 0 && (_document$getElementB4 = _document$getElementB3.contains) !== null && _document$getElementB4 !== void 0 && _document$getElementB4.call(_document$getElementB3, target))) saveEditingOption();
415
+ var _document, _document$getElementB2, _document$getElementB3;
416
+ if (!((_document = document) !== null && _document !== void 0 && (_document$getElementB2 = _document.getElementById) !== null && _document$getElementB2 !== void 0 && (_document$getElementB2 = _document$getElementB2.call(_document, "editTrigger".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value))) !== null && _document$getElementB2 !== void 0 && (_document$getElementB3 = _document$getElementB2.contains) !== null && _document$getElementB3 !== void 0 && _document$getElementB3.call(_document$getElementB2, target))) saveEditingOption();
467
417
  }
468
418
  };
469
-
470
419
  const closeList = e => {
471
420
  var _inputRef$current;
472
-
473
421
  handleClickOutside(e);
474
- 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();
422
+ 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();
475
423
  };
476
-
477
424
  const isTargetInParent = target => {
478
425
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
479
-
480
426
  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;
481
- 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;
427
+ 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;
482
428
  return false;
483
429
  };
484
-
485
430
  const isItemMatchesSearch = item => {
486
431
  const title = item.title || item.label;
487
432
  return searchValue.length ? title === null || title === void 0 ? void 0 : title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
488
- }; // --- GENERAL FUNCTIONS END --- //
489
-
433
+ };
434
+ // --- GENERAL FUNCTIONS END --- //
490
435
 
491
436
  const prepareOptions = options => {
492
437
  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();
493
438
  };
494
-
495
439
  const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
496
440
  if (option.groupName) {
497
441
  var _option$list;
498
-
499
- 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));
500
-
442
+ const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
501
443
  if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
502
- result.push({ ...option,
444
+ result.push({
445
+ ...option,
503
446
  list: filteredGroupItems
504
447
  });
505
448
  }
506
449
  } else if (isItemMatchesSearch(option)) {
507
450
  result.push(option);
508
451
  }
509
-
510
452
  return result;
511
453
  }, []);
512
-
513
454
  const getTotalOptions = (0, _react.useCallback)(() => {
514
455
  return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
515
456
  if (item !== null && item !== void 0 && item.list) {
516
457
  var _item$list2;
517
-
518
- result += (item === null || item === void 0 ? void 0 : (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
458
+ result += (item === null || item === void 0 || (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
519
459
  } else {
520
460
  ++result;
521
461
  }
522
-
523
462
  return result;
524
463
  }, 0);
525
464
  }, [options]);
526
-
527
465
  const onChangeHandler = item => {
528
466
  if (item !== null && item !== void 0 && item.isFreezed) return false;
529
-
530
467
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
531
468
  if (item.closeOnOptionSelect) setIsOpen(false);
532
469
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
533
-
534
470
  setSearchValueInterceptor("");
535
-
536
471
  if (chosenOptions.some(el => el === item.value)) {
537
472
  deleteChosen(item.value);
538
473
  return null;
539
474
  }
540
-
541
475
  if (isUseLocalOptionsStore) {
542
- setLocalOptionsStore(options => ({ ...options,
476
+ setLocalOptionsStore(options => ({
477
+ ...options,
543
478
  [item === null || item === void 0 ? void 0 : item.value]: item === null || item === void 0 ? void 0 : item.label
544
479
  }));
545
480
  }
546
-
547
481
  onChange([...chosenOptions, item.value], "chosenOptions");
548
482
  return null;
549
483
  };
550
-
551
484
  const onSearchHandler = name => {
552
485
  let inputValue = name;
553
486
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
554
487
  setSearchValueInterceptor(inputValue);
555
488
  };
556
-
557
489
  const onWrapperClick = e => {
558
490
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
559
491
  e.stopPropagation();
@@ -561,10 +493,8 @@ const TagsDropdown = _ref => {
561
493
  setIsOpen(false);
562
494
  }
563
495
  };
564
-
565
496
  const selectAllItems = () => {
566
497
  var _prepareOptions;
567
-
568
498
  const preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(_ref7 => {
569
499
  let {
570
500
  isFreezed,
@@ -572,7 +502,6 @@ const TagsDropdown = _ref => {
572
502
  } = _ref7;
573
503
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
574
504
  });
575
-
576
505
  if (isUseLocalOptionsStore) {
577
506
  setLocalOptionsStore(options => preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.reduce((result, _ref8) => {
578
507
  let {
@@ -583,7 +512,6 @@ const TagsDropdown = _ref => {
583
512
  return result;
584
513
  }, options));
585
514
  }
586
-
587
515
  onChange([...chosenOptions, ...((preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.map(_ref9 => {
588
516
  let {
589
517
  value
@@ -592,42 +520,37 @@ const TagsDropdown = _ref => {
592
520
  })) || [])], "chosenOptions");
593
521
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
594
522
  };
595
-
596
523
  const unselectAllItems = () => {
597
524
  if (isUseLocalOptionsStore) setLocalOptionsStore({});
598
525
  onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
599
- var _prepareOptions2, _prepareOptions2$find;
600
-
601
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(_ref10 => {
526
+ var _prepareOptions2;
527
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref10 => {
602
528
  let {
603
529
  value
604
530
  } = _ref10;
605
531
  return value === item;
606
- })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
532
+ })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
607
533
  }), "chosenOptions");
608
534
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
609
535
  };
610
-
611
536
  const doScrollCallback = (0, _react.useCallback)(e => {
612
537
  if (doLiveSearchRequest && typeof doLiveSearchRequest === "function") {
613
538
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
614
539
  doLiveSearchRequest(searchValueRef.current, true);
615
540
  }
616
541
  }
617
- }, [options]); // --- RENDER FUNCTIONS BEGIN --- //
542
+ }, [options]);
618
543
 
544
+ // --- RENDER FUNCTIONS BEGIN --- //
619
545
  const getMarkupForElement = item => {
620
546
  var _title$toString, _item$customMobileIco;
621
-
622
547
  const {
623
548
  description
624
549
  } = item;
625
550
  const title = item.title || item.label;
626
-
627
551
  const hightlightSearchValue = title => {
628
552
  var _title$toLowerCase;
629
-
630
- 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());
553
+ 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());
631
554
  if (index === -1) return title;
632
555
  return /*#__PURE__*/_react.default.createElement("pre", {
633
556
  className: "inherit-styles"
@@ -635,10 +558,9 @@ const TagsDropdown = _ref => {
635
558
  className: "search-match bg--yellow"
636
559
  }, 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))));
637
560
  };
638
-
639
561
  return /*#__PURE__*/_react.default.createElement("button", {
640
562
  ref: item === null || item === void 0 ? void 0 : item.ref,
641
- key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
563
+ key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
642
564
  onClick: e => {
643
565
  e.preventDefault();
644
566
  e.stopPropagation();
@@ -675,7 +597,7 @@ const TagsDropdown = _ref => {
675
597
  className: (0, _classnames.default)("".concat(RC, "__list-item-title"), item.labelClassName)
676
598
  }, hightlightSearchValue(title)), description && /*#__PURE__*/_react.default.createElement("span", {
677
599
  className: (0, _classnames.default)("".concat(RC, "__list-item-description"))
678
- }, description)), !isMobile && (item === null || item === void 0 ? void 0 : item.isEditable) && /*#__PURE__*/_react.default.createElement("div", {
600
+ }, description)), !isMobile && (item === null || item === void 0 ? void 0 : item.isEditable) && onOptionEdit && onOptionDelete && /*#__PURE__*/_react.default.createElement("div", {
679
601
  id: "editTrigger".concat(item === null || item === void 0 ? void 0 : item.value),
680
602
  className: (0, _classnames.default)("".concat(RC, "__list-item-edit-trigger")),
681
603
  onClick: e => onOptionEditClick(e, item)
@@ -686,10 +608,8 @@ const TagsDropdown = _ref => {
686
608
  }
687
609
  }) : "");
688
610
  };
689
-
690
611
  const getListMarkUp = () => {
691
- var _filteredOptions$filt, _filteredOptions$filt2, _document$getElementB5;
692
-
612
+ var _filteredOptions$filt, _filteredOptions$filt2, _document$getElementB4;
693
613
  const filteredOptions = getFilteredOptions(options);
694
614
  return /*#__PURE__*/_react.default.createElement("div", {
695
615
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -737,7 +657,7 @@ const TagsDropdown = _ref => {
737
657
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
738
658
  }, headerContent)) : null, withSearchInputInList && /*#__PURE__*/_react.default.createElement("div", {
739
659
  className: (0, _classnames.default)("".concat(RC, "__input-list-wrapper"))
740
- }, renderSearchInput()), withCreateLogic && searchValue && filteredOptions.length && singleLevelOptions.every(_ref11 => {
660
+ }, renderSearchInput()), withCreateLogic && onOptionCreate && searchValue && filteredOptions.length && singleLevelOptions.every(_ref11 => {
741
661
  let {
742
662
  label
743
663
  } = _ref11;
@@ -748,10 +668,9 @@ const TagsDropdown = _ref => {
748
668
  ref: dropdownListRef,
749
669
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
750
670
  }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
751
- var _option$groupName, _option$groupName$toS, _option$list2;
752
-
671
+ var _option$groupName, _option$list2;
753
672
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
754
- 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()),
673
+ 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()),
755
674
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
756
675
  }, /*#__PURE__*/_react.default.createElement("span", {
757
676
  className: "".concat(RC, "-group__name")
@@ -775,7 +694,7 @@ const TagsDropdown = _ref => {
775
694
  })
776
695
  }, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
777
696
  onClick: () => setIsOpen(false)
778
- }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null, editingOption && /*#__PURE__*/(0, _reactDom.createPortal)(renderEditOptionModal(), (_document$getElementB5 = document.getElementById("app")) !== null && _document$getElementB5 !== void 0 ? _document$getElementB5 : document.body), withCreateLogic && searchValue && singleLevelOptions.every(_ref14 => {
697
+ }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null, editingOption && /*#__PURE__*/(0, _reactDom.createPortal)(renderEditOptionModal(), (_document$getElementB4 = document.getElementById("app")) !== null && _document$getElementB4 !== void 0 ? _document$getElementB4 : document.body), withCreateLogic && onOptionCreate && searchValue && singleLevelOptions.every(_ref14 => {
779
698
  let {
780
699
  label
781
700
  } = _ref14;
@@ -791,7 +710,6 @@ const TagsDropdown = _ref => {
791
710
  isNoDismiss: true
792
711
  }))));
793
712
  };
794
-
795
713
  const renderSearchInput = () => {
796
714
  return /*#__PURE__*/_react.default.createElement(_Input.default, {
797
715
  ref: inputRef,
@@ -801,9 +719,10 @@ const TagsDropdown = _ref => {
801
719
  value: searchValue,
802
720
  onChange: onSearchHandler,
803
721
  placeholder: placeholder || "Select from list",
804
- attributesOfNativeInput: { ...attributesOfNativeInput,
722
+ attributesOfNativeInput: {
723
+ ...attributesOfNativeInput,
805
724
  onKeyDown: e => {
806
- if (e.keyCode === 13 && withCreateLogic && singleLevelOptions.every(_ref15 => {
725
+ if (e.keyCode === 13 && withCreateLogic && onOptionCreate && singleLevelOptions.every(_ref15 => {
807
726
  let {
808
727
  label
809
728
  } = _ref15;
@@ -811,21 +730,17 @@ const TagsDropdown = _ref => {
811
730
  })) {
812
731
  onOptionCreateClick();
813
732
  }
814
-
815
733
  onKeyPress(e, searchValue);
816
734
  },
817
735
  onFocus: e => {
818
736
  var _e$target;
819
-
820
- if (isMobile) e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.blur();
737
+ if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
821
738
  }
822
739
  }
823
740
  });
824
741
  };
825
-
826
742
  const renderDropdownTrigger = (0, _react.useCallback)(() => {
827
743
  var _renderCustomTrigger;
828
-
829
744
  const renderDefaultDropdownTrigger = () => {
830
745
  return /*#__PURE__*/_react.default.createElement("div", {
831
746
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
@@ -836,7 +751,6 @@ const TagsDropdown = _ref => {
836
751
  let {
837
752
  target
838
753
  } = _ref16;
839
-
840
754
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") {
841
755
  setIsOpen(true);
842
756
  } else if (isTargetInParent(target)) {
@@ -881,7 +795,6 @@ const TagsDropdown = _ref => {
881
795
  className: "color--text"
882
796
  })));
883
797
  };
884
-
885
798
  return (_renderCustomTrigger = renderCustomTrigger === null || renderCustomTrigger === void 0 ? void 0 : renderCustomTrigger({
886
799
  chosenOptions,
887
800
  singleLevelOptions,
@@ -891,26 +804,24 @@ const TagsDropdown = _ref => {
891
804
  isOpen,
892
805
  setIsOpen
893
806
  })) !== null && _renderCustomTrigger !== void 0 ? _renderCustomTrigger : renderDefaultDropdownTrigger();
894
- }, [chosenOptions, singleLevelOptions, inputRef, isOpen]); // --- RENDER FUNCTIONS END --- //
807
+ }, [chosenOptions, singleLevelOptions, inputRef, isOpen]);
808
+ // --- RENDER FUNCTIONS END --- //
895
809
 
896
810
  (0, _react.useLayoutEffect)(() => {
897
811
  initListContainer();
898
812
  if (isDefaultOpened) setIsOpen(true);
899
813
  return () => {
900
814
  var _getListContainer2, _getListContainerWrap;
901
-
902
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
903
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
815
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
816
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
904
817
  };
905
818
  }, []);
906
819
  (0, _react.useLayoutEffect)(() => {
907
820
  var _getListContainer3;
908
-
909
821
  const onResize = () => {
910
822
  setListContainerStyles();
911
823
  setEditOptionModalStyles();
912
824
  };
913
-
914
825
  if (!isMobile) {
915
826
  window.addEventListener("resize", onResize);
916
827
  window.addEventListener("mousewheel", closeList);
@@ -924,28 +835,27 @@ const TagsDropdown = _ref => {
924
835
  window.removeEventListener("touchmove", closeList);
925
836
  window.removeEventListener("mouseup", handleClickOutside);
926
837
  }
927
-
928
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
838
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
929
839
  return () => {
930
840
  var _getListContainer4;
931
-
932
841
  window.removeEventListener("resize", onResize);
933
842
  window.removeEventListener("mousewheel", closeList);
934
843
  window.removeEventListener("mouseup", handleClickOutside);
935
844
  window.removeEventListener("scroll", closeList);
936
845
  window.removeEventListener("touchmove", closeList);
937
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
846
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
938
847
  };
939
848
  }, [getListContainer, isMobile]);
940
849
  (0, _react.useLayoutEffect)(() => {
941
850
  setListContainerStyles();
942
851
  setEditOptionModalStyles();
943
- }, [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]);
852
+ }, [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]);
944
853
  (0, _react.useEffect)(() => {
945
854
  if (isUseLocalOptionsStore && chosenOptions.length !== Object.keys(localOptionsStore).length) {
946
855
  options.map(option => {
947
856
  if (!(localOptionsStore !== null && localOptionsStore !== void 0 && localOptionsStore[option === null || option === void 0 ? void 0 : option.value])) {
948
- setLocalOptionsStore(options => ({ ...options,
857
+ setLocalOptionsStore(options => ({
858
+ ...options,
949
859
  [option === null || option === void 0 ? void 0 : option.value]: option === null || option === void 0 ? void 0 : option.label
950
860
  }));
951
861
  }
@@ -954,37 +864,28 @@ const TagsDropdown = _ref => {
954
864
  }, [chosenOptions, isUseLocalOptionsStore]);
955
865
  (0, _react.useEffect)(() => {
956
866
  var _selectAllButtonRef$c, _unselectAllButtonRef;
957
-
958
867
  const fn = isOpen ? "addEventListener" : "removeEventListener";
959
- selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
960
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
961
-
868
+ selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
869
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
962
870
  if (isOpen) {
963
871
  var _getListContainer5;
964
-
965
872
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
966
873
  customTriggerRef.current.style.pointerEvents = "none";
967
874
  }
968
-
969
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add("tags-dropdown__container--opened");
970
-
875
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add("tags-dropdown__container--opened");
971
876
  if (!isMobile) {
972
877
  var _inputRef$current2, _inputRef$current2$fo;
973
-
974
- 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);
878
+ 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);
975
879
  } else {
976
880
  var _inputRef$current3, _inputRef$current3$bl;
977
-
978
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : (_inputRef$current3$bl = _inputRef$current3.blur) === null || _inputRef$current3$bl === void 0 ? void 0 : _inputRef$current3$bl.call(_inputRef$current3);
881
+ inputRef === null || inputRef === void 0 || (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || (_inputRef$current3$bl = _inputRef$current3.blur) === null || _inputRef$current3$bl === void 0 || _inputRef$current3$bl.call(_inputRef$current3);
979
882
  }
980
883
  } else {
981
884
  var _getListContainer6;
982
-
983
885
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
984
886
  customTriggerRef.current.style.pointerEvents = "auto";
985
887
  }
986
-
987
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove("tags-dropdown__container--opened");
888
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove("tags-dropdown__container--opened");
988
889
  if (withSearchInputInList) setSearchValueInterceptor("");
989
890
  }
990
891
  }, [isOpen]);
@@ -992,54 +893,46 @@ const TagsDropdown = _ref => {
992
893
  const setScrollTopValue = e => {
993
894
  setScrollTop(parseInt(e.target.scrollTop, 10));
994
895
  };
995
-
996
896
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
997
897
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
998
-
999
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
1000
- 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));
1001
-
898
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 || _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
899
+ 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));
1002
900
  if (isScrollableList === null) {
1003
901
  var _dropdownListRef$curr4, _dropdownListRef$curr5;
1004
-
1005
- 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));
902
+ 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));
1006
903
  }
1007
904
  }
1008
-
1009
905
  if (isOpen && dropdownListRef && dropdownListRef.current) {
1010
906
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
1011
907
  }
1012
-
1013
908
  return () => {
1014
909
  var _dropdownListRef$curr6;
1015
-
1016
910
  removeEventListener("scroll", doScrollCallback);
1017
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
911
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 || _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
1018
912
  };
1019
- }, [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]);
913
+ }, [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]);
1020
914
  (0, _react.useEffect)(() => {
1021
915
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
1022
916
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
1023
-
1024
- 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));
917
+ 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));
1025
918
  }
1026
919
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
1027
920
  (0, _react.useEffect)(() => {
1028
921
  if (isSearchable && useLiveSearch && (debouncedSearchTerm || isValueDeleted || isOpen)) {
1029
- doLiveSearchRequest === null || doLiveSearchRequest === void 0 ? void 0 : doLiveSearchRequest(debouncedSearchTerm);
922
+ doLiveSearchRequest === null || doLiveSearchRequest === void 0 || doLiveSearchRequest(debouncedSearchTerm);
1030
923
  }
1031
924
  }, [isOpen, debouncedSearchTerm, isValueDeleted]);
1032
925
  (0, _react.useEffect)(() => {
1033
- setOptions(optionsProp.map(option => ({ ...option,
926
+ setOptions(optionsProp.map(option => ({
927
+ ...option,
1034
928
  ref: /*#__PURE__*/(0, _react.createRef)()
1035
929
  })));
1036
930
  }, [optionsProp]);
1037
931
  (0, _react.useEffect)(() => {
1038
932
  if (editingOption) {
1039
933
  var _editingOptionInputRe, _editingOptionInputRe2;
1040
-
1041
934
  setEditOptionModalStyles();
1042
- editingOptionInputRef === null || editingOptionInputRef === void 0 ? void 0 : (_editingOptionInputRe = editingOptionInputRef.current) === null || _editingOptionInputRe === void 0 ? void 0 : (_editingOptionInputRe2 = _editingOptionInputRe.focus) === null || _editingOptionInputRe2 === void 0 ? void 0 : _editingOptionInputRe2.call(_editingOptionInputRe);
935
+ editingOptionInputRef === null || editingOptionInputRef === void 0 || (_editingOptionInputRe = editingOptionInputRef.current) === null || _editingOptionInputRe === void 0 || (_editingOptionInputRe2 = _editingOptionInputRe.focus) === null || _editingOptionInputRe2 === void 0 || _editingOptionInputRe2.call(_editingOptionInputRe);
1043
936
  }
1044
937
  }, [editingOption === null || editingOption === void 0 ? void 0 : editingOption.value]);
1045
938
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -1060,6 +953,4 @@ const TagsDropdown = _ref => {
1060
953
  onClick: onActionCancelClick
1061
954
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isOpen && renderListContainer());
1062
955
  };
1063
-
1064
- var _default = TagsDropdown;
1065
- exports.default = _default;
956
+ var _default = exports.default = TagsDropdown;