intelicoreact 1.3.22 → 1.3.24

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 (283) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +5 -8
  2. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.scss +9 -9
  3. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +6 -9
  4. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.scss +8 -10
  5. package/dist/Atomic/FormElements/Calendar/Calendar.js +31 -33
  6. package/dist/Atomic/FormElements/Calendar/Calendar.scss +23 -27
  7. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +4 -4
  8. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +16 -19
  9. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -1
  10. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.scss +2 -2
  11. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +53 -53
  12. package/dist/Atomic/FormElements/Datepicker/Datepicker.scss +0 -8
  13. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +20 -20
  14. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +81 -83
  15. package/dist/Atomic/FormElements/Dropdown/Dropdown.scss +141 -95
  16. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -1
  17. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.scss +3 -3
  18. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +30 -28
  19. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.scss +54 -18
  20. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +4 -4
  21. package/dist/Atomic/FormElements/FileLoader/FileLoader.scss +31 -30
  22. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +12 -12
  23. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +3 -3
  24. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +8 -8
  25. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +44 -29
  26. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +17 -15
  27. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +15 -15
  28. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.scss +24 -21
  29. package/dist/Atomic/FormElements/Input/Input.js +43 -45
  30. package/dist/Atomic/FormElements/Input/Input.scss +18 -18
  31. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +19 -19
  32. package/dist/Atomic/FormElements/InputColor/InputColor.js +7 -9
  33. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +12 -12
  34. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.scss +9 -6
  35. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +42 -42
  36. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.scss +95 -95
  37. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +10 -10
  38. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -81
  39. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +14 -14
  40. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +4 -4
  41. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +54 -54
  42. package/dist/Atomic/FormElements/InputLink/InputLink.js +11 -13
  43. package/dist/Atomic/FormElements/InputLink/InputLink.scss +5 -5
  44. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +2 -2
  45. package/dist/Atomic/FormElements/InputMask/InputMask.js +66 -67
  46. package/dist/Atomic/FormElements/InputMask/InputMask.scss +10 -10
  47. package/dist/Atomic/FormElements/InputMask/config.js +9 -9
  48. package/dist/Atomic/FormElements/InputMask/functions.js +8 -7
  49. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +42 -42
  50. package/dist/Atomic/FormElements/InputMask2/InputMask2.scss +13 -12
  51. package/dist/Atomic/FormElements/InputMask2/config.js +9 -9
  52. package/dist/Atomic/FormElements/InputMask2/functions.js +8 -7
  53. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +50 -50
  54. package/dist/Atomic/FormElements/InputMask3/InputMask3.scss +13 -12
  55. package/dist/Atomic/FormElements/InputMask3/config.js +9 -9
  56. package/dist/Atomic/FormElements/InputMask3/functions.js +8 -7
  57. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +7 -9
  58. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.scss +34 -31
  59. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +23 -23
  60. package/dist/Atomic/FormElements/InputsRow/InputsRow.scss +4 -5
  61. package/dist/Atomic/FormElements/Label/Label.js +2 -2
  62. package/dist/Atomic/FormElements/Label/Label.scss +2 -2
  63. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +69 -69
  64. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +8 -9
  65. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +2 -2
  66. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.scss +2 -2
  67. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +27 -27
  68. package/dist/Atomic/FormElements/NumericInput/NumericInput.scss +18 -18
  69. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +3 -3
  70. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.scss +1 -0
  71. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +6 -6
  72. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.scss +1 -0
  73. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +2 -2
  74. package/dist/Atomic/FormElements/RadioInput/RadioInput.scss +4 -8
  75. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +7 -7
  76. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.scss +26 -25
  77. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +24 -24
  78. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +17 -19
  79. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +30 -30
  80. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.scss +5 -5
  81. package/dist/Atomic/FormElements/RangeList/RangeList.js +27 -27
  82. package/dist/Atomic/FormElements/RangeList/RangeList.scss +23 -23
  83. package/dist/Atomic/FormElements/RangeList/partial/AnyOuterClass.scss +5 -4
  84. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -1
  85. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +31 -31
  86. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.scss +19 -24
  87. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.scss +7 -7
  88. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider.stories.scss +8 -8
  89. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +22 -22
  90. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.scss +165 -91
  91. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -1
  92. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.scss +2 -2
  93. package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -1
  94. package/dist/Atomic/FormElements/Switcher/Switcher.scss +10 -12
  95. package/dist/Atomic/FormElements/Switcher/partial/AnyOuterClass.scss +2 -2
  96. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +4 -6
  97. package/dist/Atomic/FormElements/SwitcherCheckbox/partial/AnyOuterClass.scss +2 -2
  98. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +2 -2
  99. package/dist/Atomic/FormElements/SwitcherHide/partial/AnyOuterClass.scss +2 -2
  100. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +4 -4
  101. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.scss +1 -1
  102. package/dist/Atomic/FormElements/SwitcherRadio/partial/AnyOuterClass.scss +2 -2
  103. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +5 -5
  104. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +2 -2
  105. package/dist/Atomic/FormElements/SwitcherRangeList/partial/AnyOuterClass.scss +6 -6
  106. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +9 -9
  107. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.scss +2 -3
  108. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/AnyOuterClass.scss +2 -2
  109. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +100 -100
  110. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +5 -5
  111. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.scss +2 -3
  112. package/dist/Atomic/FormElements/SwitcherTextarea/partial/AnyOuterClass.scss +4 -4
  113. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +67 -68
  114. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +103 -64
  115. package/dist/Atomic/FormElements/Text/Text.js +13 -13
  116. package/dist/Atomic/FormElements/Text/Text.scss +0 -1
  117. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +4 -4
  118. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.scss +15 -15
  119. package/dist/Atomic/FormElements/Textarea/Textarea.js +2 -2
  120. package/dist/Atomic/FormElements/Textarea/Textarea.scss +7 -8
  121. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +3 -3
  122. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.scss +5 -6
  123. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +9 -9
  124. package/dist/Atomic/FormElements/TimeRange/TimeRange.scss +1 -1
  125. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +36 -37
  126. package/dist/Atomic/FormElements/UserContacts/partial/AnyOuterClass.scss +5 -6
  127. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +3 -3
  128. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.scss +77 -59
  129. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -3
  130. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.scss +9 -10
  131. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/AnyOuterClass.scss +16 -14
  132. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +18 -18
  133. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +6 -6
  134. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.scss +9 -10
  135. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/AnyOuterClass.scss +16 -14
  136. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +14 -14
  137. package/dist/Atomic/Layout/Header/Header.js +11 -11
  138. package/dist/Atomic/Layout/Header/Header.scss +9 -10
  139. package/dist/Atomic/Layout/MainMenu/MainMenu.js +17 -18
  140. package/dist/Atomic/Layout/MainMenu/MainMenu.scss +14 -17
  141. package/dist/Atomic/Layout/Spinner/Spinner.js +4 -4
  142. package/dist/Atomic/Layout/Spinner/Spinner.scss +3 -3
  143. package/dist/Atomic/UI/Accordion/Accordion.js +7 -7
  144. package/dist/Atomic/UI/Accordion/Accordion.scss +11 -11
  145. package/dist/Atomic/UI/Accordion/AccordionItem.js +12 -12
  146. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +22 -23
  147. package/dist/Atomic/UI/AccordionTable/AccordionTable.scss +33 -38
  148. package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -3
  149. package/dist/Atomic/UI/AccordionText/AccordionText.scss +18 -10
  150. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +31 -32
  151. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +5 -5
  152. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.scss +19 -18
  153. package/dist/Atomic/UI/Alert/Alert.js +5 -5
  154. package/dist/Atomic/UI/Alert/Alert.scss +21 -21
  155. package/dist/Atomic/UI/Arrow/Arrow.js +5 -5
  156. package/dist/Atomic/UI/Box/Box.js +10 -10
  157. package/dist/Atomic/UI/Box/Box.scss +2 -4
  158. package/dist/Atomic/UI/Button/Button.js +9 -9
  159. package/dist/Atomic/UI/Button/Button.scss +34 -34
  160. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +4 -4
  161. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.scss +1 -1
  162. package/dist/Atomic/UI/Chart/Chart.js +16 -16
  163. package/dist/Atomic/UI/Chart/Chart.scss +4 -4
  164. package/dist/Atomic/UI/Chart/partial/AnyOuterClass.scss +10 -14
  165. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +30 -30
  166. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +3 -3
  167. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.scss +1 -1
  168. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +15 -15
  169. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +28 -28
  170. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +2 -2
  171. package/dist/Atomic/UI/Chart/partial/utils.js +4 -4
  172. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +9 -9
  173. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.scss +7 -9
  174. package/dist/Atomic/UI/DateTime/DateTime.js +6 -6
  175. package/dist/Atomic/UI/DateTime/DateTime.scss +1 -1
  176. package/dist/Atomic/UI/DateTime/partial/AnyOuterClass.scss +2 -2
  177. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -4
  178. package/dist/Atomic/UI/DebugContainer/DebugContainer.scss +15 -9
  179. package/dist/Atomic/UI/DoubleString/DoubleString.js +6 -6
  180. package/dist/Atomic/UI/DoubleString/DoubleString.scss +11 -5
  181. package/dist/Atomic/UI/DoubleString/partial/AnyOuterClass.scss +4 -4
  182. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -1
  183. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +48 -48
  184. package/dist/Atomic/UI/ExampleChartIntegration/partial/AnyOuterClass.scss +10 -15
  185. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +18 -18
  186. package/dist/Atomic/UI/Hint/Hint.js +40 -41
  187. package/dist/Atomic/UI/Hint/Hint.scss +12 -11
  188. package/dist/Atomic/UI/Modal/Modal.js +28 -36
  189. package/dist/Atomic/UI/Modal/Modal.scss +42 -43
  190. package/dist/Atomic/UI/Modal/ModalHOC.js +2 -5
  191. package/dist/Atomic/UI/Modal/ModalMobile.scss +18 -11
  192. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +2 -2
  193. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +6 -6
  194. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +8 -8
  195. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -1
  196. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.scss +5 -5
  197. package/dist/Atomic/UI/MonoAccordion/partial/AnyOuterClass.scss +4 -5
  198. package/dist/Atomic/UI/NavLine/NavLine.js +26 -26
  199. package/dist/Atomic/UI/NavLine/NavLine.scss +34 -36
  200. package/dist/Atomic/UI/NavLine/Tabs.js +38 -38
  201. package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -1
  202. package/dist/Atomic/UI/PageTitle/PageTitle.scss +7 -7
  203. package/dist/Atomic/UI/PieChart/PieChart.js +4 -4
  204. package/dist/Atomic/UI/PieChart/PieChart.scss +21 -10
  205. package/dist/Atomic/UI/Price/Price.js +2 -2
  206. package/dist/Atomic/UI/PriceRange/PriceRange.js +2 -2
  207. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +10 -10
  208. package/dist/Atomic/UI/ProgressLine/ProgressLine.scss +36 -40
  209. package/dist/Atomic/UI/Status/Status.js +6 -6
  210. package/dist/Atomic/UI/Status/Status.scss +19 -19
  211. package/dist/Atomic/UI/Table/Partials/TdCell.js +11 -11
  212. package/dist/Atomic/UI/Table/Partials/TdHeader.js +3 -3
  213. package/dist/Atomic/UI/Table/Partials/TdRow.js +6 -6
  214. package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -1
  215. package/dist/Atomic/UI/Table/Table.js +3 -3
  216. package/dist/Atomic/UI/Table/Table.scss +11 -13
  217. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +8 -8
  218. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +2 -2
  219. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -3
  220. package/dist/Atomic/UI/Table/TdTypes/TdTypes.scss +9 -8
  221. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +10 -13
  222. package/dist/Atomic/UI/Tag/Tag.js +6 -6
  223. package/dist/Atomic/UI/Tag/Tag.scss +12 -11
  224. package/dist/Atomic/UI/TagList/TagList.js +8 -8
  225. package/dist/Atomic/UI/TagList/TagList.scss +1 -1
  226. package/dist/Atomic/UI/UserBox/UserBox.js +5 -5
  227. package/dist/Atomic/UI/UserBox/UserBox.scss +9 -9
  228. package/dist/Classes/AbortableFetch.js +35 -35
  229. package/dist/Classes/AnimatedHandler.js +3 -3
  230. package/dist/Classes/RESTAPI/index.js +9 -9
  231. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +37 -37
  232. package/dist/Classes/RESTAPI/partials/ApiBase.js +7 -7
  233. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +4 -4
  234. package/dist/Classes/RESTAPI/partials/ApiUtils.js +4 -4
  235. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +31 -31
  236. package/dist/Classes/RESTAPI/partials/Utils.js +15 -15
  237. package/dist/Classes/RESTAPI/partials/_utils.js +14 -14
  238. package/dist/Constants/index.constants.js +10 -10
  239. package/dist/Functions/Portal.js +1 -1
  240. package/dist/Functions/customEventListener.js +5 -5
  241. package/dist/Functions/fieldValueFormatters.js +66 -82
  242. package/dist/Functions/hooks/useFormFieldsChangesManager.js +4 -4
  243. package/dist/Functions/locale/createTranslator.js +4 -15
  244. package/dist/Functions/operations.js +14 -14
  245. package/dist/Functions/presets/inputMaskPresets.js +34 -34
  246. package/dist/Functions/presets/inputPresets.js +3 -3
  247. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +2 -2
  248. package/dist/Functions/schemas.js +8 -8
  249. package/dist/Functions/useBodyScrollLock.js +20 -0
  250. package/dist/Functions/useClickOutside.js +2 -2
  251. package/dist/Functions/useFieldFocus.js +3 -7
  252. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -1
  253. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +11 -11
  254. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -1
  255. package/dist/Functions/useFormTools/functions/General.js +9 -9
  256. package/dist/Functions/useFormTools/functions/RenderFields.js +6 -6
  257. package/dist/Functions/useFormTools/index.js +18 -20
  258. package/dist/Functions/useInputHighlightError.js +5 -5
  259. package/dist/Functions/useKeyPress/useHandleKeyPress.js +44 -0
  260. package/dist/Functions/useKeyPress/useKeyPress.js +38 -0
  261. package/dist/Functions/useLocalStorage.js +2 -13
  262. package/dist/Functions/useLocationParams.js +2 -2
  263. package/dist/Functions/useMetaInfo.js +7 -7
  264. package/dist/Functions/useMouseUpOutside.js +2 -2
  265. package/dist/Functions/useOnlineStatus.js +5 -14
  266. package/dist/Functions/usePasswordChecker.js +26 -26
  267. package/dist/Functions/usePrevious.js +0 -12
  268. package/dist/Functions/useResize.js +6 -24
  269. package/dist/Functions/useScrollTo.js +1 -1
  270. package/dist/Functions/useToggle.js +1 -1
  271. package/dist/Functions/utils.js +64 -143
  272. package/dist/Molecular/FormElement/FormElement.js +1 -1
  273. package/dist/Molecular/FormElement/FormElement.scss +4 -3
  274. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +14 -14
  275. package/dist/Molecular/FormWithDependOn/partials/_utils.js +2 -2
  276. package/dist/Molecular/InputAddress/InputAddress.js +47 -46
  277. package/dist/Molecular/InputAddress/InputAddress.scss +176 -112
  278. package/dist/Molecular/InputPassword/InputPassword.js +11 -15
  279. package/dist/Molecular/InputPassword/InputPassword.scss +8 -7
  280. package/dist/scss/_fonts.scss +60 -36
  281. package/dist/scss/_vars.scss +18 -18
  282. package/dist/scss/main.scss +4 -4
  283. package/package.json +1 -1
