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
@@ -1,36 +1,46 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = exports.createGradient = exports.addNotLibraryAnimation = exports.addGradientsObject = exports.addDatasetsObjects = void 0;
7
9
 
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
8
14
  var _utils = require("../../../../Functions/utils");
9
15
 
16
+ var _excluded = ["type"];
17
+
18
+ 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; }
19
+
20
+ 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; }
21
+
10
22
  // auxiliary functions
11
- const addDatasetsObjects = (currentData, mutation) => {
23
+ var addDatasetsObjects = function addDatasetsObjects(currentData, mutation) {
12
24
  var _currentData$datasets, _currentData$datasets2;
13
25
 
14
- return { ...currentData,
15
- datasets: (_currentData$datasets = currentData.datasets) === null || _currentData$datasets === void 0 ? void 0 : (_currentData$datasets2 = _currentData$datasets.map) === null || _currentData$datasets2 === void 0 ? void 0 : _currentData$datasets2.call(_currentData$datasets, dataset => ({ ...dataset,
16
- ...(typeof mutation === "function" ? mutation(dataset) : mutation)
17
- }))
18
- };
26
+ return _objectSpread(_objectSpread({}, currentData), {}, {
27
+ datasets: (_currentData$datasets = currentData.datasets) === null || _currentData$datasets === void 0 ? void 0 : (_currentData$datasets2 = _currentData$datasets.map) === null || _currentData$datasets2 === void 0 ? void 0 : _currentData$datasets2.call(_currentData$datasets, function (dataset) {
28
+ return _objectSpread(_objectSpread({}, dataset), typeof mutation === "function" ? mutation(dataset) : mutation);
29
+ })
30
+ });
19
31
  };
20
32
 
21
33
  exports.addDatasetsObjects = addDatasetsObjects;
22
34
 
23
- const createGradient = _ref => {
24
- let {
25
- ctx,
26
- area,
27
- colors,
28
- direction,
29
- correctionFactors,
30
- collorStopPoints
31
- } = _ref;
32
-
33
- const getStartGradient = () => {
35
+ var createGradient = function createGradient(_ref) {
36
+ var ctx = _ref.ctx,
37
+ area = _ref.area,
38
+ colors = _ref.colors,
39
+ direction = _ref.direction,
40
+ correctionFactors = _ref.correctionFactors,
41
+ collorStopPoints = _ref.collorStopPoints;
42
+
43
+ var getStartGradient = function getStartGradient() {
34
44
  switch (direction) {
35
45
  case "toTop-toRight":
36
46
  return ctx.createLinearGradient(area.left, area.bottom, area.right, area.top);
@@ -59,66 +69,74 @@ const createGradient = _ref => {
59
69
  }
60
70
  };
61
71
 
62
- const getGradientWithPoints = corection => {
63
- const newGradient = getStartGradient();
64
- const staptPoint = corection ? 1 - corection : 0;
65
- colors.forEach((color, idx) => {
66
- const point = (() => {
72
+ var getGradientWithPoints = function getGradientWithPoints(corection) {
73
+ var newGradient = getStartGradient();
74
+ var staptPoint = corection ? 1 - corection : 0;
75
+ colors.forEach(function (color, idx) {
76
+ var point = function () {
67
77
  if (idx === colors.length - 1) return 1;
68
78
  return collorStopPoints && Array.isArray(collorStopPoints) ? staptPoint + collorStopPoints[idx] * (corection || 1) : staptPoint + 1 / colors.length * (corection || 1);
69
- })();
79
+ }();
70
80
 
71
81
  newGradient.addColorStop(point.toFixed(2), color);
72
82
  });
73
83
  return newGradient;
74
84
  };
75
85
 
76
- return correctionFactors ? correctionFactors.map(corection => getGradientWithPoints(corection)) : getGradientWithPoints();
86
+ return correctionFactors ? correctionFactors.map(function (corection) {
87
+ return getGradientWithPoints(corection);
88
+ }) : getGradientWithPoints();
77
89
  }; // target functions
78
90
 
79
91
 
80
92
  exports.createGradient = createGradient;
81
93
 
82
- const addGradientsObject = (currentData, gradientSettingsObj, chartInstance) => addDatasetsObjects(currentData, dataset => ({
83
- [gradientSettingsObj.gradientTargetPropertyName]: createGradient({
84
- ctx: chartInstance.ctx,
85
- area: chartInstance.chartArea,
86
- colors: gradientSettingsObj.colors,
87
- direction: gradientSettingsObj.direction,
88
- correctionFactors: gradientSettingsObj.typeDistributionOfGradientPoints === "personalBase" ? dataset.data.map(value => value / Math.max.apply(null, dataset.data)) : null,
89
- collorStopPoints: gradientSettingsObj.collorStopPoints
90
- }),
91
- ...(gradientSettingsObj.isAddFill ? {
92
- fill: true
93
- } : {})
94
- }));
94
+ var addGradientsObject = function addGradientsObject(currentData, gradientSettingsObj, chartInstance) {
95
+ return addDatasetsObjects(currentData, function (dataset) {
96
+ return _objectSpread((0, _defineProperty2.default)({}, gradientSettingsObj.gradientTargetPropertyName, createGradient({
97
+ ctx: chartInstance.ctx,
98
+ area: chartInstance.chartArea,
99
+ colors: gradientSettingsObj.colors,
100
+ direction: gradientSettingsObj.direction,
101
+ correctionFactors: gradientSettingsObj.typeDistributionOfGradientPoints === "personalBase" ? dataset.data.map(function (value) {
102
+ return value / Math.max.apply(null, dataset.data);
103
+ }) : null,
104
+ collorStopPoints: gradientSettingsObj.collorStopPoints
105
+ })), gradientSettingsObj.isAddFill ? {
106
+ fill: true
107
+ } : {});
108
+ });
109
+ };
95
110
 
96
111
  exports.addGradientsObject = addGradientsObject;
97
112
 
98
- const addNotLibraryAnimation = (currentData, animationObj, chartInstance) => {
99
- const {
100
- type,
101
- ...restAnimationObj
102
- } = animationObj || {};
113
+ var addNotLibraryAnimation = function addNotLibraryAnimation(currentData, animationObj, chartInstance) {
114
+ var _ref2 = animationObj || {},
115
+ type = _ref2.type,
116
+ restAnimationObj = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
103
117
 
104
118
  switch (type) {
105
119
  case "runningColumns":
106
- const runningColumnsDefaultFromValue = 25;
107
- const runningColumnsDefaultToValue = 75;
108
- const runningColumnsDefaultAverageValue = 50;
109
- const runningColumnsDefaultColumnsDelayCoef = 50;
110
- return addDatasetsObjects(currentData, dataset => ({
111
- animations: dataset.data.map((item, idx) => ({
112
- y: {
113
- duration: animationObj.duration,
114
- easing: animationObj.easing || "linear",
115
- from: animationObj.isFixExtremeColumns && (!idx || idx === dataset.data.length - 1) ? runningColumnsDefaultAverageValue : animationObj.from || runningColumnsDefaultFromValue,
116
- to: animationObj.isFixExtremeColumns && (!idx || idx === dataset.data.length - 1) ? runningColumnsDefaultAverageValue : animationObj.to || runningColumnsDefaultToValue,
117
- loop: true,
118
- delay: Math.random().toFixed(1) * (animationObj.columnsDelayCoef || runningColumnsDefaultColumnsDelayCoef)
119
- }
120
- }))
121
- }));
120
+ var runningColumnsDefaultFromValue = 25;
121
+ var runningColumnsDefaultToValue = 75;
122
+ var runningColumnsDefaultAverageValue = 50;
123
+ var runningColumnsDefaultColumnsDelayCoef = 50;
124
+ return addDatasetsObjects(currentData, function (dataset) {
125
+ return {
126
+ animations: dataset.data.map(function (item, idx) {
127
+ return {
128
+ y: {
129
+ duration: animationObj.duration,
130
+ easing: animationObj.easing || "linear",
131
+ from: animationObj.isFixExtremeColumns && (!idx || idx === dataset.data.length - 1) ? runningColumnsDefaultAverageValue : animationObj.from || runningColumnsDefaultFromValue,
132
+ to: animationObj.isFixExtremeColumns && (!idx || idx === dataset.data.length - 1) ? runningColumnsDefaultAverageValue : animationObj.to || runningColumnsDefaultToValue,
133
+ loop: true,
134
+ delay: Math.random().toFixed(1) * (animationObj.columnsDelayCoef || runningColumnsDefaultColumnsDelayCoef)
135
+ }
136
+ };
137
+ })
138
+ };
139
+ });
122
140
 
123
141
  default:
124
142
  return currentData;
@@ -138,10 +156,14 @@ function changeData(currentData, iterationKey, settingsForChange, chartInstance)
138
156
  });
139
157
 
140
158
  case "addGradientsObjects":
141
- return settingsForChange.reduce((acc, gradientSettingsObj) => addGradientsObject(acc, gradientSettingsObj, chartInstance), (0, _utils.clone)(currentData));
159
+ return settingsForChange.reduce(function (acc, gradientSettingsObj) {
160
+ return addGradientsObject(acc, gradientSettingsObj, chartInstance);
161
+ }, (0, _utils.clone)(currentData));
142
162
 
143
163
  case "addNotLibraryAnimations":
144
- return settingsForChange.reduce((acc, animationObj) => addNotLibraryAnimation(acc, animationObj, chartInstance), currentData);
164
+ return settingsForChange.reduce(function (acc, animationObj) {
165
+ return addNotLibraryAnimation(acc, animationObj, chartInstance);
166
+ }, currentData);
145
167
 
146
168
  default:
147
169
  return currentData;
@@ -7,14 +7,20 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.reactChartJsOptionsLayouts = exports.finturfReactChartJsOptions = exports.default = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
10
12
  var _Chart = require("./Chart.constants");
11
13
 
12
14
  var _optionsSetters = _interopRequireDefault(require("./optionsSetters"));
13
15
 
14
16
  var _finturfChartLayouts$, _finturfChartLayouts$2, _finturfChartLayouts$3, _finturfChartLayouts$4, _finturfChartLayouts$5, _finturfChartLayouts$6, _finturfChartLayouts$7, _finturfChartLayouts$8, _finturfChartLayouts$9, _finturfChartLayouts$10, _finturfChartLayouts$11, _finturfChartLayouts$12, _finturfChartLayouts$13, _finturfChartBar$opti, _finturfChartBar$opti2, _finturfChartBar$opti3, _finturfChartBar$notL, _finturfChartLine$opt, _finturfChartLine$opt2, _finturfChartLine$opt3, _finturfChartLine$opt4, _finturfChartLine$opt5, _finturfChartLine$opt6, _finturfChartLine$not;
15
17
 
18
+ 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; }
19
+
20
+ 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; }
21
+
16
22
  // options constructors for ChartJS
17
- const reactChartJsOptionsLayouts = {
23
+ var reactChartJsOptionsLayouts = {
18
24
  lineIconLayout: {
19
25
  options: {
20
26
  responsive: true,
@@ -125,119 +131,119 @@ const reactChartJsOptionsLayouts = {
125
131
  };
126
132
  exports.reactChartJsOptionsLayouts = reactChartJsOptionsLayouts;
127
133
 
128
- const finturfChartLayouts = (() => {
129
- return ["barLayout", "lineLayout"].reduce((acc, key) => {
134
+ var finturfChartLayouts = function () {
135
+ return ["barLayout", "lineLayout"].reduce(function (acc, key) {
130
136
  var _reactChartJsOptionsL, _reactChartJsOptionsL2, _reactChartJsOptionsL3, _reactChartJsOptionsL4, _reactChartJsOptionsL5, _reactChartJsOptionsL6, _reactChartJsOptionsL7, _reactChartJsOptionsL8, _reactChartJsOptionsL9, _reactChartJsOptionsL10, _reactChartJsOptionsL11, _reactChartJsOptionsL12, _reactChartJsOptionsL13, _reactChartJsOptionsL14, _reactChartJsOptionsL15, _reactChartJsOptionsL16, _reactChartJsOptionsL17;
131
137
 
132
- return { ...acc,
133
- [key]: { ...reactChartJsOptionsLayouts[key],
134
- options: { ...reactChartJsOptionsLayouts[key].options,
135
- scales: { ...((_reactChartJsOptionsL = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL === void 0 ? void 0 : _reactChartJsOptionsL.scales),
136
- x: { ...((_reactChartJsOptionsL2 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL2 === void 0 ? void 0 : (_reactChartJsOptionsL3 = _reactChartJsOptionsL2.scales) === null || _reactChartJsOptionsL3 === void 0 ? void 0 : _reactChartJsOptionsL3.x),
137
- grid: { ...((_reactChartJsOptionsL4 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL4 === void 0 ? void 0 : (_reactChartJsOptionsL5 = _reactChartJsOptionsL4.scales) === null || _reactChartJsOptionsL5 === void 0 ? void 0 : (_reactChartJsOptionsL6 = _reactChartJsOptionsL5.x) === null || _reactChartJsOptionsL6 === void 0 ? void 0 : _reactChartJsOptionsL6.grid),
138
- display: false,
139
- offset: true
140
- },
141
- ticks: { ...((_reactChartJsOptionsL7 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL7 === void 0 ? void 0 : (_reactChartJsOptionsL8 = _reactChartJsOptionsL7.scales) === null || _reactChartJsOptionsL8 === void 0 ? void 0 : (_reactChartJsOptionsL9 = _reactChartJsOptionsL8.y) === null || _reactChartJsOptionsL9 === void 0 ? void 0 : _reactChartJsOptionsL9.ticks),
142
- autoSkipPadding: 10,
143
- align: "center",
144
- color: "#757F8C",
145
- lineHeight: 18,
146
- font: {
147
- family: "Sarabun",
148
- style: "normal",
149
- weight: 400,
150
- size: 8
151
- } // callback: (value, index, ticks) => {
152
- // console.log(value);
153
- // console.log(index);
154
- // console.log(ticks);
155
- // console.log('***********');
156
- // return value;
157
- // },
138
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, key, _objectSpread(_objectSpread({}, reactChartJsOptionsLayouts[key]), {}, {
139
+ options: _objectSpread(_objectSpread({}, reactChartJsOptionsLayouts[key].options), {}, {
140
+ scales: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL === void 0 ? void 0 : _reactChartJsOptionsL.scales), {}, {
141
+ x: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL2 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL2 === void 0 ? void 0 : (_reactChartJsOptionsL3 = _reactChartJsOptionsL2.scales) === null || _reactChartJsOptionsL3 === void 0 ? void 0 : _reactChartJsOptionsL3.x), {}, {
142
+ grid: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL4 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL4 === void 0 ? void 0 : (_reactChartJsOptionsL5 = _reactChartJsOptionsL4.scales) === null || _reactChartJsOptionsL5 === void 0 ? void 0 : (_reactChartJsOptionsL6 = _reactChartJsOptionsL5.x) === null || _reactChartJsOptionsL6 === void 0 ? void 0 : _reactChartJsOptionsL6.grid), {}, {
143
+ display: false,
144
+ offset: true
145
+ }),
146
+ ticks: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL7 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL7 === void 0 ? void 0 : (_reactChartJsOptionsL8 = _reactChartJsOptionsL7.scales) === null || _reactChartJsOptionsL8 === void 0 ? void 0 : (_reactChartJsOptionsL9 = _reactChartJsOptionsL8.y) === null || _reactChartJsOptionsL9 === void 0 ? void 0 : _reactChartJsOptionsL9.ticks), {}, {
147
+ autoSkipPadding: 10,
148
+ align: "center",
149
+ color: "#757F8C",
150
+ lineHeight: 18,
151
+ font: {
152
+ family: "Sarabun",
153
+ style: "normal",
154
+ weight: 400,
155
+ size: 8
156
+ } // callback: (value, index, ticks) => {
157
+ // console.log(value);
158
+ // console.log(index);
159
+ // console.log(ticks);
160
+ // console.log('***********');
161
+ // return value;
162
+ // },
158
163
 
164
+ })
165
+ }),
166
+ y: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL10 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL10 === void 0 ? void 0 : (_reactChartJsOptionsL11 = _reactChartJsOptionsL10.scales) === null || _reactChartJsOptionsL11 === void 0 ? void 0 : _reactChartJsOptionsL11.y), {}, {
167
+ min: 0,
168
+ // grace: '5%',
169
+ bounds: "data",
170
+ grid: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL12 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL12 === void 0 ? void 0 : (_reactChartJsOptionsL13 = _reactChartJsOptionsL12.scales) === null || _reactChartJsOptionsL13 === void 0 ? void 0 : (_reactChartJsOptionsL14 = _reactChartJsOptionsL13.y) === null || _reactChartJsOptionsL14 === void 0 ? void 0 : _reactChartJsOptionsL14.grid), {}, {
171
+ borderColor: "#E1E8F1",
172
+ color: "#E1E8F1",
173
+ borderDash: [5],
174
+ // borderDashOffset: 12,
175
+ drawTicks: false,
176
+ z: -1
177
+ }),
178
+ ticks: _objectSpread(_objectSpread({}, (_reactChartJsOptionsL15 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL15 === void 0 ? void 0 : (_reactChartJsOptionsL16 = _reactChartJsOptionsL15.scales) === null || _reactChartJsOptionsL16 === void 0 ? void 0 : (_reactChartJsOptionsL17 = _reactChartJsOptionsL16.y) === null || _reactChartJsOptionsL17 === void 0 ? void 0 : _reactChartJsOptionsL17.ticks), {}, {
179
+ autoSkipPadding: 10,
180
+ align: "center",
181
+ color: "#A0A4B0",
182
+ lineHeight: 18,
183
+ padding: 6,
184
+ font: {
185
+ family: "Sarabun",
186
+ style: "normal",
187
+ weight: 400,
188
+ size: 10
159
189
  }
160
- },
161
- y: { ...((_reactChartJsOptionsL10 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL10 === void 0 ? void 0 : (_reactChartJsOptionsL11 = _reactChartJsOptionsL10.scales) === null || _reactChartJsOptionsL11 === void 0 ? void 0 : _reactChartJsOptionsL11.y),
162
- min: 0,
163
- // grace: '5%',
164
- bounds: "data",
165
- grid: { ...((_reactChartJsOptionsL12 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL12 === void 0 ? void 0 : (_reactChartJsOptionsL13 = _reactChartJsOptionsL12.scales) === null || _reactChartJsOptionsL13 === void 0 ? void 0 : (_reactChartJsOptionsL14 = _reactChartJsOptionsL13.y) === null || _reactChartJsOptionsL14 === void 0 ? void 0 : _reactChartJsOptionsL14.grid),
166
- borderColor: "#E1E8F1",
167
- color: "#E1E8F1",
168
- borderDash: [5],
169
- // borderDashOffset: 12,
170
- drawTicks: false,
171
- z: -1
172
- },
173
- ticks: { ...((_reactChartJsOptionsL15 = reactChartJsOptionsLayouts[key].options) === null || _reactChartJsOptionsL15 === void 0 ? void 0 : (_reactChartJsOptionsL16 = _reactChartJsOptionsL15.scales) === null || _reactChartJsOptionsL16 === void 0 ? void 0 : (_reactChartJsOptionsL17 = _reactChartJsOptionsL16.y) === null || _reactChartJsOptionsL17 === void 0 ? void 0 : _reactChartJsOptionsL17.ticks),
174
- autoSkipPadding: 10,
175
- align: "center",
176
- color: "#A0A4B0",
177
- lineHeight: 18,
178
- padding: 6,
179
- font: {
180
- family: "Sarabun",
181
- style: "normal",
182
- weight: 400,
183
- size: 10
184
- }
185
- }
186
- }
187
- }
188
- },
189
- notLibraryOptions: { ...reactChartJsOptionsLayouts[key].notLibraryOptions,
190
- setCanvasDimensions: {
191
- height: "194px"
192
- }
190
+ })
191
+ })
192
+ })
193
+ }),
194
+ notLibraryOptions: _objectSpread(_objectSpread({}, reactChartJsOptionsLayouts[key].notLibraryOptions), {}, {
195
+ setCanvasDimensions: {
196
+ height: "194px"
193
197
  }
194
- }
195
- };
198
+ })
199
+ })));
196
200
  }, {});
197
- })();
201
+ }();
198
202
 
199
- const finturfChartBar = { ...finturfChartLayouts.barLayout,
200
- options: { ...((_finturfChartLayouts$ = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$ === void 0 ? void 0 : _finturfChartLayouts$.options),
203
+ var finturfChartBar = _objectSpread(_objectSpread({}, finturfChartLayouts.barLayout), {}, {
204
+ options: _objectSpread(_objectSpread({}, (_finturfChartLayouts$ = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$ === void 0 ? void 0 : _finturfChartLayouts$.options), {}, {
201
205
  maintainAspectRatio: false,
202
- elements: { ...((_finturfChartLayouts$2 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$2 === void 0 ? void 0 : (_finturfChartLayouts$3 = _finturfChartLayouts$2.options) === null || _finturfChartLayouts$3 === void 0 ? void 0 : _finturfChartLayouts$3.elements),
203
- bar: { ...((_finturfChartLayouts$4 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$4 === void 0 ? void 0 : (_finturfChartLayouts$5 = _finturfChartLayouts$4.options) === null || _finturfChartLayouts$5 === void 0 ? void 0 : (_finturfChartLayouts$6 = _finturfChartLayouts$5.elements) === null || _finturfChartLayouts$6 === void 0 ? void 0 : _finturfChartLayouts$6.bar),
206
+ elements: _objectSpread(_objectSpread({}, (_finturfChartLayouts$2 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$2 === void 0 ? void 0 : (_finturfChartLayouts$3 = _finturfChartLayouts$2.options) === null || _finturfChartLayouts$3 === void 0 ? void 0 : _finturfChartLayouts$3.elements), {}, {
207
+ bar: _objectSpread(_objectSpread({}, (_finturfChartLayouts$4 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$4 === void 0 ? void 0 : (_finturfChartLayouts$5 = _finturfChartLayouts$4.options) === null || _finturfChartLayouts$5 === void 0 ? void 0 : (_finturfChartLayouts$6 = _finturfChartLayouts$5.elements) === null || _finturfChartLayouts$6 === void 0 ? void 0 : _finturfChartLayouts$6.bar), {}, {
204
208
  borderRadius: 4
205
- }
206
- }
207
- },
208
- notLibraryOptions: { ...((_finturfChartLayouts$7 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$7 === void 0 ? void 0 : _finturfChartLayouts$7.notLibraryOptions),
209
- changeData: { ...((_finturfChartLayouts$8 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$8 === void 0 ? void 0 : (_finturfChartLayouts$9 = _finturfChartLayouts$8.notLibraryOptions) === null || _finturfChartLayouts$9 === void 0 ? void 0 : _finturfChartLayouts$9.changeData),
209
+ })
210
+ })
211
+ }),
212
+ notLibraryOptions: _objectSpread(_objectSpread({}, (_finturfChartLayouts$7 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$7 === void 0 ? void 0 : _finturfChartLayouts$7.notLibraryOptions), {}, {
213
+ changeData: _objectSpread(_objectSpread({}, (_finturfChartLayouts$8 = finturfChartLayouts.barLayout) === null || _finturfChartLayouts$8 === void 0 ? void 0 : (_finturfChartLayouts$9 = _finturfChartLayouts$8.notLibraryOptions) === null || _finturfChartLayouts$9 === void 0 ? void 0 : _finturfChartLayouts$9.changeData), {}, {
210
214
  setMaxBarThickness: 16
211
- }
212
- }
213
- };
214
- const finturfChartLine = { ...finturfChartLayouts.lineLayout,
215
- options: { ...((_finturfChartLayouts$10 = finturfChartLayouts.lineLayout) === null || _finturfChartLayouts$10 === void 0 ? void 0 : _finturfChartLayouts$10.options),
215
+ })
216
+ })
217
+ });
218
+
219
+ var finturfChartLine = _objectSpread(_objectSpread({}, finturfChartLayouts.lineLayout), {}, {
220
+ options: _objectSpread(_objectSpread({}, (_finturfChartLayouts$10 = finturfChartLayouts.lineLayout) === null || _finturfChartLayouts$10 === void 0 ? void 0 : _finturfChartLayouts$10.options), {}, {
216
221
  maintainAspectRatio: false,
217
- elements: { ...((_finturfChartLayouts$11 = finturfChartLayouts.lineLayout.options) === null || _finturfChartLayouts$11 === void 0 ? void 0 : _finturfChartLayouts$11.elements),
218
- point: { ...((_finturfChartLayouts$12 = finturfChartLayouts.lineLayout.options) === null || _finturfChartLayouts$12 === void 0 ? void 0 : (_finturfChartLayouts$13 = _finturfChartLayouts$12.elements) === null || _finturfChartLayouts$13 === void 0 ? void 0 : _finturfChartLayouts$13.point),
222
+ elements: _objectSpread(_objectSpread({}, (_finturfChartLayouts$11 = finturfChartLayouts.lineLayout.options) === null || _finturfChartLayouts$11 === void 0 ? void 0 : _finturfChartLayouts$11.elements), {}, {
223
+ point: _objectSpread(_objectSpread({}, (_finturfChartLayouts$12 = finturfChartLayouts.lineLayout.options) === null || _finturfChartLayouts$12 === void 0 ? void 0 : (_finturfChartLayouts$13 = _finturfChartLayouts$12.elements) === null || _finturfChartLayouts$13 === void 0 ? void 0 : _finturfChartLayouts$13.point), {}, {
219
224
  radius: 2,
220
225
  borderColor: "#32A784",
221
226
  borderWidth: 4
222
- }
223
- }
224
- }
225
- };
226
- const finturfReactChartJsOptions = {
227
+ })
228
+ })
229
+ })
230
+ });
231
+
232
+ var finturfReactChartJsOptions = {
227
233
  finturfChartBar: (0, _optionsSetters.default)(finturfChartBar, {
228
234
  addGradientsSettings: _Chart.GRADIENTS_OBJECTS.finturf.bar,
229
235
  addTooltipOptions: _Chart.FINTURF_TOOLTIP_OPTIONS
230
236
  }),
231
- finturfLoadingModeBar: { ...finturfChartBar,
232
- options: { ...finturfChartBar.options,
233
- animations: { ...((_finturfChartBar$opti = finturfChartBar.options) === null || _finturfChartBar$opti === void 0 ? void 0 : _finturfChartBar$opti.animations),
234
- y: { ...((_finturfChartBar$opti2 = finturfChartBar.options) === null || _finturfChartBar$opti2 === void 0 ? void 0 : (_finturfChartBar$opti3 = _finturfChartBar$opti2.animations) === null || _finturfChartBar$opti3 === void 0 ? void 0 : _finturfChartBar$opti3.y),
237
+ finturfLoadingModeBar: _objectSpread(_objectSpread({}, finturfChartBar), {}, {
238
+ options: _objectSpread(_objectSpread({}, finturfChartBar.options), {}, {
239
+ animations: _objectSpread(_objectSpread({}, (_finturfChartBar$opti = finturfChartBar.options) === null || _finturfChartBar$opti === void 0 ? void 0 : _finturfChartBar$opti.animations), {}, {
240
+ y: _objectSpread(_objectSpread({}, (_finturfChartBar$opti2 = finturfChartBar.options) === null || _finturfChartBar$opti2 === void 0 ? void 0 : (_finturfChartBar$opti3 = _finturfChartBar$opti2.animations) === null || _finturfChartBar$opti3 === void 0 ? void 0 : _finturfChartBar$opti3.y), {}, {
235
241
  duration: 0
236
- }
237
- }
238
- },
239
- notLibraryOptions: { ...finturfChartBar.notLibraryOptions,
240
- changeData: { ...((_finturfChartBar$notL = finturfChartBar.notLibraryOptions) === null || _finturfChartBar$notL === void 0 ? void 0 : _finturfChartBar$notL.changeData),
242
+ })
243
+ })
244
+ }),
245
+ notLibraryOptions: _objectSpread(_objectSpread({}, finturfChartBar.notLibraryOptions), {}, {
246
+ changeData: _objectSpread(_objectSpread({}, (_finturfChartBar$notL = finturfChartBar.notLibraryOptions) === null || _finturfChartBar$notL === void 0 ? void 0 : _finturfChartBar$notL.changeData), {}, {
241
247
  addNotLibraryAnimations: [{
242
248
  type: "runningColumns",
243
249
  // duration - ms
@@ -249,31 +255,31 @@ const finturfReactChartJsOptions = {
249
255
  to: 75,
250
256
  columnsDelayCoef: 500
251
257
  }]
252
- }
253
- }
254
- },
258
+ })
259
+ })
260
+ }),
255
261
  finturfChartLine: (0, _optionsSetters.default)(finturfChartLine, {
256
262
  addGradientsSettings: _Chart.GRADIENTS_OBJECTS.finturf.line,
257
263
  addTooltipOptions: _Chart.FINTURF_TOOLTIP_OPTIONS // consoleCurrentData: true,
258
264
 
259
265
  }),
260
- finturfLoadingModeLine: { ...finturfChartLine,
261
- options: { ...finturfChartLine.options,
262
- elements: { ...((_finturfChartLine$opt = finturfChartLine.options) === null || _finturfChartLine$opt === void 0 ? void 0 : _finturfChartLine$opt.elements),
263
- point: { ...((_finturfChartLine$opt2 = finturfChartLine.options) === null || _finturfChartLine$opt2 === void 0 ? void 0 : (_finturfChartLine$opt3 = _finturfChartLine$opt2.elements) === null || _finturfChartLine$opt3 === void 0 ? void 0 : _finturfChartLine$opt3.point),
266
+ finturfLoadingModeLine: _objectSpread(_objectSpread({}, finturfChartLine), {}, {
267
+ options: _objectSpread(_objectSpread({}, finturfChartLine.options), {}, {
268
+ elements: _objectSpread(_objectSpread({}, (_finturfChartLine$opt = finturfChartLine.options) === null || _finturfChartLine$opt === void 0 ? void 0 : _finturfChartLine$opt.elements), {}, {
269
+ point: _objectSpread(_objectSpread({}, (_finturfChartLine$opt2 = finturfChartLine.options) === null || _finturfChartLine$opt2 === void 0 ? void 0 : (_finturfChartLine$opt3 = _finturfChartLine$opt2.elements) === null || _finturfChartLine$opt3 === void 0 ? void 0 : _finturfChartLine$opt3.point), {}, {
264
270
  radius: 4,
265
271
  borderWidth: 1,
266
272
  borderColor: "#E1E8F1"
267
- }
268
- },
269
- animations: { ...((_finturfChartLine$opt4 = finturfChartLine.options) === null || _finturfChartLine$opt4 === void 0 ? void 0 : _finturfChartLine$opt4.animations),
270
- y: { ...((_finturfChartLine$opt5 = finturfChartLine.options) === null || _finturfChartLine$opt5 === void 0 ? void 0 : (_finturfChartLine$opt6 = _finturfChartLine$opt5.animations) === null || _finturfChartLine$opt6 === void 0 ? void 0 : _finturfChartLine$opt6.y),
273
+ })
274
+ }),
275
+ animations: _objectSpread(_objectSpread({}, (_finturfChartLine$opt4 = finturfChartLine.options) === null || _finturfChartLine$opt4 === void 0 ? void 0 : _finturfChartLine$opt4.animations), {}, {
276
+ y: _objectSpread(_objectSpread({}, (_finturfChartLine$opt5 = finturfChartLine.options) === null || _finturfChartLine$opt5 === void 0 ? void 0 : (_finturfChartLine$opt6 = _finturfChartLine$opt5.animations) === null || _finturfChartLine$opt6 === void 0 ? void 0 : _finturfChartLine$opt6.y), {}, {
271
277
  duration: 0
272
- }
273
- }
274
- },
275
- notLibraryOptions: { ...finturfChartLine.notLibraryOptions,
276
- changeData: { ...((_finturfChartLine$not = finturfChartLine.notLibraryOptions) === null || _finturfChartLine$not === void 0 ? void 0 : _finturfChartLine$not.changeData),
278
+ })
279
+ })
280
+ }),
281
+ notLibraryOptions: _objectSpread(_objectSpread({}, finturfChartLine.notLibraryOptions), {}, {
282
+ changeData: _objectSpread(_objectSpread({}, (_finturfChartLine$not = finturfChartLine.notLibraryOptions) === null || _finturfChartLine$not === void 0 ? void 0 : _finturfChartLine$not.changeData), {}, {
277
283
  addNotLibraryAnimations: [{
278
284
  type: "runningColumns",
279
285
  // duration - ms
@@ -283,9 +289,9 @@ const finturfReactChartJsOptions = {
283
289
  columnsDelayCoef: 500,
284
290
  isFixExtremeColumns: true
285
291
  }]
286
- }
287
- }
288
- },
292
+ })
293
+ })
294
+ }),
289
295
  finturfPositiveLineIcon: (0, _optionsSetters.default)(reactChartJsOptionsLayouts.lineIconLayout, {
290
296
  addGradientsSettings: _Chart.GRADIENTS_OBJECTS.finturf.positiveLineIcon
291
297
  }),
@@ -294,7 +300,9 @@ const finturfReactChartJsOptions = {
294
300
  })
295
301
  };
296
302
  exports.finturfReactChartJsOptions = finturfReactChartJsOptions;
297
- var _default = { ...finturfReactChartJsOptions,
303
+
304
+ var _default = _objectSpread(_objectSpread({}, finturfReactChartJsOptions), {}, {
298
305
  emptyLayout: reactChartJsOptionsLayouts.emptyLayout
299
- };
306
+ });
307
+
300
308
  exports.default = _default;
@@ -1,38 +1,48 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = exports.addTooltipOptions = exports.addGradientsSettings = void 0;
7
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ 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; }
13
+
14
+ 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; }
15
+
8
16
  // gradientsSettings is Array of objects
9
- const addGradientsSettings = (currentOptions, gradientsSettings) => {
17
+ var addGradientsSettings = function addGradientsSettings(currentOptions, gradientsSettings) {
10
18
  var _currentOptions$notLi;
11
19
 
12
- return { ...currentOptions,
13
- notLibraryOptions: { ...currentOptions.notLibraryOptions,
14
- changeData: { ...((_currentOptions$notLi = currentOptions.notLibraryOptions) === null || _currentOptions$notLi === void 0 ? void 0 : _currentOptions$notLi.changeData),
20
+ return _objectSpread(_objectSpread({}, currentOptions), {}, {
21
+ notLibraryOptions: _objectSpread(_objectSpread({}, currentOptions.notLibraryOptions), {}, {
22
+ changeData: _objectSpread(_objectSpread({}, (_currentOptions$notLi = currentOptions.notLibraryOptions) === null || _currentOptions$notLi === void 0 ? void 0 : _currentOptions$notLi.changeData), {}, {
15
23
  addGradientsObjects: gradientsSettings
16
- }
17
- }
18
- };
24
+ })
25
+ })
26
+ });
19
27
  };
20
28
 
21
29
  exports.addGradientsSettings = addGradientsSettings;
22
30
 
23
- const addTooltipOptions = (currentOptions, tooltipOptions) => ({ ...currentOptions,
24
- options: { ...currentOptions.options,
25
- plugins: { ...currentOptions.options.plugins,
26
- tooltip: tooltipOptions
27
- }
28
- }
29
- }); // must be last function in file
31
+ var addTooltipOptions = function addTooltipOptions(currentOptions, tooltipOptions) {
32
+ return _objectSpread(_objectSpread({}, currentOptions), {}, {
33
+ options: _objectSpread(_objectSpread({}, currentOptions.options), {}, {
34
+ plugins: _objectSpread(_objectSpread({}, currentOptions.options.plugins), {}, {
35
+ tooltip: tooltipOptions
36
+ })
37
+ })
38
+ });
39
+ }; // must be last function in file
30
40
 
31
41
 
32
42
  exports.addTooltipOptions = addTooltipOptions;
33
43
 
34
- const addAdditionalOptions = (currentOptions, optionsToAdd) => {
35
- const addOption = (currentOptions, optionKey, optionData) => {
44
+ var addAdditionalOptions = function addAdditionalOptions(currentOptions, optionsToAdd) {
45
+ var addOption = function addOption(currentOptions, optionKey, optionData) {
36
46
  switch (optionKey) {
37
47
  case "addGradientsSettings":
38
48
  return addGradientsSettings(currentOptions, optionData);
@@ -45,8 +55,10 @@ const addAdditionalOptions = (currentOptions, optionsToAdd) => {
45
55
  }
46
56
  };
47
57
 
48
- const iterator = Object.keys(optionsToAdd);
49
- return iterator.reduce((acc, key) => addOption(acc, key, optionsToAdd[key]), currentOptions);
58
+ var iterator = Object.keys(optionsToAdd);
59
+ return iterator.reduce(function (acc, key) {
60
+ return addOption(acc, key, optionsToAdd[key]);
61
+ }, currentOptions);
50
62
  };
51
63
 
52
64
  var _default = addAdditionalOptions;