intelicoreact 1.4.42 → 1.4.44

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 (256) 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 +107 -216
  63. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +3 -0
  64. package/dist/Atomic/FormElements/Text/Text.js +10 -16
  65. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
  66. package/dist/Atomic/FormElements/Textarea/Textarea.js +18 -20
  67. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
  68. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
  69. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
  70. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
  71. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
  72. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
  73. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
  74. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
  75. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
  76. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  77. package/dist/Atomic/Layout/Header/Header.js +3 -15
  78. package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
  79. package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
  80. package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
  81. package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
  82. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
  83. package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -15
  84. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
  85. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
  86. package/dist/Atomic/UI/Alert/Alert.js +3 -19
  87. package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
  88. package/dist/Atomic/UI/Box/Box.js +3 -9
  89. package/dist/Atomic/UI/Button/Button.js +2 -11
  90. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
  91. package/dist/Atomic/UI/Chart/Chart.js +4 -29
  92. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
  93. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
  94. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
  95. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
  96. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
  97. package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
  98. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
  99. package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
  100. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
  101. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
  102. package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -17
  103. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
  104. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
  105. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
  106. package/dist/Atomic/UI/Hint/Hint.js +5 -31
  107. package/dist/Atomic/UI/Modal/Modal.js +6 -28
  108. package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
  109. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
  110. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
  111. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
  112. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
  113. package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
  114. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  115. package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
  116. package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
  117. package/dist/Atomic/UI/Price/Price.js +3 -8
  118. package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
  119. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
  120. package/dist/Atomic/UI/Status/Status.js +1 -8
  121. package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
  122. package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
  123. package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
  124. package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
  125. package/dist/Atomic/UI/Table/Table.js +1 -12
  126. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
  127. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
  128. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
  129. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
  130. package/dist/Atomic/UI/Tag/Tag.js +11 -26
  131. package/dist/Atomic/UI/TagList/TagList.js +18 -41
  132. package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
  133. package/dist/Classes/AbortableFetch.js +36 -93
  134. package/dist/Classes/AnimatedHandler.js +3 -7
  135. package/dist/Classes/RESTAPI/index.js +39 -42
  136. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
  137. package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
  138. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
  139. package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
  140. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
  141. package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
  142. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  143. package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
  144. package/dist/Constants/index.constants.js +8 -15
  145. package/dist/Functions/Portal.js +5 -16
  146. package/dist/Functions/customEventListener.js +4 -17
  147. package/dist/Functions/fieldValueFormatters.js +43 -83
  148. package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
  149. package/dist/Functions/locale/createTranslator.js +4 -9
  150. package/dist/Functions/operations.js +12 -22
  151. package/dist/Functions/presets/inputMaskPresets.js +9 -11
  152. package/dist/Functions/presets/inputPresets.js +8 -11
  153. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  154. package/dist/Functions/schemas.js +6 -13
  155. package/dist/Functions/useBodyScrollLock.js +1 -6
  156. package/dist/Functions/useClickOutside.js +0 -4
  157. package/dist/Functions/useDebounce.js +2 -7
  158. package/dist/Functions/useFieldFocus.js +6 -18
  159. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
  160. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
  161. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
  162. package/dist/Functions/useFormTools/functions/General.js +18 -28
  163. package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
  164. package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
  165. package/dist/Functions/useFormTools/index.js +85 -144
  166. package/dist/Functions/useInputHighlightError.js +3 -12
  167. package/dist/Functions/useIsMobile.js +7 -13
  168. package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
  169. package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
  170. package/dist/Functions/useLocalStorage.js +1 -9
  171. package/dist/Functions/useLocationParams.js +4 -5
  172. package/dist/Functions/useMediaQuery.js +3 -9
  173. package/dist/Functions/useMetaInfo.js +3 -10
  174. package/dist/Functions/useMouseUpOutside.js +0 -3
  175. package/dist/Functions/useOnlineStatus.js +1 -9
  176. package/dist/Functions/usePasswordChecker.js +4 -20
  177. package/dist/Functions/usePrevious.js +1 -5
  178. package/dist/Functions/useResize.js +2 -10
  179. package/dist/Functions/useScrollTo.js +2 -7
  180. package/dist/Functions/useToggle.js +1 -5
  181. package/dist/Functions/utils.js +56 -131
  182. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
  183. package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
  184. package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
  185. package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
  186. package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
  187. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
  188. package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
  189. package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
  190. package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
  191. package/dist/Molecular/CustomIcons/components/Button.js +2 -9
  192. package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
  193. package/dist/Molecular/CustomIcons/components/Check.js +2 -9
  194. package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
  195. package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
  196. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
  197. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
  198. package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
  199. package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
  200. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
  201. package/dist/Molecular/CustomIcons/components/Close.js +2 -9
  202. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
  203. package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
  204. package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
  205. package/dist/Molecular/CustomIcons/components/Email.js +2 -9
  206. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
  207. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
  208. package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
  209. package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
  210. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
  211. package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
  212. package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
  213. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
  214. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
  215. package/dist/Molecular/CustomIcons/components/Home.js +2 -9
  216. package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
  217. package/dist/Molecular/CustomIcons/components/Key.js +2 -9
  218. package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
  219. package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
  220. package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
  221. package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
  222. package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
  223. package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
  224. package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
  225. package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
  226. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
  227. package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
  228. package/dist/Molecular/CustomIcons/components/Play.js +2 -9
  229. package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
  230. package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
  231. package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
  232. package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
  233. package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
  234. package/dist/Molecular/CustomIcons/components/Star.js +2 -9
  235. package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
  236. package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
  237. package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
  238. package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
  239. package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
  240. package/dist/Molecular/CustomIcons/components/User.js +2 -9
  241. package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
  242. package/dist/Molecular/CustomIcons/components/X.js +2 -9
  243. package/dist/Molecular/CustomIcons/index.js +0 -122
  244. package/dist/Molecular/FormElement/FormElement.js +1 -12
  245. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
  246. package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
  247. package/dist/Molecular/InputAddress/InputAddress.js +65 -114
  248. package/dist/Molecular/InputPassword/InputPassword.js +5 -19
  249. package/dist/index.js +0 -2
  250. package/package.json +1 -1
  251. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
  252. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  253. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  254. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  255. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  256. 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, _selectorWrapper$getB, _listHeader$getBoundi, _listHeader$getBoundi2, _listFooter$getBoundi, _listFooter$getBoundi2;
