intelicoreact 1.4.21 → 1.4.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +1 -9
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -10
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +4 -24
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -10
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +2 -14
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +5 -54
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +3 -21
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +51 -144
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -7
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +25 -91
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +3 -15
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +15 -29
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +5 -15
  14. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +19 -35
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +9 -38
  17. package/dist/Atomic/FormElements/Input/Input.js +25 -60
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +16 -46
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
  30. package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
  31. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
  32. package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
  33. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +44 -137
  34. package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
  35. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
  36. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
  37. package/dist/Atomic/FormElements/Label/Label.js +1 -9
  38. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
  39. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
  40. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
  41. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
  42. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
  43. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
  44. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
  45. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
  46. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
  47. package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
  48. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
  49. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
  50. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
  51. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
  52. package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
  53. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
  54. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
  55. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
  56. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
  57. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
  58. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
  59. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
  60. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
  61. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +9 -31
  62. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +125 -213
  63. package/dist/Atomic/FormElements/Text/Text.js +10 -16
  64. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
  65. package/dist/Atomic/FormElements/Textarea/Textarea.js +4 -20
  66. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
  67. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
  68. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
  69. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
  70. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
  71. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
  72. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
  73. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
  74. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
  75. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  76. package/dist/Atomic/Layout/Header/Header.js +3 -15
  77. package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
  78. package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
  79. package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
  80. package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
  81. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
  82. package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -15
  83. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
  84. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
  85. package/dist/Atomic/UI/Alert/Alert.js +3 -19
  86. package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
  87. package/dist/Atomic/UI/Box/Box.js +3 -9
  88. package/dist/Atomic/UI/Button/Button.js +2 -11
  89. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
  90. package/dist/Atomic/UI/Chart/Chart.js +4 -29
  91. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
  92. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
  93. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
  94. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
  95. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
  96. package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
  97. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
  98. package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
  99. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
  100. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
  101. package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -17
  102. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
  103. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
  104. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
  105. package/dist/Atomic/UI/Hint/Hint.js +5 -31
  106. package/dist/Atomic/UI/Modal/Modal.js +6 -28
  107. package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
  108. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
  109. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
  110. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
  111. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
  112. package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
  113. package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
  114. package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
  115. package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
  116. package/dist/Atomic/UI/Price/Price.js +3 -8
  117. package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
  118. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
  119. package/dist/Atomic/UI/Status/Status.js +1 -8
  120. package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
  121. package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
  122. package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
  123. package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
  124. package/dist/Atomic/UI/Table/Table.js +1 -12
  125. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
  126. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
  127. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
  128. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
  129. package/dist/Atomic/UI/Tag/Tag.js +7 -19
  130. package/dist/Atomic/UI/TagList/TagList.js +20 -38
  131. package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
  132. package/dist/Classes/AbortableFetch.js +36 -93
  133. package/dist/Classes/AnimatedHandler.js +3 -7
  134. package/dist/Classes/RESTAPI/index.js +39 -42
  135. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
  136. package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
  137. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
  138. package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
  139. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
  140. package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
  141. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
  142. package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
  143. package/dist/Constants/index.constants.js +8 -15
  144. package/dist/Functions/Portal.js +5 -16
  145. package/dist/Functions/customEventListener.js +4 -17
  146. package/dist/Functions/fieldValueFormatters.js +43 -83
  147. package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
  148. package/dist/Functions/locale/createTranslator.js +4 -9
  149. package/dist/Functions/operations.js +12 -22
  150. package/dist/Functions/presets/inputMaskPresets.js +9 -11
  151. package/dist/Functions/presets/inputPresets.js +8 -11
  152. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
  153. package/dist/Functions/schemas.js +6 -13
  154. package/dist/Functions/useBodyScrollLock.js +1 -6
  155. package/dist/Functions/useClickOutside.js +0 -4
  156. package/dist/Functions/useDebounce.js +2 -7
  157. package/dist/Functions/useFieldFocus.js +6 -18
  158. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
  159. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
  160. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
  161. package/dist/Functions/useFormTools/functions/General.js +18 -28
  162. package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
  163. package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
  164. package/dist/Functions/useFormTools/index.js +85 -144
  165. package/dist/Functions/useInputHighlightError.js +3 -12
  166. package/dist/Functions/useIsMobile.js +7 -13
  167. package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
  168. package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
  169. package/dist/Functions/useLocalStorage.js +1 -9
  170. package/dist/Functions/useLocationParams.js +4 -5
  171. package/dist/Functions/useMediaQuery.js +3 -9
  172. package/dist/Functions/useMetaInfo.js +3 -10
  173. package/dist/Functions/useMouseUpOutside.js +0 -3
  174. package/dist/Functions/useOnlineStatus.js +1 -9
  175. package/dist/Functions/usePasswordChecker.js +4 -20
  176. package/dist/Functions/usePrevious.js +1 -5
  177. package/dist/Functions/useResize.js +2 -10
  178. package/dist/Functions/useScrollTo.js +2 -7
  179. package/dist/Functions/useToggle.js +1 -5
  180. package/dist/Functions/utils.js +56 -131
  181. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
  182. package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
  183. package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
  184. package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
  185. package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
  186. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
  187. package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
  188. package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
  189. package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
  190. package/dist/Molecular/CustomIcons/components/Button.js +2 -9
  191. package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
  192. package/dist/Molecular/CustomIcons/components/Check.js +2 -9
  193. package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
  194. package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
  195. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
  196. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
  197. package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
  198. package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
  199. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
  200. package/dist/Molecular/CustomIcons/components/Close.js +2 -9
  201. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
  202. package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
  203. package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
  204. package/dist/Molecular/CustomIcons/components/Email.js +2 -9
  205. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
  206. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
  207. package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
  208. package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
  209. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
  210. package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
  211. package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
  212. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
  213. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
  214. package/dist/Molecular/CustomIcons/components/Home.js +2 -9
  215. package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
  216. package/dist/Molecular/CustomIcons/components/Key.js +2 -9
  217. package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
  218. package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
  219. package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
  220. package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
  221. package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
  222. package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
  223. package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
  224. package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
  225. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
  226. package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
  227. package/dist/Molecular/CustomIcons/components/Play.js +2 -9
  228. package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
  229. package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
  230. package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
  231. package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
  232. package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
  233. package/dist/Molecular/CustomIcons/components/Star.js +2 -9
  234. package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
  235. package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
  236. package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
  237. package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
  238. package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
  239. package/dist/Molecular/CustomIcons/components/User.js +2 -9
  240. package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
  241. package/dist/Molecular/CustomIcons/components/X.js +2 -9
  242. package/dist/Molecular/CustomIcons/index.js +0 -122
  243. package/dist/Molecular/FormElement/FormElement.js +1 -12
  244. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
  245. package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
  246. package/dist/Molecular/InputAddress/InputAddress.js +65 -114
  247. package/dist/Molecular/InputPassword/InputPassword.js +5 -19
  248. package/dist/index.js +0 -2
  249. package/package.json +1 -1
  250. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
  251. package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
  252. package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
  253. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
  254. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
  255. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MASK_PRESETS = void 0;