@@ -8,18 +8,18 @@ var yup = _interopRequireWildcard(require("yup"));
8
8
  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); }
9
9
  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; }
10
10
  const forgotSchema = exports.forgotSchema = yup.object().shape({
11
- email: yup.string().email('Invalid email').required('E-mail is required')
11
+ email: yup.string().email("Invalid email").required("E-mail is required")
12
12
  });
13
13
  const loginSchema = exports.loginSchema = yup.object().shape({
14
- email: yup.string().email('Invalid email').required('E-mail is required'),
15
- password: yup.string().required('No password provided').min(8, 'Password is too short - should be 8 chars minimum').matches(/[a-zA-Z]/, 'Password can only contain Latin letters'),
14
+ email: yup.string().email("Invalid email").required("E-mail is required"),
15
+ password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
16
16
  remember: yup.bool()
17
17
  });
18
18
  const registerSchema = exports.registerSchema = yup.object().shape({
19
- name: yup.string().required('Name is required'),
20
- email: yup.string().email('Invalid email').required('E-mail is required'),
21
- password: yup.string().required('No password provided').min(8, 'Password is too short - should be 8 chars minimum').matches(/[a-zA-Z]/, 'Password can only contain Latin letters'),
22
- confirmPassword: yup.string().required('Confirm password').oneOf([yup.ref('password')], 'Passwords must match'),
19
+ name: yup.string().required("Name is required"),
20
+ email: yup.string().email("Invalid email").required("E-mail is required"),
21
+ password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
22
+ confirmPassword: yup.string().required("Confirm password").oneOf([yup.ref("password")], "Passwords must match"),
23
23
  promo: yup.string(),
24
- recaptcha: yup.bool().oneOf([true], 'Field must be checked')
24
+ recaptcha: yup.bool().oneOf([true], "Field must be checked")
25
25
  });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ const useBodyScrollLock = isScrollBodyLocked => {
9
+ (0, _react.useEffect)(() => {
10
+ if (isScrollBodyLocked) {
11
+ document.body.style.overflow = "hidden";
12
+ } else {
13
+ document.body.style.overflow = "auto";
14
+ }
15
+ return () => {
16
+ document.body.style.overflow = "auto";
17
+ };
18
+ }, [isScrollBodyLocked]);
19
+ };
20
+ var _default = exports.default = useBodyScrollLock;
@@ -12,9 +12,9 @@ const useClickOutside = (ref, setOut, open) => {
12
12
  }
