intelicoreact 1.4.64 → 1.4.65

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 (267) 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/FileLoaderDescription/FileLoaderDescription.js +4 -20
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
  16. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +19 -35
  17. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +9 -38
  18. package/dist/Atomic/FormElements/Input/Input.js +25 -60
  19. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
  20. package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
  21. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
  22. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
  23. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
  24. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
  25. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
  26. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
  27. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +16 -46
  28. package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
  29. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
  30. package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
  31. package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
  32. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
  33. package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
  34. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +44 -137
  35. package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
  36. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
  37. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
  38. package/dist/Atomic/FormElements/Label/Label.js +1 -9
  39. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
  40. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
  41. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
  42. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
  43. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
  44. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
  45. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
  46. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
  47. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
  48. package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
  49. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
  50. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
  51. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
  52. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
  53. package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
  54. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
  55. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
  56. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
  57. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
  58. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
  59. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
  60. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  61. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
  62. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +6 -23
  63. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +103 -218
  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 +5 -16
  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 +72 -70
  107. package/dist/Atomic/UI/Hint/Hint.scss +20 -2
  108. package/dist/Atomic/UI/Modal/Modal.js +6 -28
  109. package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
  110. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
  111. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
  112. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
  113. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
  114. package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
  115. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  116. package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
  117. package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
  118. package/dist/Atomic/UI/Price/Price.js +3 -8
  119. package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
  120. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
  121. package/dist/Atomic/UI/Status/Status.js +1 -8
  122. package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
  123. package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
  124. package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
  125. package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
  126. package/dist/Atomic/UI/Table/Table.js +1 -12
  127. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
  128. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
  129. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
  130. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
  131. package/dist/Atomic/UI/Tag/Tag.js +11 -26
  132. package/dist/Atomic/UI/TagList/TagList.js +18 -41
  133. package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
  134. package/dist/Atomic/UI/WizardStepper/constructor.js +3 -11
  135. package/dist/Atomic/UI/WizardStepper/index.js +1 -5
  136. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +0 -10
  137. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
  138. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +2 -17
  139. package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
  140. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -15
  141. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
  142. package/dist/Atomic/UI/WizardStepper/ui/icons.js +2 -9
  143. package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
  144. package/dist/Classes/AbortableFetch.js +36 -93
  145. package/dist/Classes/AnimatedHandler.js +3 -7
  146. package/dist/Classes/RESTAPI/index.js +39 -42
  147. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
  148. package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
  149. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
  150. package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
  151. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
  152. package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
  153. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  154. package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
  155. package/dist/Constants/index.constants.js +8 -15
  156. package/dist/Functions/Portal.js +5 -16
  157. package/dist/Functions/customEventListener.js +4 -17
  158. package/dist/Functions/fieldValueFormatters.js +43 -83
  159. package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
  160. package/dist/Functions/locale/createTranslator.js +4 -9
  161. package/dist/Functions/operations.js +12 -22
  162. package/dist/Functions/presets/inputMaskPresets.js +9 -11
  163. package/dist/Functions/presets/inputPresets.js +8 -11
  164. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  165. package/dist/Functions/schemas.js +6 -13
  166. package/dist/Functions/useBodyScrollLock.js +1 -6
  167. package/dist/Functions/useClickOutside.js +0 -4
  168. package/dist/Functions/useDebounce.js +2 -7
  169. package/dist/Functions/useFieldFocus.js +6 -18
  170. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
  171. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
  172. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
  173. package/dist/Functions/useFormTools/functions/General.js +18 -28
  174. package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
  175. package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
  176. package/dist/Functions/useFormTools/index.js +85 -144
  177. package/dist/Functions/useInputHighlightError.js +3 -12
  178. package/dist/Functions/useIsMobile.js +7 -13
  179. package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
  180. package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
  181. package/dist/Functions/useLocalStorage.js +1 -9
  182. package/dist/Functions/useLocationParams.js +4 -5
  183. package/dist/Functions/useMediaQuery.js +3 -9
  184. package/dist/Functions/useMetaInfo.js +3 -10
  185. package/dist/Functions/useMouseUpOutside.js +0 -3
  186. package/dist/Functions/useOnlineStatus.js +1 -9
  187. package/dist/Functions/usePasswordChecker.js +4 -20
  188. package/dist/Functions/usePrevious.js +1 -5
  189. package/dist/Functions/useResize.js +2 -10
  190. package/dist/Functions/useScrollTo.js +2 -7
  191. package/dist/Functions/useToggle.js +1 -5
  192. package/dist/Functions/utils.js +56 -131
  193. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
  194. package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
  195. package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
  196. package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
  197. package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
  198. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
  199. package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
  200. package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
  201. package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
  202. package/dist/Molecular/CustomIcons/components/Button.js +2 -9
  203. package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
  204. package/dist/Molecular/CustomIcons/components/Check.js +2 -9
  205. package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
  206. package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
  207. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
  208. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
  209. package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
  210. package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
  211. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
  212. package/dist/Molecular/CustomIcons/components/Close.js +2 -9
  213. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
  214. package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
  215. package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
  216. package/dist/Molecular/CustomIcons/components/Email.js +2 -9
  217. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
  218. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
  219. package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
  220. package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
  221. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
  222. package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
  223. package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
  224. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
  225. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
  226. package/dist/Molecular/CustomIcons/components/Home.js +2 -9
  227. package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
  228. package/dist/Molecular/CustomIcons/components/Key.js +2 -9
  229. package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
  230. package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
  231. package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
  232. package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
  233. package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
  234. package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
  235. package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
  236. package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
  237. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
  238. package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
  239. package/dist/Molecular/CustomIcons/components/Play.js +2 -9
  240. package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
  241. package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
  242. package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
  243. package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
  244. package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
  245. package/dist/Molecular/CustomIcons/components/Star.js +2 -9
  246. package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
  247. package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
  248. package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
  249. package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
  250. package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
  251. package/dist/Molecular/CustomIcons/components/User.js +2 -9
  252. package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
  253. package/dist/Molecular/CustomIcons/components/X.js +2 -9
  254. package/dist/Molecular/CustomIcons/index.js +0 -122
  255. package/dist/Molecular/FormElement/FormElement.js +1 -12
  256. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
  257. package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
  258. package/dist/Molecular/InputAddress/InputAddress.js +65 -114
  259. package/dist/Molecular/InputPassword/InputPassword.js +5 -19
  260. package/dist/index.js +0 -2
  261. package/package.json +1 -1
  262. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
  263. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  264. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  265. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  266. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  267. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
