intelicoreact 1.3.19 → 1.3.21

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