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