@@ -1,35 +1,24 @@
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 _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _reactDom = require("react-dom");
15
-
16
11
  var _reactFeather = require("react-feather");
17
-
18
12
  var _utils = require("../../../Functions/utils");
19
-
20
13
  var _CustomIcons = require("./../../../Molecular/CustomIcons");
21
-
14
+ var _utils2 = require("./partials/_utils");
22
15
  require("./Hint.scss");
23
-
24
- 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); }
25
-
26
- 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; }
27
-
16
+ 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); }
17
+ 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; }
18
+ // ToDo - не понятно зачем (ф-я не используется), но не трогаю
28
19
  const time = (Date.now() * Math.random() / 1000).toString().replace(/\./g, "_");
29
-
30
20
  const Hint = _ref => {
31
21
  var _ref2, _label$replace;
32
-
33
22
  let {
34
23
  hint,
35
24
  side = "right",
@@ -46,86 +35,101 @@ const Hint = _ref => {
46
35
  isAccessability = false,
47
36
  testId = "test-hint"
48
37
  } = _ref;
49
- const [hintId, setHintId] = (0, _react.useState)((_ref2 = key !== null && key !== void 0 ? key : id) !== null && _ref2 !== void 0 ? _ref2 : Math.random().toString(16).slice(2));
50
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
51
38
  const hintRef = (0, _react.useRef)(null);
52
- const isCallbackExist = typeof onClickCallback === "function";
53
-
54
- const handleClickOutside = event => {
55
- if (!getHintContainer().contains(event === null || event === void 0 ? void 0 : event.target)) {
56
- setIsOpen(false);
57
- }
58
- };
59
-
60
- const getParentNode = () => {
61
- var _ref3, _document$querySelect;
62
-
63
- return (_ref3 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref3 !== void 0 ? _ref3 : document.body;
64
- };
65
-
66
- const initHintContainer = () => {
67
- var _getParentNode;
68
-
69
- const {
70
- className
71
- } = hintContainer;
72
- const hint = document.createElement("div");
73
- hint.setAttribute("id", hintId);
74
- hint.classList.add("hint__container");
75
- if (className) hint.classList.add(className);
76
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(hint);
77
- };
78
-
79
- const getHintContainer = () => {
80
- return document.getElementById(hintId);
81
- };
39
+ const [hintId] = (0, _react.useState)((_ref2 = key !== null && key !== void 0 ? key : id) !== null && _ref2 !== void 0 ? _ref2 : Math.random().toString(16).slice(2));
40
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
82
41
 
42
+ //? Определяем handleScroll-стейт, чтобы никогда не менять ссылку тем самым гарантировать корректную работу removeEventListener.
43
+ //? Инициализируем стейт вызовом конструктора HandleScrollObj, передаем setIsOpen для записи в объект.
44
+ const [handleScroll] = (0, _react.useState)(new _utils2.HandleScrollObj(setIsOpen));
45
+ //? По аналогии определяем handleClickOutside
46
+ const [handleClickOutside] = (0, _react.useState)(new _utils2.HandleClickOutsideObj(hintId, setIsOpen));
47
+ const isCallbackExist = typeof onClickCallback === "function";
83
48
  const getHintMarkUp = className => {
84
49
  return /*#__PURE__*/_react.default.createElement("div", {
85
50
  "data-testid": "test-hint-text",
86
51
  className: (0, _classnames.default)("hint__text", "hint__text_".concat(side), "hint--".concat(className, "__text"))
87
52
  }, hint, children);
88
53
  };
89
-
90
54
  const setHintContainerStyles = () => {
91
- var _sw$getBoundingClient, _ref4, _ref5, _ref6;
92
-
93
- const hc = getHintContainer();
55
+ var _ref3, _ref4, _ref5;
56
+ const hc = (0, _utils2.getHintContainer)(hintId);
94
57
  if (!hc || !isOpen) return false;
95
58
  const {
96
59
  width,
97
- left,
98
- top
60
+ top,
61
+ left
99
62
  } = (hintRef === null || hintRef === void 0 ? void 0 : hintRef.current.getBoundingClientRect()) || {};
100
63
  const {
101
64
  addWidth,
102
65
  addLeft,
103
66
  addTop
104
67
  } = hintContainer;
68
+ const windowInnerWidth = document.documentElement.clientWidth;
69
+ const windowInnerHeight = document.documentElement.clientHeight;
105
70
  const sw = hc.getElementsByClassName("hint__text")[0];
106
- const swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
107
- hc.style.width = isOpen ? (_ref4 = (!Number.isNaN(+addWidth) ? +addWidth : 0) + width) === null || _ref4 === void 0 ? void 0 : _ref4.toString().concat("px") : 0;
108
- hc.style.left = isOpen ? (_ref5 = (!Number.isNaN(+addLeft) ? +addLeft : 0) + left) === null || _ref5 === void 0 ? void 0 : _ref5.toString().concat("px") : 0;
109
- hc.style.top = isOpen ? (_ref6 = (!Number.isNaN(+addTop) ? +addTop : 0) + top) === null || _ref6 === void 0 ? void 0 : _ref6.toString().concat("px") : 0;
71
+ const {
72
+ width: swWidth,
73
+ height: swHeight
74
+ } = (sw === null || sw === void 0 ? void 0 : sw.getBoundingClientRect()) || {};
75
+ hc.style.width = isOpen ? (_ref3 = (!Number.isNaN(+addWidth) ? +addWidth : 0) + width) === null || _ref3 === void 0 ? void 0 : _ref3.toString().concat("px") : 0;
76
+ hc.style.left = isOpen ? (_ref4 = (!Number.isNaN(+addLeft) ? +addLeft : 0) + left) === null || _ref4 === void 0 ? void 0 : _ref4.toString().concat("px") : 0;
77
+ hc.style.top = isOpen ? (_ref5 = (!Number.isNaN(+addTop) ? +addTop : 0) + top) === null || _ref5 === void 0 ? void 0 : _ref5.toString().concat("px") : 0;
110
78
  hc.style.maxHeight = isOpen ? swHeight === null || swHeight === void 0 ? void 0 : swHeight.toString().concat("px") : 0;
111
- };
112
79
 
80
+ //? Базовое значение погрешности
81
+ //? В разных свитч-кейсах может использоваться по разному (вся или частично). Определял "на глазок"
82
+ const INACCURACY = 20;
83
+ switch (side) {
84
+ case 'top':
85
+ case 'centeredTop':
86
+ if (top - swHeight - INACCURACY / 2 < 0) {
87
+ sw.classList.remove("hint__text_".concat(side));
88
+ sw.classList.add("hint__text_".concat(side === 'top' ? 'bottom' : 'centeredBottom'));
89
+ }
90
+ break;
91
+ case 'bottom':
92
+ case 'centeredBottom':
93
+ if (top + swHeight + INACCURACY > windowInnerHeight) {
94
+ sw.classList.remove("hint__text_".concat(side));
95
+ sw.classList.add("hint__text_".concat(side === 'bottom' ? 'top' : 'centeredTop'));
96
+ }
97
+ break;
98
+ case 'left':
99
+ if (left - swWidth - INACCURACY / 2 < 0) {
100
+ sw.classList.remove("hint__text_".concat(side));
101
+ sw.classList.add('hint__text_right');
102
+ }
103
+ break;
104
+ case 'right':
105
+ default:
106
+ if (left + width + swWidth + INACCURACY / 2 > windowInnerWidth) {
107
+ sw.classList.remove("hint__text_".concat(side));
108
+ sw.classList.add('hint__text_left');
109
+ }
110
+ break;
111
+ }
112
+ };
113
113
  const renderHintContainer = className => {
114
- const hc = getHintContainer();
114
+ const hc = (0, _utils2.getHintContainer)(hintId);
115
115
  if (!hc) return null;
116
116
  return /*#__PURE__*/(0, _reactDom.createPortal)(getHintMarkUp(className), hc);
117
117
  };
118
-
119
118
  (0, _react.useEffect)(() => {
120
- initHintContainer();
119
+ (0, _utils2.initHintContainer)(hintId, hintContainer);
121
120
  }, []);
122
121
  (0, _react.useEffect)(() => {
123
122
  setHintContainerStyles();
123
+
124
+ //! Обеспечиваем работу колбэка ТОЛЬКО для открытых тултипов
125
+ if (isOpen) {
126
+ document.addEventListener("scroll", handleScroll, true);
127
+ document.addEventListener("click", handleClickOutside, true);
128
+ } else {
129
+ document.removeEventListener("scroll", handleScroll, true);
130
+ document.removeEventListener("click", handleClickOutside, true);
131
+ }
124
132
  }, [isOpen]);
125
- (0, _react.useEffect)(() => {
126
- document.addEventListener("click", handleClickOutside, true);
127
- return () => document.removeEventListener("click", handleClickOutside, true);
128
- }, []);
129
133
  return /*#__PURE__*/_react.default.createElement("div", {
130
134
  className: (0, _classnames.default)("hint", className),
131
135
  ref: hintRef
@@ -134,8 +138,8 @@ const Hint = _ref => {
134
138
  "data-testid": typeof label === "string" && label.length ? (_label$replace = label.replace) === null || _label$replace === void 0 ? void 0 : _label$replace.call(label, /\s/g, "-") : testId,
135
139
  "aria-label": isAccessability && label || "",
136
140
  onClick: () => handleOpenType === "click" && (isCallbackExist ? onClickCallback() : setIsOpen(!isOpen)),
137
- onMouseEnter: () => handleOpenType === "hover" && setIsOpen(!isOpen),
138
- onMouseLeave: () => handleOpenType === "hover" && handleClickOutside(),
141
+ onMouseEnter: () => handleOpenType === "hover" && setIsOpen(true),
142
+ onMouseLeave: () => handleOpenType === "hover" && setIsOpen(false),
139
143
  className: (0, _classnames.default)("hint__button", {
140
144
  hint__button_active: isOpen
141
145
  })
@@ -156,6 +160,4 @@ const Hint = _ref => {
156
160
  })
157
161
  }, (0, _utils.capitalized)(label))), isOpen && renderHintContainer(className));