257
-
217
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _selectorWrapper$getB, _listHeader$getBoundi, _listHeader$getBoundi2, _listFooter$getBoundi, _listFooter$getBoundi2;
258
218
  const listContainer = getListContainer();
259
219
  if (!listContainer || !isOpen) return false;
260
220
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
@@ -263,18 +223,16 @@ 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 selectorWrapper = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
268
228
  const dropdownList = listContainer.getElementsByClassName("tags-dropdown__list")[0];
269
229
  const listHeader = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__header")[0];
270
230
  const listFooter = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : selectorWrapper.getElementsByClassName("tags-dropdown__footer")[0];
271
- const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(selectorWrapper)) === 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
- let selectorWrapperHeight = selectorWrapper === null || selectorWrapper === void 0 ? void 0 : (_selectorWrapper$getB = selectorWrapper.getBoundingClientRect()) === null || _selectorWrapper$getB === void 0 ? void 0 : _selectorWrapper$getB.height;
273
- const maxSelectorWrapperHeight = 500 - ((_listHeader$getBoundi = listHeader === null || listHeader === void 0 ? void 0 : (_listHeader$getBoundi2 = listHeader.getBoundingClientRect()) === null || _listHeader$getBoundi2 === void 0 ? void 0 : _listHeader$getBoundi2.height) !== null && _listHeader$getBoundi !== void 0 ? _listHeader$getBoundi : 0) - ((_listFooter$getBoundi = listFooter === null || listFooter === void 0 ? void 0 : (_listFooter$getBoundi2 = listFooter.getBoundingClientRect()) === null || _listFooter$getBoundi2 === void 0 ? void 0 : _listFooter$getBoundi2.height) !== null && _listFooter$getBoundi !== void 0 ? _listFooter$getBoundi : 0);
274
-
231
+ const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(selectorWrapper)) === 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
+ let selectorWrapperHeight = selectorWrapper === null || selectorWrapper === void 0 || (_selectorWrapper$getB = selectorWrapper.getBoundingClientRect()) === null || _selectorWrapper$getB === void 0 ? void 0 : _selectorWrapper$getB.height;
233
+ const maxSelectorWrapperHeight = 500 - ((_listHeader$getBoundi = listHeader === null || listHeader === void 0 || (_listHeader$getBoundi2 = listHeader.getBoundingClientRect()) === null || _listHeader$getBoundi2 === void 0 ? void 0 : _listHeader$getBoundi2.height) !== null && _listHeader$getBoundi !== void 0 ? _listHeader$getBoundi : 0) - ((_listFooter$getBoundi = listFooter === null || listFooter === void 0 || (_listFooter$getBoundi2 = listFooter.getBoundingClientRect()) === null || _listFooter$getBoundi2 === void 0 ? void 0 : _listFooter$getBoundi2.height) !== null && _listFooter$getBoundi !== void 0 ? _listFooter$getBoundi : 0);
275
234
  if (!isMobile || !withMobileLogic) {
276
235
  var _getComputedStyle2, _dropdownListMaxHeigh;
277
-
278
236
  const dropdownListMaxHeightInPx = (_getComputedStyle2 = getComputedStyle(dropdownList)) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.maxHeight;
279
237
  const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_dropdownListMaxHeigh = dropdownListMaxHeightInPx === null || dropdownListMaxHeightInPx === void 0 ? void 0 : dropdownListMaxHeightInPx.replace("px", "")) !== null && _dropdownListMaxHeigh !== void 0 ? _dropdownListMaxHeigh : 0, 10);
