intelicoreact 1.4.21 → 1.4.23
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 +16 -46
- 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 +9 -31
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +125 -213
- 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 +4 -20
- 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 -42
- 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
|
@@ -1,42 +1,26 @@
|
|
|
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.renderModalTitle = exports.default = exports.KEY_CODE = 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 _Button = _interopRequireDefault(require("../Button/Button"));
|
|
17
|
-
|
|
18
12
|
var _useHandleKeyPress = _interopRequireDefault(require("./../../../Functions/useKeyPress/useHandleKeyPress"));
|
|
19
|
-
|
|
20
13
|
var _ModalFooter = _interopRequireDefault(require("./partials/ModalFooter"));
|
|
21
|
-
|
|
22
14
|
var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
|
|
23
|
-
|
|
24
15
|
var _useMobileModal = _interopRequireDefault(require("./partials/useMobileModal"));
|
|
25
|
-
|
|
26
16
|
require("./Modal.scss");
|
|
27
|
-
|
|
28
17
|
require("./ModalMobile.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
|
-
|
|
34
|
-
const KEY_CODE = Object.freeze({
|
|
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; }
|
|
20
|
+
const KEY_CODE = exports.KEY_CODE = Object.freeze({
|
|
35
21
|
ENTER: 13,
|
|
36
22
|
ESC: 27
|
|
37
23
|
});
|
|
38
|
-
exports.KEY_CODE = KEY_CODE;
|
|
39
|
-
|
|
40
24
|
const renderModalTitle = _ref => {
|
|
41
25
|
let {
|
|
42
26
|
mode,
|
|
@@ -46,9 +30,7 @@ const renderModalTitle = _ref => {
|
|
|
46
30
|
if (mode && mode !== "default" && !onlyTitle) return "".concat(mode[0].toUpperCase() + mode.slice(1), " ").concat(title);
|
|
47
31
|
return title;
|
|
48
32
|
};
|
|
49
|
-
|
|
50
33
|
exports.renderModalTitle = renderModalTitle;
|
|
51
|
-
|
|
52
34
|
const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
53
35
|
let {
|
|
54
36
|
zIndex = 100,
|
|
@@ -111,12 +93,12 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
111
93
|
});
|
|
112
94
|
const handle = {
|
|
113
95
|
confirm: () => {
|
|
114
|
-
onConfirm === null || onConfirm === void 0
|
|
96
|
+
onConfirm === null || onConfirm === void 0 || onConfirm();
|
|
115
97
|
},
|
|
116
98
|
decline: () => {
|
|
117
99
|
//? closeModal используется для ESC и оверлея, давно хотелось иметь возможность разделить
|
|
118
100
|
//? Теперь можно не передавать closeModal, а для cancel-кнопки передать отдельный обработчик
|
|
119
|
-
if (typeof onDecline === "function") onDecline();else closeModal === null || closeModal === void 0
|
|
101
|
+
if (typeof onDecline === "function") onDecline();else closeModal === null || closeModal === void 0 || closeModal();
|
|
120
102
|
}
|
|
121
103
|
};
|
|
122
104
|
(0, _useHandleKeyPress.default)({
|
|
@@ -124,7 +106,6 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
124
106
|
escCallback: closeOnEsc && typeof closeModal === "function" ? () => closeModal() : null,
|
|
125
107
|
withClamping: false
|
|
126
108
|
});
|
|
127
|
-
|
|
128
109
|
const render = () => !isOpen ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
129
110
|
style: {
|
|
130
111
|
zIndex
|
|
@@ -194,9 +175,6 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
194
175
|
icon: confirmBtnIcon,
|
|
195
176
|
isIconRight: isConfirmBtnIconPositionRight
|
|
196
177
|
}))))))));
|
|
197
|
-
|
|
198
178
|
return render();
|
|
199
179
|
});
|
|
200
|
-
|
|
201
|
-
var _default = Modal;
|
|
202
|
-
exports.default = _default;
|
|
180
|
+
var _default = exports.default = Modal;
|
|
@@ -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 = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _useHandleKeyPress = _interopRequireDefault(require("../../../Functions/useKeyPress/useHandleKeyPress"));
|
|
15
|
-
|
|
16
11
|
require("./Modal.scss");
|
|
17
|
-
|
|
18
12
|
const Modal = _ref => {
|
|
19
13
|
let {
|
|
20
14
|
zIndex = 100,
|
|
@@ -48,6 +42,4 @@ const Modal = _ref => {
|
|
|
48
42
|
className: (0, _classnames.default)(className, "modal")
|
|
49
43
|
}, children));
|
|
50
44
|
};
|
|
51
|
-
|
|
52
|
-
var _default = Modal;
|
|
53
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = Modal;
|
|
@@ -1,16 +1,12 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
const ModalFooter = _ref => {
|
|
15
11
|
let {
|
|
16
12
|
className = "",
|
|
@@ -22,6 +18,4 @@ const ModalFooter = _ref => {
|
|
|
22
18
|
className: (0, _classnames.default)("modal__footer", className)
|
|
23
19
|
}, children);
|
|
24
20
|
};
|
|
25
|
-
|
|
26
|
-
var _default = ModalFooter;
|
|
27
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = ModalFooter;
|
|
@@ -1,18 +1,13 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _reactFeather = require("react-feather");
|
|
15
|
-
|
|
16
11
|
const ModalTitle = _ref => {
|
|
17
12
|
let {
|
|
18
13
|
variant = "primary",
|
|
@@ -42,6 +37,4 @@ const ModalTitle = _ref => {
|
|
|
42
37
|
className: "modal-close-icon"
|
|
43
38
|
})));
|
|
44
39
|
};
|
|
45
|
-
|
|
46
|
-
var _default = ModalTitle;
|
|
47
|
-
exports.default = _default;
|
|
40
|
+
var _default = exports.default = ModalTitle;
|
|
@@ -1,28 +1,20 @@
|
|
|
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 = useMobileModal;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _useIsMobile = _interopRequireDefault(require("../../../../Functions/useIsMobile"));
|
|
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 SCROLL_DIRECTION = {
|
|
19
13
|
UP: "up",
|
|
20
14
|
DOWN: "down"
|
|
21
15
|
};
|
|
22
|
-
|
|
23
16
|
function useMobileModal(_ref) {
|
|
24
|
-
var
|
|
25
|
-
|
|
17
|
+
var _modalMobileHeaderRef3, _modalMobileFooterRef3;
|
|
26
18
|
let {
|
|
27
19
|
modalRef = null,
|
|
28
20
|
withMobileLogic = false,
|
|
@@ -52,12 +44,11 @@ function useMobileModal(_ref) {
|
|
|
52
44
|
const [scrollTop, setScrollTop] = (0, _react.useState)(0);
|
|
53
45
|
const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
|
|
54
46
|
const [containerScrollHeight, setContainerScrollHeight] = (0, _react.useState)(1);
|
|
47
|
+
|
|
55
48
|
/* MODALS LOGIC | BEGIN */
|
|
56
49
|
// Count ScrollTop
|
|
57
|
-
|
|
58
50
|
(0, _react.useLayoutEffect)(() => {
|
|
59
51
|
const el = modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current;
|
|
60
|
-
|
|
61
52
|
if (el) {
|
|
62
53
|
el.addEventListener("scroll", () => {
|
|
63
54
|
setScrollTop(scrollTop => {
|
|
@@ -66,38 +57,35 @@ function useMobileModal(_ref) {
|
|
|
66
57
|
});
|
|
67
58
|
});
|
|
68
59
|
}
|
|
69
|
-
}, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]);
|
|
70
|
-
|
|
60
|
+
}, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]);
|
|
61
|
+
// Count ScrollDirection
|
|
71
62
|
(0, _react.useEffect)(() => {
|
|
72
63
|
setScrollDirection(prevScrollDirection => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection);
|
|
73
|
-
}, [scrollTop, scrollTopPrev]);
|
|
74
|
-
|
|
64
|
+
}, [scrollTop, scrollTopPrev]);
|
|
65
|
+
// Dynamic Modal Positioning
|
|
75
66
|
(0, _react.useLayoutEffect)(() => {
|
|
76
67
|
if (isOpen) {
|
|
77
68
|
const modalStyle = modalRef !== null && modalRef !== void 0 && modalRef.current ? (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current.currentStyle) || window.getComputedStyle(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) : {};
|
|
78
69
|
const computedModalHeight = modalRef !== null && modalRef !== void 0 && modalRef.current ? modalHeight + parseFloat((modalStyle === null || modalStyle === void 0 ? void 0 : modalStyle.marginTop) || 0) : 0;
|
|
79
70
|
const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
|
|
80
|
-
|
|
81
71
|
if (modalMobileContainerRef !== null && modalMobileContainerRef !== void 0 && modalMobileContainerRef.current) {
|
|
82
72
|
if (computedModalHeight <= windowHeight) {
|
|
83
73
|
modalMobileContainerRef.current.style.display = "flex";
|
|
84
74
|
modalMobileContainerRef.current.style.alignItems = "flex-end";
|
|
85
75
|
} else {
|
|
86
|
-
var _modalMobileContainer, _modalMobileContainer2
|
|
87
|
-
|
|
88
|
-
(
|
|
89
|
-
(_modalMobileContainer3 = modalMobileContainerRef.current) === null || _modalMobileContainer3 === void 0 ? void 0 : (_modalMobileContainer4 = _modalMobileContainer3.style) === null || _modalMobileContainer4 === void 0 ? void 0 : _modalMobileContainer4.removeProperty("align-items");
|
|
76
|
+
var _modalMobileContainer, _modalMobileContainer2;
|
|
77
|
+
(_modalMobileContainer = modalMobileContainerRef.current) === null || _modalMobileContainer === void 0 || (_modalMobileContainer = _modalMobileContainer.style) === null || _modalMobileContainer === void 0 || _modalMobileContainer.removeProperty("display");
|
|
78
|
+
(_modalMobileContainer2 = modalMobileContainerRef.current) === null || _modalMobileContainer2 === void 0 || (_modalMobileContainer2 = _modalMobileContainer2.style) === null || _modalMobileContainer2 === void 0 || _modalMobileContainer2.removeProperty("align-items");
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
81
|
}
|
|
93
|
-
}, [modalsLogicProps, isOpen, isMobile, modalHeight]);
|
|
82
|
+
}, [modalsLogicProps, isOpen, isMobile, modalHeight]);
|
|
94
83
|
|
|
84
|
+
// Calculating
|
|
95
85
|
(0, _react.useLayoutEffect)(() => {
|
|
96
86
|
if (isMobile && isOpen) {
|
|
97
|
-
var _modalRef$current
|
|
98
|
-
|
|
99
|
-
const newModalHeight = modalRef === null || modalRef === void 0 ? void 0 : (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 ? void 0 : (_modalRef$current$get = _modalRef$current.getBoundingClientRect()) === null || _modalRef$current$get === void 0 ? void 0 : _modalRef$current$get.height;
|
|
100
|
-
|
|
87
|
+
var _modalRef$current;
|
|
88
|
+
const newModalHeight = modalRef === null || modalRef === void 0 || (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || (_modalRef$current = _modalRef$current.getBoundingClientRect()) === null || _modalRef$current === void 0 ? void 0 : _modalRef$current.height;
|
|
101
89
|
if (modalHeight !== newModalHeight) {
|
|
102
90
|
setModalHeight(newModalHeight);
|
|
103
91
|
}
|
|
@@ -118,38 +106,35 @@ function useMobileModal(_ref) {
|
|
|
118
106
|
}
|
|
119
107
|
}, [scrollTop, scrollHeight, isMobile, withMobileLogic, scrollDirection, modalsLogicProps, modalHeight, window.innerHeight]);
|
|
120
108
|
(0, _react.useLayoutEffect)(() => {
|
|
121
|
-
var _modalMobileHeaderRef
|
|
122
|
-
|
|
123
|
-
if ((modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef2 = _modalMobileHeaderRef.getBoundingClientRect()) === null || _modalMobileHeaderRef2 === void 0 ? void 0 : _modalMobileHeaderRef2.height) !== undefined) {
|
|
109
|
+
var _modalMobileHeaderRef;
|
|
110
|
+
if ((modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef = _modalMobileHeaderRef.getBoundingClientRect()) === null || _modalMobileHeaderRef === void 0 ? void 0 : _modalMobileHeaderRef.height) !== undefined) {
|
|
124
111
|
setModalsLogicProps(state => {
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
headerHeight: modalMobileHeaderRef === null || modalMobileHeaderRef === void 0
|
|
112
|
+
var _modalMobileHeaderRef2;
|
|
113
|
+
return {
|
|
114
|
+
...state,
|
|
115
|
+
headerHeight: modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef2 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef2 === void 0 || (_modalMobileHeaderRef2 = _modalMobileHeaderRef2.getBoundingClientRect()) === null || _modalMobileHeaderRef2 === void 0 ? void 0 : _modalMobileHeaderRef2.height
|
|
129
116
|
};
|
|
130
117
|
});
|
|
131
118
|
}
|
|
132
|
-
}, [modalMobileHeaderRef === null || modalMobileHeaderRef === void 0
|
|
119
|
+
}, [modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 || (_modalMobileHeaderRef3 = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef3 === void 0 || (_modalMobileHeaderRef3 = _modalMobileHeaderRef3.getBoundingClientRect()) === null || _modalMobileHeaderRef3 === void 0 ? void 0 : _modalMobileHeaderRef3.height]);
|
|
133
120
|
(0, _react.useLayoutEffect)(() => {
|
|
134
|
-
var _modalMobileFooterRef
|
|
135
|
-
|
|
136
|
-
if ((modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef2 = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.height) !== undefined) {
|
|
121
|
+
var _modalMobileFooterRef;
|
|
122
|
+
if ((modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 || (_modalMobileFooterRef = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef === void 0 ? void 0 : _modalMobileFooterRef.height) !== undefined) {
|
|
137
123
|
setModalsLogicProps(state => {
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
footerHeight: modalMobileFooterRef === null || modalMobileFooterRef === void 0
|
|
124
|
+
var _modalMobileFooterRef2;
|
|
125
|
+
return {
|
|
126
|
+
...state,
|
|
127
|
+
footerHeight: modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef2 = modalMobileFooterRef.current) === null || _modalMobileFooterRef2 === void 0 || (_modalMobileFooterRef2 = _modalMobileFooterRef2.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.height
|
|
142
128
|
};
|
|
143
129
|
});
|
|
144
130
|
}
|
|
145
|
-
}, [modalMobileFooterRef === null || modalMobileFooterRef === void 0
|
|
131
|
+
}, [modalMobileFooterRef === null || modalMobileFooterRef === void 0 || (_modalMobileFooterRef3 = modalMobileFooterRef.current) === null || _modalMobileFooterRef3 === void 0 || (_modalMobileFooterRef3 = _modalMobileFooterRef3.getBoundingClientRect()) === null || _modalMobileFooterRef3 === void 0 ? void 0 : _modalMobileFooterRef3.height]);
|
|
146
132
|
(0, _react.useEffect)(() => {
|
|
147
133
|
if (modalMobileContainerRef !== null && modalMobileContainerRef !== void 0 && modalMobileContainerRef.current) {
|
|
148
|
-
var
|
|
149
|
-
|
|
134
|
+
var _modalMobileContainer3, _modalMobileContainer4;
|
|
150
135
|
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
151
|
-
setContainerScrollHeight(modalMobileContainerRef === null || modalMobileContainerRef === void 0
|
|
152
|
-
setScrollHeight((modalMobileContainerRef === null || modalMobileContainerRef === void 0
|
|
136
|
+
setContainerScrollHeight(modalMobileContainerRef === null || modalMobileContainerRef === void 0 || (_modalMobileContainer3 = modalMobileContainerRef.current) === null || _modalMobileContainer3 === void 0 ? void 0 : _modalMobileContainer3.scrollHeight);
|
|
137
|
+
setScrollHeight((modalMobileContainerRef === null || modalMobileContainerRef === void 0 || (_modalMobileContainer4 = modalMobileContainerRef.current) === null || _modalMobileContainer4 === void 0 ? void 0 : _modalMobileContainer4.scrollHeight) - window.innerHeight);
|
|
153
138
|
}
|
|
154
139
|
}, [scrollTop, modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current, window.innerHeight]);
|
|
155
140
|
(0, _react.useEffect)(() => {
|
|
@@ -168,11 +153,9 @@ function useMobileModal(_ref) {
|
|
|
168
153
|
ref: modalMobileContainerRef
|
|
169
154
|
}, modal);
|
|
170
155
|
};
|
|
171
|
-
|
|
172
156
|
const renderModal = modal => {
|
|
173
157
|
return isMobile && withMobileLogic ? renderMobileModal(modal) : modal;
|
|
174
158
|
};
|
|
175
|
-
|
|
176
159
|
return {
|
|
177
160
|
modalMobileContainerRef,
|
|
178
161
|
modalMobileHeaderRef,
|
|
@@ -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 _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
|
require("./MonoAccordion.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 = "mono-accordion";
|
|
23
|
-
|
|
24
15
|
const MonoAccordion = _ref => {
|
|
25
16
|
let {
|
|
26
17
|
titleJSX,
|
|
@@ -36,23 +27,19 @@ const MonoAccordion = _ref => {
|
|
|
36
27
|
const [maxHeight, setMaxHeight] = (0, _react.useState)();
|
|
37
28
|
const titleRef = (0, _react.useRef)();
|
|
38
29
|
const containerRef = (0, _react.useRef)();
|
|
39
|
-
|
|
40
30
|
const setHeight = value => {
|
|
41
31
|
if (value !== undefined) setMaxHeight(state => "".concat(value, "px"));else setMaxHeight(state => {
|
|
42
32
|
var _Array$from, _Array$from$reduce, _containerRef$current;
|
|
43
|
-
|
|
44
|
-
return "".concat((_Array$from = Array.from((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.childNodes)) === null || _Array$from === void 0 ? void 0 : (_Array$from$reduce = _Array$from.reduce) === null || _Array$from$reduce === void 0 ? void 0 : _Array$from$reduce.call(_Array$from, (acc, el) => acc + el.offsetHeight, 0), "px");
|
|
33
|
+
return "".concat((_Array$from = Array.from((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.childNodes)) === null || _Array$from === void 0 || (_Array$from$reduce = _Array$from.reduce) === null || _Array$from$reduce === void 0 ? void 0 : _Array$from$reduce.call(_Array$from, (acc, el) => acc + el.offsetHeight, 0), "px");
|
|
45
34
|
});
|
|
46
35
|
};
|
|
47
|
-
|
|
48
36
|
const handleClick = e => {
|
|
49
37
|
if (!Array.from(titleRef.current.childNodes).some(el => el.contains(e.target))) {
|
|
50
38
|
onClick(e);
|
|
51
|
-
e === null || e === void 0
|
|
52
|
-
e === null || e === void 0
|
|
39
|
+
e === null || e === void 0 || e.preventDefault();
|
|
40
|
+
e === null || e === void 0 || e.stopPropagation();
|
|
53
41
|
} else return e;
|
|
54
42
|
};
|
|
55
|
-
|
|
56
43
|
(0, _react.useEffect)(() => {
|
|
57
44
|
if (!isOpen) setHeight(0);else setHeight();
|
|
58
45
|
}, [isOpen]);
|
|
@@ -80,6 +67,4 @@ const MonoAccordion = _ref => {
|
|
|
80
67
|
className: "".concat(RC, "__content-wrapper")
|
|
81
68
|
}, children)));
|
|
82
69
|
};
|
|
83
|
-
|
|
84
|
-
var _default = MonoAccordion;
|
|
85
|
-
exports.default = _default;
|
|
70
|
+
var _default = exports.default = MonoAccordion;
|
|
@@ -1,30 +1,19 @@
|
|
|
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 Icons = _interopRequireWildcard(require("react-feather"));
|
|
15
|
-
|
|
16
11
|
var _reactRouterDom = require("react-router-dom");
|
|
17
|
-
|
|
18
12
|
var _index = require("../../../Constants/index.constants");
|
|
19
|
-
|
|
20
13
|
require("./NavLine.scss");
|
|
21
|
-
|
|
22
|
-
function
|
|
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
|
-
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
26
16
|
const checkedRef = ref => ref ? typeof ref === "function" ? node => ref(node) : ref : null;
|
|
27
|
-
|
|
28
17
|
const NavLine = _ref => {
|
|
29
18
|
let {
|
|
30
19
|
root,
|
|
@@ -49,36 +38,29 @@ const NavLine = _ref => {
|
|
|
49
38
|
const [navLineItemsTotalWidth, setNavLineItemsTotalWidth] = (0, _react.useState)(0);
|
|
50
39
|
const [navLineFirstItemOffset, setNavLineFirstItemOffset] = (0, _react.useState)(0);
|
|
51
40
|
const [scrollQueue, setScrollQueue] = (0, _react.useState)([]);
|
|
52
|
-
|
|
53
41
|
const popScrollTask = () => {
|
|
54
42
|
if (!scrollQueue.length) return null;
|
|
55
43
|
const [task, ...rest] = scrollQueue;
|
|
56
44
|
setScrollQueue(rest);
|
|
57
45
|
return task;
|
|
58
46
|
};
|
|
59
|
-
|
|
60
47
|
const pushScrollTask = task => setScrollQueue(queue => [...queue, task]);
|
|
61
|
-
|
|
62
48
|
(0, _react.useEffect)(() => {
|
|
63
49
|
const task = popScrollTask();
|
|
64
|
-
|
|
65
50
|
if (scrollQueue.length && task) {
|
|
66
51
|
switch (task) {
|
|
67
52
|
case "next":
|
|
68
53
|
scrollToNextItem();
|
|
69
54
|
break;
|
|
70
|
-
|
|
71
55
|
case "prev":
|
|
72
56
|
scrollToPrevItem();
|
|
73
57
|
break;
|
|
74
|
-
|
|
75
58
|
default:
|
|
76
59
|
break;
|
|
77
60
|
}
|
|
78
61
|
}
|
|
79
62
|
}, [scrollQueue]);
|
|
80
63
|
const [isScrollBlocked, setScrollBlocked] = (0, _react.useState)(false);
|
|
81
|
-
|
|
82
64
|
const getVisibleNavLineItems = () => {
|
|
83
65
|
const wrapperInner = wrapperInnerRef === null || wrapperInnerRef === void 0 ? void 0 : wrapperInnerRef.current;
|
|
84
66
|
const wrapperInnerProps = wrapperInner.getBoundingClientRect();
|
|
@@ -95,7 +77,6 @@ const NavLine = _ref => {
|
|
|
95
77
|
return x - wrapperInnerProps.x >= 0 && x - wrapperInnerProps.x <= wrapperRefWidth;
|
|
96
78
|
});
|
|
97
79
|
};
|
|
98
|
-
|
|
99
80
|
const getUnvisibleLeftSideNavLineItems = () => {
|
|
100
81
|
const wrapperInner = wrapperInnerRef === null || wrapperInnerRef === void 0 ? void 0 : wrapperInnerRef.current;
|
|
101
82
|
const wrapperInnerProps = wrapperInner.getBoundingClientRect();
|
|
@@ -112,7 +93,6 @@ const NavLine = _ref => {
|
|
|
112
93
|
return x - wrapperInnerProps.x <= 0;
|
|
113
94
|
});
|
|
114
95
|
};
|
|
115
|
-
|
|
116
96
|
const scroll = function () {
|
|
117
97
|
let offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
118
98
|
if (isScrollBlocked) return false;
|
|
@@ -120,31 +100,32 @@ const NavLine = _ref => {
|
|
|
120
100
|
const wrapperInner = wrapperInnerRef === null || wrapperInnerRef === void 0 ? void 0 : wrapperInnerRef.current;
|
|
121
101
|
const wrapperInnerProps = wrapperInner.getBoundingClientRect();
|
|
122
102
|
const leftOffset = wrapperInner.scrollLeft;
|
|
123
|
-
wrapperInner === null || wrapperInner === void 0
|
|
103
|
+
wrapperInner === null || wrapperInner === void 0 || wrapperInner.addEventListener("scroll", () => {
|
|
124
104
|
setTotalScrolledItems(state => offset > 0 ? ++state : --state);
|
|
125
105
|
setScrollLeft(leftOffset + offset < 0 ? 0 : leftOffset + offset);
|
|
126
106
|
setTimeout(() => setScrollBlocked(false), 50);
|
|
127
107
|
}, {
|
|
128
108
|
once: true
|
|
129
109
|
});
|
|
130
|
-
wrapperInner === null || wrapperInner === void 0
|
|
110
|
+
wrapperInner === null || wrapperInner === void 0 || wrapperInner.scrollBy({
|
|
131
111
|
left: offset,
|
|
132
112
|
behavior: "smooth"
|
|
133
113
|
});
|
|
134
114
|
};
|
|
135
|
-
|
|
136
115
|
const scrollToPrevItem = () => {
|
|
137
|
-
if (isScrollBlocked) return false;
|
|
116
|
+
if (isScrollBlocked) return false;
|
|
117
|
+
|
|
118
|
+
// const wrapperInner = wrapperInnerRef?.current;
|
|
138
119
|
// const navLineUnvisibleItems = getUnvisibleLeftSideNavLineItems();
|
|
139
120
|
// const [prevItem, secondPrevItem] = navLineUnvisibleItems.reverse();
|
|
140
121
|
// const wrapperInnerProps = wrapperInner.getBoundingClientRect();
|
|
141
122
|
// const prevItemProps = prevItem?.ref?.current?.getBoundingClientRect();
|
|
123
|
+
|
|
142
124
|
// let scrollOffset = prevItemProps?.x - wrapperInnerProps?.x;
|
|
143
125
|
|
|
144
126
|
const scrollOffset = -100;
|
|
145
127
|
scroll(scrollOffset);
|
|
146
128
|
};
|
|
147
|
-
|
|
148
129
|
const scrollToNextItem = () => {
|
|
149
130
|
// const wrapperInner = wrapperInnerRef?.current;
|
|
150
131
|
// const navLineVisibleItems = getVisibleNavLineItems();
|
|
@@ -152,11 +133,12 @@ const NavLine = _ref => {
|
|
|
152
133
|
// const wrapperInnerProps = wrapperInner.getBoundingClientRect();
|
|
153
134
|
// const firstVisibleItemProps = firstVisibleItem?.ref?.current?.getBoundingClientRect();
|
|
154
135
|
// const secondVisibleItemProps = secondVisibleItem?.ref?.current?.getBoundingClientRect();
|
|
136
|
+
|
|
155
137
|
// const scrollOffset = secondVisibleItemProps.x-wrapperInnerProps.x;
|
|
138
|
+
|
|
156
139
|
const scrollOffset = 100;
|
|
157
140
|
scroll(scrollOffset);
|
|
158
141
|
};
|
|
159
|
-
|
|
160
142
|
const onWheel = e => {
|
|
161
143
|
e.preventDefault();
|
|
162
144
|
e.stopPropagation();
|
|
@@ -164,30 +146,24 @@ const NavLine = _ref => {
|
|
|
164
146
|
deltaY,
|
|
165
147
|
shiftKey
|
|
166
148
|
} = e;
|
|
167
|
-
|
|
168
149
|
if (shiftKey) {
|
|
169
150
|
if (deltaY > 0) pushScrollTask("next");else pushScrollTask("prev");
|
|
170
151
|
}
|
|
171
152
|
};
|
|
172
|
-
|
|
173
153
|
const onTabChange = item => {
|
|
174
154
|
onChange(item.tabId);
|
|
175
155
|
};
|
|
176
|
-
|
|
177
156
|
const navigateByKeys = event => {
|
|
178
157
|
var _items, _items2;
|
|
179
|
-
|
|
180
158
|
const activeTabIndex = items === null || items === void 0 ? void 0 : items.indexOf(items === null || items === void 0 ? void 0 : items.find(tab => tab.tabId === activeTab));
|
|
181
159
|
const nextTabID = (_items = items[activeTabIndex + 1]) === null || _items === void 0 ? void 0 : _items.tabId;
|
|
182
160
|
const prevTabID = (_items2 = items[activeTabIndex - 1]) === null || _items2 === void 0 ? void 0 : _items2.tabId;
|
|
183
|
-
|
|
184
161
|
if (event.keyCode === _index.KEYBOARD_KEY_CODES.ARROW_RIGHT && !event.repeat && nextTabID) {
|
|
185
162
|
onChange(nextTabID);
|
|
186
163
|
} else if (event.keyCode === _index.KEYBOARD_KEY_CODES.ARROW_LEFT && !event.repeat && prevTabID) {
|
|
187
164
|
onChange(prevTabID);
|
|
188
165
|
}
|
|
189
166
|
};
|
|
190
|
-
|
|
191
167
|
(0, _react.useEffect)(() => {
|
|
192
168
|
if (isNavigateByKeys && !isTabLoading) {
|
|
193
169
|
document.addEventListener("keydown", navigateByKeys);
|
|
@@ -196,42 +172,39 @@ const NavLine = _ref => {
|
|
|
196
172
|
}, [activeTab, isTabLoading]);
|
|
197
173
|
(0, _react.useEffect)(() => {
|
|
198
174
|
var _wrapperRef$current;
|
|
199
|
-
|
|
200
|
-
if (wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.addEventListener("mousewheel", onWheel, {
|
|
175
|
+
if (wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 || _wrapperRef$current.addEventListener("mousewheel", onWheel, {
|
|
201
176
|
passive: false
|
|
202
177
|
});
|
|
203
|
-
}, [wrapperRef]);
|
|
178
|
+
}, [wrapperRef]);
|
|
204
179
|
|
|
180
|
+
// Count Total NavLine Items Width
|
|
205
181
|
(0, _react.useEffect)(() => {
|
|
206
|
-
var _navLineItems$0$ref$c, _navLineItems
|
|
207
|
-
|
|
182
|
+
var _navLineItems$0$ref$c, _navLineItems$;
|
|
208
183
|
setNavLineItemsTotalWidth(() => {
|
|
209
184
|
return navLineItems.reduce((totalWidth, item) => {
|
|
210
185
|
var _item$ref;
|
|
211
|
-
|
|
212
|
-
const element = item === null || item === void 0 ? void 0 : (_item$ref = item.ref) === null || _item$ref === void 0 ? void 0 : _item$ref.current;
|
|
213
|
-
|
|
186
|
+
const element = item === null || item === void 0 || (_item$ref = item.ref) === null || _item$ref === void 0 ? void 0 : _item$ref.current;
|
|
214
187
|
if (element) {
|
|
215
188
|
var _element$getBoundingC;
|
|
216
|
-
|
|
217
|
-
totalWidth += element === null || element === void 0 ? void 0 : (_element$getBoundingC = element.getBoundingClientRect()) === null || _element$getBoundingC === void 0 ? void 0 : _element$getBoundingC.width;
|
|
189
|
+
totalWidth += element === null || element === void 0 || (_element$getBoundingC = element.getBoundingClientRect()) === null || _element$getBoundingC === void 0 ? void 0 : _element$getBoundingC.width;
|
|
218
190
|
}
|
|
219
|
-
|
|
220
191
|
return totalWidth;
|
|
221
192
|
}, 0);
|
|
222
193
|
});
|
|
223
|
-
setNavLineFirstItemOffset((_navLineItems$0$ref$c = (_navLineItems$ = navLineItems[0]) === null || _navLineItems$ === void 0
|
|
224
|
-
}, [navLineItems === null || navLineItems === void 0 ? void 0 : navLineItems.length]);
|
|
194
|
+
setNavLineFirstItemOffset((_navLineItems$0$ref$c = (_navLineItems$ = navLineItems[0]) === null || _navLineItems$ === void 0 || (_navLineItems$ = _navLineItems$.ref) === null || _navLineItems$ === void 0 || (_navLineItems$ = _navLineItems$.current) === null || _navLineItems$ === void 0 ? void 0 : _navLineItems$.getBoundingClientRect().x) !== null && _navLineItems$0$ref$c !== void 0 ? _navLineItems$0$ref$c : 0);
|
|
195
|
+
}, [navLineItems === null || navLineItems === void 0 ? void 0 : navLineItems.length]);
|
|
225
196
|
|
|
197
|
+
// Count Wrapper Width
|
|
226
198
|
(0, _react.useEffect)(() => {
|
|
227
|
-
var _wrapperRef$current$g, _wrapperRef$current2
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}, [wrapperRef]); //Init NavLine Items
|
|
199
|
+
var _wrapperRef$current$g, _wrapperRef$current2;
|
|
200
|
+
setWrapperRefWidth((_wrapperRef$current$g = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current2 = wrapperRef.current) === null || _wrapperRef$current2 === void 0 || (_wrapperRef$current2 = _wrapperRef$current2.getBoundingClientRect()) === null || _wrapperRef$current2 === void 0 ? void 0 : _wrapperRef$current2.width) !== null && _wrapperRef$current$g !== void 0 ? _wrapperRef$current$g : 0);
|
|
201
|
+
}, [wrapperRef]);
|
|
231
202
|
|
|
203
|
+
//Init NavLine Items
|
|
232
204
|
(0, _react.useEffect)(() => {
|
|
233
205
|
setNavLineItems(items.map(item => {
|
|
234
|
-
return {
|
|
206
|
+
return {
|
|
207
|
+
...item,
|
|
235
208
|
ref: /*#__PURE__*/(0, _react.createRef)()
|
|
236
209
|
};
|
|
237
210
|
}));
|
|
@@ -314,6 +287,4 @@ const NavLine = _ref => {
|
|
|
314
287
|
className: "nav-line__body"
|
|
315
288
|
}, children));
|
|
316
289
|
};
|
|
317
|
-
|
|
318
|
-
var _default = NavLine;
|
|
319
|
-
exports.default = _default;
|
|
290
|
+
var _default = exports.default = NavLine;
|