158
162
  };
159
-
160
- var _default = Hint;
161
- exports.default = _default;
163
+ var _default = exports.default = Hint;
@@ -91,7 +91,10 @@
91
91
 
92
92
  &_right {
93
93
  top: -4px;
94
- left: 24px;
94
+
95
+ // ToDo - есть вероятность поломки позиционирования хинтов. Если сломается - откатить
96
+ // left: 24px;
97
+ left: calc(100% + 8px);
95
98
 
96
99
  &::before {
97
100
  top: 8px;
@@ -101,7 +104,11 @@
101
104
 
102
105
  &_left {
103
106
  top: -4px;
104
- right: 28px;
107
+
108
+ // ToDo - есть вероятность поломки позиционирования хинтов. Если сломается - откатить
109
+ // right: 28px;
110
+ left: unset;
111
+ right: calc(100% + 8px);
105
112
 
106
113
  &::before {
107
114
  top: 8px;
@@ -118,6 +125,17 @@
118
125
  left: 8px;
119
126
  }
120
127
  }
128
+
129
+ &_centeredTop {
130
+ bottom: 8px;
131
+ left: 50%;
132
+ transform: translateX(-50%);
133
+
134
+ &::before {
135
+ bottom: -4.25px;
136
+ left: calc(50% - 8px);
137
+ }
138
+ }
121
139
  }
122
140
 
123
141
  &__icon.outlined {
@@ -1,42 +1,26 @@
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.renderModalTitle = exports.default = exports.KEY_CODE = 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 _Button = _interopRequireDefault(require("../Button/Button"));
17
-
18
12
  var _useHandleKeyPress = _interopRequireDefault(require("./../../../Functions/useKeyPress/useHandleKeyPress"));
19
-
20
13
  var _ModalFooter = _interopRequireDefault(require("./partials/ModalFooter"));
21
-
22
14
  var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
23
-
24
15
  var _useMobileModal = _interopRequireDefault(require("./partials/useMobileModal"));
25
-
26
16
  require("./Modal.scss");
27
-
28
17
  require("./ModalMobile.scss");
29
-
30
- 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); }
31
-
32
- 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; }
33
-
34
- const KEY_CODE = Object.freeze({
18
+ 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); }
19
+ 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; }
20
+ const KEY_CODE = exports.KEY_CODE = Object.freeze({
35
21
  ENTER: 13,
36
22
  ESC: 27
37
23
  });