280
238
  if (initListHeight === null && !isNaN(maxHeight)) setInitListHeight(maxHeight);
@@ -290,19 +248,18 @@ const TagsDropdown = _ref => {
290
248
  dropdownList.style.maxHeight = "".concat(maxSelectorWrapperHeight, "px");
291
249
  }
292
250
  };
293
-
294
251
  const renderListContainer = () => {
295
252
  const lc = getListContainer();
296
- if (!lc) return null; // eslint-disable-next-line no-use-before-define
253
+ if (!lc) return null;
297
254
 
255
+ // eslint-disable-next-line no-use-before-define
298
256
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
299
- }; // --- LIST CONTAINER FUNCTIONS END --- //
300
- // --- CREATABLE LOGIC BEGIN --- //
301
-
257
+ };
258
+ // --- LIST CONTAINER FUNCTIONS END --- //
302
259
 
260
+ // --- CREATABLE LOGIC BEGIN --- //
303
261
  const onOptionCreateClick = () => {
304
262
  var _onOptionCreate;
305
-
306
263
  const newOption = {
307
264
  label: searchValue,
308
265
  style: {
@@ -310,11 +267,11 @@ const TagsDropdown = _ref => {
310
267
  },
311
268
  isEditable: true,
312
269
  ref: /*#__PURE__*/(0, _react.createRef)()
313
- }; // eslint-disable-next-line no-promise-executor-return
270
+ };
314
271
 
272
+ // eslint-disable-next-line no-promise-executor-return
315
273
  ((_onOptionCreate = onOptionCreate === null || onOptionCreate === void 0 ? void 0 : onOptionCreate(newOption)) !== null && _onOptionCreate !== void 0 ? _onOptionCreate : new Promise(r => r())).then(result => {
316
274
  var _result$id;
317
-
318
275
  const tempId = Math.random().toString(16).slice(2);
319
276
  newOption.value = (_result$id = result === null || result === void 0 ? void 0 : result.id) !== null && _result$id !== void 0 ? _result$id : tempId;
320
277
  setOptions(state => [...state, newOption]);
@@ -322,16 +279,13 @@ const TagsDropdown = _ref => {
322
279
  onChangeHandler(newOption);
323
280
  });
324
281
  };
325
-
326
282
  const onOptionEditClick = (e, item) => {
327
- e === null || e === void 0 ? void 0 : e.preventDefault();
328
- e === null || e === void 0 ? void 0 : e.stopPropagation();
283
+ e === null || e === void 0 || e.preventDefault();
284
+ e === null || e === void 0 || e.stopPropagation();
329
285
  setEditingOption((editingOption === null || editingOption === void 0 ? void 0 : editingOption.value) === (item === null || item === void 0 ? void 0 : item.value) ? null : item);
330
286
  };
331
-
332
287
  const onOptionDeleteClick = () => {
333
288
  var _onOptionDelete;
334
-
335
289
  // eslint-disable-next-line no-promise-executor-return
336
290
  ((_onOptionDelete = onOptionDelete === null || onOptionDelete === void 0 ? void 0 : onOptionDelete(editingOption)) !== null && _onOptionDelete !== void 0 ? _onOptionDelete : new Promise(r => r())).then(() => {
337
291
  deleteChosen(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value);
@@ -344,29 +298,25 @@ const TagsDropdown = _ref => {
344
298
  setEditingOption(null);
345
299
  });
346
300
  };
347
-
348
301
  const saveEditingOption = () => {
349
302
  if (!(editingOption !== null && editingOption !== void 0 && editingOption.isChanged) || isEditingOptionError) {
350
303
  setEditingOption(null);
351
304
  return false;
352
305
  }
353
-
354
- onOptionEdit === null || onOptionEdit === void 0 ? void 0 : onOptionEdit(editingOption);
306
+ onOptionEdit === null || onOptionEdit === void 0 || onOptionEdit(editingOption);
355
307
  setOptions(options => options.map(option => {
356
308
  if (editingOption && option.value === (editingOption === null || editingOption === void 0 ? void 0 : editingOption.value)) {
357
- const tmp = { ...editingOption
309
+ const tmp = {
310
+ ...editingOption
358
311
  };
359
312
  setEditingOption(null);
360
313
  return tmp;
361
314
  }
362
-
363
315
  return option;
364
316
  }));
365
317
  };
366
-
367
318
  const setEditOptionModalStyles = () => {
368
319
  var _editingOption$ref, _el$getBoundingClient, _dropdownListWrapperR, _positionClasses, _positionClasses2;
369
-
370
320
  if (!editingOption || !(editOptionModalRef !== null && editOptionModalRef !== void 0 && editOptionModalRef.current)) return null;
371
321
  const modalSize = 200;
372
322
  const {
@@ -381,14 +331,14 @@ const TagsDropdown = _ref => {
381
331
  };
382
332
  const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
383
333
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
384
- const el = editingOption === null || editingOption === void 0 ? void 0 : (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
334
+ const el = editingOption === null || editingOption === void 0 || (_editingOption$ref = editingOption.ref) === null || _editingOption$ref === void 0 ? void 0 : _editingOption$ref.current;
385
335
  const {
386
336
  x,
387
337
  y,
388
338
  width,
389
339
  height
390
340
  } = (_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect()) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : {};
391
- const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
341
+ const containerPosition = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.getBoundingClientRect();
392
342
  const distanceToRight = windowWidth - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.x) - (containerPosition === null || containerPosition === void 0 ? void 0 : containerPosition.width);
393
343
  const distanceToBottom = windowHeight - y - scrollY - height;
394
344
  Object.values(positionClasses).map(className => editOptionModalRef.current.classList.remove(className));
@@ -400,7 +350,6 @@ const TagsDropdown = _ref => {
400
350
  editOptionModalRef.current.style.top = "".concat(y + scrollY + height, "px");
401
351
  editOptionModalRef.current.style.transform = "translate(".concat(xTranslate, ", ").concat(yTranslate, ")");
402
352
  };
403
-
404
353
  const renderEditOptionModal = () => {
405
354
  return /*#__PURE__*/_react.default.createElement("div", {
406
355
  key: "editOptionModal".concat(editingOption === null || editingOption === void 0 ? void 0 : editingOption.value),
@@ -410,7 +359,8 @@ const TagsDropdown = _ref => {
410
359
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section"))
411
360
  }, /*#__PURE__*/_react.default.createElement(_Input.default, {
412
361
  value: editingOption.label,
413
- onChange: v => setEditingOption(state => ({ ...state,
362
+ onChange: v => setEditingOption(state => ({
363
+ ...state,
414
364
  label: v
415
365
  })),
416
366
  error: isEditingOptionError,
@@ -432,132 +382,113 @@ const TagsDropdown = _ref => {
432
382
  className: (0, _classnames.default)("".concat(RC, "__edit-option-modal-section-colors"))
433
383
  }, COLORS.map(color => {
434
384
  var _editingOption$style;
435
-
436
385
  return /*#__PURE__*/_react.default.createElement("div", {
437
386
  key: color,
438
387
  className: "color-block",
439
388
  style: {
440
389
  backgroundColor: color
441
390
  },
442
- onClick: () => setEditingOption(state => ({ ...state,
443
- style: { ...state.style,
391
+ onClick: () => setEditingOption(state => ({
392
+ ...state,
393
+ style: {
394
+ ...state.style,
444
395
  backgroundColor: color
445
396
  }
446
397
  }))
447
- }, (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);
398
+ }, (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);
448
399
  }))));
449
- }; // --- CREATABLE LOGIC END --- //
450
- // --- GENERAL FUNCTIONS BEGIN --- //
451
-
400
+ };
401
+ // --- CREATABLE LOGIC END --- //
452
402
 
403
+ // --- GENERAL FUNCTIONS BEGIN --- //
453
404
  const handleClickOutside = e => {
454
405
  var _getListContainer, _editOptionModalRef$c;
455
-
456
406
  const {
457
407
  target
458
408
  } = e;
459
-
460
- if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current // &&
409
+ if (isOpen && !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) && !editOptionModalRef.current
410
+ // &&
461
411
  // (
462
412
  // customTriggerRef?.current ? customTriggerRef?.current?.contains(target) : true
463
413
  // )
464
414
  ) {
465
415
  setIsOpen(false);
466
- onDropdownListClose === null || onDropdownListClose === void 0 ? void 0 : onDropdownListClose(e);
416
+ onDropdownListClose === null || onDropdownListClose === void 0 || onDropdownListClose(e);
467
417
  } else if (editOptionModalRef.current && !((_editOptionModalRef$c = editOptionModalRef.current) !== null && _editOptionModalRef$c !== void 0 && _editOptionModalRef$c.contains(target))) {
468
- var _document, _document$getElementB2, _document$getElementB3, _document$getElementB4;
469
-
470
- 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();
418
+ var _document, _document$getElementB2, _document$getElementB3;
419
+ 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();
471
420
  }
472
421
  };
473
-
474
422
  const closeList = e => {
475
423
  var _inputRef$current;
476
-
477
424
  handleClickOutside(e);
478
- 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();
425
+ 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();
479
426
  };
480
-
481
427
  const isTargetInParent = target => {
482
428
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
483
-
484
429
  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;
485
- 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;
430
+ 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;
486
431
  return false;
487
432
  };
488
-
489
433
  const isItemMatchesSearch = item => {
490
434
  const title = item.title || item.label;
491
435
  return searchValue.length ? title === null || title === void 0 ? void 0 : title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
492
- }; // --- GENERAL FUNCTIONS END --- //
493
-
436
+ };
437
+ // --- GENERAL FUNCTIONS END --- //
494
438
 
495
439
  const prepareOptions = options => {
496
440
  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();
497
441
  };
498
-
499
442
  const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
500
443
  if (option.groupName) {
501
444
  var _option$list;
502
-
503
- 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));
504
-
445
+ const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
505
446
  if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
506
- result.push({ ...option,
447
+ result.push({
448
+ ...option,
507
449
  list: filteredGroupItems
508
450
  });
509
451
  }
510
452
  } else if (isItemMatchesSearch(option)) {
511
453
  result.push(option);
512
454
  }
513
-
514
455
  return result;
515
456
  }, []);
516
-
517
457
  const getTotalOptions = (0, _react.useCallback)(() => {
518
458
  return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
519
459
  if (item !== null && item !== void 0 && item.list) {
520
460
  var _item$list2;
521
-
522
- result += (item === null || item === void 0 ? void 0 : (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
461
+ result += (item === null || item === void 0 || (_item$list2 = item.list) === null || _item$list2 === void 0 ? void 0 : _item$list2.length) || 0;
523
462
  } else {
524
463
  ++result;
525
464
  }
526
-
527
465
  return result;
528
466
  }, 0);
529
467
  }, [options]);
530
-
531
468
  const onChangeHandler = item => {
532
469
  if (item !== null && item !== void 0 && item.isFreezed) return false;
533
-
534
470
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
535
471
  if (item.closeOnOptionSelect) setIsOpen(false);
536
472
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
537
-
538
473
  setSearchValueInterceptor("");
539
-
540
474
  if (chosenOptions.some(el => el === item.value)) {
541
475
  deleteChosen(item.value);
542
476
  return null;
543
477
  }
544
-
545
478
  if (isUseLocalOptionsStore) {
546
- setLocalOptionsStore(options => ({ ...options,
479
+ setLocalOptionsStore(options => ({
480
+ ...options,
547
481
  [item === null || item === void 0 ? void 0 : item.value]: item === null || item === void 0 ? void 0 : item.label
548
482
  }));
549
483
  }
550
-
551
484
  onChange([...chosenOptions, item.value], "chosenOptions");
552
485
  return null;
553
486
  };
554
-
555
487
  const onSearchHandler = name => {
556
488
  let inputValue = name;
557
489
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
558
490
  setSearchValueInterceptor(inputValue);
559
491
  };
560
-
561
492
  const onWrapperClick = e => {
562
493
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
563
494
  e.stopPropagation();
@@ -565,10 +496,8 @@ const TagsDropdown = _ref => {
565
496
  setIsOpen(false);
566
497
  }
567
498
  };
568
-
569
499
  const selectAllItems = () => {
570
500
  var _prepareOptions;
571
-
572
501
  const preparedOptions = (_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.filter(_ref7 => {
573
502
  let {
574
503
  isFreezed,
@@ -576,7 +505,6 @@ const TagsDropdown = _ref => {
576
505
  } = _ref7;
577
506
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
578
507
  });
579
-
580
508
  if (isUseLocalOptionsStore) {
581
509
  setLocalOptionsStore(options => preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.reduce((result, _ref8) => {
582
510
  let {
@@ -587,7 +515,6 @@ const TagsDropdown = _ref => {
587
515
  return result;
588
516
  }, options));
589
517
  }
590
-
591
518
  onChange([...chosenOptions, ...((preparedOptions === null || preparedOptions === void 0 ? void 0 : preparedOptions.map(_ref9 => {
592
519
  let {
593
520
  value
@@ -596,42 +523,37 @@ const TagsDropdown = _ref => {
596
523
  })) || [])], "chosenOptions");
597
524
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
598
525
  };
599
-
600
526
  const unselectAllItems = () => {
601
527
  if (isUseLocalOptionsStore) setLocalOptionsStore({});
602
528
  onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
603
- var _prepareOptions2, _prepareOptions2$find;
604
-
605
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(_ref10 => {
529
+ var _prepareOptions2;
530
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref10 => {
606
531
  let {
607
532
  value
608
533
  } = _ref10;
609
534
  return value === item;
610
- })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
535
+ })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
611
536
  }), "chosenOptions");
612
537
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
613
538
  };
614
-
615
539
  const doScrollCallback = (0, _react.useCallback)(e => {
616
540
  if (doLiveSearchRequest && typeof doLiveSearchRequest === "function") {
617
541
  if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
618
542
  doLiveSearchRequest(searchValueRef.current, true);
619
543
  }
620
544
  }
621
- }, [options]); // --- RENDER FUNCTIONS BEGIN --- //
545
+ }, [options]);
622
546
 
547
+ // --- RENDER FUNCTIONS BEGIN --- //
623
548
  const getMarkupForElement = item => {
624
549
  var _title$toString, _item$customMobileIco;
625
-
626
550
  const {
627
551
  description
628
552
  } = item;
629
553
  const title = item.title || item.label;
630
-
631
554
  const hightlightSearchValue = title => {
632
555
  var _title$toLowerCase;
633
-
634
- 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());
556
+ 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());
635
557
  if (index === -1) return title;
636
558
  return /*#__PURE__*/_react.default.createElement("pre", {
637
559
  className: "inherit-styles"
@@ -639,10 +561,9 @@ const TagsDropdown = _ref => {
639
561
  className: "search-match bg--yellow"
640
562
  }, 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))));
641
563
  };
642
-
643
564
  return /*#__PURE__*/_react.default.createElement("button", {
644
565
  ref: item === null || item === void 0 ? void 0 : item.ref,
645
- key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
566
+ key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
646
567
  onClick: e => {
647
568
  e.preventDefault();
648
569
  e.stopPropagation();
@@ -690,10 +611,8 @@ const TagsDropdown = _ref => {
690
611
  }
691
612
  }) : "");
692
613
  };
693
-
694
614
  const getListMarkUp = () => {
695
- var _filteredOptions$filt, _filteredOptions$filt2, _document$getElementB5;
696
-
615
+ var _filteredOptions$filt, _filteredOptions$filt2, _document$getElementB4;
697
616
  const filteredOptions = getFilteredOptions(options);
698
617
  return /*#__PURE__*/_react.default.createElement("div", {
699
618
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -737,9 +656,7 @@ const TagsDropdown = _ref => {
737
656
  setIsOpen(true);
738
657
  }
739
658
  }
740
- }, attributesOfNativeInput, withCreateLogic ? {
741
- symbolsLimit: 50
742
- } : {})))), headerContent && /*#__PURE__*/_react.default.createElement("div", {
659
+ }, attributesOfNativeInput)))), headerContent && /*#__PURE__*/_react.default.createElement("div", {
743
660
  className: (0, _classnames.default)("".concat(RC, "__header-row"))
744
661
  }, headerContent)) : null, withSearchInputInList && /*#__PURE__*/_react.default.createElement("div", {
745
662
  className: (0, _classnames.default)("".concat(RC, "__input-list-wrapper"))
@@ -754,10 +671,9 @@ const TagsDropdown = _ref => {
754
671
  ref: dropdownListRef,
755
672
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
756
673
  }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
757
- var _option$groupName, _option$groupName$toS, _option$list2;
758
-
674
+ var _option$groupName, _option$list2;
759
675
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
760
- 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()),
676
+ 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()),
761
677
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
762
678
  }, /*#__PURE__*/_react.default.createElement("span", {
763
679
  className: "".concat(RC, "-group__name")
@@ -781,7 +697,7 @@ const TagsDropdown = _ref => {
781
697
  })
782
698
  }, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
