intelicoreact 1.4.21 → 1.4.23

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