intelicoreact 1.4.13 → 1.4.14
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.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +1 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -10
- package/dist/Atomic/FormElements/Calendar/Calendar.js +4 -24
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -10
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +2 -14
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +5 -54
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +3 -21
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +51 -144
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -7
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +25 -91
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +3 -15
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +15 -29
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +5 -15
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +19 -35
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +9 -38
- package/dist/Atomic/FormElements/Input/Input.js +25 -60
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
- package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +21 -51
- package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
- package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
- package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
- package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +44 -137
- package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
- package/dist/Atomic/FormElements/Label/Label.js +1 -9
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
- package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +8 -30
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +96 -187
- package/dist/Atomic/FormElements/Text/Text.js +10 -16
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
- package/dist/Atomic/FormElements/Textarea/Textarea.js +3 -17
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +3 -15
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
- package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
- package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
- package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -15
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
- package/dist/Atomic/UI/Alert/Alert.js +3 -19
- package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
- package/dist/Atomic/UI/Box/Box.js +3 -9
- package/dist/Atomic/UI/Button/Button.js +2 -11
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
- package/dist/Atomic/UI/Chart/Chart.js +4 -29
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
- package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
- package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
- package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -17
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
- package/dist/Atomic/UI/Hint/Hint.js +5 -31
- package/dist/Atomic/UI/Modal/Modal.js +6 -28
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
- package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
- package/dist/Atomic/UI/Price/Price.js +3 -8
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
- package/dist/Atomic/UI/Status/Status.js +1 -8
- package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
- package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
- package/dist/Atomic/UI/Table/Table.js +1 -12
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
- package/dist/Atomic/UI/Tag/Tag.js +7 -19
- package/dist/Atomic/UI/TagList/TagList.js +20 -38
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
- package/dist/Classes/AbortableFetch.js +36 -93
- package/dist/Classes/AnimatedHandler.js +3 -7
- package/dist/Classes/RESTAPI/index.js +39 -44
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
- package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +5 -16
- package/dist/Functions/customEventListener.js +4 -17
- package/dist/Functions/fieldValueFormatters.js +43 -83
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
- package/dist/Functions/locale/createTranslator.js +4 -9
- package/dist/Functions/operations.js +12 -22
- package/dist/Functions/presets/inputMaskPresets.js +9 -11
- package/dist/Functions/presets/inputPresets.js +8 -11
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -13
- package/dist/Functions/useBodyScrollLock.js +1 -6
- package/dist/Functions/useClickOutside.js +0 -4
- package/dist/Functions/useDebounce.js +2 -7
- package/dist/Functions/useFieldFocus.js +6 -18
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
- package/dist/Functions/useFormTools/functions/General.js +18 -28
- package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
- package/dist/Functions/useFormTools/index.js +85 -144
- package/dist/Functions/useInputHighlightError.js +3 -12
- package/dist/Functions/useIsMobile.js +7 -13
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
- package/dist/Functions/useLocalStorage.js +1 -9
- package/dist/Functions/useLocationParams.js +4 -5
- package/dist/Functions/useMediaQuery.js +3 -9
- package/dist/Functions/useMetaInfo.js +3 -10
- package/dist/Functions/useMouseUpOutside.js +0 -3
- package/dist/Functions/useOnlineStatus.js +1 -9
- package/dist/Functions/usePasswordChecker.js +4 -20
- package/dist/Functions/usePrevious.js +1 -5
- package/dist/Functions/useResize.js +2 -10
- package/dist/Functions/useScrollTo.js +2 -7
- package/dist/Functions/useToggle.js +1 -5
- package/dist/Functions/utils.js +56 -131
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
- package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
- package/dist/Molecular/CustomIcons/components/Button.js +2 -9
- package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/Close.js +2 -9
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
- package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
- package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
- package/dist/Molecular/CustomIcons/components/Email.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
- package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Key.js +2 -9
- package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
- package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
- package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
- package/dist/Molecular/CustomIcons/components/Play.js +2 -9
- package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
- package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
- package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
- package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
- package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
- package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
- package/dist/Molecular/CustomIcons/components/User.js +2 -9
- package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
- package/dist/Molecular/CustomIcons/components/X.js +2 -9
- package/dist/Molecular/CustomIcons/index.js +0 -122
- package/dist/Molecular/FormElement/FormElement.js +1 -12
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
- package/dist/Molecular/InputAddress/InputAddress.js +65 -114
- package/dist/Molecular/InputPassword/InputPassword.js +5 -19
- package/dist/index.js +0 -2
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
- package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
- package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
|
@@ -4,39 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactFeather = require("react-feather");
|
|
11
|
-
|
|
12
9
|
require("./DebugContainer.scss");
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
12
|
const DebugContainer = _ref => {
|
|
19
13
|
var _Object$keys2;
|
|
20
|
-
|
|
21
14
|
let {
|
|
22
15
|
data,
|
|
23
16
|
children
|
|
24
17
|
} = _ref;
|
|
25
18
|
const [isVisible, setIsVisible] = (0, _react.useState)(true);
|
|
26
|
-
|
|
27
19
|
const renderData = () => {
|
|
28
20
|
var _Object$keys;
|
|
29
|
-
|
|
30
21
|
return /*#__PURE__*/_react.default.createElement("pre", null, "{\n", (_Object$keys = Object.keys(data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(key => {
|
|
31
22
|
return " ".concat(key, ": ").concat(data === null || data === void 0 ? void 0 : data[key], ",\n");
|
|
32
23
|
}), "}");
|
|
33
24
|
};
|
|
34
|
-
|
|
35
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
26
|
className: "debug-container"
|
|
37
27
|
}, isVisible && /*#__PURE__*/_react.default.createElement("div", {
|
|
38
28
|
className: "debug-container__body"
|
|
39
|
-
}, /*#__PURE__*/_react.default.createElement("h5", null, "Debug:"), data && Boolean(Object === null || Object === void 0
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("h5", null, "Debug:"), data && Boolean(Object === null || Object === void 0 || (_Object$keys2 = Object.keys(data)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length) && /*#__PURE__*/_react.default.createElement("div", {
|
|
40
30
|
className: "debug-container__body-row"
|
|
41
31
|
}, renderData()), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
42
32
|
className: "debug-container__body-row"
|
|
@@ -45,6 +35,4 @@ const DebugContainer = _ref => {
|
|
|
45
35
|
onClick: () => setIsVisible(v => !v)
|
|
46
36
|
}, isVisible ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null)));
|
|
47
37
|
};
|
|
48
|
-
|
|
49
|
-
var _default = DebugContainer;
|
|
50
|
-
exports.default = _default;
|
|
38
|
+
var _default = exports.default = DebugContainer;
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _DebugContainer = _interopRequireDefault(require("./DebugContainer"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
12
|
const useDebugContainer = () => {
|
|
19
13
|
const [data, setData] = (0, _react.useState)({});
|
|
20
14
|
return {
|
|
@@ -25,6 +19,4 @@ const useDebugContainer = () => {
|
|
|
25
19
|
})
|
|
26
20
|
};
|
|
27
21
|
};
|
|
28
|
-
|
|
29
|
-
var _default = useDebugContainer;
|
|
30
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = useDebugContainer;
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
-
|
|
16
11
|
require("./DoubleString.scss");
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
14
|
const RC = "double-string";
|
|
23
|
-
|
|
24
15
|
const DoubleString = _ref => {
|
|
25
16
|
let {
|
|
26
17
|
value,
|
|
@@ -51,9 +42,8 @@ const DoubleString = _ref => {
|
|
|
51
42
|
};
|
|
52
43
|
(0, _react.useEffect)(() => {
|
|
53
44
|
var _valueRef$current, _descriptionRef$curre;
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
const descriptionWidth = descriptionRef === null || descriptionRef === void 0 ? void 0 : (_descriptionRef$curre = descriptionRef.current) === null || _descriptionRef$curre === void 0 ? void 0 : _descriptionRef$curre.clientWidth;
|
|
45
|
+
const valueWidth = valueRef === null || valueRef === void 0 || (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.clientWidth;
|
|
46
|
+
const descriptionWidth = descriptionRef === null || descriptionRef === void 0 || (_descriptionRef$curre = descriptionRef.current) === null || _descriptionRef$curre === void 0 ? void 0 : _descriptionRef$curre.clientWidth;
|
|
57
47
|
setElemsWidth({
|
|
58
48
|
valueWidth,
|
|
59
49
|
descriptionWidth
|
|
@@ -82,6 +72,4 @@ const DoubleString = _ref => {
|
|
|
82
72
|
className: (0, _classnames.default)("".concat(RC, "__value-postfix"))
|
|
83
73
|
}, valuePostfix))));
|
|
84
74
|
};
|
|
85
|
-
|
|
86
|
-
var _default = DoubleString;
|
|
87
|
-
exports.default = _default;
|
|
75
|
+
var _default = exports.default = DoubleString;
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
10
|
const DynamicIcon = _ref => {
|
|
15
11
|
let {
|
|
16
12
|
iconKey,
|
|
@@ -24,11 +20,8 @@ const DynamicIcon = _ref => {
|
|
|
24
20
|
const iconComponent = FeatherIcons[iconKey];
|
|
25
21
|
setIcon(iconComponent);
|
|
26
22
|
};
|
|
27
|
-
|
|
28
23
|
fetchData();
|
|
29
24
|
}, []);
|
|
30
25
|
return Icon ? /*#__PURE__*/_react.default.createElement(Icon, props) : null;
|
|
31
26
|
};
|
|
32
|
-
|
|
33
|
-
var _default = DynamicIcon;
|
|
34
|
-
exports.default = _default;
|
|
27
|
+
var _default = exports.default = DynamicIcon;
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _uuid = require("uuid");
|
|
17
|
-
|
|
18
12
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
19
|
-
|
|
20
13
|
var _utils = require("../../../Functions/utils");
|
|
21
|
-
|
|
22
14
|
var _InputDateRange = _interopRequireDefault(require("../../FormElements/InputDateRange/InputDateRange"));
|
|
23
|
-
|
|
24
15
|
var _Chart = _interopRequireDefault(require("../Chart/Chart"));
|
|
25
|
-
|
|
26
16
|
var _utils2 = require("./partial/utils");
|
|
27
|
-
|
|
28
17
|
require("./partial/AnyOuterClass.scss");
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
20
|
const ExampleChartIntegration = props => {
|
|
35
21
|
const {
|
|
36
22
|
inputDateRangeProps,
|
|
@@ -52,12 +38,9 @@ const ExampleChartIntegration = props => {
|
|
|
52
38
|
const [tab3, setTab3] = (0, _react.useState)(null);
|
|
53
39
|
const [tab4, setTab4] = (0, _react.useState)(null);
|
|
54
40
|
const [dataForRender, setDataForRender] = (0, _react.useState)(null);
|
|
55
|
-
|
|
56
41
|
const getMockData = () => {
|
|
57
42
|
const labels = (0, _utils2.getLabels)(dateRange);
|
|
58
|
-
|
|
59
43
|
const mock = () => labels.map(label => (0, _utils2.getMockValue)());
|
|
60
|
-
|
|
61
44
|
return {
|
|
62
45
|
labels,
|
|
63
46
|
datasets: [{
|
|
@@ -65,91 +48,71 @@ const ExampleChartIntegration = props => {
|
|
|
65
48
|
}]
|
|
66
49
|
};
|
|
67
50
|
};
|
|
68
|
-
|
|
69
51
|
const getTabData = tabId => {
|
|
70
52
|
switch (tabId) {
|
|
71
53
|
case "tab1":
|
|
72
54
|
return !tab1 ? null : (0, _utils.clone)(tab1);
|
|
73
|
-
|
|
74
55
|
case "tab2":
|
|
75
56
|
return !tab2 ? null : (0, _utils.clone)(tab2);
|
|
76
|
-
|
|
77
57
|
case "tab3":
|
|
78
58
|
return !tab3 ? null : (0, _utils.clone)(tab3);
|
|
79
|
-
|
|
80
59
|
case "tab4":
|
|
81
60
|
return !tab4 ? null : (0, _utils.clone)(tab4);
|
|
82
|
-
|
|
83
61
|
default:
|
|
84
62
|
return null;
|
|
85
63
|
}
|
|
86
64
|
};
|
|
87
|
-
|
|
88
65
|
const getDescription = tabId => {
|
|
89
66
|
switch (tabId) {
|
|
90
67
|
case "tab1":
|
|
91
68
|
return "Tab 1";
|
|
92
|
-
|
|
93
69
|
case "tab2":
|
|
94
70
|
return "Tab 2";
|
|
95
|
-
|
|
96
71
|
case "tab3":
|
|
97
72
|
return "Tab 3";
|
|
98
|
-
|
|
99
73
|
case "tab4":
|
|
100
74
|
return "Tab 4";
|
|
101
|
-
|
|
102
75
|
default:
|
|
103
76
|
return null;
|
|
104
77
|
}
|
|
105
78
|
};
|
|
106
|
-
|
|
107
79
|
const selectData = () => getTabData(tab) ? getTabData(tab) : getMockData();
|
|
108
|
-
|
|
109
80
|
const modelsForSwitch = (0, _react.useMemo)(() => getTabData(tab) ? ["finturfChartBar", "finturfChartLine"] : ["finturfLoadingModeBar", "finturfLoadingModeLine"], [Boolean(getTabData(tab))]);
|
|
110
|
-
|
|
111
81
|
const handleChangeChartType = model => {
|
|
112
82
|
setChartType(model.includes("Line") ? "Line" : "Bar");
|
|
113
83
|
setInitialModel(model);
|
|
114
84
|
};
|
|
115
|
-
|
|
116
85
|
const getModel = () => {
|
|
117
86
|
if (!getTabData(tab)) return chartType === "Bar" ? "finturfLoadingModeBar" : "finturfLoadingModeLine";else return chartType === "Bar" ? "finturfChartBar" : "finturfChartLine";
|
|
118
87
|
};
|
|
119
|
-
|
|
120
88
|
const processResponse = (res, tabId) => {
|
|
121
89
|
switch (tabId) {
|
|
122
90
|
case "tab1":
|
|
123
91
|
setTab1(res);
|
|
124
92
|
break;
|
|
125
|
-
|
|
126
93
|
case "tab2":
|
|
127
94
|
setTab2(res);
|
|
128
95
|
break;
|
|
129
|
-
|
|
130
96
|
case "tab3":
|
|
131
97
|
setTab3(res);
|
|
132
98
|
break;
|
|
133
|
-
|
|
134
99
|
case "tab4":
|
|
135
100
|
setTab4(res);
|
|
136
101
|
break;
|
|
137
|
-
|
|
138
102
|
default:
|
|
139
103
|
break;
|
|
140
104
|
}
|
|
141
|
-
|
|
142
105
|
return res;
|
|
143
106
|
};
|
|
144
|
-
|
|
145
107
|
(0, _react.useLayoutEffect)(() => {
|
|
146
108
|
setTab1(null);
|
|
147
109
|
setTab2(null);
|
|
148
110
|
setTab3(null);
|
|
149
|
-
setTab4(null);
|
|
111
|
+
setTab4(null);
|
|
112
|
+
|
|
113
|
+
// эмуляция запросов
|
|
150
114
|
// вся логика происходит в самих входящих промисах
|
|
151
115
|
// Promise.all добавлен для расширения на случай надобности описания эффектов по завершении всех запросов
|
|
152
|
-
|
|
153
116
|
Promise.all([(0, _utils2.getTab)("tab1", dateRange, processResponse), (0, _utils2.getTab)("tab2", dateRange, processResponse), (0, _utils2.getTab)("tab3", dateRange, processResponse), (0, _utils2.getTab)("tab4", dateRange, processResponse)]);
|
|
154
117
|
}, [dateRange]);
|
|
155
118
|
(0, _react.useLayoutEffect)(() => {
|
|
@@ -196,13 +159,17 @@ const ExampleChartIntegration = props => {
|
|
|
196
159
|
id: tab
|
|
197
160
|
},
|
|
198
161
|
modifyOptions: options => {
|
|
199
|
-
var _options$options, _options$options2, _options$
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
options: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
162
|
+
var _options$options, _options$options2, _options$options3;
|
|
163
|
+
return {
|
|
164
|
+
...options,
|
|
165
|
+
options: {
|
|
166
|
+
...(options === null || options === void 0 ? void 0 : options.options),
|
|
167
|
+
plugins: {
|
|
168
|
+
...(options === null || options === void 0 || (_options$options = options.options) === null || _options$options === void 0 ? void 0 : _options$options.plugins),
|
|
169
|
+
tooltip: {
|
|
170
|
+
...(options === null || options === void 0 || (_options$options2 = options.options) === null || _options$options2 === void 0 || (_options$options2 = _options$options2.plugins) === null || _options$options2 === void 0 ? void 0 : _options$options2.tooltip),
|
|
171
|
+
callbacks: {
|
|
172
|
+
...(options === null || options === void 0 || (_options$options3 = options.options) === null || _options$options3 === void 0 || (_options$options3 = _options$options3.plugins) === null || _options$options3 === void 0 || (_options$options3 = _options$options3.tooltip) === null || _options$options3 === void 0 ? void 0 : _options$options3.callbacks),
|
|
206
173
|
label: context => {
|
|
207
174
|
return context.dataset.id === "tab3" || context.dataset.id === "tab4" ? (0, _fieldValueFormatters.formatToPriceWithUSD)(context.raw || "0") : context.raw || "0";
|
|
208
175
|
}
|
|
@@ -214,6 +181,4 @@ const ExampleChartIntegration = props => {
|
|
|
214
181
|
}
|
|
215
182
|
})));
|
|
216
183
|
};
|
|
217
|
-
|
|
218
|
-
var _default = ExampleChartIntegration;
|
|
219
|
-
exports.default = _default;
|
|
184
|
+
var _default = exports.default = ExampleChartIntegration;
|
|
@@ -1,63 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getTab = exports.getSafelyDateRange = exports.getMockValue = exports.getLabels = void 0;
|
|
9
|
-
|
|
10
8
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
11
|
-
|
|
12
9
|
var _dependencies = require("../../../FormElements/InputDateRange/dependencies");
|
|
13
|
-
|
|
14
10
|
const getSafelyDateRange = dateRange => (!(dateRange !== null && dateRange !== void 0 && dateRange.start) || !(dateRange !== null && dateRange !== void 0 && dateRange.end)) && (!(dateRange !== null && dateRange !== void 0 && dateRange.intervalKey) || (dateRange === null || dateRange === void 0 ? void 0 : dateRange.intervalKey) === "allTime") ? (0, _dependencies.getActualDateRange)({
|
|
15
11
|
start: "2022-01-01T00:00:00",
|
|
16
12
|
end: (0, _momentTimezone.default)().endOf("day").format("YYYY-MM-DDTHH:mm:ss")
|
|
17
13
|
}) : (0, _dependencies.getActualDateRange)(dateRange);
|
|
18
|
-
|
|
19
14
|
exports.getSafelyDateRange = getSafelyDateRange;
|
|
20
|
-
|
|
21
15
|
const getLabels = range => {
|
|
22
16
|
const MINIMUM_INTERVAL = "hour";
|
|
23
17
|
const NO_MORE_THAN_THREE_HOURS = 3; // this is hours
|
|
24
|
-
|
|
25
18
|
const NO_MORE_THAN_TWO_DAYS = 48; // this is hours
|
|
26
|
-
|
|
27
19
|
const NO_MORE_THAN_TWO_MONTHS = 2; // this is months
|
|
28
|
-
|
|
29
20
|
const NO_MORE_THAN_THREE_YEARS = 24; // this is months
|
|
30
|
-
// safely Range must have 'start' and 'end' properties
|
|
31
21
|
|
|
22
|
+
// safely Range must have 'start' and 'end' properties
|
|
32
23
|
const safelyRange = (0, _dependencies.getActualDateRange)(range);
|
|
33
24
|
const start = (0, _momentTimezone.default)(safelyRange === null || safelyRange === void 0 ? void 0 : safelyRange.start).startOf(MINIMUM_INTERVAL);
|
|
34
25
|
const end = (0, _momentTimezone.default)(safelyRange === null || safelyRange === void 0 ? void 0 : safelyRange.end).startOf(MINIMUM_INTERVAL);
|
|
35
|
-
|
|
36
26
|
const getValues = intervalStepKey => {
|
|
37
27
|
let format;
|
|
38
|
-
|
|
39
28
|
switch (intervalStepKey) {
|
|
40
29
|
case "minutes":
|
|
41
30
|
format = "MM.DD hh:mm";
|
|
42
31
|
break;
|
|
43
|
-
|
|
44
32
|
case "hours":
|
|
45
33
|
format = "MM.DD.YYYY h A";
|
|
46
34
|
break;
|
|
47
|
-
|
|
48
35
|
case "days":
|
|
49
36
|
format = "MM.DD.YYYY";
|
|
50
37
|
break;
|
|
51
|
-
|
|
52
38
|
case "months":
|
|
53
39
|
format = "MM.YYYY";
|
|
54
40
|
break;
|
|
55
|
-
|
|
56
41
|
default:
|
|
57
42
|
format = "YYYY";
|
|
58
43
|
break;
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
const structure = [...Array(end.diff(start, intervalStepKey)).keys()];
|
|
62
46
|
const process = structure.reduce((acc, iteration) => {
|
|
63
47
|
acc.values.push(acc.point.format(format));
|
|
@@ -69,41 +53,30 @@ const getLabels = range => {
|
|
|
69
53
|
});
|
|
70
54
|
return process.values;
|
|
71
55
|
};
|
|
72
|
-
|
|
73
56
|
if (end.diff(start, "hours") <= NO_MORE_THAN_THREE_HOURS) return getValues("minutes");else if (end.diff(start, "hours") <= NO_MORE_THAN_TWO_DAYS) return getValues("hours");else if (end.diff(start, "months") <= NO_MORE_THAN_TWO_MONTHS) return getValues("days");else if (end.diff(start, "months") <= NO_MORE_THAN_THREE_YEARS) return getValues("months");else return getValues("years");
|
|
74
57
|
};
|
|
75
|
-
|
|
76
58
|
exports.getLabels = getLabels;
|
|
77
|
-
|
|
78
59
|
const getMockValue = () => Math.trunc(Math.random() * 1000000);
|
|
79
|
-
|
|
80
60
|
exports.getMockValue = getMockValue;
|
|
81
|
-
|
|
82
61
|
const getTab = async (tabId, range, callback) => {
|
|
83
62
|
let requestDelay;
|
|
84
|
-
|
|
85
63
|
switch (tabId) {
|
|
86
64
|
case "tab1":
|
|
87
65
|
requestDelay = 2000;
|
|
88
66
|
break;
|
|
89
|
-
|
|
90
67
|
case "tab2":
|
|
91
68
|
requestDelay = 1500;
|
|
92
69
|
break;
|
|
93
|
-
|
|
94
70
|
case "tab3":
|
|
95
71
|
requestDelay = 3000;
|
|
96
72
|
break;
|
|
97
|
-
|
|
98
73
|
case "tab4":
|
|
99
74
|
requestDelay = 500;
|
|
100
75
|
break;
|
|
101
|
-
|
|
102
76
|
default:
|
|
103
77
|
requestDelay = 1000;
|
|
104
78
|
break;
|
|
105
79
|
}
|
|
106
|
-
|
|
107
80
|
return new Promise(res => setTimeout(() => {
|
|
108
81
|
const labels = getLabels(range);
|
|
109
82
|
res({
|
|
@@ -114,5 +87,4 @@ const getTab = async (tabId, range, callback) => {
|
|
|
114
87
|
});
|
|
115
88
|
}, requestDelay)).then(res => callback ? callback(res, tabId) : res);
|
|
116
89
|
};
|
|
117
|
-
|
|
118
90
|
exports.getTab = getTab;
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _reactDom = require("react-dom");
|
|
15
|
-
|
|
16
11
|
var _reactFeather = require("react-feather");
|
|
17
|
-
|
|
18
12
|
var _utils = require("../../../Functions/utils");
|
|
19
|
-
|
|
20
13
|
var _CustomIcons = require("./../../../Molecular/CustomIcons");
|
|
21
|
-
|
|
22
14
|
require("./Hint.scss");
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
17
|
const time = (Date.now() * Math.random() / 1000).toString().replace(/\./g, "_");
|
|
29
|
-
|
|
30
18
|
const Hint = _ref => {
|
|
31
19
|
var _ref2, _label$replace;
|
|
32
|
-
|
|
33
20
|
let {
|
|
34
21
|
hint,
|
|
35
22
|
side = "right",
|
|
@@ -49,42 +36,33 @@ const Hint = _ref => {
|
|
|
49
36
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
50
37
|
const hintRef = (0, _react.useRef)(null);
|
|
51
38
|
const isCallbackExist = typeof onClickCallback === "function";
|
|
52
|
-
|
|
53
39
|
const handleClickOutside = event => {
|
|
54
40
|
if (!getHintContainer().contains(event === null || event === void 0 ? void 0 : event.target)) {
|
|
55
41
|
setIsOpen(false);
|
|
56
42
|
}
|
|
57
43
|
};
|
|
58
|
-
|
|
59
44
|
const getParentNode = () => {
|
|
60
45
|
var _ref3, _document$querySelect;
|
|
61
|
-
|
|
62
46
|
return (_ref3 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref3 !== void 0 ? _ref3 : document.body;
|
|
63
47
|
};
|
|
64
|
-
|
|
65
48
|
const initHintContainer = () => {
|
|
66
49
|
var _getParentNode;
|
|
67
|
-
|
|
68
50
|
const hint = document.createElement("div");
|
|
69
51
|
hint.setAttribute("id", hintId);
|
|
70
52
|
hint.classList.add("hint__container");
|
|
71
|
-
(_getParentNode = getParentNode()) === null || _getParentNode === void 0
|
|
53
|
+
(_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(hint);
|
|
72
54
|
};
|
|
73
|
-
|
|
74
55
|
const getHintContainer = () => {
|
|
75
56
|
return document.getElementById(hintId);
|
|
76
57
|
};
|
|
77
|
-
|
|
78
58
|
const getHintMarkUp = className => {
|
|
79
59
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
80
60
|
"data-testid": "test-hint-text",
|
|
81
61
|
className: (0, _classnames.default)("hint__text", "hint__text_".concat(side), "hint--".concat(className, "__text"))
|
|
82
62
|
}, hint, children);
|
|
83
63
|
};
|
|
84
|
-
|
|
85
64
|
const setHintContainerStyles = () => {
|
|
86
65
|
var _sw$getBoundingClient;
|
|
87
|
-
|
|
88
66
|
const hc = getHintContainer();
|
|
89
67
|
if (!hc || !isOpen) return false;
|
|
90
68
|
const {
|
|
@@ -93,19 +71,17 @@ const Hint = _ref => {
|
|
|
93
71
|
top
|
|
94
72
|
} = (hintRef === null || hintRef === void 0 ? void 0 : hintRef.current.getBoundingClientRect()) || {};
|
|
95
73
|
const sw = hc.getElementsByClassName("hint__text")[0];
|
|
96
|
-
const swHeight = sw === null || sw === void 0
|
|
74
|
+
const swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
|
|
97
75
|
hc.style.width = isOpen ? width === null || width === void 0 ? void 0 : width.toString().concat("px") : 0;
|
|
98
76
|
hc.style.left = isOpen ? left === null || left === void 0 ? void 0 : left.toString().concat("px") : 0;
|
|
99
77
|
hc.style.top = isOpen ? top === null || top === void 0 ? void 0 : top.toString().concat("px") : 0;
|
|
100
78
|
hc.style.maxHeight = isOpen ? swHeight === null || swHeight === void 0 ? void 0 : swHeight.toString().concat("px") : 0;
|
|
101
79
|
};
|
|
102
|
-
|
|
103
80
|
const renderHintContainer = className => {
|
|
104
81
|
const hc = getHintContainer();
|
|
105
82
|
if (!hc) return null;
|
|
106
83
|
return /*#__PURE__*/(0, _reactDom.createPortal)(getHintMarkUp(className), hc);
|
|
107
84
|
};
|
|
108
|
-
|
|
109
85
|
(0, _react.useEffect)(() => {
|
|
110
86
|
initHintContainer();
|
|
111
87
|
}, []);
|
|
@@ -146,6 +122,4 @@ const Hint = _ref => {
|
|
|
146
122
|
})
|
|
147
123
|
}, (0, _utils.capitalized)(label))), isOpen && renderHintContainer(className));
|
|
148
124
|
};
|
|
149
|
-
|
|
150
|
-
var _default = Hint;
|
|
151
|
-
exports.default = _default;
|
|
125
|
+
var _default = exports.default = Hint;
|