13
13
  }
14
14
  (0, _react.useEffect)(() => {
15
- document.addEventListener('mousedown', handleClickOutside);
15
+ document.addEventListener("mousedown", handleClickOutside);
16
16
  return () => {
17
- document.removeEventListener('mousedown', handleClickOutside);
17
+ document.removeEventListener("mousedown", handleClickOutside);
18
18
  };
19
19
  }, [ref]);
20
20
  };
@@ -5,16 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = useFieldsFocus;
7
7
  var _react = require("react");
8
- /**
9
- * It adds refs to each field in the form, and provides a function to set focus to a field by key
10
- * @returns An object with two functions.
11
- */
12
8
  function useFieldsFocus(_ref) {
13
9
  let {
14
10
  form,
15
11
  setForm
16
12
  } = _ref;
17
- const isFormAsObject = Boolean(typeof form === 'object' && !Array.isArray(form));
13
+ const isFormAsObject = Boolean(typeof form === "object" && !Array.isArray(form));
18
14
  const getField = key => {
19
15
  if (isFormAsObject) {
20
16
  var _form$key, _Object$values;
@@ -60,12 +56,12 @@ function useFieldsFocus(_ref) {
60
56
  const toggleFieldFocus = _ref2 => {
61
57
  let {
62
58
  field,
63
- action = 'focus'
59
+ action = "focus"
64
60
  } = _ref2;
65
61
  if (!field || !(field !== null && field !== void 0 && field.ref)) return null;
66
62
  setTimeout(() => {
67
63
  var _field$ref$current;
68
- (_field$ref$current = field.ref.current) === null || _field$ref$current === void 0 || (_field$ref$current = _field$ref$current.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || 'input')) === null || _field$ref$current === void 0 || _field$ref$current[action]();
64
+ (_field$ref$current = field.ref.current) === null || _field$ref$current === void 0 || (_field$ref$current = _field$ref$current.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || "input")) === null || _field$ref$current === void 0 || _field$ref$current[action]();
69
65
  }, 50);
70
66
  };
71
67
  const setFocusTo = key => {
@@ -28,7 +28,7 @@ function ArrayWithObjects(_ref) {
28
28
  return (_getFormFields = getFormFields(argForm)) === null || _getFormFields === void 0 ? void 0 : _getFormFields.find(f => f.key === key);
29
29
  };
30
30
  const setFormFields = data => {
31
- const isFunction = typeof data === 'function';
31
+ const isFunction = typeof data === "function";
32
32
  setForm(state => isFunction ? data(state) : data);
33
33
  };
34
34
  const setFormField = function (data) {
@@ -15,17 +15,17 @@ function ObjectWithIterableObjects(_ref) {
15
15
  args[_key] = arguments[_key];
16
16
  }
17
17
  const [mainArg] = args;
18
- const MainArgProto = Array.isArray(mainArg) ? 'Array' : typeof mainArg === 'object' ? 'Object' : undefined;
19
- const template = Array.isArray(mainArg) ? [] : typeof mainArg === 'object' ? {} : null;
18
+ const MainArgProto = Array.isArray(mainArg) ? "Array" : typeof mainArg === "object" ? "Object" : undefined;
19
+ const template = Array.isArray(mainArg) ? [] : typeof mainArg === "object" ? {} : null;
20
20
  if (!template) return undefined;
21
21
  return args.reduce((result, item) => {
22
- if (MainArgProto === 'Array') {
22
+ if (MainArgProto === "Array") {
23
23
  if (Array.isArray(item)) {
24
24
  return [...result, ...item];
25
25
  } else {
26
26
  return [...result, item];
27
27
  }
28
- } else if (MainArgProto === 'Object') {
28
+ } else if (MainArgProto === "Object") {
29
29
  return {
30
30
  ...result,
31
31
  ...item
@@ -38,7 +38,7 @@ function ObjectWithIterableObjects(_ref) {
38
38
  const getFieldData = key => {
39
39
  if (Array.isArray(FormFields)) {
40
40
  return FormFields[key] || FormFields.find(f => f.key === key);
41
- } else if (typeof FormFields === 'object') {
41
+ } else if (typeof FormFields === "object") {
42
42
  return FormFields[key] || Object.values(FormFields).find(f => f.key === key);
43
43
  } else {
44
44
  return undefined;
@@ -49,10 +49,10 @@ function ObjectWithIterableObjects(_ref) {
49
49
  };
50
50
  const getFormField = key => {
51
51
  // eslint-disable-next-line no-undef
52
- if (FormProto === 'Array') {
52
+ if (FormProto === "Array") {
53
53
  return getFormFields().find(field => field.key === key);
54
54
  // eslint-disable-next-line no-undef
55
- } else if (FormProto === 'Object') {
55
+ } else if (FormProto === "Object") {
56
56
  return Object.values(getFormFields()).find(field => field.key === key) || Object.keys(getFormFields()).reduce((result, field) => {
57
57
  if (field === key) result = getFormFields()[field];
58
58
  return result;
@@ -62,7 +62,7 @@ function ObjectWithIterableObjects(_ref) {
62
62
  }
63
63
  };
64
64
  const setFormFields = data => {
65
- const isFunction = typeof data === 'function';
65
+ const isFunction = typeof data === "function";
66
66
  setForm(state => {
67
67
  if (state.fields) {
68
68
  return {
@@ -76,7 +76,7 @@ function ObjectWithIterableObjects(_ref) {
76
76
  };
77
77
  const setFormField = function (data) {
78
78
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
79
- const isFunction = typeof data === 'function';
79
+ const isFunction = typeof data === "function";
80
80
  setFormFields(fields => {
81
81
  const pop = (fields, key) => {
82
82
  const result = {
@@ -86,13 +86,13 @@ function ObjectWithIterableObjects(_ref) {
86
86
  result.item = fields[key] || fields.find(f => f.key === key);
87
87
  if (!result.item) return result;
88
88
  if (Array.isArray(fields)) {
89
- const index = parseInt(key);
89
+ const index = parseInt(key, 10);
90
90
  if (!isNaN(index)) {
91
91
  result.fields.splice(key, 1);
92
92
  } else {
93
93
  result.fields = result.fields.filter(f => f.key !== key);
94
94
  }
95
- } else if (typeof fields === 'object') {
95
+ } else if (typeof fields === "object") {
96
96
  result.fields = Object.values(fields).reduce((object, _ref2) => {
97
97
  let {
98
98
  key: fKey
@@ -32,7 +32,7 @@ function ObjectWithNamedKeyObjects() {
32
32
  }, null));
33
33
  };
34
34
  const setFormFields = data => {
35
- const isFunction = typeof data === 'function';
35
+ const isFunction = typeof data === "function";
36
36
  setForm(state => {
37
37
  if (state.fields) {
38
38
  return {
@@ -14,17 +14,17 @@ function General() {
14
14
  args[_key] = arguments[_key];
15
15
  }
16
16
  const [mainArg] = args;
17
- const MainArgProto = Array.isArray(mainArg) ? 'Array' : typeof mainArg === 'object' ? 'Object' : undefined;
18
- const template = Array.isArray(mainArg) ? [] : typeof mainArg === 'object' ? {} : null;
17
+ const MainArgProto = Array.isArray(mainArg) ? "Array" : typeof mainArg === "object" ? "Object" : undefined;
18
+ const template = Array.isArray(mainArg) ? [] : typeof mainArg === "object" ? {} : null;
19
19
  if (!template) return undefined;
20
20
  return args.reduce((result, item) => {
21
- if (MainArgProto === 'Array') {
21
+ if (MainArgProto === "Array") {
22
22
  if (Array.isArray(item)) {
23
23
  return [...result, ...item];
24
24
  } else {
25
25
  return [...result, item];
26
26
  }
27
- } else if (MainArgProto === 'Object') {
27
+ } else if (MainArgProto === "Object") {
28
28
  return {
29
29
  ...result,
30
30
  ...item
@@ -45,7 +45,7 @@ function General() {
45
45
  ...FormFields.find(f => f.key === key)
46
46
  };
47
47
  }
48
- } else if (typeof FormFields === 'object') {
48
+ } else if (typeof FormFields === "object") {
49
49
  return {
50
50
  ...FormFields[key]
51
51
  } || {
@@ -61,7 +61,7 @@ function General() {
61
61
  };
62
62
  const getFormFieldsAsArray = fields => {
63
63
  if (Array.isArray(fields)) return fields;
64
- if (typeof fields === 'object') {
64
+ if (typeof fields === "object") {
65
65
  return Object.values(fields);
66
66
  }
67
67
  return fields;
@@ -74,7 +74,7 @@ function General() {
74
74
  } = _ref;
75
75
  return key;
76
76
  });
77
- if (typeof fields === 'object') {
77
+ if (typeof fields === "object") {
78
78
  return Object.values(fields).map(_ref2 => {
79
79
  let {
80
80
  key
@@ -92,14 +92,14 @@ function General() {
92
92
  if (Array.isArray(fields)) {
93
93
  result.item = fields === null || fields === void 0 ? void 0 : fields.find(f => f.key === key);
94
94
  result.itemIndex = result.item ? fields.findIndex(f => f.key === key) : fields.length;
95
- } else if (typeof fields === 'object') {
95
+ } else if (typeof fields === "object") {
96
96
  result.item = fields[key] || Object.values(fields).find(f => f.key === key);
97
97
  result.itemIndex = result.item ? fields[key] ? key : Object.values(fields).findIndex(f => f.key === key) : key;
98
98
  }
99
99
  return result;
100
100
  };
101
101
  const updateFormField = (fields, data, key) => {
102
- const isFunction = typeof data === 'function';
102
+ const isFunction = typeof data === "function";
103
103
  //KEY is NULLable
104
104
  if (!key) {
105
105
  return data.key ? Object.values(fields).reduce((result, field, i) => {
@@ -6,22 +6,22 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = RenderFields;
7
7
  const defaultRenderFieldComponent = () => {
8
8
  // eslint-disable-next-line no-console
9
- console.error('RenderFields: RenderFieldComponent Property is not recieved!');
9
+ console.error("RenderFields: RenderFieldComponent Property is not recieved!");
10
10
  return null;
11
11
  };
12
12
  const defaultFormDataDriver = () => {
13
13
  // eslint-disable-next-line no-console
14
- console.error('RenderFields: FormDataDriver Property is not recieved!');
14
+ console.error("RenderFields: FormDataDriver Property is not recieved!");
15
15
  return null;
16
16
  };
17
17
  const defaultOnFieldChange = () => {
18
18
  // eslint-disable-next-line no-console
19
- console.warn('RenderFields: Be careful, onFieldChange handler is not recieved!');
19
+ console.warn("RenderFields: Be careful, onFieldChange handler is not recieved!");
20
20
  return null;
21
21
  };
22
22
  const defaultOnFieldBlur = () => {
23
23
  // eslint-disable-next-line no-console
24
- console.warn('RenderFields: Be careful, defaultOnFieldBlur handler is not recieved!');
24
+ console.warn("RenderFields: Be careful, defaultOnFieldBlur handler is not recieved!");
25
25
  return null;
26
26
  };
27
27
  function RenderFields() {
@@ -56,7 +56,7 @@ function RenderFields() {
56
56
  return /*#__PURE__*/React.createElement("div", {
57
57
  key: "render-field-wrapper-".concat(key),
58
58
  id: "render-field-wrapper-".concat(key),
59
- ref: wrapperRef ? typeof wrapperRef === 'function' ? node => wrapperRef(node, key) : wrapperRef : null
59
+ ref: wrapperRef ? typeof wrapperRef === "function" ? node => wrapperRef(node, key) : wrapperRef : null
60
60
  }, /*#__PURE__*/React.createElement(RenderFieldComponent, {
61
61
  key: key,
62
62
  field: field,
@@ -85,7 +85,7 @@ function RenderFields() {
85
85
  className: "row"
86
86
  }, parts.map((part, i) => /*#__PURE__*/React.createElement("div", {
87
87
  key: "render-fields-row-".concat(i),
88
- className: "col-12 col-lg-".concat(parseInt(maxWidth / columnsQty))
88
+ className: "col-12 col-lg-".concat(parseInt(maxWidth / columnsQty, 10))
89
89
  }, part.map(renderFormField))));
90
90
  };
91
91
  const render = cols === 1 ? renderSingleColumn : renderSplitColumns;
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = useFormTools;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _General = _interopRequireDefault(require("./functions/General"));
8
+ var _react = require("react");
10
9
  var _ArrayWithObjects = _interopRequireDefault(require("./form-drivers/ArrayWithObjects"));
11
10
  var _ObjectWithIterableObjects = _interopRequireDefault(require("./form-drivers/ObjectWithIterableObjects"));
12
11
  var _ObjectWithNamedKeyObjects = _interopRequireDefault(require("./form-drivers/ObjectWithNamedKeyObjects"));
12
+ var _General = _interopRequireDefault(require("./functions/General"));
13
13
  var _RenderFields = _interopRequireDefault(require("./functions/RenderFields"));
14
- 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); }
15
- 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; }
16
14
  // eslint-disable-next-line no-unused-vars
17
15
 
18
16
  const DefaultFocusControllerProps = {
@@ -25,7 +23,7 @@ function useFormTools() {
25
23
  setForm,
26
24
  FormType,
27
25
  FormFields,
28
- FormDataDriverName = 'ArrayWithObjects' || 'ObjectWithIterableObjects' || 'ObjectWithNamedKeyObjects',
26
+ FormDataDriverName = "ArrayWithObjects" || "ObjectWithIterableObjects" || "ObjectWithNamedKeyObjects",
29
27
  FormDataDriver = null,
30
28
  FocusControllerProps = DefaultFocusControllerProps,
31
29
  goToNextFieldOnEnterPressed = true
@@ -99,7 +97,7 @@ function useFormTools() {
99
97
  });
100
98
  };
101
99
  const onChangeObserver = (key, value) => {
102
- if (!onChangeObservers[key] || typeof onChangeObservers[key] !== 'object') return;
100
+ if (!onChangeObservers[key] || typeof onChangeObservers[key] !== "object") return;
103
101
  const Observers = onChangeObservers[key];
104
102
  Object.values(Observers).map(cb => {
105
103
  cb({
@@ -115,7 +113,7 @@ function useFormTools() {
115
113
  onChangeObserver(key, value);
116
114
  setFormField(field => ({
117
115
  ...field,
118
- error: '',
116
+ error: "",
119
117
  value
120
118
  }), key);
121
119
  };
@@ -215,11 +213,11 @@ function useFormTools() {
215
213
  return renderFormFields.reduce((result, key) => {
216
214
  var _field$className;
217
215
  const fieldData = getFieldData(key);
218
- let field = !getFormField(key) ? fieldData : getFormField(key);
216
+ const field = getFormField(key) ? getFormField(key) : fieldData;
219
217
  if (!(field !== null && field !== void 0 && field.className) || (field === null || field === void 0 || (_field$className = field.className) === null || _field$className === void 0 ? void 0 : _field$className.indexOf(getFieldClassName(key, FormType))) === -1) {
220
218
  field.className = "".concat(field === null || field === void 0 ? void 0 : field.className, " ").concat(getFieldClassName(key, FormType));
221
219
  }
222
- if (typeof (fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) === 'object') {
220
+ if (typeof (fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) === "object") {
223
221
  field.label = fieldData.label[FormType] || fieldData.label.default;
224
222
  }
225
223
  field.ref = /*#__PURE__*/(0, _react.createRef)();
@@ -237,14 +235,14 @@ function useFormTools() {
237
235
  // eslint-disable-next-line no-use-before-define
238
236
  addOnFieldRenderedObserver(key, () => {
239
237
  var _getFormField2;
240
- const element = (_getFormField2 = getFormField(key)) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.ref) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.current) === null || _getFormField2 === void 0 ? void 0 : _getFormField2.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || 'input');
238
+ const element = (_getFormField2 = getFormField(key)) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.ref) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.current) === null || _getFormField2 === void 0 ? void 0 : _getFormField2.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || "input");
241
239
  const handler = () => setFormField({
242
240
  isValueChangedByUser: true
243
241
  }, key);
244
- element === null || element === void 0 || element.addEventListener('paste', handler, {
242
+ element === null || element === void 0 || element.addEventListener("paste", handler, {
245
243
  once: true
246
244
  });
247
- element === null || element === void 0 || element.addEventListener('keypress', handler, {
245
+ element === null || element === void 0 || element.addEventListener("keypress", handler, {
248
246
  once: true
249
247
  });
250
248
  }, true);
@@ -331,9 +329,9 @@ function useFormTools() {
331
329
  filtered === null || filtered === void 0 || filtered.map(field => {
332
330
  const formField = document.querySelector(".".concat(field === null || field === void 0 ? void 0 : field.className));
333
331
  if (!formField) return null;
334
- formField.classList.remove('errorLabelHightlite');
332
+ formField.classList.remove("errorLabelHightlite");
335
333
  if (field !== null && field !== void 0 && field.error) {
336
- formField.classList.add('errorLabelHightlite');
334
+ formField.classList.add("errorLabelHightlite");
337
335
  }
338
336
  return null;
339
337
  });
@@ -358,17 +356,17 @@ function useFormTools() {
358
356
  form: argForm,
359
357
  field
360
358
  } = _ref;
361
- let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'focus';
359
+ let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "focus";
362
360
  if (!key && !field) return null;
363
361
  if (!argForm) argForm = form;
364
362
  const formField = field || getFormField(key, argForm);
365
363
  if (!formField || !formField.ref) {
366
364
  return false;
367
365
  }
368
- if (action === 'focus' && FocusControllerProps.onlyEmptyFieldAutoFocus && Boolean(formField === null || formField === void 0 ? void 0 : formField.value)) return null;
366
+ if (action === "focus" && FocusControllerProps.onlyEmptyFieldAutoFocus && Boolean(formField === null || formField === void 0 ? void 0 : formField.value)) return null;
369
367
  setTimeout(() => {
370
368
  var _formField$ref$curren;
371
- (_formField$ref$curren = formField.ref.current) === null || _formField$ref$curren === void 0 || (_formField$ref$curren = _formField$ref$curren.querySelector((formField === null || formField === void 0 ? void 0 : formField.focusSelector) || 'input')) === null || _formField$ref$curren === void 0 || _formField$ref$curren[action]();
369
+ (_formField$ref$curren = formField.ref.current) === null || _formField$ref$curren === void 0 || (_formField$ref$curren = _formField$ref$curren.querySelector((formField === null || formField === void 0 ? void 0 : formField.focusSelector) || "input")) === null || _formField$ref$curren === void 0 || _formField$ref$curren[action]();
372
370
  cb();
373
371
  }, 50);
374
372
  };
@@ -384,7 +382,7 @@ function useFormTools() {
384
382
  cb,
385
383
  form: argForm,
386
384
  field
387
- }, 'focus');
385
+ }, "focus");
388
386
  };
389
387
  const setFieldBlur = _ref3 => {
390
388
  let {
@@ -398,7 +396,7 @@ function useFormTools() {
398
396
  cb,
399
397
  form: argForm,
400
398
  field
401
- }, 'blur');
399
+ }, "blur");
402
400
  };
403
401
  const setFirstFieldFocus = () => {
404
402
  var _field;
@@ -541,7 +539,7 @@ function useFormTools() {
541
539
  });
542
540
  };
543
541
  const onFieldRenderedObserver = (key, data) => {
544
- if (!onFieldRenderedObservers[key] || typeof onFieldRenderedObservers[key] !== 'object') return;
542
+ if (!onFieldRenderedObservers[key] || typeof onFieldRenderedObservers[key] !== "object") return;
545
543
  const Observers = onFieldRenderedObservers[key];
546
544
  const FilteredObservers = Object.values(Observers).filter(observer => !(observer !== null && observer !== void 0 && observer.isObserverWorkedOut));
547
545
  if (FilteredObservers.length === 0) return null;
@@ -19,11 +19,11 @@ const useInputHighlightError = _ref => {
19
19
  const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
20
20
  const [prevValue, setPreviousValue] = (0, _react.useState)(value);
21
21
  function hasHighlightError(e) {
22
- const changedValue = "".concat(value !== null && value !== void 0 ? value : '');
23
- const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : '');
22
+ const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
23
+ const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : "");
24
24
  const short = previousValue.length <= changedValue.length ? previousValue : changedValue;
25
25
  const long = previousValue.length > changedValue.length ? previousValue : changedValue;
26
- const infoAboutDifferencesSameness = short.split('').reduce((acc, symbol, idx) => {
26
+ const infoAboutDifferencesSameness = short.split("").reduce((acc, symbol, idx) => {
27
27
  if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
28
28
  acc.countOn = false;
29
29
  acc.differences.push([idx, symbol]);
@@ -34,9 +34,9 @@ const useInputHighlightError = _ref => {
34
34
  countOn: true,
35
35
  differences: []
36
36
  });
37
- const samePart = infoAboutDifferencesSameness.same.join('');
37
+ const samePart = infoAboutDifferencesSameness.same.join("");
38
38
  const differencesLength = infoAboutDifferencesSameness.differences.length;
39
- const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, '');
39
+ const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
40
40
  if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
41
41
  }
42
42
  (0, _react.useEffect)(() => {
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = require("react");
9
+ var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
10
+ /**
11
+ * @function useHandleKeyPress
12
+ * @param {Object} props - объект с действиями и состоянием обновления.
13
+ * @param {Function} props.escCallback - функция, которая вызывается при нажатии клавиши 'Escape'.
14
+ * @param {Function} props.enterCallback - функция, которая вызывается при нажатии клавиши 'Enter'.
15
+ * @returns {void} - возвращает null.
16
+ * @description
17
+ * Хук `useHandleKeyPress` используется для создания действий при нажатии определённых клавиш ('Escape' и 'Enter').
18
+ * Если props.escCallback и props.enterCallback определены и передано состояние обновления (isUpdating) равное false,
19
+ * то при нажатии на клавиши 'Escape' или 'Enter' будут вызваны соответственные функции обратного вызова (escCallback и enterCallback).
20
+ *
21
+ * @example
22
+ * function Component() {
23
+ * useHandleKeyPress({
24
+ * escCallback: () => console.log('Esc pressed'),
25
+ * enterCallback: () => console.log('Enter pressed'),
26
+ * });
27
+ *
28
+ * // ...
29
+ * }
30
+ *
31
+ */
32
+ const useHandleKeyPress = _ref => {
33
+ let {
34
+ escCallback,
35
+ enterCallback
36
+ } = _ref;
37
+ const isPressEnter = (0, _useKeyPress.default)("Enter");
38
+ const isPressEscape = (0, _useKeyPress.default)("Escape");
39
+ (0, _react.useEffect)(() => {
40
+ if (isPressEnter && typeof enterCallback === "function") enterCallback();
41
+ if (isPressEscape && typeof escCallback === "function") escCallback();
42
+ }, [enterCallback, escCallback, isPressEnter, isPressEscape]);
43
+ };
44
+ var _default = exports.default = useHandleKeyPress;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ const useKeyPress = targetKey => {
9
+ const [keyPressed, setKeyPressed] = (0, _react.useState)(false);
10
+ const downHandler = (0, _react.useCallback)(_ref => {
11
+ let {
12
+ key
13
+ } = _ref;
14
+ if (key === targetKey) {
15
+ setKeyPressed(true);
16
+ }
17
+ }, [targetKey]);
18
+ const upHandler = (0, _react.useCallback)(_ref2 => {
19
+ let {
20
+ key
21
+ } = _ref2;
22
+ if (key === targetKey) {
23
+ setKeyPressed(false);
24
+ }
25
+ }, [targetKey]);
26
+ (0, _react.useEffect)(() => {
27
+ const handleDown = event => downHandler(event);
28
+ const handleUp = event => upHandler(event);
29
+ window.addEventListener("keydown", handleDown);
30
+ window.addEventListener("keyup", handleUp);
31
+ return () => {
32
+ window.removeEventListener("keydown", handleDown);
33
+ window.removeEventListener("keyup", handleUp);
34
+ };
35
+ }, [downHandler, upHandler]);
36
+ return keyPressed;
37
+ };
38
+ var _default = exports.default = useKeyPress;
@@ -5,20 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = require("react");
8
- /**
9
- * The useLocalStorage function is a hook that allows you to store and retrieve data from localStorage.
10
- *
11
- *
12
- * @param key Store the value in localstorage
13
- * @param initialValue Set the initial value of the state
14
- *
15
- * @return An array of two values
16
- *
17
- * @docauthor Trelent
18
- */
19
8
  const useLocalStorage = (key, initialValue) => {
20
9
  const [storedValue, setStoredValue] = (0, _react.useState)(() => {
21
- if (typeof window === 'undefined') {
10
+ if (typeof window === "undefined") {
22
11
  return initialValue;
23
12
  }
24
13
  try {
@@ -34,7 +23,7 @@ const useLocalStorage = (key, initialValue) => {
34
23
  try {
35
24
  const valueToStore = value instanceof Function ? value(storedValue) : value;
36
25
  setStoredValue(valueToStore);
37
- if (typeof window !== 'undefined') {
26
+ if (typeof window !== "undefined") {
38
27
  window.localStorage.setItem(key, JSON.stringify(valueToStore));
39
28
  }
40
29
  } catch (error) {
@@ -10,11 +10,11 @@ function useLocationParams() {
10
10
  (0, _react.useEffect)(() => {
11
11
  setParams(state => {
12
12
  var _window$location$sear;
13
- const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace('?', '').split('&');
13
+ const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace("?", "").split("&");
14
14
  return {
15
15
  ...state,
16
16
  ...arr.reduce((obj, item) => {
17
- const keyVal = item.split('=');
17
+ const keyVal = item.split("=");
18
18
  const key = keyVal[0];
19
19
  const value = keyVal[1];
20
20
  return {
@@ -6,27 +6,27 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useMetaInfo = exports.default = void 0;
7
7
  var _react = require("react");
8
8
  const useMetaInfo = () => {
9
- const [browser, setBrowser] = (0, _react.useState)('Other');
10
- const [device, setDevice] = (0, _react.useState)('desktop');
9
+ const [browser, setBrowser] = (0, _react.useState)("Other");
10
+ const [device, setDevice] = (0, _react.useState)("desktop");
11
11
  const [isiOS, setIsiOS] = (0, _react.useState)(false);
12
12
  const [chromeVersion, setChromeVersion] = (0, _react.useState)(null);
13
13
  const [iOSVersion, setiOSVersion] = (0, _react.useState)(null);
14
14
  (0, _react.useEffect)(() => {
15
15
  const userAgent = navigator.userAgent;
16
- if (userAgent.indexOf('Chrome') !== -1) {
17
- setBrowser('Chrome');
16
+ if (userAgent.indexOf("Chrome") !== -1) {
17
+ setBrowser("Chrome");
18
18
 
19
19
  // Извлечение версии Chrome
20
20
  const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
21
21
  setChromeVersion(version);
22
- } else if (userAgent.indexOf('Safari') !== -1) setBrowser('Safari');
23
- const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || '0').replace('_', '.');
22
+ } else if (userAgent.indexOf("Safari") !== -1) setBrowser("Safari");
23
+ const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || "0").replace("_", ".");
24
24
  const iOSVersion = parseFloat(iOSV);
25
25
  setIsiOS(!isNaN(iOSVersion));
26
26
  if (!isNaN(iOSVersion)) {
27
27
  setiOSVersion(iOSV); // Записываем версию iOS
28
28
  }
29
- if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice('mobile');
29
+ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice("mobile");
30
30
  }, []);
31
31
  return {
32
32
  browser,