intelicoreact 1.3.27 → 1.3.29
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 +153 -58
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +47 -9
- 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 +57 -24
- 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 +27 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +42 -7
- 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 +44 -14
- 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 +72 -14
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +124 -40
- 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/TagsDropdown/TagsDropdown.js +133 -45
- 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 +10 -1
- 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 +16 -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 +30 -5
- package/dist/Atomic/UI/Modal/Modal.js +29 -6
- package/dist/Atomic/UI/Modal/ModalHOC.js +15 -2
- 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 +90 -65
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
- 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 +14 -3
- package/dist/Atomic/UI/TagList/TagList.js +35 -19
- 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 +43 -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 +19 -7
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +35 -28
- 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 +12 -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/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 +127 -49
- 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 +13 -3
- package/dist/index.js +2 -0
- package/package.json +2 -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,21 +1,33 @@
|
|
|
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 _CustomIcons = require("./../../../Molecular/CustomIcons");
|
|
19
|
+
|
|
13
20
|
require("./Hint.scss");
|
|
14
|
-
|
|
15
|
-
function
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
16
26
|
const time = (Date.now() * Math.random() / 1000).toString().replace(/\./g, "_");
|
|
27
|
+
|
|
17
28
|
const Hint = _ref => {
|
|
18
29
|
var _ref2;
|
|
30
|
+
|
|
19
31
|
let {
|
|
20
32
|
hint,
|
|
21
33
|
side = "right",
|
|
@@ -34,33 +46,42 @@ const Hint = _ref => {
|
|
|
34
46
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
35
47
|
const hintRef = (0, _react.useRef)(null);
|
|
36
48
|
const isCallbackExist = typeof onClickCallback === "function";
|
|
49
|
+
|
|
37
50
|
const handleClickOutside = event => {
|
|
38
51
|
if (!getHintContainer().contains(event === null || event === void 0 ? void 0 : event.target)) {
|
|
39
52
|
setIsOpen(false);
|
|
40
53
|
}
|
|
41
54
|
};
|
|
55
|
+
|
|
42
56
|
const getParentNode = () => {
|
|
43
57
|
var _ref3, _document$querySelect;
|
|
58
|
+
|
|
44
59
|
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;
|
|
45
60
|
};
|
|
61
|
+
|
|
46
62
|
const initHintContainer = () => {
|
|
47
63
|
var _getParentNode;
|
|
64
|
+
|
|
48
65
|
const hint = document.createElement("div");
|
|
49
66
|
hint.setAttribute("id", hintId);
|
|
50
67
|
hint.classList.add("hint__container");
|
|
51
|
-
(_getParentNode = getParentNode()) === null || _getParentNode === void 0
|
|
68
|
+
(_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(hint);
|
|
52
69
|
};
|
|
70
|
+
|
|
53
71
|
const getHintContainer = () => {
|
|
54
72
|
return document.getElementById(hintId);
|
|
55
73
|
};
|
|
74
|
+
|
|
56
75
|
const getHintMarkUp = () => {
|
|
57
76
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
77
|
"data-testid": "test-hint-text",
|
|
59
78
|
className: (0, _classnames.default)("hint__text", "hint__text_".concat(side))
|
|
60
79
|
}, hint, children);
|
|
61
80
|
};
|
|
81
|
+
|
|
62
82
|
const setHintContainerStyles = () => {
|
|
63
83
|
var _sw$getBoundingClient;
|
|
84
|
+
|
|
64
85
|
const hc = getHintContainer();
|
|
65
86
|
if (!hc || !isOpen) return false;
|
|
66
87
|
const {
|
|
@@ -69,17 +90,19 @@ const Hint = _ref => {
|
|
|
69
90
|
top
|
|
70
91
|
} = (hintRef === null || hintRef === void 0 ? void 0 : hintRef.current.getBoundingClientRect()) || {};
|
|
71
92
|
const sw = hc.getElementsByClassName("hint__text")[0];
|
|
72
|
-
const swHeight = sw === null || sw === void 0
|
|
93
|
+
const swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
|
|
73
94
|
hc.style.width = isOpen ? width === null || width === void 0 ? void 0 : width.toString().concat("px") : 0;
|
|
74
95
|
hc.style.left = isOpen ? left === null || left === void 0 ? void 0 : left.toString().concat("px") : 0;
|
|
75
96
|
hc.style.top = isOpen ? top === null || top === void 0 ? void 0 : top.toString().concat("px") : 0;
|
|
76
97
|
hc.style.maxHeight = isOpen ? swHeight === null || swHeight === void 0 ? void 0 : swHeight.toString().concat("px") : 0;
|
|
77
98
|
};
|
|
99
|
+
|
|
78
100
|
const renderHintContainer = () => {
|
|
79
101
|
const hc = getHintContainer();
|
|
80
102
|
if (!hc) return null;
|
|
81
103
|
return /*#__PURE__*/(0, _reactDom.createPortal)(getHintMarkUp(), hc);
|
|
82
104
|
};
|
|
105
|
+
|
|
83
106
|
(0, _react.useEffect)(() => {
|
|
84
107
|
initHintContainer();
|
|
85
108
|
}, []);
|
|
@@ -120,4 +143,6 @@ const Hint = _ref => {
|
|
|
120
143
|
})
|
|
121
144
|
}, label[0].toUpperCase() + label.slice(1))), isOpen && renderHintContainer());
|
|
122
145
|
};
|
|
123
|
-
|
|
146
|
+
|
|
147
|
+
var _default = Hint;
|
|
148
|
+
exports.default = _default;
|
|
@@ -1,27 +1,44 @@
|
|
|
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 _useBodyScrollLock = _interopRequireDefault(require("./../../../Functions/useBodyScrollLock"));
|
|
19
|
+
|
|
13
20
|
var _useHandleKeyPress = _interopRequireDefault(require("./../../../Functions/useKeyPress/useHandleKeyPress"));
|
|
21
|
+
|
|
14
22
|
var _ModalFooter = _interopRequireDefault(require("./partials/ModalFooter"));
|
|
23
|
+
|
|
15
24
|
var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
|
|
25
|
+
|
|
16
26
|
var _useMobileModal = _interopRequireDefault(require("./partials/useMobileModal"));
|
|
27
|
+
|
|
17
28
|
require("./Modal.scss");
|
|
29
|
+
|
|
18
30
|
require("./ModalMobile.scss");
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
const KEY_CODE = Object.freeze({
|
|
22
37
|
ENTER: 13,
|
|
23
38
|
ESC: 27
|
|
24
39
|
});
|
|
40
|
+
exports.KEY_CODE = KEY_CODE;
|
|
41
|
+
|
|
25
42
|
const renderModalTitle = _ref => {
|
|
26
43
|
let {
|
|
27
44
|
mode,
|
|
@@ -31,7 +48,9 @@ const renderModalTitle = _ref => {
|
|
|
31
48
|
if (mode && mode !== "default" && !onlyTitle) return "".concat(mode[0].toUpperCase() + mode.slice(1), " ").concat(title);
|
|
32
49
|
return title;
|
|
33
50
|
};
|
|
51
|
+
|
|
34
52
|
exports.renderModalTitle = renderModalTitle;
|
|
53
|
+
|
|
35
54
|
const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
36
55
|
let {
|
|
37
56
|
zIndex = 100,
|
|
@@ -92,12 +111,12 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
92
111
|
});
|
|
93
112
|
const handle = {
|
|
94
113
|
confirm: () => {
|
|
95
|
-
onConfirm === null || onConfirm === void 0
|
|
114
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
96
115
|
},
|
|
97
116
|
decline: () => {
|
|
98
117
|
//? closeModal используется для ESC и оверлея, давно хотелось иметь возможность разделить
|
|
99
118
|
//? Теперь можно не передавать closeModal, а для cancel-кнопки передать отдельный обработчик
|
|
100
|
-
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();
|
|
101
120
|
}
|
|
102
121
|
};
|
|
103
122
|
(0, _useBodyScrollLock.default)(isScrollLock && isOpen);
|
|
@@ -105,6 +124,7 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
105
124
|
enterCallback: submitOnEnter && typeof onConfirm === "function" ? () => handle.confirm() : null,
|
|
106
125
|
escCallback: closeOnEsc && typeof closeModal === "function" ? () => closeModal() : null
|
|
107
126
|
});
|
|
127
|
+
|
|
108
128
|
const render = () => !isOpen ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
109
129
|
style: {
|
|
110
130
|
zIndex
|
|
@@ -174,6 +194,9 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
174
194
|
icon: confirmBtnIcon,
|
|
175
195
|
isIconRight: isConfirmBtnIconPositionRight
|
|
176
196
|
})))))));
|
|
197
|
+
|
|
177
198
|
return render();
|
|
178
199
|
});
|
|
179
|
-
|
|
200
|
+
|
|
201
|
+
var _default = Modal;
|
|
202
|
+
exports.default = _default;
|
|
@@ -1,13 +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
|
+
|
|
14
|
+
var _useHandleKeyPress = _interopRequireDefault(require("../../../Functions/useKeyPress/useHandleKeyPress"));
|
|
15
|
+
|
|
10
16
|
require("./Modal.scss");
|
|
17
|
+
|
|
11
18
|
const Modal = _ref => {
|
|
12
19
|
let {
|
|
13
20
|
zIndex = 100,
|
|
@@ -16,9 +23,13 @@ const Modal = _ref => {
|
|
|
16
23
|
children,
|
|
17
24
|
className,
|
|
18
25
|
size,
|
|
19
|
-
testId
|
|
26
|
+
testId,
|
|
27
|
+
closeOnEsc = true
|
|
20
28
|
} = _ref;
|
|
21
29
|
if (!isOpen) return null;
|
|
30
|
+
(0, _useHandleKeyPress.default)({
|
|
31
|
+
escCallback: closeOnEsc && typeof closeModal === "function" ? () => closeModal === null || closeModal === void 0 ? void 0 : closeModal() : null
|
|
32
|
+
});
|
|
22
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
34
|
style: {
|
|
24
35
|
zIndex
|
|
@@ -36,4 +47,6 @@ const Modal = _ref => {
|
|
|
36
47
|
className: (0, _classnames.default)(className, "modal")
|
|
37
48
|
}, children));
|
|
38
49
|
};
|
|
39
|
-
|
|
50
|
+
|
|
51
|
+
var _default = Modal;
|
|
52
|
+
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;
|