38
- exports.KEY_CODE = KEY_CODE;
39
-
40
24
  const renderModalTitle = _ref => {
41
25
  let {
42
26
  mode,
@@ -46,9 +30,7 @@ const renderModalTitle = _ref => {
46
30
  if (mode && mode !== "default" && !onlyTitle) return "".concat(mode[0].toUpperCase() + mode.slice(1), " ").concat(title);
47
31
  return title;
48
32
  };
49
-
50
33
  exports.renderModalTitle = renderModalTitle;
51
-
52
34
  const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
53
35
  let {
54
36
  zIndex = 100,
@@ -111,12 +93,12 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
111
93
  });
112
94
  const handle = {
113
95
  confirm: () => {
114
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
96
+ onConfirm === null || onConfirm === void 0 || onConfirm();
115
97
  },
116
98
  decline: () => {
117
99
  //? closeModal используется для ESC и оверлея, давно хотелось иметь возможность разделить
118
100
  //? Теперь можно не передавать closeModal, а для cancel-кнопки передать отдельный обработчик
119
- if (typeof onDecline === "function") onDecline();else closeModal === null || closeModal === void 0 ? void 0 : closeModal();
101
+ if (typeof onDecline === "function") onDecline();else closeModal === null || closeModal === void 0 || closeModal();
120
102
  }
121
103
  };
122
104
  (0, _useHandleKeyPress.default)({
@@ -124,7 +106,6 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
124
106
  escCallback: closeOnEsc && typeof closeModal === "function" ? () => closeModal() : null,
125
107
  withClamping: false
126
108
  });
127
-
128
109
  const render = () => !isOpen ? null : /*#__PURE__*/_react.default.createElement("div", {
129
110
  style: {
130
111
  zIndex
@@ -194,9 +175,6 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
194
175
  icon: confirmBtnIcon,
195
176
  isIconRight: isConfirmBtnIconPositionRight
196
177
  }))))))));
