intelicoreact 1.3.19 → 1.3.21

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 (252) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +23 -15
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +23 -15
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +124 -69
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +36 -27
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +39 -23
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +246 -110
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +85 -44
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +414 -246
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +9 -5
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +165 -93
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +64 -39
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +132 -51
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +73 -34
  14. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +75 -54
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +110 -67
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +83 -33
  17. package/dist/Atomic/FormElements/Input/Input.js +253 -161
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +102 -48
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +40 -27
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +58 -28
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +176 -108
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +57 -32
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +302 -184
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +157 -85
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +16 -11
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +193 -76
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +58 -34
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +12 -8
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +964 -554
  30. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  31. package/dist/Atomic/FormElements/InputMask/functions.js +43 -17
  32. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +404 -268
  33. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  34. package/dist/Atomic/FormElements/InputMask2/functions.js +43 -17
  35. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +459 -299
  36. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  37. package/dist/Atomic/FormElements/InputMask3/functions.js +43 -17
  38. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +113 -53
  39. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +118 -64
  40. package/dist/Atomic/FormElements/Label/Label.js +23 -13
  41. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +349 -217
  42. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +47 -25
  43. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +207 -133
  44. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +61 -29
  45. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +42 -20
  46. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +33 -22
  47. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +43 -20
  48. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +101 -54
  49. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +102 -59
  50. package/dist/Atomic/FormElements/RangeList/RangeList.js +150 -89
  51. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +29 -23
  52. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +300 -135
  53. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +571 -381
  54. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +24 -14
  55. package/dist/Atomic/FormElements/Switcher/Switcher.js +29 -24
  56. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +47 -25
  57. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +32 -20
  58. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +55 -32
  59. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +42 -22
  60. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +33 -23
  61. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +120 -51
  62. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
  63. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +46 -23
  64. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +417 -253
  65. package/dist/Atomic/FormElements/Text/Text.js +53 -47
  66. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +31 -21
  67. package/dist/Atomic/FormElements/Textarea/Textarea.js +27 -16
  68. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +128 -68
  69. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +36 -25
  70. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +70 -33
  71. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +124 -58
  72. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
  73. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +80 -48
  74. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +42 -32
  75. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +60 -40
  76. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +3 -2
  77. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +69 -50
  78. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  79. package/dist/Atomic/Layout/Header/Header.js +48 -21
  80. package/dist/Atomic/Layout/MainMenu/MainMenu.js +79 -36
  81. package/dist/Atomic/Layout/Spinner/Spinner.js +14 -8
  82. package/dist/Atomic/UI/Accordion/Accordion.js +48 -18
  83. package/dist/Atomic/UI/Accordion/AccordionItem.js +60 -35
  84. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +106 -49
  85. package/dist/Atomic/UI/AccordionText/AccordionText.js +37 -13
  86. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +94 -48
  87. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +50 -22
  88. package/dist/Atomic/UI/Alert/Alert.js +44 -20
  89. package/dist/Atomic/UI/Arrow/Arrow.js +35 -15
  90. package/dist/Atomic/UI/Box/Box.js +21 -14
  91. package/dist/Atomic/UI/Button/Button.js +35 -26
  92. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +31 -22
  93. package/dist/Atomic/UI/Chart/Chart.js +86 -45
  94. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +24 -14
  95. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +22 -13
  96. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +113 -68
  97. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +140 -158
  98. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +42 -26
  99. package/dist/Atomic/UI/Chart/partial/utils.js +48 -20
  100. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +42 -22
  101. package/dist/Atomic/UI/DateTime/DateTime.js +38 -23
  102. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +36 -12
  103. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +21 -5
  104. package/dist/Atomic/UI/DoubleString/DoubleString.js +50 -27
  105. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +63 -15
  106. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +157 -62
  107. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +110 -47
  108. package/dist/Atomic/UI/Hint/Hint.js +94 -49
  109. package/dist/Atomic/UI/Modal/Modal.js +179 -149
  110. package/dist/Atomic/UI/Modal/ModalHOC.js +21 -12
  111. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +12 -7
  112. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +21 -17
  113. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +167 -94
  114. package/dist/Atomic/UI/ModalBackup/Modal.js +90 -65
  115. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
  116. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
  117. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
  118. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +62 -32
  119. package/dist/Atomic/UI/NavLine/NavLine.js +211 -120
  120. package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
  121. package/dist/Atomic/UI/PageTitle/PageTitle.js +17 -13
  122. package/dist/Atomic/UI/PieChart/PieChart.js +21 -11
  123. package/dist/Atomic/UI/Price/Price.js +13 -10
  124. package/dist/Atomic/UI/PriceRange/PriceRange.js +11 -7
  125. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +56 -27
  126. package/dist/Atomic/UI/Status/Status.js +30 -19
  127. package/dist/Atomic/UI/Table/Partials/TdCell.js +71 -28
  128. package/dist/Atomic/UI/Table/Partials/TdHeader.js +16 -7
  129. package/dist/Atomic/UI/Table/Partials/TdRow.js +65 -29
  130. package/dist/Atomic/UI/Table/Partials/TdTitle.js +40 -16
  131. package/dist/Atomic/UI/Table/Table.js +47 -27
  132. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +48 -18
  133. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +19 -9
  134. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +8 -5
  135. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +47 -25
  136. package/dist/Atomic/UI/Tag/Tag.js +48 -20
  137. package/dist/Atomic/UI/TagList/TagList.js +150 -80
  138. package/dist/Atomic/UI/UserBox/UserBox.js +26 -14
  139. package/dist/Classes/AbortableFetch.js +422 -283
  140. package/dist/Classes/AnimatedHandler.js +56 -44
  141. package/dist/Classes/RESTAPI/index.js +433 -154
  142. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +428 -290
  143. package/dist/Classes/RESTAPI/partials/ApiBase.js +67 -24
  144. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +275 -57
  145. package/dist/Classes/RESTAPI/partials/ApiUtils.js +377 -146
  146. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +403 -155
  147. package/dist/Classes/RESTAPI/partials/Utils.js +135 -81
  148. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
  149. package/dist/Classes/RESTAPI/partials/_utils.js +395 -101
  150. package/dist/Constants/index.constants.js +15 -8
  151. package/dist/Functions/Portal.js +33 -14
  152. package/dist/Functions/customEventListener.js +20 -5
  153. package/dist/Functions/fieldValueFormatters.js +211 -148
  154. package/dist/Functions/hooks/useFormFieldsChangesManager.js +137 -75
  155. package/dist/Functions/locale/createTranslator.js +27 -13
  156. package/dist/Functions/operations.js +49 -35
  157. package/dist/Functions/presets/inputMaskPresets.js +27 -25
  158. package/dist/Functions/presets/inputPresets.js +22 -19
  159. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
  160. package/dist/Functions/schemas.js +15 -6
  161. package/dist/Functions/useClickOutside.js +7 -3
  162. package/dist/Functions/useDebounce.js +25 -11
  163. package/dist/Functions/useFieldFocus.js +67 -42
  164. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +54 -35
  165. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +95 -74
  166. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +91 -55
  167. package/dist/Functions/useFormTools/functions/General.js +99 -80
  168. package/dist/Functions/useFormTools/functions/RenderFields.js +72 -45
  169. package/dist/Functions/useFormTools/functions/usePrevious.js +7 -3
  170. package/dist/Functions/useFormTools/index.js +598 -382
  171. package/dist/Functions/useInputHighlightError.js +52 -27
  172. package/dist/Functions/useIsMobile.js +36 -13
  173. package/dist/Functions/useLocalStorage.js +22 -7
  174. package/dist/Functions/useLocationParams.js +27 -16
  175. package/dist/Functions/useMetaInfo.js +50 -19
  176. package/dist/Functions/useMouseUpOutside.js +5 -2
  177. package/dist/Functions/useOnlineStatus.js +26 -7
  178. package/dist/Functions/usePasswordChecker.js +77 -42
  179. package/dist/Functions/usePrevious.js +7 -3
  180. package/dist/Functions/useResize.js +32 -12
  181. package/dist/Functions/useScrollTo.js +20 -6
  182. package/dist/Functions/useToggle.js +30 -10
  183. package/dist/Functions/utils.js +366 -186
  184. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +32 -21
  185. package/dist/Molecular/CustomIcons/components/AlertCircle.js +32 -21
  186. package/dist/Molecular/CustomIcons/components/AppStore.js +36 -25
  187. package/dist/Molecular/CustomIcons/components/Arrow.js +42 -31
  188. package/dist/Molecular/CustomIcons/components/ArrowDown.js +24 -13
  189. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +27 -16
  190. package/dist/Molecular/CustomIcons/components/ArrowRight.js +27 -16
  191. package/dist/Molecular/CustomIcons/components/ArrowUp.js +24 -13
  192. package/dist/Molecular/CustomIcons/components/Bell.js +22 -11
  193. package/dist/Molecular/CustomIcons/components/Button.js +22 -11
  194. package/dist/Molecular/CustomIcons/components/Campaigns.js +23 -12
  195. package/dist/Molecular/CustomIcons/components/Check.js +23 -12
  196. package/dist/Molecular/CustomIcons/components/Check2.js +22 -11
  197. package/dist/Molecular/CustomIcons/components/ChevronDown.js +22 -11
  198. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +22 -11
  199. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +22 -11
  200. package/dist/Molecular/CustomIcons/components/ChevronRight.js +22 -11
  201. package/dist/Molecular/CustomIcons/components/ChevronUp.js +22 -11
  202. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +37 -26
  203. package/dist/Molecular/CustomIcons/components/Close.js +24 -13
  204. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +49 -38
  205. package/dist/Molecular/CustomIcons/components/Delete.js +23 -12
  206. package/dist/Molecular/CustomIcons/components/Edit.js +22 -11
  207. package/dist/Molecular/CustomIcons/components/Email.js +40 -29
  208. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +30 -19
  209. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +38 -27
  210. package/dist/Molecular/CustomIcons/components/Flows.js +22 -11
  211. package/dist/Molecular/CustomIcons/components/Gift.js +27 -16
  212. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +36 -25
  213. package/dist/Molecular/CustomIcons/components/GooglePlay.js +36 -25
  214. package/dist/Molecular/CustomIcons/components/HelpCircle.js +25 -14
  215. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +26 -15
  216. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +25 -14
  217. package/dist/Molecular/CustomIcons/components/Home.js +25 -14
  218. package/dist/Molecular/CustomIcons/components/Home2.js +28 -17
  219. package/dist/Molecular/CustomIcons/components/Key.js +30 -19
  220. package/dist/Molecular/CustomIcons/components/Landers.js +26 -15
  221. package/dist/Molecular/CustomIcons/components/Lock.js +22 -11
  222. package/dist/Molecular/CustomIcons/components/Mail.js +30 -19
  223. package/dist/Molecular/CustomIcons/components/Mastercard.js +72 -61
  224. package/dist/Molecular/CustomIcons/components/Minus.js +35 -24
  225. package/dist/Molecular/CustomIcons/components/Offers.js +23 -12
  226. package/dist/Molecular/CustomIcons/components/Pause.js +35 -24
  227. package/dist/Molecular/CustomIcons/components/PayPal.js +49 -38
  228. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +36 -25
  229. package/dist/Molecular/CustomIcons/components/Phone.js +37 -26
  230. package/dist/Molecular/CustomIcons/components/Play.js +35 -24
  231. package/dist/Molecular/CustomIcons/components/Plus.js +35 -24
  232. package/dist/Molecular/CustomIcons/components/Profile.js +27 -16
  233. package/dist/Molecular/CustomIcons/components/QRCode.js +37 -26
  234. package/dist/Molecular/CustomIcons/components/Rectangle.js +22 -11
  235. package/dist/Molecular/CustomIcons/components/Revert.js +25 -14
  236. package/dist/Molecular/CustomIcons/components/Star.js +21 -10
  237. package/dist/Molecular/CustomIcons/components/Star2.js +23 -12
  238. package/dist/Molecular/CustomIcons/components/TrafficSources.js +25 -14
  239. package/dist/Molecular/CustomIcons/components/Trash.js +22 -11
  240. package/dist/Molecular/CustomIcons/components/TrashRed.js +22 -11
  241. package/dist/Molecular/CustomIcons/components/Triggers.js +22 -11
  242. package/dist/Molecular/CustomIcons/components/User.js +27 -16
  243. package/dist/Molecular/CustomIcons/components/Visa.js +38 -27
  244. package/dist/Molecular/CustomIcons/components/X.js +22 -11
  245. package/dist/Molecular/CustomIcons/index.js +183 -61
  246. package/dist/Molecular/FormElement/FormElement.js +27 -18
  247. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +108 -86
  248. package/dist/Molecular/FormWithDependOn/partials/_utils.js +34 -29
  249. package/dist/Molecular/InputAddress/InputAddress.js +312 -176
  250. package/dist/Molecular/InputPassword/InputPassword.js +39 -15
  251. package/dist/index.js +3 -1
  252. package/package.json +1 -1
