intelicoreact 1.3.21 → 1.3.22

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