197
-
198
178
  return render();
199
179
  });
200
-
201
- var _default = Modal;
202
- exports.default = _default;
180
+ var _default = exports.default = Modal;
@@ -1,20 +1,14 @@
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 _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _useHandleKeyPress = _interopRequireDefault(require("../../../Functions/useKeyPress/useHandleKeyPress"));
15
-
16
11
  require("./Modal.scss");
17
-
18
12
  const Modal = _ref => {
19
13
  let {
20
14
  zIndex = 100,
@@ -48,6 +42,4 @@ const Modal = _ref => {
48
42
  className: (0, _classnames.default)(className, "modal")
49
43
  }, children));
50
44
  };
51
-
52
- var _default = Modal;
53
- exports.default = _default;
45
+ var _default = exports.default = Modal;
@@ -1,16 +1,12 @@
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 _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  const ModalFooter = _ref => {
15
11
  let {
16
12
  className = "",
@@ -22,6 +18,4 @@ const ModalFooter = _ref => {
22
18
  className: (0, _classnames.default)("modal__footer", className)
23
19
  }, children);
24
20
  };
25
-
26
- var _default = ModalFooter;
27
- exports.default = _default;
21
+ var _default = exports.default = ModalFooter;
@@ -1,18 +1,13 @@
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 _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _reactFeather = require("react-feather");
15
-
16
11
  const ModalTitle = _ref => {
17
12
  let {
18
13
  variant = "primary",
@@ -42,6 +37,4 @@ const ModalTitle = _ref => {
42
37
  className: "modal-close-icon"
43
38
  })));
