intelicoreact 1.4.81 → 1.4.83

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 (258) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +13 -13
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +12 -13
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +103 -68
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +26 -26
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +27 -23
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +201 -114
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +69 -46
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +301 -230
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +2 -4
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +201 -145
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +54 -41
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +112 -45
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +63 -34
  14. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +153 -81
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +59 -57
  16. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +98 -66
  17. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +48 -27
  18. package/dist/Atomic/FormElements/Input/Input.js +209 -148
  19. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +77 -50
  20. package/dist/Atomic/FormElements/InputColor/InputColor.js +28 -23
  21. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +53 -38
  22. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +139 -106
  23. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +38 -31
  24. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +230 -135
  25. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +122 -85
  26. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -10
  27. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +159 -72
  28. package/dist/Atomic/FormElements/InputLink/InputLink.js +39 -30
  29. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -8
  30. package/dist/Atomic/FormElements/InputMask/InputMask.js +800 -521
  31. package/dist/Atomic/FormElements/InputMask/config.js +1 -1
  32. package/dist/Atomic/FormElements/InputMask/functions.js +15 -15
  33. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +294 -234
  34. package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
  35. package/dist/Atomic/FormElements/InputMask2/functions.js +15 -15
  36. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +332 -265
  37. package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
  38. package/dist/Atomic/FormElements/InputMask3/functions.js +15 -15
  39. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +101 -53
  40. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +99 -64
  41. package/dist/Atomic/FormElements/Label/Label.js +15 -13
  42. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +284 -190
  43. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +34 -24
  44. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +170 -117
  45. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +50 -28
  46. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +29 -18
  47. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +24 -22
  48. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +31 -19
  49. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +83 -56
  50. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +75 -49
  51. package/dist/Atomic/FormElements/RangeList/RangeList.js +129 -87
  52. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +18 -22
  53. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +250 -143
  54. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +477 -367
  55. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +15 -14
  56. package/dist/Atomic/FormElements/Switcher/Switcher.js +20 -24
  57. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +30 -24
  58. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +23 -20
  59. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +40 -32
  60. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +31 -25
  61. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +22 -22
  62. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +98 -52
  63. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +34 -22
  64. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +81 -47
  65. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +525 -415
  66. package/dist/Atomic/FormElements/Text/Text.js +39 -39
  67. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +23 -21
  68. package/dist/Atomic/FormElements/Textarea/Textarea.js +33 -28
  69. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +98 -67
  70. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +24 -22
  71. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +57 -34
  72. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +94 -56
  73. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +102 -74
  74. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +69 -50
  75. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +33 -30
  76. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +50 -38
  77. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -1
  78. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +59 -47
  79. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -1
  80. package/dist/Atomic/Layout/Header/Header.js +37 -22
  81. package/dist/Atomic/Layout/MainMenu/MainMenu.js +59 -34
  82. package/dist/Atomic/Layout/Spinner/Spinner.js +6 -7
  83. package/dist/Atomic/UI/Accordion/Accordion.js +31 -17
  84. package/dist/Atomic/UI/Accordion/AccordionItem.js +41 -30
  85. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +81 -50
  86. package/dist/Atomic/UI/AccordionText/AccordionText.js +39 -20
  87. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +74 -46
  88. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +37 -21
  89. package/dist/Atomic/UI/Alert/Alert.js +36 -23
  90. package/dist/Atomic/UI/Arrow/Arrow.js +21 -14
  91. package/dist/Atomic/UI/Box/Box.js +12 -11
  92. package/dist/Atomic/UI/Button/Button.js +26 -26
  93. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +21 -21
  94. package/dist/Atomic/UI/Chart/Chart.js +60 -44
  95. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +13 -11
  96. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +10 -12
  97. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +82 -60
  98. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +124 -116
  99. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +30 -18
  100. package/dist/Atomic/UI/Chart/partial/utils.js +30 -16
  101. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +31 -21
  102. package/dist/Atomic/UI/DateTime/DateTime.js +29 -25
  103. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +23 -11
  104. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +12 -4
  105. package/dist/Atomic/UI/DoubleString/DoubleString.js +53 -36
  106. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +55 -14
  107. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +114 -54
  108. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +88 -53
  109. package/dist/Atomic/UI/Hint/Hint.js +87 -58
  110. package/dist/Atomic/UI/Hint/partials/_utils.js +10 -10
  111. package/dist/Atomic/UI/Modal/Modal.js +159 -144
  112. package/dist/Atomic/UI/Modal/ModalHOC.js +17 -14
  113. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +5 -6
  114. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +13 -16
  115. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +118 -73
  116. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +48 -33
  117. package/dist/Atomic/UI/NavLine/NavLine.js +166 -104
  118. package/dist/Atomic/UI/PageTitle/PageTitle.js +8 -12
  119. package/dist/Atomic/UI/PieChart/PieChart.js +11 -10
  120. package/dist/Atomic/UI/Price/Price.js +5 -7
  121. package/dist/Atomic/UI/PriceRange/PriceRange.js +4 -6
  122. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +42 -27
  123. package/dist/Atomic/UI/Status/Status.js +22 -18
  124. package/dist/Atomic/UI/Table/Partials/TdCell.js +47 -28
  125. package/dist/Atomic/UI/Table/Partials/TdHeader.js +5 -6
  126. package/dist/Atomic/UI/Table/Partials/TdRow.js +53 -29
  127. package/dist/Atomic/UI/Table/Partials/TdTitle.js +28 -15
  128. package/dist/Atomic/UI/Table/Table.js +36 -27
  129. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +32 -18
  130. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +10 -8
  131. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +2 -4
  132. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +26 -21
  133. package/dist/Atomic/UI/Tag/Tag.js +72 -52
  134. package/dist/Atomic/UI/TagList/TagList.js +102 -65
  135. package/dist/Atomic/UI/UserBox/UserBox.js +13 -13
  136. package/dist/Atomic/UI/WizardStepper/constructor.js +6 -6
  137. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +16 -20
  138. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +25 -27
  139. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +27 -22
  140. package/dist/Atomic/UI/WizardStepper/ui/icons.js +41 -39
  141. package/dist/Classes/AbortableFetch.js +393 -311
  142. package/dist/Classes/AnimatedHandler.js +53 -45
  143. package/dist/Classes/RESTAPI/index.js +431 -152
  144. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +400 -320
  145. package/dist/Classes/RESTAPI/partials/ApiBase.js +59 -24
  146. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +338 -76
  147. package/dist/Classes/RESTAPI/partials/ApiUtils.js +378 -143
  148. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +375 -159
  149. package/dist/Classes/RESTAPI/partials/Utils.js +128 -87
  150. package/dist/Classes/RESTAPI/partials/_utils.js +388 -116
  151. package/dist/Constants/index.constants.js +7 -7
  152. package/dist/Functions/Portal.js +19 -11
  153. package/dist/Functions/customEventListener.js +7 -5
  154. package/dist/Functions/fieldValueFormatters.js +131 -109
  155. package/dist/Functions/hooks/useFormFieldsChangesManager.js +128 -69
  156. package/dist/Functions/locale/createTranslator.js +21 -11
  157. package/dist/Functions/operations.js +27 -23
  158. package/dist/Functions/presets/inputMaskPreset.js +176 -0
  159. package/dist/Functions/presets/inputMaskPresets.js +17 -17
  160. package/dist/Functions/presets/inputPresets.js +15 -15
  161. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +3 -3
  162. package/dist/Functions/schemas.js +7 -5
  163. package/dist/Functions/useBodyScrollLock.js +3 -3
  164. package/dist/Functions/useClickOutside.js +3 -3
  165. package/dist/Functions/useDebounce.js +20 -11
  166. package/dist/Functions/useFieldFocus.js +51 -38
  167. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +46 -36
  168. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +78 -68
  169. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +81 -54
  170. package/dist/Functions/useFormTools/functions/General.js +80 -71
  171. package/dist/Functions/useFormTools/functions/RenderFields.js +63 -45
  172. package/dist/Functions/useFormTools/functions/usePrevious.js +2 -2
  173. package/dist/Functions/useFormTools/index.js +467 -314
  174. package/dist/Functions/useInputHighlightError.js +42 -26
  175. package/dist/Functions/useIsMobile.js +29 -11
  176. package/dist/Functions/useKeyPress/useHandleKeyPress.js +8 -9
  177. package/dist/Functions/useKeyPress/useKeyPress.js +26 -17
  178. package/dist/Functions/useLocalStorage.js +13 -6
  179. package/dist/Functions/useLocationParams.js +24 -14
  180. package/dist/Functions/useMediaQuery.js +18 -7
  181. package/dist/Functions/useMetaInfo.js +40 -16
  182. package/dist/Functions/useMouseUpOutside.js +2 -2
  183. package/dist/Functions/useOnlineStatus.js +17 -6
  184. package/dist/Functions/usePasswordChecker.js +61 -42
  185. package/dist/Functions/usePrevious.js +2 -2
  186. package/dist/Functions/useResize.js +24 -12
  187. package/dist/Functions/useScrollTo.js +13 -4
  188. package/dist/Functions/useToggle.js +25 -9
  189. package/dist/Functions/utils.js +272 -147
  190. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +27 -23
  191. package/dist/Molecular/CustomIcons/components/AlertCircle.js +27 -23
  192. package/dist/Molecular/CustomIcons/components/AppStore.js +31 -27
  193. package/dist/Molecular/CustomIcons/components/Arrow.js +37 -33
  194. package/dist/Molecular/CustomIcons/components/ArrowDown.js +19 -15
  195. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -18
  196. package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -18
  197. package/dist/Molecular/CustomIcons/components/ArrowUp.js +19 -15
  198. package/dist/Molecular/CustomIcons/components/Bell.js +17 -13
  199. package/dist/Molecular/CustomIcons/components/Button.js +17 -13
  200. package/dist/Molecular/CustomIcons/components/Campaigns.js +18 -14
  201. package/dist/Molecular/CustomIcons/components/Check.js +18 -14
  202. package/dist/Molecular/CustomIcons/components/Check2.js +17 -13
  203. package/dist/Molecular/CustomIcons/components/ChevronDown.js +17 -13
  204. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +17 -13
  205. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +17 -13
  206. package/dist/Molecular/CustomIcons/components/ChevronRight.js +17 -13
  207. package/dist/Molecular/CustomIcons/components/ChevronUp.js +17 -13
  208. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +32 -28
  209. package/dist/Molecular/CustomIcons/components/Close.js +19 -15
  210. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +44 -40
  211. package/dist/Molecular/CustomIcons/components/Delete.js +18 -14
  212. package/dist/Molecular/CustomIcons/components/Edit.js +17 -13
  213. package/dist/Molecular/CustomIcons/components/Email.js +35 -31
  214. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +25 -21
  215. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +33 -29
  216. package/dist/Molecular/CustomIcons/components/Flows.js +17 -13
  217. package/dist/Molecular/CustomIcons/components/Gift.js +22 -18
  218. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +31 -27
  219. package/dist/Molecular/CustomIcons/components/GooglePlay.js +31 -27
  220. package/dist/Molecular/CustomIcons/components/HelpCircle.js +20 -16
  221. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +21 -17
  222. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +20 -16
  223. package/dist/Molecular/CustomIcons/components/Home.js +20 -16
  224. package/dist/Molecular/CustomIcons/components/Home2.js +23 -19
  225. package/dist/Molecular/CustomIcons/components/Key.js +25 -21
  226. package/dist/Molecular/CustomIcons/components/Landers.js +21 -17
  227. package/dist/Molecular/CustomIcons/components/Lock.js +17 -13
  228. package/dist/Molecular/CustomIcons/components/Mail.js +25 -21
  229. package/dist/Molecular/CustomIcons/components/Mastercard.js +65 -61
  230. package/dist/Molecular/CustomIcons/components/Minus.js +30 -26
  231. package/dist/Molecular/CustomIcons/components/Offers.js +18 -14
  232. package/dist/Molecular/CustomIcons/components/Pause.js +30 -26
  233. package/dist/Molecular/CustomIcons/components/PayPal.js +44 -40
  234. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +31 -27
  235. package/dist/Molecular/CustomIcons/components/Phone.js +32 -28
  236. package/dist/Molecular/CustomIcons/components/Play.js +30 -26
  237. package/dist/Molecular/CustomIcons/components/Plus.js +30 -26
  238. package/dist/Molecular/CustomIcons/components/Profile.js +22 -18
  239. package/dist/Molecular/CustomIcons/components/QRCode.js +32 -28
  240. package/dist/Molecular/CustomIcons/components/Rectangle.js +17 -13
  241. package/dist/Molecular/CustomIcons/components/Revert.js +20 -16
  242. package/dist/Molecular/CustomIcons/components/Star.js +14 -10
  243. package/dist/Molecular/CustomIcons/components/Star2.js +18 -14
  244. package/dist/Molecular/CustomIcons/components/TrafficSources.js +20 -16
  245. package/dist/Molecular/CustomIcons/components/Trash.js +17 -13
  246. package/dist/Molecular/CustomIcons/components/TrashRed.js +17 -13
  247. package/dist/Molecular/CustomIcons/components/Triggers.js +17 -13
  248. package/dist/Molecular/CustomIcons/components/User.js +22 -18
  249. package/dist/Molecular/CustomIcons/components/Visa.js +33 -29
  250. package/dist/Molecular/CustomIcons/components/X.js +17 -13
  251. package/dist/Molecular/CustomIcons/index.js +61 -61
  252. package/dist/Molecular/FormElement/FormElement.js +17 -19
  253. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +93 -73
  254. package/dist/Molecular/FormWithDependOn/partials/_utils.js +27 -28
  255. package/dist/Molecular/InputAddress/InputAddress.js +213 -126
  256. package/dist/Molecular/InputPassword/InputPassword.js +23 -13
  257. package/dist/index.js +1 -1
  258. package/package.json +1 -1