783
699
  onClick: () => setIsOpen(false)
784
- }, "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 && onOptionCreate && searchValue && singleLevelOptions.every(_ref14 => {
700
+ }, "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 => {
785
701
  let {
786
702
  label
787
703
  } = _ref14;
@@ -797,9 +713,8 @@ const TagsDropdown = _ref => {
797
713
  isNoDismiss: true
798
714
  }))));
799
715
  };
800
-
801
716
  const renderSearchInput = () => {
802
- return /*#__PURE__*/_react.default.createElement(_Input.default, {
717
+ return /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
803
718
  ref: inputRef,
804
719
  className: (0, _classnames.default)("".concat(RC, "__input"), {
805
720
  ["".concat(RC, "__input--in-list")]: withSearchInputInList
@@ -807,7 +722,8 @@ const TagsDropdown = _ref => {
807
722
  value: searchValue,
808
723
  onChange: onSearchHandler,
809
724
  placeholder: placeholder || "Select from list",
810
- attributesOfNativeInput: { ...attributesOfNativeInput,
725
+ attributesOfNativeInput: {
726
+ ...attributesOfNativeInput,
811
727
  onKeyDown: e => {
812
728
  if (e.keyCode === 13 && withCreateLogic && onOptionCreate && singleLevelOptions.every(_ref15 => {
813
729
  let {
@@ -817,19 +733,18 @@ const TagsDropdown = _ref => {
817
733
  })) {
818
734
  onOptionCreateClick();
819
735
  }
820
-
821
736
  onKeyPress(e, searchValue);
822
- } // onFocus: (e) => {
737
+ }
738
+ // onFocus: (e) => {
823
739
  // if (isMobile) e?.target?.blur();
824
740
  // },
825
-
826
741
  }
827
- });
742
+ }, withCreateLogic ? {
743
+ symbolsLimit: 50
744
+ } : {}));
828
745
  };
829
-
830
746
  const renderDropdownTrigger = (0, _react.useCallback)(() => {
831
747
  var _renderCustomTrigger;
832
-
833
748
  const renderDefaultDropdownTrigger = () => {
834
749
  return /*#__PURE__*/_react.default.createElement("div", {
835
750
  className: (0, _classnames.default)("".concat(RC, "__trigger"), {
@@ -840,7 +755,6 @@ const TagsDropdown = _ref => {
840
755
  let {
841
756
  target
842
757
  } = _ref16;
843
-
844
758
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") {
845
759
  setIsOpen(true);
846
760
  } else if (isTargetInParent(target)) {
@@ -885,7 +799,6 @@ const TagsDropdown = _ref => {
885
799
  className: "color--text"
886
800
  })));
887
801
  };
888
-
889
802
  return (_renderCustomTrigger = renderCustomTrigger === null || renderCustomTrigger === void 0 ? void 0 : renderCustomTrigger({
890
803
  chosenOptions,
891
804
  singleLevelOptions,
@@ -895,26 +808,24 @@ const TagsDropdown = _ref => {
895
808
  isOpen,
896
809
  setIsOpen
897
810
  })) !== null && _renderCustomTrigger !== void 0 ? _renderCustomTrigger : renderDefaultDropdownTrigger();
898
- }, [chosenOptions, singleLevelOptions, inputRef, isOpen]); // --- RENDER FUNCTIONS END --- //
811
+ }, [chosenOptions, singleLevelOptions, inputRef, isOpen]);
812
+ // --- RENDER FUNCTIONS END --- //
899
813
 
900
814
  (0, _react.useLayoutEffect)(() => {
901
815
  initListContainer();
902
816
  if (isDefaultOpened) setIsOpen(true);
903
817
  return () => {
904
818
  var _getListContainer2, _getListContainerWrap;
905
-
906
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
907
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
819
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
820
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
908
821
  };
909
822
  }, []);
910
823
  (0, _react.useLayoutEffect)(() => {
911
824
  var _getListContainer3;
912
-
913
825
  const onResize = () => {
914
826
  setListContainerStyles();
915
827
  setEditOptionModalStyles();
916
828
  };
917
-
918
829
  if (!isMobile) {
919
830
  window.addEventListener("resize", onResize);
920
831
  window.addEventListener("mousewheel", closeList);
@@ -928,28 +839,27 @@ const TagsDropdown = _ref => {
928
839
  window.removeEventListener("touchmove", closeList);
929
840
  window.removeEventListener("mouseup", handleClickOutside);
930
841
  }
931
-
932
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
842
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
933
843
  return () => {
934
844
  var _getListContainer4;
935
-
936
845
  window.removeEventListener("resize", onResize);
937
846
  window.removeEventListener("mousewheel", closeList);
938
847
  window.removeEventListener("mouseup", handleClickOutside);
939
848
  window.removeEventListener("scroll", closeList);
940
849
  window.removeEventListener("touchmove", closeList);
941
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
850
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
942
851
  };
943
852
  }, [getListContainer, isMobile]);
944
853
  (0, _react.useLayoutEffect)(() => {
945
854
  setListContainerStyles();
946
855
  setEditOptionModalStyles();
947
- }, [isOpen, optionsProp, 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]);
856
+ }, [isOpen, optionsProp, 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]);
948
857
  (0, _react.useEffect)(() => {
949
858
  if (isUseLocalOptionsStore && chosenOptions.length !== Object.keys(localOptionsStore).length) {
950
859
  options.map(option => {
951
860
  if (!(localOptionsStore !== null && localOptionsStore !== void 0 && localOptionsStore[option === null || option === void 0 ? void 0 : option.value])) {
952
- setLocalOptionsStore(options => ({ ...options,
861
+ setLocalOptionsStore(options => ({
862
+ ...options,
953
863
  [option === null || option === void 0 ? void 0 : option.value]: option === null || option === void 0 ? void 0 : option.label
954
864
  }));
955
865
  }
@@ -958,37 +868,28 @@ const TagsDropdown = _ref => {
958
868
  }, [chosenOptions, isUseLocalOptionsStore]);
959
869
  (0, _react.useEffect)(() => {
960
870
  var _selectAllButtonRef$c, _unselectAllButtonRef;
961
-
962
871
  const fn = isOpen ? "addEventListener" : "removeEventListener";
963
- selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
964
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
965
-
872
+ selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
873
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
966
874
  if (isOpen) {
967
875
  var _getListContainer5;
968
-
969
876
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
970
877
  customTriggerRef.current.style.pointerEvents = "none";
971
878
  }
972
-
973
- (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 ? void 0 : _getListContainer5.classList.add("tags-dropdown__container--opened");
974
-
879
+ (_getListContainer5 = getListContainer()) === null || _getListContainer5 === void 0 || _getListContainer5.classList.add("tags-dropdown__container--opened");
975
880
  if (!isMobile) {
976
881
  var _inputRef$current2, _inputRef$current2$fo;
977
-
978
- 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);
882
+ 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);
979
883
  } else {
980
884
  var _inputRef$current3, _inputRef$current3$bl;
981
-
982
- 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);
885
+ 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);
983
886
  }
984
887
  } else {
985
888
  var _getListContainer6;
986
-
987
889
  if (customTriggerRef !== null && customTriggerRef !== void 0 && customTriggerRef.current) {
988
890
  customTriggerRef.current.style.pointerEvents = "auto";
989
891
  }
990
-
991
- (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 ? void 0 : _getListContainer6.classList.remove("tags-dropdown__container--opened");
892
+ (_getListContainer6 = getListContainer()) === null || _getListContainer6 === void 0 || _getListContainer6.classList.remove("tags-dropdown__container--opened");
992
893
  if (withSearchInputInList) setSearchValueInterceptor("");
993
894
  }
994
895
  }, [isOpen]);
@@ -996,54 +897,46 @@ const TagsDropdown = _ref => {
996
897
  const setScrollTopValue = e => {
997
898
  setScrollTop(parseInt(e.target.scrollTop, 10));
998
899
  };
999
-
1000
900
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
1001
901
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
1002
-
1003
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
1004
- 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));
1005
-
902
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 || _dropdownListRef$curr.addEventListener("scroll", setScrollTopValue);
903
+ 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));
1006
904
  if (isScrollableList === null) {
1007
905
  var _dropdownListRef$curr4, _dropdownListRef$curr5;
1008
-
1009
- 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));
906
+ 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));
1010
907
  }