44
39
  };
45
-
46
- var _default = ModalTitle;
47
- exports.default = _default;
40
+ var _default = exports.default = ModalTitle;
@@ -1,28 +1,20 @@
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 = useMobileModal;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _useIsMobile = _interopRequireDefault(require("../../../../Functions/useIsMobile"));
13
-
14
- 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); }
15
-
16
- 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; }
17
-
10
+ 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); }
11
+ 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; }
18
12
  const SCROLL_DIRECTION = {
19
13
  UP: "up",
20
14
  DOWN: "down"
21
15
  };
22
-
23
16
  function useMobileModal(_ref) {
24
- var _modalMobileHeaderRef5, _modalMobileHeaderRef6, _modalMobileFooterRef5, _modalMobileFooterRef6;
25
-
17
+ var _modalMobileHeaderRef3, _modalMobileFooterRef3;
26
18
  let {
27
19
  modalRef = null,
28
20
  withMobileLogic = false,
@@ -52,12 +44,11 @@ function useMobileModal(_ref) {
52
44
  const [scrollTop, setScrollTop] = (0, _react.useState)(0);
53
45
  const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
54
46
  const [containerScrollHeight, setContainerScrollHeight] = (0, _react.useState)(1);
47
+
55
48
  /* MODALS LOGIC | BEGIN */
56
49
  // Count ScrollTop
57
-
58
50
  (0, _react.useLayoutEffect)(() => {
59
51
  const el = modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current;
60
-
61
52
  if (el) {
62
53
  el.addEventListener("scroll", () => {
63
54
  setScrollTop(scrollTop => {
@@ -66,38 +57,35 @@ function useMobileModal(_ref) {
66
57
  });
67
58
  });
68
59
  }
69
- }, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]); // Count ScrollDirection
70
-
60
+ }, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]);
61
+ // Count ScrollDirection
71
62
  (0, _react.useEffect)(() => {
72
63
  setScrollDirection(prevScrollDirection => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection);
73
- }, [scrollTop, scrollTopPrev]); // Dynamic Modal Positioning
74
-
64
+ }, [scrollTop, scrollTopPrev]);
65
+ // Dynamic Modal Positioning
75
66
  (0, _react.useLayoutEffect)(() => {
76
67
  if (isOpen) {
77
68
  const modalStyle = modalRef !== null && modalRef !== void 0 && modalRef.current ? (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current.currentStyle) || window.getComputedStyle(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) : {};
78
69
  const computedModalHeight = modalRef !== null && modalRef !== void 0 && modalRef.current ? modalHeight + parseFloat((modalStyle === null || modalStyle === void 0 ? void 0 : modalStyle.marginTop) || 0) : 0;
79
70
  const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
80
-
81
71
  if (modalMobileContainerRef !== null && modalMobileContainerRef !== void 0 && modalMobileContainerRef.current) {
82
72
  if (computedModalHeight <= windowHeight) {
83
73
  modalMobileContainerRef.current.style.display = "flex";
84
74
  modalMobileContainerRef.current.style.alignItems = "flex-end";
85
75
  } else {
86
- var _modalMobileContainer, _modalMobileContainer2, _modalMobileContainer3, _modalMobileContainer4;
87
-
88
- (_modalMobileContainer = modalMobileContainerRef.current) === null || _modalMobileContainer === void 0 ? void 0 : (_modalMobileContainer2 = _modalMobileContainer.style) === null || _modalMobileContainer2 === void 0 ? void 0 : _modalMobileContainer2.removeProperty("display");
89
- (_modalMobileContainer3 = modalMobileContainerRef.current) === null || _modalMobileContainer3 === void 0 ? void 0 : (_modalMobileContainer4 = _modalMobileContainer3.style) === null || _modalMobileContainer4 === void 0 ? void 0 : _modalMobileContainer4.removeProperty("align-items");
76
+ var _modalMobileContainer, _modalMobileContainer2;
77
+ (_modalMobileContainer = modalMobileContainerRef.current) === null || _modalMobileContainer === void 0 || (_modalMobileContainer = _modalMobileContainer.style) === null || _modalMobileContainer === void 0 || _modalMobileContainer.removeProperty("display");
78
+ (_modalMobileContainer2 = modalMobileContainerRef.current) === null || _modalMobileContainer2 === void 0 || (_modalMobileContainer2 = _modalMobileContainer2.style) === null || _modalMobileContainer2 === void 0 || _modalMobileContainer2.removeProperty("align-items");
90
79
  }
91
80
  }
92
81
  }
93
- }, [modalsLogicProps, isOpen, isMobile, modalHeight]); // Calculating
82
+ }, [modalsLogicProps, isOpen, isMobile, modalHeight]);
94
83
 