@@ -7,16 +7,38 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+
12
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
+
14
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
15
+
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+
18
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
19
+
20
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
21
+
22
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
23
+
24
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
25
+
10
26
  var _classPrivateFieldSet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldSet"));
11
27
 
12
28
  var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));
13
29
 
30
+ var _excluded = ["name", "path", "pathPrefix", "method", "queryParameters", "headers", "body", "options", "callback", "mergeProps"];
31
+
32
+ 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; }
33
+
34
+ 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; }
35
+
14
36
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
15
37
 
16
38
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
17
39
 
18
40
  /* eslint-disable no-unused-vars */
19
- const RESPONSE_AS_OBJECT_ALWAYS_VALUE = "always";
41
+ var RESPONSE_AS_OBJECT_ALWAYS_VALUE = "always";
20
42
 
21
43
  var _pathPrefix = /*#__PURE__*/new WeakMap();
22
44
 
@@ -38,8 +60,10 @@ var _everyPromiseCallback = /*#__PURE__*/new WeakMap();
38
60
 
39
61
  var _isResponseAsObject = /*#__PURE__*/new WeakMap();
40
62
 
41
- class AbortableFetch {
42
- constructor(input) {
63
+ var AbortableFetch = /*#__PURE__*/function () {
64
+ function AbortableFetch(input) {
65
+ (0, _classCallCheck2.default)(this, AbortableFetch);
66
+
43
67
  _classPrivateFieldInitSpec(this, _pathPrefix, {
44
68
  writable: true,
45
69
  value: null
@@ -90,7 +114,7 @@ class AbortableFetch {
90
114
  value: false
91
115
  });
92
116
 
93
- if (input && (typeof input !== "object" || Array.isArray(input))) throw new Error("Not valid input value!");
117
+ if (input && ((0, _typeof2.default)(input) !== "object" || Array.isArray(input))) throw new Error("Not valid input value!");
94
118
  this.getPathPrefix = this.getPathPrefix.bind(this);
95
119
  this.setPathPrefix = this.setPathPrefix.bind(this);
96
120
  this.getMethod = this.getMethod.bind(this);
@@ -120,319 +144,377 @@ class AbortableFetch {
120
144
  this.setProps(input || {});
121
145
  }
122
146
 
123
- request(props) {
124
- if (!props || typeof props !== "object" && typeof props !== "string") throw new Error("Not valid props value!");
125
-
126
- const stringifyBody = b => (b === null || b === void 0 ? void 0 : b.constructor) === FormData ? b : JSON.stringify(b);
127
-
128
- this.requestInput = props; // eslint-disable-next-line no-use-before-define
129
-
130
- const requests = getRequestsArray.call(this, props);
131
- if (!requests.length) return Promise.reject(new Error("There are no any valid props"));
132
- const abortController = new AbortController();
133
- let externalRequest = Promise.all(requests.map(async item => {
134
- const safelyQuery = item.path.includes("?") ? "&".concat(item.queryParameters.replace(/\?/g, "")) : item.queryParameters;
135
- let request = fetch("".concat(item.pathPrefix).concat(item.path).concat(safelyQuery), { ...item.options,
136
- method: item.method,
137
- headers: item.headers,
138
- ...(item.body ? {
139
- body: stringifyBody(item.body)
140
- } : {}),
141
- signal: abortController.signal
142
- }).then(response => {
143
- response.request = item;
144
- return response;
145
- }).catch(response => Promise.resolve({
146
- ok: false,
147
- status: 0,
148
- statusText: response,
149
- request: item
150
- }));
151
- if ((0, _classPrivateFieldGet2.default)(this, _everyPromiseCallback) && !item.isSkipEveryPromiseCallback) request = request.then(response => (0, _classPrivateFieldGet2.default)(this, _everyPromiseCallback).call(this, response));
152
- if (item.callback) request = request.then(response => item.callback(response));
153
- if ((0, _classPrivateFieldGet2.default)(this, _isResponseAsObject)) request = request.then(response => ({
154
- name: item.name,
155
- response
156
- }));
157
- return request;
158
- }));
159
- externalRequest = externalRequest.then(response => response.length < 2 ? response[0] : response);
160
-
161
- if ((0, _classPrivateFieldGet2.default)(this, _isResponseAsObject)) {
162
- externalRequest = externalRequest.then(response => {
163
- if (Array.isArray(props) && props.length > 1) return response.reduce((ac, item) => ({ ...ac,
164
- [item.name]: item.response
165
- }), {});else return (0, _classPrivateFieldGet2.default)(this, _isResponseAsObject) === RESPONSE_AS_OBJECT_ALWAYS_VALUE ? {
166
- [response.name]: response.response
167
- } : response.response;
168
- });
169
- }
147
+ (0, _createClass2.default)(AbortableFetch, [{
148
+ key: "request",
149
+ value: function request(props) {
150
+ var _this = this;
151
+
152
+ if (!props || (0, _typeof2.default)(props) !== "object" && typeof props !== "string") throw new Error("Not valid props value!");
153
+
154
+ var stringifyBody = function stringifyBody(b) {
155
+ return (b === null || b === void 0 ? void 0 : b.constructor) === FormData ? b : JSON.stringify(b);
156
+ };
157
+
158
+ this.requestInput = props; // eslint-disable-next-line no-use-before-define
159
+
160
+ var requests = getRequestsArray.call(this, props);
161
+ if (!requests.length) return Promise.reject(new Error("There are no any valid props"));
162
+ var abortController = new AbortController();
163
+ var externalRequest = Promise.all(requests.map( /*#__PURE__*/function () {
164
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(item) {
165
+ var safelyQuery, request;
166
+ return _regenerator.default.wrap(function _callee$(_context) {
167
+ while (1) {
168
+ switch (_context.prev = _context.next) {
169
+ case 0:
170
+ safelyQuery = item.path.includes("?") ? "&".concat(item.queryParameters.replace(/\?/g, "")) : item.queryParameters;
171
+ request = fetch("".concat(item.pathPrefix).concat(item.path).concat(safelyQuery), _objectSpread(_objectSpread(_objectSpread({}, item.options), {}, {
172
+ method: item.method,
173
+ headers: item.headers
174
+ }, item.body ? {
175
+ body: stringifyBody(item.body)
176
+ } : {}), {}, {
177
+ signal: abortController.signal
178
+ })).then(function (response) {
179
+ response.request = item;
180
+ return response;
181
+ }).catch(function (response) {
182
+ return Promise.resolve({
183
+ ok: false,
184
+ status: 0,
185
+ statusText: response,
186
+ request: item
187
+ });
188
+ });
189
+ if ((0, _classPrivateFieldGet2.default)(_this, _everyPromiseCallback) && !item.isSkipEveryPromiseCallback) request = request.then(function (response) {
190
+ return (0, _classPrivateFieldGet2.default)(_this, _everyPromiseCallback).call(_this, response);
191
+ });
192
+ if (item.callback) request = request.then(function (response) {
193
+ return item.callback(response);
194
+ });
195
+ if ((0, _classPrivateFieldGet2.default)(_this, _isResponseAsObject)) request = request.then(function (response) {
196
+ return {
197
+ name: item.name,
198
+ response: response
199
+ };
200
+ });
201
+ return _context.abrupt("return", request);
202
+
203
+ case 6:
204
+ case "end":
205
+ return _context.stop();
206
+ }
207
+ }
208
+ }, _callee);
209
+ }));
170
210
 
171
- externalRequest = externalRequest.then(response => (0, _classPrivateFieldGet2.default)(this, _callback) ? (0, _classPrivateFieldGet2.default)(this, _callback).call(this, response) : response);
172
- externalRequest = externalRequest.catch(error => (0, _classPrivateFieldGet2.default)(this, _catchCallback) ? (0, _classPrivateFieldGet2.default)(this, _catchCallback).call(this, error) : error); // eslint-disable-next-line no-proto
173
-
174
- externalRequest.__proto__.abort = () => abortController.abort();
175
-
176
- return externalRequest;
177
-
178
- function getRequestsArray(input) {
179
- const requestsArray = (() => {
180
- if (typeof input === "string") return [{
181
- path: input
182
- }];
183
- return Array.isArray(input) ? [...input] : [input];
184
- })();
185
-
186
- return requestsArray.reduce((ac, item, index) => {
187
- const itemObj = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
188
- const {
189
- name,
190
- path,
191
- method,
192
- queryParameters,
193
- headers,
194
- body,
195
- options,
196
- callback,
197
- mergeProps,
198
- isNoPathPrefix,
199
- isSkipEveryPromiseCallback
200
- } = itemObj;
201
- const safelyMergeProps = mergeProps instanceof Object && !Array.isArray(mergeProps) ? mergeProps : {};
202
-
203
- const getMergeProps = key => {
204
- var _safelyMergeProps$all;
205
-
206
- return (_safelyMergeProps$all = safelyMergeProps.all) !== null && _safelyMergeProps$all !== void 0 ? _safelyMergeProps$all : safelyMergeProps[key];
211
+ return function (_x) {
212
+ return _ref.apply(this, arguments);
207
213
  };
214
+ }()));
215
+ externalRequest = externalRequest.then(function (response) {
216
+ return response.length < 2 ? response[0] : response;
217
+ });
208
218
 
209
- if (!path || typeof path !== "string") return ac;
210
- const {
211
- name: omitName,
212
- path: omitPath,
213
- pathPrefix: omitPathPrefix,
214
- method: omitMethod,
215
- queryParameters: omitQueryParameters,
216
- headers: omitHeaders,
217
- body: omitBody,
218
- options: omitOptions,
219
- callback: omitCallback,
220
- mergeProps: omitMergeProps,
221
- ...optionsRest
222
- } = options || {};
223
- return [...ac, {
224
- path,
225
- pathPrefix: getMergeProps("pathPrefix") === "onlyLocal" || isNoPathPrefix ? "" : (0, _classPrivateFieldGet2.default)(this, _pathPrefix) || "",
226
- method: (() => {
227
- if (getMergeProps("method") === "onlyLocal") return method || "GET";
228
- return getMergeProps("method") === "onlyGlobal" ? (0, _classPrivateFieldGet2.default)(this, _method) || "GET" : method || (0, _classPrivateFieldGet2.default)(this, _method) || "GET";
229
- })(),
230
- queryParameters: (() => {
231
- var _getMergeProps, _getMergeProps2;
232
-
233
- if (((_getMergeProps = getMergeProps("queryParameters")) !== null && _getMergeProps !== void 0 ? _getMergeProps : getMergeProps("query")) === "onlyLocal") {
234
- return this.getQueryString(this.getQueryArray(queryParameters));
235
- }
219
+ if ((0, _classPrivateFieldGet2.default)(this, _isResponseAsObject)) {
220
+ externalRequest = externalRequest.then(function (response) {
221
+ if (Array.isArray(props) && props.length > 1) return response.reduce(function (ac, item) {
222
+ return _objectSpread(_objectSpread({}, ac), {}, (0, _defineProperty2.default)({}, item.name, item.response));
223
+ }, {});else return (0, _classPrivateFieldGet2.default)(_this, _isResponseAsObject) === RESPONSE_AS_OBJECT_ALWAYS_VALUE ? (0, _defineProperty2.default)({}, response.name, response.response) : response.response;
224
+ });
225
+ }
236
226
 
237
- return ((_getMergeProps2 = getMergeProps("queryParameters")) !== null && _getMergeProps2 !== void 0 ? _getMergeProps2 : getMergeProps("query")) === "onlyGlobal" ? this.getQueryString(this.getQueryArray((0, _classPrivateFieldGet2.default)(this, _queryParameters))) : this.getQueryString([...this.getQueryArray((0, _classPrivateFieldGet2.default)(this, _queryParameters)), ...this.getQueryArray(queryParameters)]);
238
- })(),
239
- headers: (() => {
240
- if (getMergeProps("headers") === "onlyLocal") return this.getHeadersObj(headers || {});
241
- return getMergeProps("headers") === "onlyGlobal" ? this.getHeadersObj({ ...((0, _classPrivateFieldGet2.default)(this, _headers) || {})
242
- }) : this.getHeadersObj({ ...((0, _classPrivateFieldGet2.default)(this, _headers) || {}),
243
- ...(headers || {})
244
- });
245
- })(),
246
- body: (() => {
247
- if (getMergeProps("body") === "onlyLocal") return body || null;
248
- if (getMergeProps("body") === "onlyGlobal") return (0, _classPrivateFieldGet2.default)(this, _body) || null;
249
-
250
- if (body && (0, _classPrivateFieldGet2.default)(this, _body) && typeof body === typeof (0, _classPrivateFieldGet2.default)(this, _body) && typeof body === "object") {
251
- return Array.isArray(body) ? [...(0, _classPrivateFieldGet2.default)(this, _body), ...body] : { ...(0, _classPrivateFieldGet2.default)(this, _body),
252
- ...body
253
- };
254
- } else return body || (0, _classPrivateFieldGet2.default)(this, _body) || null;
255
- })(),
256
- options: (() => {
257
- if (getMergeProps("options") === "onlyLocal") return { ...(optionsRest || {})
258
- };
259
- return getMergeProps("options") === "onlyGlobal" ? { ...((0, _classPrivateFieldGet2.default)(this, _options) || {})
260
- } : { ...((0, _classPrivateFieldGet2.default)(this, _options) || {}),
261
- ...(optionsRest || {})
262
- };
263
- })(),
264
- callback,
265
- isSkipEveryPromiseCallback,
266
- ...(this.getIsResponseAsObject() ? {
227
+ externalRequest = externalRequest.then(function (response) {
228
+ return (0, _classPrivateFieldGet2.default)(_this, _callback) ? (0, _classPrivateFieldGet2.default)(_this, _callback).call(_this, response) : response;
229
+ });
230
+ externalRequest = externalRequest.catch(function (error) {
231
+ return (0, _classPrivateFieldGet2.default)(_this, _catchCallback) ? (0, _classPrivateFieldGet2.default)(_this, _catchCallback).call(_this, error) : error;
232
+ }); // eslint-disable-next-line no-proto
233
+
234
+ externalRequest.__proto__.abort = function () {
235
+ return abortController.abort();
236
+ };
237
+
238
+ return externalRequest;
239
+
240
+ function getRequestsArray(input) {
241
+ var _this2 = this;
242
+
243
+ var requestsArray = function () {
244
+ if (typeof input === "string") return [{
245
+ path: input
246
+ }];
247
+ return Array.isArray(input) ? (0, _toConsumableArray2.default)(input) : [input];
248
+ }();
249
+
250
+ return requestsArray.reduce(function (ac, item, index) {
251
+ var itemObj = (0, _typeof2.default)(item) === "object" && item !== null && !Array.isArray(item) ? item : {};
252
+ var name = itemObj.name,
253
+ path = itemObj.path,
254
+ method = itemObj.method,
255
+ queryParameters = itemObj.queryParameters,
256
+ headers = itemObj.headers,
257
+ body = itemObj.body,
258
+ options = itemObj.options,
259
+ callback = itemObj.callback,
260
+ mergeProps = itemObj.mergeProps,
261
+ isNoPathPrefix = itemObj.isNoPathPrefix,
262
+ isSkipEveryPromiseCallback = itemObj.isSkipEveryPromiseCallback;
263
+ var safelyMergeProps = mergeProps instanceof Object && !Array.isArray(mergeProps) ? mergeProps : {};
264
+
265
+ var getMergeProps = function getMergeProps(key) {
266
+ var _safelyMergeProps$all;
267
+
268
+ return (_safelyMergeProps$all = safelyMergeProps.all) !== null && _safelyMergeProps$all !== void 0 ? _safelyMergeProps$all : safelyMergeProps[key];
269
+ };
270
+
271
+ if (!path || typeof path !== "string") return ac;
272
+
273
+ var _ref3 = options || {},
274
+ omitName = _ref3.name,
275
+ omitPath = _ref3.path,
276
+ omitPathPrefix = _ref3.pathPrefix,
277
+ omitMethod = _ref3.method,
278
+ omitQueryParameters = _ref3.queryParameters,
279
+ omitHeaders = _ref3.headers,
280
+ omitBody = _ref3.body,
281
+ omitOptions = _ref3.options,
282
+ omitCallback = _ref3.callback,
283
+ omitMergeProps = _ref3.mergeProps,
284
+ optionsRest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
285
+
286
+ return [].concat((0, _toConsumableArray2.default)(ac), [_objectSpread({
287
+ path: path,
288
+ pathPrefix: getMergeProps("pathPrefix") === "onlyLocal" || isNoPathPrefix ? "" : (0, _classPrivateFieldGet2.default)(_this2, _pathPrefix) || "",
289
+ method: function () {
290
+ if (getMergeProps("method") === "onlyLocal") return method || "GET";
291
+ return getMergeProps("method") === "onlyGlobal" ? (0, _classPrivateFieldGet2.default)(_this2, _method) || "GET" : method || (0, _classPrivateFieldGet2.default)(_this2, _method) || "GET";
292
+ }(),
293
+ queryParameters: function () {
294
+ var _getMergeProps, _getMergeProps2;
295
+
296
+ if (((_getMergeProps = getMergeProps("queryParameters")) !== null && _getMergeProps !== void 0 ? _getMergeProps : getMergeProps("query")) === "onlyLocal") {
297
+ return _this2.getQueryString(_this2.getQueryArray(queryParameters));
298
+ }
299
+
300
+ return ((_getMergeProps2 = getMergeProps("queryParameters")) !== null && _getMergeProps2 !== void 0 ? _getMergeProps2 : getMergeProps("query")) === "onlyGlobal" ? _this2.getQueryString(_this2.getQueryArray((0, _classPrivateFieldGet2.default)(_this2, _queryParameters))) : _this2.getQueryString([].concat((0, _toConsumableArray2.default)(_this2.getQueryArray((0, _classPrivateFieldGet2.default)(_this2, _queryParameters))), (0, _toConsumableArray2.default)(_this2.getQueryArray(queryParameters))));
301
+ }(),
302
+ headers: function () {
303
+ if (getMergeProps("headers") === "onlyLocal") return _this2.getHeadersObj(headers || {});
304
+ return getMergeProps("headers") === "onlyGlobal" ? _this2.getHeadersObj(_objectSpread({}, (0, _classPrivateFieldGet2.default)(_this2, _headers) || {})) : _this2.getHeadersObj(_objectSpread(_objectSpread({}, (0, _classPrivateFieldGet2.default)(_this2, _headers) || {}), headers || {}));
305
+ }(),
306
+ body: function () {
307
+ if (getMergeProps("body") === "onlyLocal") return body || null;
308
+ if (getMergeProps("body") === "onlyGlobal") return (0, _classPrivateFieldGet2.default)(_this2, _body) || null;
309
+
310
+ if (body && (0, _classPrivateFieldGet2.default)(_this2, _body) && (0, _typeof2.default)(body) === (0, _typeof2.default)((0, _classPrivateFieldGet2.default)(_this2, _body)) && (0, _typeof2.default)(body) === "object") {
311
+ return Array.isArray(body) ? [].concat((0, _toConsumableArray2.default)((0, _classPrivateFieldGet2.default)(_this2, _body)), (0, _toConsumableArray2.default)(body)) : _objectSpread(_objectSpread({}, (0, _classPrivateFieldGet2.default)(_this2, _body)), body);
312
+ } else return body || (0, _classPrivateFieldGet2.default)(_this2, _body) || null;
313
+ }(),
314
+ options: function () {
315
+ if (getMergeProps("options") === "onlyLocal") return _objectSpread({}, optionsRest || {});
316
+ return getMergeProps("options") === "onlyGlobal" ? _objectSpread({}, (0, _classPrivateFieldGet2.default)(_this2, _options) || {}) : _objectSpread(_objectSpread({}, (0, _classPrivateFieldGet2.default)(_this2, _options) || {}), optionsRest || {});
317
+ }(),
318
+ callback: callback,
319
+ isSkipEveryPromiseCallback: isSkipEveryPromiseCallback
320
+ }, _this2.getIsResponseAsObject() ? {
267
321
  name: name && typeof name === "string" ? name : index
268
- } : {})
269
- }];
270
- }, []);
322
+ } : {})]);
323
+ }, []);
324
+ }
271
325
  }
272
- }
273
-
274
- repeatRequest() {
275
- return this.request(this.requestInput);
276
- } // ***** getters and setters *****
277
-
278
-
279
- getPathPrefix() {
280
- return (0, _classPrivateFieldGet2.default)(this, _pathPrefix);
281
- }
282
-
283
- setPathPrefix(value) {
284
- if (value && typeof value !== "string") throw new Error("Not valid pathPrefix value!");
285
- (0, _classPrivateFieldSet2.default)(this, _pathPrefix, value || null);
286
- }
287
-
288
- getMethod() {
289
- return (0, _classPrivateFieldGet2.default)(this, _method);
290
- }
291
-
292
- setMethod(value) {
293
- const methods = ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"];
294
- if (value && !methods.includes(value)) throw new Error("Not valid method value!");
295
- (0, _classPrivateFieldSet2.default)(this, _method, value || null);
296
- }
297
-
298
- getQueryParameters() {
299
- return (0, _classPrivateFieldGet2.default)(this, _queryParameters);
300
- } // eslint-disable-next-line class-methods-use-this
301
-
302
-
303
- getQueryArray(value) {
304
- var _value$replace;
305
-
306
- if (typeof value === "string") return value === null || value === void 0 ? void 0 : (_value$replace = value.replace(/\?/g, "")) === null || _value$replace === void 0 ? void 0 : _value$replace.split("&");else if (Array.isArray(value)) return value.map(item => item.replace(/\?/g, ""));else if (typeof value === "object" && value !== null) return Object.keys(value).filter(key => key && value[key]).map(key => "".concat(key, "=").concat(value[key]));else return [];
307
- } // eslint-disable-next-line class-methods-use-this
308
-
309
-
310
- getQueryString(value) {
311
- if (!Array.isArray(value)) throw new Error("Not valid query parameters value!");
312
- return value.length ? "?".concat(value.join("&")) : "";
313
- }
314
-
315
- setQueryParameters(value) {
316
- if (value && !Array.isArray(value)) throw new Error("Not valid query parameters value!");
317
- (0, _classPrivateFieldSet2.default)(this, _queryParameters, value || null);
318
- }
319
-
320
- getHeaders() {
321
- return (0, _classPrivateFieldGet2.default)(this, _headers);
322
- } // eslint-disable-next-line class-methods-use-this
323
-
324
-
325
- getHeadersObj(value) {
326
- const headers = new Headers();
327
- if (!value) return headers;
328
- if (typeof value !== "object" || Array.isArray(value)) throw new Error("Not valid headers value!");
329
- Object.keys(value).forEach(item => {
330
- headers.append(item, value[item]);
331
- });
332
- return headers;
333
- }
334
-
335
- setHeaders(value) {
336
- if (value && (typeof value !== "object" || Array.isArray(value))) throw new Error("Not valid headers value!");
337
- (0, _classPrivateFieldSet2.default)(this, _headers, value || null);
338
- }
339
-
340
- getBody() {
341
- return (0, _classPrivateFieldGet2.default)(this, _body);
342
- }
343
-
344
- setBody(value) {
345
- (0, _classPrivateFieldSet2.default)(this, _body, value);
346
- }
347
-
348
- getOptions() {
349
- return (0, _classPrivateFieldGet2.default)(this, _options);
350
- }
351
-
352
- setOptions(value) {
353
- if (value && (typeof value !== "object" || Array.isArray(value))) throw new Error("Not valid options value!");
354
- (0, _classPrivateFieldSet2.default)(this, _options, { ...value
355
- });
356
- }
357
-
358
- getCallback() {
359
- return (0, _classPrivateFieldGet2.default)(this, _callback);
360
- }
361
-
362
- setCallback(value) {
363
- if (value && typeof value !== "function") throw new Error("Not valid callback value!");
364
- (0, _classPrivateFieldSet2.default)(this, _callback, value || null);
365
- }
366
-
367
- getCatchCallback() {
368
- return (0, _classPrivateFieldGet2.default)(this, _catchCallback);
369
- }
370
-
371
- setCatchCallback(value) {
372
- if (value && typeof value !== "function") throw new Error("Not valid callback value!");
373
- (0, _classPrivateFieldSet2.default)(this, _catchCallback, value || null);
374
- }
375
-
376
- getEveryPromiseCallback() {
377
- return (0, _classPrivateFieldGet2.default)(this, _everyPromiseCallback);
378
- }
379
-
380
- setEveryPromiseCallback(value) {
381
- if (value && typeof value !== "function") throw new Error("Not valid callback value!");
382
- (0, _classPrivateFieldSet2.default)(this, _everyPromiseCallback, value || null);
383
- }
384
-
385
- getIsResponseAsObject() {
386
- return (0, _classPrivateFieldGet2.default)(this, _isResponseAsObject);
387
- }
388
-
389
- setIsResponseAsObject(value) {
390
- (0, _classPrivateFieldSet2.default)(this, _isResponseAsObject, typeof value !== "boolean" && value !== "always" ? Boolean(value) : value);
391
- }
392
-
393
- getProps() {
394
- return {
395
- pathPrefix: this.getPathPrefix() || null,
396
- method: this.getMethod() || null,
397
- queryParameters: this.getQueryParameters() || null,
398
- headers: this.getHeaders() || null,
399
- body: this.getBody() || null,
400
- options: this.getOptions() || null,
401
- callback: this.getCallback() || null,
402
- everyPromiseCallback: this.getEveryPromiseCallback(),
403
- // isAnywayRunCallback: this.getIsAnywayRunCallback(),
404
- isResponseAsObject: this.getIsResponseAsObject()
405
- };
406
- }
407
-
408
- setProps(input) {
409
- const {
410
- pathPrefix,
411
- method,
412
- queryParameters,
413
- headers,
414
- body,
415
- options,
416
- callback,
417
- catchCallback,
418
- everyPromiseCallback,
419
- // isAnywayRunCallback,
420
- isResponseAsObject
421
- } = input;
422
- if (pathPrefix) this.setPathPrefix(pathPrefix);
423
- if (method) this.setMethod(method);
424
- if (queryParameters) this.setQueryParameters(this.getQueryArray(queryParameters));
425
- if (headers) this.setHeaders(headers);
426
- if (body) this.setBody(body);
427
- if (options) this.setOptions(options);
428
- if (callback) this.setCallback(callback);
429
- if (catchCallback) this.setCatchCallback(catchCallback);
430
- if (everyPromiseCallback) this.setEveryPromiseCallback(everyPromiseCallback); // if (isAnywayRunCallback) this.setIsAnywayRunCallback(isAnywayRunCallback);
431
-
432
- if (isResponseAsObject !== undefined) this.setIsResponseAsObject(isResponseAsObject);
433
- }
434
-
435
- }
326
+ }, {
327
+ key: "repeatRequest",
328
+ value: function repeatRequest() {
329
+ return this.request(this.requestInput);
330
+ } // ***** getters and setters *****
331
+
332
+ }, {
333
+ key: "getPathPrefix",
334
+ value: function getPathPrefix() {
335
+ return (0, _classPrivateFieldGet2.default)(this, _pathPrefix);
336
+ }
337
+ }, {
338
+ key: "setPathPrefix",
339
+ value: function setPathPrefix(value) {
340
+ if (value && typeof value !== "string") throw new Error("Not valid pathPrefix value!");
341
+ (0, _classPrivateFieldSet2.default)(this, _pathPrefix, value || null);
342
+ }
343
+ }, {
344
+ key: "getMethod",
345
+ value: function getMethod() {
346
+ return (0, _classPrivateFieldGet2.default)(this, _method);
347
+ }
348
+ }, {
349
+ key: "setMethod",
350
+ value: function setMethod(value) {
351
+ var methods = ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"];
352
+ if (value && !methods.includes(value)) throw new Error("Not valid method value!");
353
+ (0, _classPrivateFieldSet2.default)(this, _method, value || null);
354
+ }
355
+ }, {
356
+ key: "getQueryParameters",
357
+ value: function getQueryParameters() {
358
+ return (0, _classPrivateFieldGet2.default)(this, _queryParameters);
359
+ } // eslint-disable-next-line class-methods-use-this
360
+
361
+ }, {
362
+ key: "getQueryArray",
363
+ value: function getQueryArray(value) {
364
+ var _value$replace;
365
+
366
+ if (typeof value === "string") return value === null || value === void 0 ? void 0 : (_value$replace = value.replace(/\?/g, "")) === null || _value$replace === void 0 ? void 0 : _value$replace.split("&");else if (Array.isArray(value)) return value.map(function (item) {
367
+ return item.replace(/\?/g, "");
368
+ });else if ((0, _typeof2.default)(value) === "object" && value !== null) return Object.keys(value).filter(function (key) {
369
+ return key && value[key];
370
+ }).map(function (key) {
371
+ return "".concat(key, "=").concat(value[key]);
372
+ });else return [];
373
+ } // eslint-disable-next-line class-methods-use-this
374
+
375
+ }, {
376
+ key: "getQueryString",
377
+ value: function getQueryString(value) {
378
+ if (!Array.isArray(value)) throw new Error("Not valid query parameters value!");
379
+ return value.length ? "?".concat(value.join("&")) : "";
380
+ }
381
+ }, {
382
+ key: "setQueryParameters",
383
+ value: function setQueryParameters(value) {
384
+ if (value && !Array.isArray(value)) throw new Error("Not valid query parameters value!");
385
+ (0, _classPrivateFieldSet2.default)(this, _queryParameters, value || null);
386
+ }
387
+ }, {
388
+ key: "getHeaders",
389
+ value: function getHeaders() {
390
+ return (0, _classPrivateFieldGet2.default)(this, _headers);
391
+ } // eslint-disable-next-line class-methods-use-this
392
+
393
+ }, {
394
+ key: "getHeadersObj",
395
+ value: function getHeadersObj(value) {
396
+ var headers = new Headers();
397
+ if (!value) return headers;
398
+ if ((0, _typeof2.default)(value) !== "object" || Array.isArray(value)) throw new Error("Not valid headers value!");
399
+ Object.keys(value).forEach(function (item) {
400
+ headers.append(item, value[item]);
401
+ });
402
+ return headers;
403
+ }
404
+ }, {
405
+ key: "setHeaders",
406
+ value: function setHeaders(value) {
407
+ if (value && ((0, _typeof2.default)(value) !== "object" || Array.isArray(value))) throw new Error("Not valid headers value!");
408
+ (0, _classPrivateFieldSet2.default)(this, _headers, value || null);
409
+ }
410
+ }, {
411
+ key: "getBody",
412
+ value: function getBody() {
413
+ return (0, _classPrivateFieldGet2.default)(this, _body);
414
+ }
415
+ }, {
416
+ key: "setBody",
417
+ value: function setBody(value) {
418
+ (0, _classPrivateFieldSet2.default)(this, _body, value);
419
+ }
420
+ }, {
421
+ key: "getOptions",
422
+ value: function getOptions() {
423
+ return (0, _classPrivateFieldGet2.default)(this, _options);
424
+ }
425
+ }, {
426
+ key: "setOptions",
427
+ value: function setOptions(value) {
428
+ if (value && ((0, _typeof2.default)(value) !== "object" || Array.isArray(value))) throw new Error("Not valid options value!");
429
+ (0, _classPrivateFieldSet2.default)(this, _options, _objectSpread({}, value));
430
+ }
431
+ }, {
432
+ key: "getCallback",
433
+ value: function getCallback() {
434
+ return (0, _classPrivateFieldGet2.default)(this, _callback);
435
+ }
436
+ }, {
437
+ key: "setCallback",
438
+ value: function setCallback(value) {
439
+ if (value && typeof value !== "function") throw new Error("Not valid callback value!");
440
+ (0, _classPrivateFieldSet2.default)(this, _callback, value || null);
441
+ }
442
+ }, {
443
+ key: "getCatchCallback",
444
+ value: function getCatchCallback() {
445
+ return (0, _classPrivateFieldGet2.default)(this, _catchCallback);
446
+ }
447
+ }, {
448
+ key: "setCatchCallback",
449
+ value: function setCatchCallback(value) {
450
+ if (value && typeof value !== "function") throw new Error("Not valid callback value!");
451
+ (0, _classPrivateFieldSet2.default)(this, _catchCallback, value || null);
452
+ }
453
+ }, {
454
+ key: "getEveryPromiseCallback",
455
+ value: function getEveryPromiseCallback() {
456
+ return (0, _classPrivateFieldGet2.default)(this, _everyPromiseCallback);
457
+ }
458
+ }, {
459
+ key: "setEveryPromiseCallback",
460
+ value: function setEveryPromiseCallback(value) {
461
+ if (value && typeof value !== "function") throw new Error("Not valid callback value!");
462
+ (0, _classPrivateFieldSet2.default)(this, _everyPromiseCallback, value || null);
463
+ }
464
+ }, {
465
+ key: "getIsResponseAsObject",
466
+ value: function getIsResponseAsObject() {
467
+ return (0, _classPrivateFieldGet2.default)(this, _isResponseAsObject);
468
+ }
469
+ }, {
470
+ key: "setIsResponseAsObject",
471
+ value: function setIsResponseAsObject(value) {
472
+ (0, _classPrivateFieldSet2.default)(this, _isResponseAsObject, typeof value !== "boolean" && value !== "always" ? Boolean(value) : value);
473
+ }
474
+ }, {
475
+ key: "getProps",
476
+ value: function getProps() {
477
+ return {
478
+ pathPrefix: this.getPathPrefix() || null,
479
+ method: this.getMethod() || null,
480
+ queryParameters: this.getQueryParameters() || null,
481
+ headers: this.getHeaders() || null,
482
+ body: this.getBody() || null,
483
+ options: this.getOptions() || null,
484
+ callback: this.getCallback() || null,
485
+ everyPromiseCallback: this.getEveryPromiseCallback(),
486
+ // isAnywayRunCallback: this.getIsAnywayRunCallback(),
487
+ isResponseAsObject: this.getIsResponseAsObject()
488
+ };
489
+ }
490
+ }, {
491
+ key: "setProps",
492
+ value: function setProps(input) {
493
+ var pathPrefix = input.pathPrefix,
494
+ method = input.method,
495
+ queryParameters = input.queryParameters,
496
+ headers = input.headers,
497
+ body = input.body,
498
+ options = input.options,
499
+ callback = input.callback,
500
+ catchCallback = input.catchCallback,
501
+ everyPromiseCallback = input.everyPromiseCallback,
502
+ isResponseAsObject = input.isResponseAsObject;
503
+ if (pathPrefix) this.setPathPrefix(pathPrefix);
504
+ if (method) this.setMethod(method);
505
+ if (queryParameters) this.setQueryParameters(this.getQueryArray(queryParameters));
506
+ if (headers) this.setHeaders(headers);
507
+ if (body) this.setBody(body);
508
+ if (options) this.setOptions(options);
509
+ if (callback) this.setCallback(callback);
510
+ if (catchCallback) this.setCatchCallback(catchCallback);
511
+ if (everyPromiseCallback) this.setEveryPromiseCallback(everyPromiseCallback); // if (isAnywayRunCallback) this.setIsAnywayRunCallback(isAnywayRunCallback);
512
+
513
+ if (isResponseAsObject !== undefined) this.setIsResponseAsObject(isResponseAsObject);
514
+ }
515
+ }]);
516
+ return AbortableFetch;
517
+ }();
436
518
 
437
519
  var _default = AbortableFetch;
438
520
  exports.default = _default;