1011
908
  }
1012
-
1013
909
  if (isOpen && dropdownListRef && dropdownListRef.current) {
1014
910
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
1015
911
  }
1016
-
1017
912
  return () => {
1018
913
  var _dropdownListRef$curr6;
1019
-
1020
914
  removeEventListener("scroll", doScrollCallback);
1021
- dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
915
+ dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 || _dropdownListRef$curr6.removeEventListener("scroll", setScrollTopValue);
1022
916
  };
1023
- }, [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]);
917
+ }, [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]);
1024
918
  (0, _react.useEffect)(() => {
1025
919
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
1026
920
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
1027
-
1028
- 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));
921
+ 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));
1029
922
  }
1030
923
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
1031
924
  (0, _react.useEffect)(() => {
1032
925
  if (isSearchable && useLiveSearch && (debouncedSearchTerm || isValueDeleted || isOpen)) {
1033
- doLiveSearchRequest === null || doLiveSearchRequest === void 0 ? void 0 : doLiveSearchRequest(debouncedSearchTerm);
926
+ doLiveSearchRequest === null || doLiveSearchRequest === void 0 || doLiveSearchRequest(debouncedSearchTerm);
1034
927
  }
1035
928
  }, [isOpen, debouncedSearchTerm, isValueDeleted]);