7
-
8
7
  /**
9
8
  * @param type: 'inputMask',
10
9
  * @param maskPattern: 'DD.DD.DDDD',
@@ -27,6 +26,7 @@ const DATE_PRESET = {
27
26
  autocomplete: "bday",
28
27
  focusSelector: "input"
29
28
  };
29
+
30
30
  /**
31
31
  * @param type: 'inputMask',
32
32
  * @param maskPattern: 'DDDDD',
@@ -38,7 +38,6 @@ const DATE_PRESET = {
38
38
  * @param autocomplete: 'postal-code',
39
39
  * @param rules: 'fieldZip'
40
40
  */
41
-
42
41
  const ZIP_PRESET = {
43
42
  type: "inputMask",
44
43
  focusSelector: "input",
@@ -50,6 +49,7 @@ const ZIP_PRESET = {
50
49
  autocomplete: "postal-code",
51
50
  rules: "fieldZip"
52
51
  };
52
+
53
53
  /**
54
54
  * @param type: 'inputMask',
55
55
  * @param maskPattern: 'DDDDDDDDD',
@@ -59,7 +59,6 @@ const ZIP_PRESET = {
59
59
  * @param showErrors: false,
60
60
  * @param focusSelector: 'input',
61
61
  */
62
-
63
62
  const SSN_PRESET = {
64
63
  type: "inputMask",
65
64
  maskPattern: "DDDDDDDDD",
@@ -69,6 +68,7 @@ const SSN_PRESET = {
69
68
  blinkErrors: true,
70
69
  showErrors: false
71
70
  };
71
+
72
72
  /**
73
73
  * @param type: 'inputMask',
74
74
  * @param maskPattern: 'DDD-DDD-DDDD',
@@ -79,7 +79,6 @@ const SSN_PRESET = {
79
79
  * @param focusSelector: 'input',
80
80
  * @param autocomplete: 'tel-national',
81
81
  */
82
-
83
82
  const MOBILE_PHONE_PRESET = {
84
83
  type: "inputMask",
85
84
  // maskPattern: 'DDD-DDD-DDDD',
@@ -91,6 +90,7 @@ const MOBILE_PHONE_PRESET = {
91
90
  showErrors: false,
92
91
  autocomplete: "tel-national"
93
92
  };
93
+
94
94
  /**
95
95
  * @param type: 'inputMask3',
96
96
  * @param maskPattern: 'DDDD',
@@ -99,7 +99,6 @@ const MOBILE_PHONE_PRESET = {
99
99
  * @param blinkErrors: true,
100
100
  * @param showErrors: false,
101
101
  */
102
-
103
102
  const SHORT_SSN_PRESET = {
104
103
  type: "inputMask3",
105
104
  maskPattern: "DDDD",
@@ -109,6 +108,7 @@ const SHORT_SSN_PRESET = {
109
108
  blinkErrors: true,
110
109
  showErrors: false
111
110
  };
111
+
112
112
  /**
113
113
  * @param type: 'inputMask',
114
114
  * @param maskPattern: 'DDDDDDDDD',
@@ -117,7 +117,6 @@ const SHORT_SSN_PRESET = {
117
117
  * @param blinkErrors: true,
118
118
  * @param showErrors: false,
119
119
  */
120
-
121
120
  const ABA_PRESET = {
122
121
  type: "inputMask",
123
122
  maskPattern: "DDDDDDDDD",
@@ -126,6 +125,7 @@ const ABA_PRESET = {
126
125
  blinkErrors: true,
127
126
  showErrors: false
128
127
  };
128
+
129
129
  /**
130
130
  * @param type: 'inputMask',
131
131
  * @param maskPattern: 'MM/YY',
@@ -136,7 +136,6 @@ const ABA_PRESET = {
136
136
  * @param showErrors: false,
137
137
  * @param focusSelector: 'input',
138
138
  */
139
-
140
139
  const CC_EXPIRATION_DATE = {
141
140
  type: "inputMask",
142
141
  maskPattern: "MM/YY",
@@ -147,6 +146,7 @@ const CC_EXPIRATION_DATE = {
147
146
  showErrors: false,
148
147
  focusSelector: "input"
149
148
  };
149
+
150
150
  /**
151
151
  * @param type: 'inputMask',
152
152
  * @param maskPattern: 'DDDDDDDDDD',
@@ -155,7 +155,6 @@ const CC_EXPIRATION_DATE = {
155
155
  * @param blinkErrors: true,
156
156
  * @param showErrors: false,
157
157
  */
158
-
159
158
  const BANK_ACCOUNT = {
160
159
  type: "inputMask",
161
160
  maskPattern: "DDDDDDDDDD",
@@ -164,7 +163,7 @@ const BANK_ACCOUNT = {
164
163
  blinkErrors: true,
165
164
  showErrors: false
166
165
  };
167
- const MASK_PRESETS = {
166
+ const MASK_PRESETS = exports.MASK_PRESETS = {
168
167
  BANK_ACCOUNT,
169
168
  CC_EXPIRATION_DATE,
170
169
  DATE_PRESET,
@@ -173,5 +172,4 @@ const MASK_PRESETS = {
173
172
  MOBILE_PHONE_PRESET,
174
173
  SHORT_SSN_PRESET,
175
174
  ABA_PRESET
176
- };
177
- exports.MASK_PRESETS = MASK_PRESETS;
175
+ };
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.INPUT_PRESETS = void 0;
7
-
8
7
  var _fieldValueFormatters = require("../fieldValueFormatters");
9
-
10
8
  const NAME_SYMBOLS_EXCLUDER = {
11
9
  /**
12
10
  * @name fieldChangesMiddleware
@@ -19,12 +17,12 @@ const NAME_SYMBOLS_EXCLUDER = {
19
17
  */
20
18
  fieldChangesMiddleware: value => {
21
19
  // remove invalid characters
22
- const invalidCharacters = new RegExp(/[^a-zA-Z-\s']/g); // handle any two '-' or ''' should not be side by side
23
-
24
- const sideBySideHyphenOrApostrophe = new RegExp(/['-]{2,}/g); // replace sequence of spaces with single space
25
-
26
- const multipleSpaces = new RegExp(/\s{2,}/g); // remove '-' or ''' if they are followed by a space
27
-
20
+ const invalidCharacters = new RegExp(/[^a-zA-Z-\s']/g);
21
+ // handle any two '-' or ''' should not be side by side
22
+ const sideBySideHyphenOrApostrophe = new RegExp(/['-]{2,}/g);
23
+ // replace sequence of spaces with single space
24
+ const multipleSpaces = new RegExp(/\s{2,}/g);
25
+ // remove '-' or ''' if they are followed by a space
28
26
  const beforeSpace = new RegExp(/['-](?=\s)/g);
29
27
  const sanitizedValue = (0, _fieldValueFormatters.getSafelyValue)(value).replace(invalidCharacters, "").replace(sideBySideHyphenOrApostrophe, "").replace(multipleSpaces, " ").replace(beforeSpace, "");
30
28
  return sanitizedValue;
@@ -50,8 +48,7 @@ const ONLY_STRING_AND_DASH = {
50
48
  return sanitizedInput.replace(nonAlphabeticAndNotSingleDash, "").replace(consecutiveDashes, "-");
51
49
  }
52
50
  };
53
- const INPUT_PRESETS = {
51
+ const INPUT_PRESETS = exports.INPUT_PRESETS = {
54
52
  NAME_SYMBOLS_EXCLUDER,
55
53
  ONLY_STRING_AND_DASH
56
- };
57
- exports.INPUT_PRESETS = INPUT_PRESETS;
54
+ };
@@ -5,15 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.NUMERIC_KEYBOARD = exports.EMAIL_KEYBOARD = exports.ALL_KEYBOARD_TYPES = void 0;
7
7
  //? Удобно использовать для расширения объекта атрибутов
8
- const ALL_KEYBOARD_TYPES = {
8
+ const ALL_KEYBOARD_TYPES = exports.ALL_KEYBOARD_TYPES = {
9
9
  numeric: {
10
10
  inputMode: "numeric"
11
11
  },
12
12
  email: {
13
13
  inputMode: "email"
14
14
  }
15
- }; //? Например:
15
+ };
16
16
 
17
+ //? Например:
17
18
  /*
18
19
  const constructor = [
19
20
  ...
@@ -29,10 +30,10 @@ const ALL_KEYBOARD_TYPES = {
29
30
  ];
30
31
 
31
32
  */
33
+
32
34
  // *****************************
33
35
  //? Удобно использовать для расширения объекта филда, если в филде более не добавляются другие атрибуты
34
36
  //? Например:
35
-
36
37
  /*
37
38
  const constructor = [
38
39
  ...
@@ -46,12 +47,9 @@ const ALL_KEYBOARD_TYPES = {
46
47
 
47
48
  */
48
49
 
49
- exports.ALL_KEYBOARD_TYPES = ALL_KEYBOARD_TYPES;
50
- const NUMERIC_KEYBOARD = {
50
+ const NUMERIC_KEYBOARD = exports.NUMERIC_KEYBOARD = {
51
51
  attributesOfNativeInput: ALL_KEYBOARD_TYPES.numeric
52
52
  };
53
- exports.NUMERIC_KEYBOARD = NUMERIC_KEYBOARD;
54
- const EMAIL_KEYBOARD = {
53
+ const EMAIL_KEYBOARD = exports.EMAIL_KEYBOARD = {
55
54
  attributesOfNativeInput: ALL_KEYBOARD_TYPES.email
56
- };
57
- exports.EMAIL_KEYBOARD = EMAIL_KEYBOARD;
55
+ };
@@ -4,29 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.registerSchema = exports.loginSchema = exports.forgotSchema = void 0;
7
-
8
7
  var yup = _interopRequireWildcard(require("yup"));
9
-
10
- 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); }
11
-
12
- 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; }
13
-
14
- const forgotSchema = yup.object().shape({
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
+ 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
+ const forgotSchema = exports.forgotSchema = yup.object().shape({
15
11
  email: yup.string().email("Invalid email").required("E-mail is required")
16
12
  });
17
- exports.forgotSchema = forgotSchema;
18
- const loginSchema = yup.object().shape({
13
+ const loginSchema = exports.loginSchema = yup.object().shape({
19
14
  email: yup.string().email("Invalid email").required("E-mail is required"),
20
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"),
21
16
  remember: yup.bool()
22
17
  });
23
- exports.loginSchema = loginSchema;
24
- const registerSchema = yup.object().shape({
18
+ const registerSchema = exports.registerSchema = yup.object().shape({
25
19
  name: yup.string().required("Name is required"),
26
20
  email: yup.string().email("Invalid email").required("E-mail is required"),
27
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"),
28
22
  confirmPassword: yup.string().required("Confirm password").oneOf([yup.ref("password")], "Passwords must match"),
29
23
  promo: yup.string(),
30
24
  recaptcha: yup.bool().oneOf([true], "Field must be checked")
31
- });
32
- exports.registerSchema = registerSchema;
25
+ });
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  const useBodyScrollLock = isScrollBodyLocked => {
11
9
  (0, _react.useEffect)(() => {
12
10
  if (isScrollBodyLocked) {
@@ -14,12 +12,9 @@ const useBodyScrollLock = isScrollBodyLocked => {
14
12
  } else {
15
13
  document.body.style.overflow = "auto";
16
14
  }
17
-
18
15
  return () => {
19
16
  document.body.style.overflow = "auto";
20
17
  };
21
18
  }, [isScrollBodyLocked]);
22
19
  };
23
-
24
- var _default = useBodyScrollLock;
25
- exports.default = _default;
20
+ var _default = exports.default = useBodyScrollLock;
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useClickOutside = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  const useClickOutside = (ref, setOut, open) => {
11
9
  function handleClickOutside(event) {
12
10
  if (ref.current && !ref.current.contains(event.target)) {
13
11
  setOut(open);
14
12
  }
15
13
  }
16
-
17
14
  (0, _react.useEffect)(() => {
18
15
  document.addEventListener("mousedown", handleClickOutside);
19
16
  return () => {
@@ -21,5 +18,4 @@ const useClickOutside = (ref, setOut, open) => {
21
18
  };
22
19
  }, [ref]);
23
20
  };
24
-
25
21
  exports.useClickOutside = useClickOutside;
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useDebounce = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
- 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); }
11
-
12
- 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; }
13
-
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
+ 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; }
14
10
  const useDebounce = _ref => {
15
11
  let {
16
12
  searchValue,
@@ -27,5 +23,4 @@ const useDebounce = _ref => {
27
23
  }, [searchValue, delay]);
28
24
  return debouncedValue;
29
25
  };
30
-
31
26
  exports.useDebounce = useDebounce;
@@ -4,45 +4,39 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = useFieldsFocus;
7
-
8
7
  var _react = require("react");
9
-
10
8
  function useFieldsFocus(_ref) {
11
9
  let {
12
10
  form,
13
11
  setForm
14
12
  } = _ref;
15
13
  const isFormAsObject = Boolean(typeof form === "object" && !Array.isArray(form));
16
-
17
14
  const getField = key => {
18
15
  if (isFormAsObject) {
19
16
  var _form$key, _Object$values;
20
-
21
17
  return (_form$key = form === null || form === void 0 ? void 0 : form[key]) !== null && _form$key !== void 0 ? _form$key : (_Object$values = Object.values(form)) === null || _Object$values === void 0 ? void 0 : _Object$values.find(field => field.key === key);
22
18
  } else {
23
19
  return form === null || form === void 0 ? void 0 : form.find(field => field.key === key);
24
20
  }
25
21
  };
26
-
27
22
  const getErroredFields = () => {
28
23
  if (isFormAsObject) {
29
24
  var _Object$values2;
30
-
31
25
  return (_Object$values2 = Object.values(form)) === null || _Object$values2 === void 0 ? void 0 : _Object$values2.filter(field => field.error);
32
26
  } else {
33
27
  return form === null || form === void 0 ? void 0 : form.filter(f => f === null || f === void 0 ? void 0 : f.error);
34
28
  }
35
29
  };
36
-
37
30
  const addRefsToFields = () => {
38
31
  if (isFormAsObject) {
39
32
  setForm(form => {
40
33
  var _Object$keys;
41
-
42
34
  return (_Object$keys = Object.keys(form)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce((result, key) => {
43
35
  const field = form[key];
44
- return { ...result,
45
- [key]: { ...field,
36
+ return {
37
+ ...result,
38
+ [key]: {
39
+ ...field,
46
40
  ref: /*#__PURE__*/(0, _react.createRef)(),
47
41
  wrapperRef: /*#__PURE__*/(0, _react.createRef)()
48
42
  }
@@ -59,7 +53,6 @@ function useFieldsFocus(_ref) {
59
53
  });
60
54
  }
61
55
  };
62
-
63
56
  const toggleFieldFocus = _ref2 => {
64
57
  let {
65
58
  field,
@@ -67,12 +60,10 @@ function useFieldsFocus(_ref) {
67
60
  } = _ref2;
68
61
  if (!field || !(field !== null && field !== void 0 && field.ref)) return null;
69
62
  setTimeout(() => {
70
- var _field$ref$current, _field$ref$current$qu;
71
-
72
- (_field$ref$current = field.ref.current) === null || _field$ref$current === void 0 ? void 0 : (_field$ref$current$qu = _field$ref$current.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || "input")) === null || _field$ref$current$qu === void 0 ? void 0 : _field$ref$current$qu[action]();
63
+ var _field$ref$current;
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]();
73
65
  }, 50);
74
66
  };
75
-
76
67
  const setFocusTo = key => {
77
68
  const field = getField(key);
78
69
  if (!field) return false;
@@ -80,17 +71,14 @@ function useFieldsFocus(_ref) {
80
71
  field
81
72
  });
82
73
  };
83
-
84
74
  const setFocusToErroredField = () => {
85
75
  var _getErroredFields;
86
-
87
76
  const field = (_getErroredFields = getErroredFields()) === null || _getErroredFields === void 0 ? void 0 : _getErroredFields[0];
88
77
  if (!field) return false;
89
78
  toggleFieldFocus({
90
79
  field
91
80
  });
92
81
  };
93
-
94
82
  (0, _react.useEffect)(() => {
95
83
  addRefsToFields();
96
84
  }, [form === null || form === void 0 ? void 0 : form.length]);
@@ -1,14 +1,11 @@
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 = ArrayWithObjects;
9
-
10
8
  var _General = _interopRequireDefault(require("../functions/General"));
11
-
12
9
  function ArrayWithObjects(_ref) {
13
10
  let {
14
11
  form,
@@ -25,26 +22,20 @@ function ArrayWithObjects(_ref) {
25
22
  } = (0, _General.default)({
26
23
  FormFields
27
24
  });
28
-
29
25
  const getFormField = function (key) {
30
26
  var _getFormFields;
31
-
32
27
  let argForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : form;
33
28
  return (_getFormFields = getFormFields(argForm)) === null || _getFormFields === void 0 ? void 0 : _getFormFields.find(f => f.key === key);
34
29
  };
35
-
36
30
  const setFormFields = data => {
37
31
  const isFunction = typeof data === "function";
38
32
  setForm(state => isFunction ? data(state) : data);
39
33
  };
40
-
41
34
  const setFormField = function (data) {
42
35
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
43
36
  return setFormFields(fields => updateFormField(fields, data, key));
44
37
  };
45
-
46
38
  const removeAllFormFields = () => setFormFields([]);
47
-
48
39
  return {
49
40
  joinData,
50
41
  getFieldData,
@@ -4,19 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ObjectWithIterableObjects;
7
-
8
7
  function ObjectWithIterableObjects(_ref) {
9
8
  let {
10
9
  form,
11
10
  setForm,
12
11
  FormFields
13
12
  } = _ref;
14
-
15
13
  const joinData = function () {
16
14
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17
15
  args[_key] = arguments[_key];
18
16
  }
19
-
20
17
  const [mainArg] = args;
21
18
  const MainArgProto = Array.isArray(mainArg) ? "Array" : typeof mainArg === "object" ? "Object" : undefined;
22
19
  const template = Array.isArray(mainArg) ? [] : typeof mainArg === "object" ? {} : null;
@@ -29,7 +26,8 @@ function ObjectWithIterableObjects(_ref) {
29
26
  return [...result, item];
30
27
  }
31
28
  } else if (MainArgProto === "Object") {
32
- return { ...result,
29
+ return {
30
+ ...result,
33
31
  ...item
34
32
  };
35
33
  } else {
@@ -37,7 +35,6 @@ function ObjectWithIterableObjects(_ref) {
37
35
  }
38
36
  }, template);
39
37
  };
40
-
41
38
  const getFieldData = key => {
42
39
  if (Array.isArray(FormFields)) {
43
40
  return FormFields[key] || FormFields.find(f => f.key === key);
@@ -47,15 +44,14 @@ function ObjectWithIterableObjects(_ref) {
47
44
  return undefined;
48
45
  }
49
46
  };
50
-
51
47
  const getFormFields = () => {
52
48
  return form.fields || form;
53
49
  };
54
-
55
50
  const getFormField = key => {
56
51
  // eslint-disable-next-line no-undef
57
52
  if (FormProto === "Array") {
58
- return getFormFields().find(field => field.key === key); // eslint-disable-next-line no-undef
53
+ return getFormFields().find(field => field.key === key);
54
+ // eslint-disable-next-line no-undef
59
55
  } else if (FormProto === "Object") {
60
56
  return Object.values(getFormFields()).find(field => field.key === key) || Object.keys(getFormFields()).reduce((result, field) => {
61
57
  if (field === key) result = getFormFields()[field];
@@ -65,12 +61,12 @@ function ObjectWithIterableObjects(_ref) {
65
61
  return undefined;
66
62
  }
67
63
  };
68
-
69
64
  const setFormFields = data => {
70
65
  const isFunction = typeof data === "function";
71
66
  setForm(state => {
72
67
  if (state.fields) {
73
- return { ...state,
68
+ return {
69
+ ...state,
74
70
  fields: isFunction ? data(state.fields) : data
75
71
  };
76
72
  } else {
@@ -78,7 +74,6 @@ function ObjectWithIterableObjects(_ref) {
78
74
  }
79
75
  });
80
76
  };
81
-
82
77
  const setFormField = function (data) {
83
78
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
84
79
  const isFunction = typeof data === "function";
@@ -90,10 +85,8 @@ function ObjectWithIterableObjects(_ref) {
90
85
  };
91
86
  result.item = fields[key] || fields.find(f => f.key === key);
92
87
  if (!result.item) return result;
93
-
94
88
  if (Array.isArray(fields)) {
95
89
  const index = parseInt(key, 10);
96
-
97
90
  if (!isNaN(index)) {
98
91
  result.fields.splice(key, 1);
99
92
  } else {
@@ -104,47 +97,43 @@ function ObjectWithIterableObjects(_ref) {
104
97
  let {
105
98
  key: fKey
106
99
  } = _ref2;
107
-
108
100
  if (key !== fKey) {
109
101
  object[key] = fields[key];
110
102
  }
111
-
112
103
  return object;
113
104
  }, {});
114
105
  }
115
-
116
106
  return result;
117
107
  };
118
-
119
108
  const update = fields => {
120
109
  //KEY is NULLable
121
110
  if (!key) {
122
111
  return data.key ? Object.values(fields).reduce((result, field, i) => {
123
112
  const index = fields[field.key] ? field.key : i;
124
- return { ...result,
113
+ return {
114
+ ...result,
125
115
  [index]: data.key === field.key ? isFunction ? data(field) : data : field
126
116
  };
127
- }, {}) : { ...fields,
117
+ }, {}) : {
118
+ ...fields,
128
119
  [fields.length || 0]: isFunction ? data({}) : data
129
120
  };
130
121
  }
131
-
132
122
  const {
133
123
  fields: filtered,
134
124
  item: field
135
125
  } = pop(fields, key);
136
- const updatedField = isFunction ? data(field || {}) : { ...field,
126
+ const updatedField = isFunction ? data(field || {}) : {
127
+ ...field,
137
128
  ...data
138
129
  };
139
130
  return joinData(filtered, fields[key] ? {
140
131
  [key]: updatedField
141
132
  } : updatedField);
142
133
  };
143
-
144
134
  return update(fields);
145
135
  });
146
136
  };
147
-
148
137
  return {
149
138
  joinData,
150
139
  getFieldData,
@@ -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 = ObjectWithNamedKeyObjects;
9
-
10
8
  var _General = _interopRequireDefault(require("../functions/General"));
11
-
12
9
  const noop = () => {};
13
-
14
10
  function ObjectWithNamedKeyObjects() {
15
11
  let {
16
12
  form,
@@ -27,22 +23,20 @@ function ObjectWithNamedKeyObjects() {
27
23
  } = (0, _General.default)({
28
24
  FormFields
29
25
  });
30
-
31
26
  const getFormField = function (key) {
32
27
  var _Object$values, _Object$keys;
33
-
34
28
  let argForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : form;
35
29
  return ((_Object$values = Object.values(getFormFields(argForm))) === null || _Object$values === void 0 ? void 0 : _Object$values.find(field => (field === null || field === void 0 ? void 0 : field.key) === key)) || ((_Object$keys = Object.keys(getFormFields(argForm))) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce((result, field) => {
36
30
  if (field === key) result = getFormFields(argForm)[field];
37
31
  return result;
38
32
  }, null));
39
33
  };
40
-
41
34
  const setFormFields = data => {
42
35
  const isFunction = typeof data === "function";
43
36
  setForm(state => {
44
37
  if (state.fields) {
45
- return { ...state,
38
+ return {
39
+ ...state,
46
40
  fields: isFunction ? data(state.fields) : data
47
41
  };
48
42
  } else {
@@ -50,25 +44,22 @@ function ObjectWithNamedKeyObjects() {
50
44
  }
51
45
  });
52
46
  };
53
-
54
47
  const setFormField = function (data) {
55
48
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
56
49
  return setFormFields(fields => updateFormField(fields, data, key));
57
50
  };
58
-
59
51
  const removeAllFormFields = () => setFormFields({});
60
-
61
- const removeFormField = key => setFormFields(state => Object.keys(state).filter(fKey => fKey !== key).reduce((obj, key) => ({ ...obj,
52
+ const removeFormField = key => setFormFields(state => Object.keys(state).filter(fKey => fKey !== key).reduce((obj, key) => ({
53
+ ...obj,
62
54
  [key]: state[key]
63
55
  }), {}));
64
-
65
56
  const removeFormFields = _ref => {
66
57
  let [...keys] = _ref;
67
- return setFormFields(state => Object.keys(state).filter(fKey => !keys.includes(fKey)).reduce((obj, key) => ({ ...obj,
58
+ return setFormFields(state => Object.keys(state).filter(fKey => !keys.includes(fKey)).reduce((obj, key) => ({
59
+ ...obj,
68
60
  [key]: state[key]
69
61
  }), {}));
70
62
  };
71
-
72
63
  return {
73
64
  joinData,
74
65
  getFieldData,