@@ -1,59 +1,79 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = ObjectWithIterableObjects;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
+
14
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
7
20
  function ObjectWithIterableObjects(_ref) {
8
- let {
9
- form,
10
- setForm,
11
- FormFields
12
- } = _ref;
13
- const joinData = function () {
21
+ var form = _ref.form,
22
+ setForm = _ref.setForm,
23
+ FormFields = _ref.FormFields;
24
+
25
+ var joinData = function joinData() {
14
26
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
27
  args[_key] = arguments[_key];
16
28
  }
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;
29
+
30
+ var mainArg = args[0];
31
+ var MainArgProto = Array.isArray(mainArg) ? 'Array' : (0, _typeof2.default)(mainArg) === 'object' ? 'Object' : undefined;
32
+ var template = Array.isArray(mainArg) ? [] : (0, _typeof2.default)(mainArg) === 'object' ? {} : null;
20
33
  if (!template) return undefined;
21
- return args.reduce((result, item) => {
34
+ return args.reduce(function (result, item) {
22
35
  if (MainArgProto === 'Array') {
23
36
  if (Array.isArray(item)) {
24
- return [...result, ...item];
37
+ return [].concat((0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(item));
25
38
  } else {
26
- return [...result, item];
39
+ return [].concat((0, _toConsumableArray2.default)(result), [item]);
27
40
  }
28
41
  } else if (MainArgProto === 'Object') {
29
- return {
30
- ...result,
31
- ...item
32
- };
42
+ return _objectSpread(_objectSpread({}, result), item);
33
43
  } else {
34
44
  return template;
35
45
  }
36
46
  }, template);
37
47
  };
38
- const getFieldData = key => {
48
+
49
+ var getFieldData = function getFieldData(key) {
39
50
  if (Array.isArray(FormFields)) {
40
- return FormFields[key] || FormFields.find(f => f.key === key);
41
- } else if (typeof FormFields === 'object') {
42
- return FormFields[key] || Object.values(FormFields).find(f => f.key === key);
51
+ return FormFields[key] || FormFields.find(function (f) {
52
+ return f.key === key;
53
+ });
54
+ } else if ((0, _typeof2.default)(FormFields) === 'object') {
55
+ return FormFields[key] || Object.values(FormFields).find(function (f) {
56
+ return f.key === key;
57
+ });
43
58
  } else {
44
59
  return undefined;
45
60
  }
46
61
  };
47
- const getFormFields = () => {
62
+
63
+ var getFormFields = function getFormFields() {
48
64
  return form.fields || form;
49
65
  };
50
- const getFormField = key => {
66
+
67
+ var getFormField = function getFormField(key) {
51
68
  // eslint-disable-next-line no-undef
52
69
  if (FormProto === 'Array') {
53
- return getFormFields().find(field => field.key === key);
54
- // eslint-disable-next-line no-undef
70
+ return getFormFields().find(function (field) {
71
+ return field.key === key;
72
+ }); // eslint-disable-next-line no-undef
55
73
  } else if (FormProto === 'Object') {
56
- return Object.values(getFormFields()).find(field => field.key === key) || Object.keys(getFormFields()).reduce((result, field) => {
74
+ return Object.values(getFormFields()).find(function (field) {
75
+ return field.key === key;
76
+ }) || Object.keys(getFormFields()).reduce(function (result, field) {
57
77
  if (field === key) result = getFormFields()[field];
58
78
  return result;
59
79
  }, {});
@@ -61,85 +81,86 @@ function ObjectWithIterableObjects(_ref) {
61
81
  return undefined;
62
82
  }
63
83
  };
64
- const setFormFields = data => {
65
- const isFunction = typeof data === 'function';
66
- setForm(state => {
84
+
85
+ var setFormFields = function setFormFields(data) {
86
+ var isFunction = typeof data === 'function';
87
+ setForm(function (state) {
67
88
  if (state.fields) {
68
- return {
69
- ...state,
89
+ return _objectSpread(_objectSpread({}, state), {}, {
70
90
  fields: isFunction ? data(state.fields) : data
71
- };
91
+ });
72
92
  } else {
73
93
  return isFunction ? data(state) : data;
74
94
  }
75
95
  });
76
96
  };
77
- const setFormField = function (data) {
78
- let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
79
- const isFunction = typeof data === 'function';
80
- setFormFields(fields => {
81
- const pop = (fields, key) => {
82
- const result = {
83
- fields,
97
+
98
+ var setFormField = function setFormField(data) {
99
+ var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
100
+ var isFunction = typeof data === 'function';
101
+ setFormFields(function (fields) {
102
+ var pop = function pop(fields, key) {
103
+ var result = {
104
+ fields: fields,
84
105
  item: undefined
85
106
  };
86
- result.item = fields[key] || fields.find(f => f.key === key);
107
+ result.item = fields[key] || fields.find(function (f) {
108
+ return f.key === key;
109
+ });
87
110
  if (!result.item) return result;
111
+
88
112
  if (Array.isArray(fields)) {
89
- const index = parseInt(key);
113
+ var index = parseInt(key);
114
+
90
115
  if (!isNaN(index)) {
91
116
  result.fields.splice(key, 1);
92
117
  } else {
93
- result.fields = result.fields.filter(f => f.key !== key);
118
+ result.fields = result.fields.filter(function (f) {
119
+ return f.key !== key;
120
+ });
94
121
  }
95
- } else if (typeof fields === 'object') {
96
- result.fields = Object.values(fields).reduce((object, _ref2) => {
97
- let {
98
- key: fKey
99
- } = _ref2;
122
+ } else if ((0, _typeof2.default)(fields) === 'object') {
123
+ result.fields = Object.values(fields).reduce(function (object, _ref2) {
124
+ var fKey = _ref2.key;
125
+
100
126
  if (key !== fKey) {
101
127
  object[key] = fields[key];
102
128
  }
129
+
103
130
  return object;
104
131
  }, {});
105
132
  }
133
+
106
134
  return result;
107
135
  };
108
- const update = fields => {
136
+
137
+ var update = function update(fields) {
109
138
  //KEY is NULLable
110
139
  if (!key) {
111
- return data.key ? Object.values(fields).reduce((result, field, i) => {
112
- const index = fields[field.key] ? field.key : i;
113
- return {
114
- ...result,
115
- [index]: data.key === field.key ? isFunction ? data(field) : data : field
116
- };
117
- }, {}) : {
118
- ...fields,
119
- [fields.length || 0]: isFunction ? data({}) : data
120
- };
140
+ return data.key ? Object.values(fields).reduce(function (result, field, i) {
141
+ var index = fields[field.key] ? field.key : i;
142
+ return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, index, data.key === field.key ? isFunction ? data(field) : data : field));
143
+ }, {}) : _objectSpread(_objectSpread({}, fields), {}, (0, _defineProperty2.default)({}, fields.length || 0, isFunction ? data({}) : data));
121
144
  }
122
- const {
123
- fields: filtered,
124
- item: field
125
- } = pop(fields, key);
126
- const updatedField = isFunction ? data(field || {}) : {
127
- ...field,
128
- ...data
129
- };
130
- return joinData(filtered, fields[key] ? {
131
- [key]: updatedField
132
- } : updatedField);
145
+
146
+ var _pop = pop(fields, key),
147
+ filtered = _pop.fields,
148
+ field = _pop.item;
149
+
150
+ var updatedField = isFunction ? data(field || {}) : _objectSpread(_objectSpread({}, field), data);
151
+ return joinData(filtered, fields[key] ? (0, _defineProperty2.default)({}, key, updatedField) : updatedField);
133
152
  };
153
+
134
154
  return update(fields);
135
155
  });
136
156
  };
157
+
137
158
  return {
138
- joinData,
139
- getFieldData,
140
- getFormFields,
141
- getFormField,
142
- setFormFields,
143
- setFormField
159
+ joinData: joinData,
160
+ getFieldData: getFieldData,
161
+ getFormFields: getFormFields,
162
+ getFormField: getFormField,
163
+ setFormFields: setFormFields,
164
+ setFormField: setFormField
144
165
  };
145
166
  }
@@ -1,78 +1,114 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = ObjectWithNamedKeyObjects;
8
- var _General = _interopRequireDefault(require("../functions/General"));
9
- const noop = () => {};
9
+
10
+ var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _General2 = _interopRequireDefault(require("../functions/General"));
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
20
+ var noop = function noop() {};
21
+
10
22
  function ObjectWithNamedKeyObjects() {
11
- let {
12
- form,
13
- setForm = noop,
14
- FormFields
15
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
- const {
17
- joinData,
18
- getFieldData,
19
- updateFormField,
20
- getFormFields,
21
- getFormFieldsAsArray,
22
- getFormFieldsKeys
23
- } = (0, _General.default)({
24
- FormFields
25
- });
26
- const getFormField = function (key) {
23
+ var _ref4;
24
+
25
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
26
+ form = _ref.form,
27
+ _ref$setForm = _ref.setForm,
28
+ setForm = _ref$setForm === void 0 ? noop : _ref$setForm,
29
+ FormFields = _ref.FormFields;
30
+
31
+ var _General = (0, _General2.default)({
32
+ FormFields: FormFields
33
+ }),
34
+ joinData = _General.joinData,
35
+ getFieldData = _General.getFieldData,
36
+ updateFormField = _General.updateFormField,
37
+ _getFormFields = _General.getFormFields,
38
+ _getFormFieldsAsArray = _General.getFormFieldsAsArray,
39
+ _getFormFieldsKeys = _General.getFormFieldsKeys;
40
+
41
+ var getFormField = function getFormField(key) {
27
42
  var _Object$values, _Object$keys;
28
- let argForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : form;
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) => {
30
- if (field === key) result = getFormFields(argForm)[field];
43
+
44
+ var argForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : form;
45
+ return ((_Object$values = Object.values(_getFormFields(argForm))) === null || _Object$values === void 0 ? void 0 : _Object$values.find(function (field) {
46
+ return (field === null || field === void 0 ? void 0 : field.key) === key;
47
+ })) || ((_Object$keys = Object.keys(_getFormFields(argForm))) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce(function (result, field) {
48
+ if (field === key) result = _getFormFields(argForm)[field];
31
49
  return result;
32
50
  }, null));
33
51
  };
34
- const setFormFields = data => {
35
- const isFunction = typeof data === 'function';
36
- setForm(state => {
52
+
53
+ var setFormFields = function setFormFields(data) {
54
+ var isFunction = typeof data === 'function';
55
+ setForm(function (state) {
37
56
  if (state.fields) {
38
- return {
39
- ...state,
57
+ return _objectSpread(_objectSpread({}, state), {}, {
40
58
  fields: isFunction ? data(state.fields) : data
41
- };
59
+ });
42
60
  } else {
43
61
  return isFunction ? data(state) : data;
44
62
  }
45
63
  });
46
64
  };
47
- const setFormField = function (data) {
48
- let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
49
- return setFormFields(fields => updateFormField(fields, data, key));
65
+
66
+ var setFormField = function setFormField(data) {
67
+ var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
68
+ return setFormFields(function (fields) {
69
+ return updateFormField(fields, data, key);
70
+ });
50
71
  };
51
- const removeAllFormFields = () => setFormFields({});
52
- const removeFormField = key => setFormFields(state => Object.keys(state).filter(fKey => fKey !== key).reduce((obj, key) => ({
53
- ...obj,
54
- [key]: state[key]
55
- }), {}));
56
- const removeFormFields = _ref => {
57
- let [...keys] = _ref;
58
- return setFormFields(state => Object.keys(state).filter(fKey => !keys.includes(fKey)).reduce((obj, key) => ({
59
- ...obj,
60
- [key]: state[key]
61
- }), {}));
72
+
73
+ var removeAllFormFields = function removeAllFormFields() {
74
+ return setFormFields({});
62
75
  };
63
- return {
64
- joinData,
65
- getFieldData,
66
- getFormFields,
67
- getFormField,
68
- setFormFields,
69
- setFormField,
70
- // eslint-disable-next-line no-dupe-keys
71
- getFormFields: () => getFormFields(form),
72
- getFormFieldsAsArray: () => getFormFieldsAsArray(getFormFields(form)),
73
- getFormFieldsKeys: () => getFormFieldsKeys(getFormFields(form)),
74
- removeAllFormFields,
75
- removeFormField,
76
- removeFormFields
76
+
77
+ var removeFormField = function removeFormField(key) {
78
+ return setFormFields(function (state) {
79
+ return Object.keys(state).filter(function (fKey) {
80
+ return fKey !== key;
81
+ }).reduce(function (obj, key) {
82
+ return _objectSpread(_objectSpread({}, obj), {}, (0, _defineProperty2.default)({}, key, state[key]));
83
+ }, {});
84
+ });
77
85
  };
86
+
87
+ var removeFormFields = function removeFormFields(_ref2) {
88
+ var _ref3 = (0, _toArray2.default)(_ref2),
89
+ keys = _ref3.slice(0);
90
+
91
+ return setFormFields(function (state) {
92
+ return Object.keys(state).filter(function (fKey) {
93
+ return !keys.includes(fKey);
94
+ }).reduce(function (obj, key) {
95
+ return _objectSpread(_objectSpread({}, obj), {}, (0, _defineProperty2.default)({}, key, state[key]));
96
+ }, {});
97
+ });
98
+ };
99
+
100
+ return _ref4 = {
101
+ joinData: joinData,
102
+ getFieldData: getFieldData,
103
+ getFormFields: _getFormFields,
104
+ getFormField: getFormField,
105
+ setFormFields: setFormFields,
106
+ setFormField: setFormField
107
+ }, (0, _defineProperty2.default)(_ref4, "getFormFields", function getFormFields() {
108
+ return _getFormFields(form);
109
+ }), (0, _defineProperty2.default)(_ref4, "getFormFieldsAsArray", function getFormFieldsAsArray() {
110
+ return _getFormFieldsAsArray(_getFormFields(form));
111
+ }), (0, _defineProperty2.default)(_ref4, "getFormFieldsKeys", function getFormFieldsKeys() {
112
+ return _getFormFieldsKeys(_getFormFields(form));
113
+ }), (0, _defineProperty2.default)(_ref4, "removeAllFormFields", removeAllFormFields), (0, _defineProperty2.default)(_ref4, "removeFormField", removeFormField), (0, _defineProperty2.default)(_ref4, "removeFormFields", removeFormFields), _ref4;
78
114
  }
@@ -1,139 +1,158 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = General;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
+
14
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
7
20
  function General() {
8
- let {
9
- form,
10
- FormFields = []
11
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12
- const joinData = function () {
21
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
22
+ form = _ref.form,
23
+ _ref$FormFields = _ref.FormFields,
24
+ FormFields = _ref$FormFields === void 0 ? [] : _ref$FormFields;
25
+
26
+ var joinData = function joinData() {
13
27
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14
28
  args[_key] = arguments[_key];
15
29
  }
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;
30
+
31
+ var mainArg = args[0];
32
+ var MainArgProto = Array.isArray(mainArg) ? 'Array' : (0, _typeof2.default)(mainArg) === 'object' ? 'Object' : undefined;
33
+ var template = Array.isArray(mainArg) ? [] : (0, _typeof2.default)(mainArg) === 'object' ? {} : null;
19
34
  if (!template) return undefined;
20
- return args.reduce((result, item) => {
35
+ return args.reduce(function (result, item) {
21
36
  if (MainArgProto === 'Array') {
22
37
  if (Array.isArray(item)) {
23
- return [...result, ...item];
38
+ return [].concat((0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(item));
24
39
  } else {
25
- return [...result, item];
40
+ return [].concat((0, _toConsumableArray2.default)(result), [item]);
26
41
  }
27
42
  } else if (MainArgProto === 'Object') {
28
- return {
29
- ...result,
30
- ...item
31
- };
43
+ return _objectSpread(_objectSpread({}, result), item);
32
44
  } else {
33
45
  return template;
34
46
  }
35
47
  }, template);
36
48
  };
37
- const getFieldData = key => {
49
+
50
+ var getFieldData = function getFieldData(key) {
38
51
  if (Array.isArray(FormFields)) {
39
52
  if (FormFields[key]) {
40
- return {
41
- ...FormFields[key]
42
- };
53
+ return _objectSpread({}, FormFields[key]);
43
54
  } else {
44
- return {
45
- ...FormFields.find(f => f.key === key)
46
- };
55
+ return _objectSpread({}, FormFields.find(function (f) {
56
+ return f.key === key;
57
+ }));
47
58
  }
48
- } else if (typeof FormFields === 'object') {
49
- return {
50
- ...FormFields[key]
51
- } || {
52
- ...Object.values(FormFields).find(f => f.key === key)
53
- };
59
+ } else if ((0, _typeof2.default)(FormFields) === 'object') {
60
+ return _objectSpread({}, FormFields[key]) || _objectSpread({}, Object.values(FormFields).find(function (f) {
61
+ return f.key === key;
62
+ }));
54
63
  } else {
55
64
  return undefined;
56
65
  }
57
66
  };
58
- const getFormFields = function () {
59
- let argForm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : form;
67
+
68
+ var getFormFields = function getFormFields() {
69
+ var argForm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : form;
60
70
  return (argForm === null || argForm === void 0 ? void 0 : argForm.fields) || argForm;
61
71
  };
62
- const getFormFieldsAsArray = fields => {
72
+
73
+ var getFormFieldsAsArray = function getFormFieldsAsArray(fields) {
63
74
  if (Array.isArray(fields)) return fields;
64
- if (typeof fields === 'object') {
75
+
76
+ if ((0, _typeof2.default)(fields) === 'object') {
65
77
  return Object.values(fields);
66
78
  }
79
+
67
80
  return fields;
68
81
  };
69
- const getFormFieldsKeys = function () {
70
- let fields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getFormFields();
71
- if (Array.isArray(fields)) return fields.map(_ref => {
72
- let {
73
- key
74
- } = _ref;
82
+
83
+ var getFormFieldsKeys = function getFormFieldsKeys() {
84
+ var fields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getFormFields();
85
+ if (Array.isArray(fields)) return fields.map(function (_ref2) {
86
+ var key = _ref2.key;
75
87
  return key;
76
88
  });
77
- if (typeof fields === 'object') {
78
- return Object.values(fields).map(_ref2 => {
79
- let {
80
- key
81
- } = _ref2;
89
+
90
+ if ((0, _typeof2.default)(fields) === 'object') {
91
+ return Object.values(fields).map(function (_ref3) {
92
+ var key = _ref3.key;
82
93
  return key;
83
94
  });
84
95
  }
96
+
85
97
  return fields;
86
98
  };
87
- const popFormField = (fields, key) => {
88
- const result = {
99
+
100
+ var popFormField = function popFormField(fields, key) {
101
+ var result = {
89
102
  item: undefined,
90
103
  itemIndex: undefined
91
104
  };
105
+
92
106
  if (Array.isArray(fields)) {
93
- result.item = fields === null || fields === void 0 ? void 0 : fields.find(f => f.key === key);
94
- result.itemIndex = result.item ? fields.findIndex(f => f.key === key) : fields.length;
95
- } else if (typeof fields === 'object') {
96
- result.item = fields[key] || Object.values(fields).find(f => f.key === key);
97
- result.itemIndex = result.item ? fields[key] ? key : Object.values(fields).findIndex(f => f.key === key) : key;
107
+ result.item = fields === null || fields === void 0 ? void 0 : fields.find(function (f) {
108
+ return f.key === key;
109
+ });
110
+ result.itemIndex = result.item ? fields.findIndex(function (f) {
111
+ return f.key === key;
112
+ }) : fields.length;
113
+ } else if ((0, _typeof2.default)(fields) === 'object') {
114
+ result.item = fields[key] || Object.values(fields).find(function (f) {
115
+ return f.key === key;
116
+ });
117
+ result.itemIndex = result.item ? fields[key] ? key : Object.values(fields).findIndex(function (f) {
118
+ return f.key === key;
119
+ }) : key;
98
120
  }
121
+
99
122
  return result;
100
123
  };
101
- const updateFormField = (fields, data, key) => {
102
- const isFunction = typeof data === 'function';
103
- //KEY is NULLable
124
+
125
+ var updateFormField = function updateFormField(fields, data, key) {
126
+ var isFunction = typeof data === 'function'; //KEY is NULLable
127
+
104
128
  if (!key) {
105
- return data.key ? Object.values(fields).reduce((result, field, i) => {
106
- const index = fields[field.key] ? field.key : i;
107
- return {
108
- ...result,
109
- [index]: data.key === field.key ? isFunction ? data(field) : data : field
110
- };
111
- }, {}) : {
112
- ...fields,
113
- [fields.length || 0]: isFunction ? data({}) : data
114
- };
129
+ return data.key ? Object.values(fields).reduce(function (result, field, i) {
130
+ var index = fields[field.key] ? field.key : i;
131
+ return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, index, data.key === field.key ? isFunction ? data(field) : data : field));
132
+ }, {}) : _objectSpread(_objectSpread({}, fields), {}, (0, _defineProperty2.default)({}, fields.length || 0, isFunction ? data({}) : data));
115
133
  }
116
- const {
117
- item: field = data,
118
- itemIndex
119
- } = popFormField(fields, key);
120
- fields[itemIndex] = isFunction ? data(field || {}) : {
121
- ...field,
122
- ...data
123
- };
134
+
135
+ var _popFormField = popFormField(fields, key),
136
+ _popFormField$item = _popFormField.item,
137
+ field = _popFormField$item === void 0 ? data : _popFormField$item,
138
+ itemIndex = _popFormField.itemIndex;
139
+
140
+ fields[itemIndex] = isFunction ? data(field || {}) : _objectSpread(_objectSpread({}, field), data);
124
141
  return fields;
125
142
  };
126
- const getFieldClassName = (key, type) => {
143
+
144
+ var getFieldClassName = function getFieldClassName(key, type) {
127
145
  return "form-".concat(type, "_field-").concat(key);
128
146
  };
147
+
129
148
  return {
130
- joinData,
131
- getFieldData,
132
- popFormField,
133
- updateFormField,
134
- getFormFields,
135
- getFormFieldsAsArray,
136
- getFieldClassName,
137
- getFormFieldsKeys
149
+ joinData: joinData,
150
+ getFieldData: getFieldData,
151
+ popFormField: popFormField,
152
+ updateFormField: updateFormField,
153
+ getFormFields: getFormFields,
154
+ getFormFieldsAsArray: getFormFieldsAsArray,
155
+ getFieldClassName: getFieldClassName,
156
+ getFormFieldsKeys: getFormFieldsKeys
138
157
  };
139
158
  }