1036
929
  (0, _react.useEffect)(() => {
1037
- setOptions(optionsProp.map(option => ({ ...option,
930
+ setOptions(optionsProp.map(option => ({
931
+ ...option,
1038
932
  ref: /*#__PURE__*/(0, _react.createRef)()
1039
933
  })));
1040
934
  }, [optionsProp]);
1041
935
  (0, _react.useEffect)(() => {
1042
936
  if (editingOption) {
1043
937
  var _editingOptionInputRe, _editingOptionInputRe2;
1044
-
1045
938
  setEditOptionModalStyles();
1046
- 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);
939
+ editingOptionInputRef === null || editingOptionInputRef === void 0 || (_editingOptionInputRe = editingOptionInputRef.current) === null || _editingOptionInputRe === void 0 || (_editingOptionInputRe2 = _editingOptionInputRe.focus) === null || _editingOptionInputRe2 === void 0 || _editingOptionInputRe2.call(_editingOptionInputRe);
1047
940
  }
1048
941
  }, [editingOption === null || editingOption === void 0 ? void 0 : editingOption.value]);
1049
942
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -1064,6 +957,4 @@ const TagsDropdown = _ref => {
1064
957
  onClick: onActionCancelClick
1065
958
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.X, null))), isOpen && renderListContainer());
1066
959
  };
1067
-
1068
- var _default = TagsDropdown;
1069
- exports.default = _default;
960
+ var _default = exports.default = TagsDropdown;