84
+ // Calculating
95
85
  (0, _react.useLayoutEffect)(() => {
96
86
  if (isMobile && isOpen) {
97
- var _modalRef$current, _modalRef$current$get;
98
-
99
- const newModalHeight = modalRef === null || modalRef === void 0 ? void 0 : (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 ? void 0 : (_modalRef$current$get = _modalRef$current.getBoundingClientRect()) === null || _modalRef$current$get === void 0 ? void 0 : _modalRef$current$get.height;
100
-
87
+ var _modalRef$current;
88
+ const newModalHeight = modalRef === null || modalRef === void 0 || (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || (_modalRef$current = _modalRef$current.getBoundingClientRect()) === null || _modalRef$current === void 0 ? void 0 : _modalRef$current.height;
101
89
  if (modalHeight !== newModalHeight) {
102
90
  setModalHeight(newModalHeight);
103
91
  }
@@ -118,38 +106,35 @@ function useMobileModal(_ref) {
118
106
  }
119
107
  }, [scrollTop, scrollHeight, isMobile, withMobileLogic, scrollDirection, modalsLogicProps, modalHeight, window.innerHeight]);
120
108
  (0, _react.useLayoutEffect)(() => {
121
- var _modalMobileHeaderRef, _modalMobileHeaderRef2;
122
-
123
- if ((modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef2 = _modalMobileHeaderRef.getBoundingClientRect()) === null || _modalMobileHeaderRef2 === void 0 ? void 0 : _modalMobileHeaderRef2.height) !== undefined) {
109
+ var _modalMobileHeaderRef;
110
+ if ((modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef = _modalMobileHeaderRef.getBoundingClientRect()) === null || _modalMobileHeaderRef === void 0 ? void 0 : _modalMobileHeaderRef.height) !== undefined) {
124
111
  setModalsLogicProps(state => {
125
- var _modalMobileHeaderRef3, _modalMobileHeaderRef4;
126
-
127
- return { ...state,
128
- headerHeight: modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef3 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef3 === void 0 ? void 0 : (_modalMobileHeaderRef4 = _modalMobileHeaderRef3.getBoundingClientRect()) === null || _modalMobileHeaderRef4 === void 0 ? void 0 : _modalMobileHeaderRef4.height
112
+ var _modalMobileHeaderRef2;
113
+ return {
114
+ ...state,
115
+ headerHeight: modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef2 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef2 === void 0 || (_modalMobileHeaderRef2 = _modalMobileHeaderRef2.getBoundingClientRect()) === null || _modalMobileHeaderRef2 === void 0 ? void 0 : _modalMobileHeaderRef2.height
129
116
  };
130
117
  });
131
118
  }
132
- }, [modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef5 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef5 === void 0 ? void 0 : (_modalMobileHeaderRef6 = _modalMobileHeaderRef5.getBoundingClientRect()) === null || _modalMobileHeaderRef6 === void 0 ? void 0 : _modalMobileHeaderRef6.height]);
119
+ }, [modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef3 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef3 === void 0 || (_modalMobileHeaderRef3 = _modalMobileHeaderRef3.getBoundingClientRect()) === null || _modalMobileHeaderRef3 === void 0 ? void 0 : _modalMobileHeaderRef3.height]);
133
120
  (0, _react.useLayoutEffect)(() => {
134
- var _modalMobileFooterRef, _modalMobileFooterRef2;
135
-
136
- if ((modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef2 = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.height) !== undefined) {
121
+ var _modalMobileFooterRef;
122
+ if ((modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 || (_modalMobileFooterRef = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef === void 0 ? void 0 : _modalMobileFooterRef.height) !== undefined) {
137
123
  setModalsLogicProps(state => {
138
- var _modalMobileFooterRef3, _modalMobileFooterRef4;
139
-
140
- return { ...state,
141
- footerHeight: modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef3 = modalMobileFooterRef.current) === null || _modalMobileFooterRef3 === void 0 ? void 0 : (_modalMobileFooterRef4 = _modalMobileFooterRef3.getBoundingClientRect()) === null || _modalMobileFooterRef4 === void 0 ? void 0 : _modalMobileFooterRef4.height
124
+ var _modalMobileFooterRef2;
125
+ return {
126
+ ...state,
127
+ footerHeight: modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef2 = modalMobileFooterRef.current) === null || _modalMobileFooterRef2 === void 0 || (_modalMobileFooterRef2 = _modalMobileFooterRef2.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.height
142
128
  };
143
129
  });
144
130
  }
145
- }, [modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef5 = modalMobileFooterRef.current) === null || _modalMobileFooterRef5 === void 0 ? void 0 : (_modalMobileFooterRef6 = _modalMobileFooterRef5.getBoundingClientRect()) === null || _modalMobileFooterRef6 === void 0 ? void 0 : _modalMobileFooterRef6.height]);
131
+ }, [modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef3 = modalMobileFooterRef.current) === null || _modalMobileFooterRef3 === void 0 || (_modalMobileFooterRef3 = _modalMobileFooterRef3.getBoundingClientRect()) === null || _modalMobileFooterRef3 === void 0 ? void 0 : _modalMobileFooterRef3.height]);
146
132
  (0, _react.useEffect)(() => {
147
133
  if (modalMobileContainerRef !== null && modalMobileContainerRef !== void 0 && modalMobileContainerRef.current) {
148
- var _modalMobileContainer5, _modalMobileContainer6;
149
-
134
+ var _modalMobileContainer3, _modalMobileContainer4;
150
135
  // eslint-disable-next-line no-unsafe-optional-chaining
151
- setContainerScrollHeight(modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : (_modalMobileContainer5 = modalMobileContainerRef.current) === null || _modalMobileContainer5 === void 0 ? void 0 : _modalMobileContainer5.scrollHeight);
152
- setScrollHeight((modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : (_modalMobileContainer6 = modalMobileContainerRef.current) === null || _modalMobileContainer6 === void 0 ? void 0 : _modalMobileContainer6.scrollHeight) - window.innerHeight);
136
+ setContainerScrollHeight(modalMobileContainerRef === null || modalMobileContainerRef === void 0 || (_modalMobileContainer3 = modalMobileContainerRef.current) === null || _modalMobileContainer3 === void 0 ? void 0 : _modalMobileContainer3.scrollHeight);
137
+ setScrollHeight((modalMobileContainerRef === null || modalMobileContainerRef === void 0 || (_modalMobileContainer4 = modalMobileContainerRef.current) === null || _modalMobileContainer4 === void 0 ? void 0 : _modalMobileContainer4.scrollHeight) - window.innerHeight);
153
138
  }
154
139
  }, [scrollTop, modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current, window.innerHeight]);
155
140
  (0, _react.useEffect)(() => {
@@ -168,11 +153,9 @@ function useMobileModal(_ref) {
168
153
  ref: modalMobileContainerRef
169
154
  }, modal);
170
155
  };
171
-
172
156
  const renderModal = modal => {
173
157
  return isMobile && withMobileLogic ? renderMobileModal(modal) : modal;
174
158
  };
175
-
176
159
  return {
177
160
  modalMobileContainerRef,
178
161
  modalMobileHeaderRef,