intelicoreact 1.6.22 → 1.6.24
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 +98 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +87 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +47 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +256 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
- package/dist/Atomic/UI/Modal/Modal.js +179 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +31 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
- package/dist/Atomic/UI/Status/Status.js +67 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +167 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +294 -1
- package/dist/Functions/guards/safeValue.js +75 -1
- package/dist/Functions/guards/typeGuards.js +373 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +626 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +104 -1
- package/package.json +1 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
- package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
|
+
const _useHandleKeyPress = /*#__PURE__*/ _interop_require_default(require("../../../Functions/useKeyPress/useHandleKeyPress"));
|
|
15
|
+
require("./Modal.scss");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
22
|
+
if (typeof WeakMap !== "function") return null;
|
|
23
|
+
var cacheBabelInterop = new WeakMap();
|
|
24
|
+
var cacheNodeInterop = new WeakMap();
|
|
25
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
26
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
27
|
+
})(nodeInterop);
|
|
28
|
+
}
|
|
29
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
30
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
34
|
+
return {
|
|
35
|
+
default: obj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
39
|
+
if (cache && cache.has(obj)) {
|
|
40
|
+
return cache.get(obj);
|
|
41
|
+
}
|
|
42
|
+
var newObj = {
|
|
43
|
+
__proto__: null
|
|
44
|
+
};
|
|
45
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
46
|
+
for(var key in obj){
|
|
47
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
48
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
49
|
+
if (desc && (desc.get || desc.set)) {
|
|
50
|
+
Object.defineProperty(newObj, key, desc);
|
|
51
|
+
} else {
|
|
52
|
+
newObj[key] = obj[key];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
newObj.default = obj;
|
|
57
|
+
if (cache) {
|
|
58
|
+
cache.set(obj, newObj);
|
|
59
|
+
}
|
|
60
|
+
return newObj;
|
|
61
|
+
}
|
|
62
|
+
const Modal = ({ zIndex = 100, isOpen, closeModal, children, className, size, testId = 'modal', closeOnEsc = true })=>{
|
|
63
|
+
const modalRef = (0, _react.useRef)(null);
|
|
64
|
+
(0, _useHandleKeyPress.default)({
|
|
65
|
+
escCallback: closeOnEsc && typeof closeModal === 'function' ? ()=>closeModal === null || closeModal === void 0 ? void 0 : closeModal() : undefined
|
|
66
|
+
});
|
|
67
|
+
if (!isOpen) return null;
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
69
|
+
style: {
|
|
70
|
+
zIndex
|
|
71
|
+
},
|
|
72
|
+
"data-testid": testId,
|
|
73
|
+
className: "modal-box j5",
|
|
74
|
+
role: "presentation",
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
77
|
+
className: "modal-overlay",
|
|
78
|
+
onClick: closeModal,
|
|
79
|
+
role: "presentation",
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
83
|
+
ref: modalRef,
|
|
84
|
+
style: {
|
|
85
|
+
width: size
|
|
86
|
+
},
|
|
87
|
+
className: (0, _classnames.default)(className, 'modal'),
|
|
88
|
+
role: "dialog",
|
|
89
|
+
"aria-modal": "true",
|
|
90
|
+
"aria-labelledby": testId,
|
|
91
|
+
tabIndex: -1,
|
|
92
|
+
children: children
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const _default = Modal;
|
|
@@ -1 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
20
|
+
if (typeof WeakMap !== "function") return null;
|
|
21
|
+
var cacheBabelInterop = new WeakMap();
|
|
22
|
+
var cacheNodeInterop = new WeakMap();
|
|
23
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
24
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
25
|
+
})(nodeInterop);
|
|
26
|
+
}
|
|
27
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
28
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
32
|
+
return {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
37
|
+
if (cache && cache.has(obj)) {
|
|
38
|
+
return cache.get(obj);
|
|
39
|
+
}
|
|
40
|
+
var newObj = {
|
|
41
|
+
__proto__: null
|
|
42
|
+
};
|
|
43
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
44
|
+
for(var key in obj){
|
|
45
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
46
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
47
|
+
if (desc && (desc.get || desc.set)) {
|
|
48
|
+
Object.defineProperty(newObj, key, desc);
|
|
49
|
+
} else {
|
|
50
|
+
newObj[key] = obj[key];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
newObj.default = obj;
|
|
55
|
+
if (cache) {
|
|
56
|
+
cache.set(obj, newObj);
|
|
57
|
+
}
|
|
58
|
+
return newObj;
|
|
59
|
+
}
|
|
60
|
+
const ModalFooter = /*#__PURE__*/ (0, _react.memo)(({ className = '', children, wrapperRef, testId = 'modal-footer' })=>{
|
|
61
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("footer", {
|
|
62
|
+
"data-testid": testId,
|
|
63
|
+
ref: wrapperRef,
|
|
64
|
+
className: (0, _classnames.default)('modal__footer', className),
|
|
65
|
+
role: "contentinfo",
|
|
66
|
+
"aria-label": "Modal footer",
|
|
67
|
+
children: children
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
71
|
+
const _default = ModalFooter;
|
|
@@ -1 +1,110 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
|
+
const _reactfeather = require("react-feather");
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
21
|
+
if (typeof WeakMap !== "function") return null;
|
|
22
|
+
var cacheBabelInterop = new WeakMap();
|
|
23
|
+
var cacheNodeInterop = new WeakMap();
|
|
24
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
25
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
26
|
+
})(nodeInterop);
|
|
27
|
+
}
|
|
28
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
29
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
33
|
+
return {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
38
|
+
if (cache && cache.has(obj)) {
|
|
39
|
+
return cache.get(obj);
|
|
40
|
+
}
|
|
41
|
+
var newObj = {
|
|
42
|
+
__proto__: null
|
|
43
|
+
};
|
|
44
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
45
|
+
for(var key in obj){
|
|
46
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
47
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
48
|
+
if (desc && (desc.get || desc.set)) {
|
|
49
|
+
Object.defineProperty(newObj, key, desc);
|
|
50
|
+
} else {
|
|
51
|
+
newObj[key] = obj[key];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
newObj.default = obj;
|
|
56
|
+
if (cache) {
|
|
57
|
+
cache.set(obj, newObj);
|
|
58
|
+
}
|
|
59
|
+
return newObj;
|
|
60
|
+
}
|
|
61
|
+
const ModalTitle = /*#__PURE__*/ (0, _react.memo)(({ variant = 'primary', children, isForced = false, onClose, noHeaderCloseBtn = false, className, wrapperRef, testId = 'modal-title' })=>{
|
|
62
|
+
const handleKeyDown = (0, _react.useCallback)((e)=>{
|
|
63
|
+
if (e.key === 'Enter' || e.key === 'Space') {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
66
|
+
}
|
|
67
|
+
}, [
|
|
68
|
+
onClose
|
|
69
|
+
]);
|
|
70
|
+
const handleClick = (0, _react.useCallback)(()=>{
|
|
71
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
72
|
+
}, [
|
|
73
|
+
onClose
|
|
74
|
+
]);
|
|
75
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("header", {
|
|
76
|
+
"data-testid": testId,
|
|
77
|
+
ref: wrapperRef,
|
|
78
|
+
className: (0, _classnames.default)('modal__header', className, {
|
|
79
|
+
[`modal__header-${variant}`]: variant
|
|
80
|
+
}),
|
|
81
|
+
role: "banner",
|
|
82
|
+
"aria-label": "Modal header",
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
85
|
+
className: (0, _classnames.default)('modal__header-title', {
|
|
86
|
+
[`modal__header-${variant}-title`]: variant
|
|
87
|
+
}),
|
|
88
|
+
id: `${testId}-heading`,
|
|
89
|
+
children: children
|
|
90
|
+
}),
|
|
91
|
+
!isForced && /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
onClick: handleClick,
|
|
94
|
+
onKeyDown: handleKeyDown,
|
|
95
|
+
className: (0, _classnames.default)('modal-close-icon-box', {
|
|
96
|
+
'modal-close-icon-box-primary': variant === 'primary'
|
|
97
|
+
}),
|
|
98
|
+
"aria-label": "Close modal",
|
|
99
|
+
title: "Close modal",
|
|
100
|
+
children: !noHeaderCloseBtn && /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.X, {
|
|
101
|
+
className: "modal-close-icon",
|
|
102
|
+
role: "img",
|
|
103
|
+
"aria-hidden": "true"
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
ModalTitle.displayName = 'ModalTitle';
|
|
110
|
+
const _default = ModalTitle;
|
|
@@ -1 +1,192 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable react-web-api/no-leaked-event-listener */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useMobileModal;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = require("react");
|
|
13
|
+
const _useIsMobile = /*#__PURE__*/ _interop_require_default(require("../../../../Functions/useIsMobile/useIsMobile"));
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const SCROLL_DIRECTION = {
|
|
20
|
+
UP: 'up',
|
|
21
|
+
DOWN: 'down'
|
|
22
|
+
};
|
|
23
|
+
function useMobileModal({ modalRef, withMobileLogic = false, withFixedFooter = false, isOpen = false }) {
|
|
24
|
+
var _modalMobileHeaderRef_current_getBoundingClientRect, _modalMobileHeaderRef_current, _modalMobileFooterRef_current_getBoundingClientRect, _modalMobileFooterRef_current;
|
|
25
|
+
const modalMobileContainerRef = (0, _react.useRef)(null);
|
|
26
|
+
const modalMobileHeaderRef = (0, _react.useRef)(null);
|
|
27
|
+
const modalMobileFooterRef = (0, _react.useRef)(null);
|
|
28
|
+
const modalMobileBodyRef = (0, _react.useRef)(null);
|
|
29
|
+
const { isMobile } = (0, _useIsMobile.default)();
|
|
30
|
+
const [modalHeight, setModalHeight] = (0, _react.useState)(0);
|
|
31
|
+
const [modalsLogic, setModalsLogic] = (0, _react.useState)({
|
|
32
|
+
IS_HEADER_HIDDEN: false,
|
|
33
|
+
IS_HEADER_STICKY: false,
|
|
34
|
+
IS_FOOTER_HIDDEN: false,
|
|
35
|
+
IS_FOOTER_STICKY: withFixedFooter
|
|
36
|
+
});
|
|
37
|
+
const [modalsLogicProps, setModalsLogicProps] = (0, _react.useState)({
|
|
38
|
+
headerHeight: 0,
|
|
39
|
+
footerHeight: 0
|
|
40
|
+
});
|
|
41
|
+
const [scrollDirection, setScrollDirection] = (0, _react.useState)(SCROLL_DIRECTION.UP);
|
|
42
|
+
const [scrollTopPrev, setScrollTopPrev] = (0, _react.useState)(0);
|
|
43
|
+
const [scrollTop, setScrollTop] = (0, _react.useState)(0);
|
|
44
|
+
const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
|
|
45
|
+
const [, setContainerScrollHeight] = (0, _react.useState)(1);
|
|
46
|
+
/* MODALS LOGIC | BEGIN */ // Count ScrollTop
|
|
47
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
48
|
+
const el = modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current;
|
|
49
|
+
if (el) {
|
|
50
|
+
el.addEventListener('scroll', ()=>{
|
|
51
|
+
setScrollTop((scrollTop)=>{
|
|
52
|
+
if (scrollTop !== el.scrollTop) setScrollTopPrev(scrollTop);
|
|
53
|
+
return el.scrollTop;
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current
|
|
59
|
+
]);
|
|
60
|
+
// Count ScrollDirection
|
|
61
|
+
(0, _react.useEffect)(()=>{
|
|
62
|
+
setScrollDirection((prevScrollDirection)=>scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection);
|
|
63
|
+
}, [
|
|
64
|
+
scrollTop,
|
|
65
|
+
scrollTopPrev
|
|
66
|
+
]);
|
|
67
|
+
// Dynamic Modal Positioning
|
|
68
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
69
|
+
if (isOpen) {
|
|
70
|
+
const modalStyle = (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) ? (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current.style) || window.getComputedStyle(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) : {};
|
|
71
|
+
const computedModalHeight = (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) ? modalHeight + Number.parseFloat((modalStyle === null || modalStyle === void 0 ? void 0 : modalStyle.marginTop) || '0') : 0;
|
|
72
|
+
const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
|
|
73
|
+
if (modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current) {
|
|
74
|
+
if (computedModalHeight <= windowHeight) {
|
|
75
|
+
modalMobileContainerRef.current.style.display = 'flex';
|
|
76
|
+
modalMobileContainerRef.current.style.alignItems = 'flex-end';
|
|
77
|
+
} else {
|
|
78
|
+
var _modalMobileContainerRef_current_style, _modalMobileContainerRef_current, _modalMobileContainerRef_current_style1, _modalMobileContainerRef_current1;
|
|
79
|
+
(_modalMobileContainerRef_current = modalMobileContainerRef.current) === null || _modalMobileContainerRef_current === void 0 ? void 0 : (_modalMobileContainerRef_current_style = _modalMobileContainerRef_current.style) === null || _modalMobileContainerRef_current_style === void 0 ? void 0 : _modalMobileContainerRef_current_style.removeProperty('display');
|
|
80
|
+
(_modalMobileContainerRef_current1 = modalMobileContainerRef.current) === null || _modalMobileContainerRef_current1 === void 0 ? void 0 : (_modalMobileContainerRef_current_style1 = _modalMobileContainerRef_current1.style) === null || _modalMobileContainerRef_current_style1 === void 0 ? void 0 : _modalMobileContainerRef_current_style1.removeProperty('align-items');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [
|
|
85
|
+
modalsLogicProps,
|
|
86
|
+
isOpen,
|
|
87
|
+
isMobile,
|
|
88
|
+
modalHeight
|
|
89
|
+
]);
|
|
90
|
+
// Calculating
|
|
91
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
92
|
+
if (isMobile && isOpen) {
|
|
93
|
+
var _modalRef_current_getBoundingClientRect, _modalRef_current;
|
|
94
|
+
const newModalHeight = modalRef === null || modalRef === void 0 ? void 0 : (_modalRef_current = modalRef.current) === null || _modalRef_current === void 0 ? void 0 : (_modalRef_current_getBoundingClientRect = _modalRef_current.getBoundingClientRect()) === null || _modalRef_current_getBoundingClientRect === void 0 ? void 0 : _modalRef_current_getBoundingClientRect.height;
|
|
95
|
+
if (newModalHeight && modalHeight !== newModalHeight) {
|
|
96
|
+
setModalHeight(newModalHeight);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
(0, _react.useEffect)(()=>{
|
|
101
|
+
if (isMobile && withMobileLogic) {
|
|
102
|
+
const { footerHeight, headerHeight } = modalsLogicProps;
|
|
103
|
+
setModalsLogic((prevStickyLogic)=>({
|
|
104
|
+
IS_HEADER_HIDDEN: scrollDirection === SCROLL_DIRECTION.DOWN || scrollTop === 0,
|
|
105
|
+
IS_HEADER_STICKY: scrollDirection === SCROLL_DIRECTION.UP && scrollTop !== 0 && (scrollTop >= headerHeight || prevStickyLogic.IS_HEADER_STICKY),
|
|
106
|
+
IS_FOOTER_HIDDEN: !withFixedFooter && (scrollDirection === SCROLL_DIRECTION.UP || scrollHeight === Math.round(scrollTop)),
|
|
107
|
+
IS_FOOTER_STICKY: withFixedFooter && scrollHeight > 1 || scrollDirection === SCROLL_DIRECTION.DOWN && (scrollHeight - Math.round(scrollTop) >= footerHeight || prevStickyLogic.IS_FOOTER_STICKY)
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
scrollTop,
|
|
112
|
+
scrollHeight,
|
|
113
|
+
isMobile,
|
|
114
|
+
withMobileLogic,
|
|
115
|
+
scrollDirection,
|
|
116
|
+
modalsLogicProps,
|
|
117
|
+
modalHeight,
|
|
118
|
+
window.innerHeight
|
|
119
|
+
]);
|
|
120
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
121
|
+
var _modalMobileHeaderRef_current_getBoundingClientRect, _modalMobileHeaderRef_current;
|
|
122
|
+
if ((modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef_current = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef_current === void 0 ? void 0 : (_modalMobileHeaderRef_current_getBoundingClientRect = _modalMobileHeaderRef_current.getBoundingClientRect()) === null || _modalMobileHeaderRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileHeaderRef_current_getBoundingClientRect.height) !== undefined) {
|
|
123
|
+
setModalsLogicProps((state)=>{
|
|
124
|
+
var _modalMobileHeaderRef_current_getBoundingClientRect, _modalMobileHeaderRef_current;
|
|
125
|
+
var _modalMobileHeaderRef_current_getBoundingClientRect_height;
|
|
126
|
+
return {
|
|
127
|
+
...state,
|
|
128
|
+
headerHeight: (_modalMobileHeaderRef_current_getBoundingClientRect_height = modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef_current = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef_current === void 0 ? void 0 : (_modalMobileHeaderRef_current_getBoundingClientRect = _modalMobileHeaderRef_current.getBoundingClientRect()) === null || _modalMobileHeaderRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileHeaderRef_current_getBoundingClientRect.height) !== null && _modalMobileHeaderRef_current_getBoundingClientRect_height !== void 0 ? _modalMobileHeaderRef_current_getBoundingClientRect_height : 0
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}, [
|
|
133
|
+
modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef_current = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef_current === void 0 ? void 0 : (_modalMobileHeaderRef_current_getBoundingClientRect = _modalMobileHeaderRef_current.getBoundingClientRect()) === null || _modalMobileHeaderRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileHeaderRef_current_getBoundingClientRect.height
|
|
134
|
+
]);
|
|
135
|
+
(0, _react.useLayoutEffect)(()=>{
|
|
136
|
+
var _modalMobileFooterRef_current_getBoundingClientRect, _modalMobileFooterRef_current;
|
|
137
|
+
if ((modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef_current = modalMobileFooterRef.current) === null || _modalMobileFooterRef_current === void 0 ? void 0 : (_modalMobileFooterRef_current_getBoundingClientRect = _modalMobileFooterRef_current.getBoundingClientRect()) === null || _modalMobileFooterRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileFooterRef_current_getBoundingClientRect.height) !== undefined) {
|
|
138
|
+
setModalsLogicProps((state)=>{
|
|
139
|
+
var _modalMobileFooterRef_current_getBoundingClientRect, _modalMobileFooterRef_current;
|
|
140
|
+
var _modalMobileFooterRef_current_getBoundingClientRect_height;
|
|
141
|
+
return {
|
|
142
|
+
...state,
|
|
143
|
+
footerHeight: (_modalMobileFooterRef_current_getBoundingClientRect_height = modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef_current = modalMobileFooterRef.current) === null || _modalMobileFooterRef_current === void 0 ? void 0 : (_modalMobileFooterRef_current_getBoundingClientRect = _modalMobileFooterRef_current.getBoundingClientRect()) === null || _modalMobileFooterRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileFooterRef_current_getBoundingClientRect.height) !== null && _modalMobileFooterRef_current_getBoundingClientRect_height !== void 0 ? _modalMobileFooterRef_current_getBoundingClientRect_height : 0
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}, [
|
|
148
|
+
modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef_current = modalMobileFooterRef.current) === null || _modalMobileFooterRef_current === void 0 ? void 0 : (_modalMobileFooterRef_current_getBoundingClientRect = _modalMobileFooterRef_current.getBoundingClientRect()) === null || _modalMobileFooterRef_current_getBoundingClientRect === void 0 ? void 0 : _modalMobileFooterRef_current_getBoundingClientRect.height
|
|
149
|
+
]);
|
|
150
|
+
(0, _react.useEffect)(()=>{
|
|
151
|
+
if (modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current) {
|
|
152
|
+
var _modalMobileContainerRef_current, _modalMobileContainerRef_current1;
|
|
153
|
+
setContainerScrollHeight(modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : (_modalMobileContainerRef_current = modalMobileContainerRef.current) === null || _modalMobileContainerRef_current === void 0 ? void 0 : _modalMobileContainerRef_current.scrollHeight);
|
|
154
|
+
setScrollHeight((modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : (_modalMobileContainerRef_current1 = modalMobileContainerRef.current) === null || _modalMobileContainerRef_current1 === void 0 ? void 0 : _modalMobileContainerRef_current1.scrollHeight) - window.innerHeight);
|
|
155
|
+
}
|
|
156
|
+
}, [
|
|
157
|
+
scrollTop,
|
|
158
|
+
modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current,
|
|
159
|
+
window.innerHeight
|
|
160
|
+
]);
|
|
161
|
+
(0, _react.useEffect)(()=>{
|
|
162
|
+
window.addEventListener('resize', ()=>{
|
|
163
|
+
setContainerScrollHeight((containerScrollHeight)=>{
|
|
164
|
+
setScrollHeight(containerScrollHeight - window.innerHeight);
|
|
165
|
+
return containerScrollHeight;
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}, []);
|
|
169
|
+
/* MODALS LOGIC | END */ const renderModal = (0, _react.useCallback)((modal)=>{
|
|
170
|
+
if (!isMobile || !withMobileLogic) return modal;
|
|
171
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
172
|
+
className: "modal-mobile-container",
|
|
173
|
+
ref: modalMobileContainerRef,
|
|
174
|
+
children: modal
|
|
175
|
+
});
|
|
176
|
+
}, [
|
|
177
|
+
isMobile,
|
|
178
|
+
withMobileLogic
|
|
179
|
+
]);
|
|
180
|
+
return {
|
|
181
|
+
modalMobileContainerRef,
|
|
182
|
+
modalMobileHeaderRef,
|
|
183
|
+
modalMobileBodyRef,
|
|
184
|
+
modalMobileFooterRef,
|
|
185
|
+
MODALS_LOGIC: modalsLogic,
|
|
186
|
+
SCROLL_DIRECTION,
|
|
187
|
+
scrollTop,
|
|
188
|
+
scrollHeight,
|
|
189
|
+
renderModal,
|
|
190
|
+
isMobile
|
|
191
|
+
};
|
|
192
|
+
}
|
|
@@ -1 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import MonoAccordion from './MonoAccordion';
|
|
4
|
+
|
|
5
|
+
describe('monoAccordion', () => {
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
titleJSX: <div>Accordion Title</div>,
|
|
8
|
+
icon: <span>▼</span>,
|
|
9
|
+
isOpen: false,
|
|
10
|
+
onClick: jest.fn(),
|
|
11
|
+
testId: 'test-accordion',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
it('renders correctly with default props', () => {
|
|
15
|
+
render(
|
|
16
|
+
<MonoAccordion {...defaultProps}>
|
|
17
|
+
<div>Accordion Content</div>
|
|
18
|
+
</MonoAccordion>,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
expect(screen.getByTestId('test-accordion')).toBeInTheDocument();
|
|
22
|
+
expect(screen.getByText('Accordion Title')).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('handles click events correctly', () => {
|
|
26
|
+
render(
|
|
27
|
+
<MonoAccordion {...defaultProps}>
|
|
28
|
+
<div>Accordion Content</div>
|
|
29
|
+
</MonoAccordion>,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
fireEvent.click(screen.getByRole('button'));
|
|
33
|
+
expect(defaultProps.onClick).toHaveBeenCalled();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('applies correct classes when open', () => {
|
|
37
|
+
render(
|
|
38
|
+
<MonoAccordion {...defaultProps} isOpen={true}>
|
|
39
|
+
<div>Accordion Content</div>
|
|
40
|
+
</MonoAccordion>,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
expect(screen.getByTestId('test-accordion')).toHaveClass('mono-accordion--is-open');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('applies disabled state correctly', () => {
|
|
47
|
+
render(
|
|
48
|
+
<MonoAccordion {...defaultProps} disabled={true}>
|
|
49
|
+
<div>Accordion Content</div>
|
|
50
|
+
</MonoAccordion>,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const button = screen.getByRole('button');
|
|
54
|
+
expect(button).toBeDisabled();
|
|
55
|
+
expect(screen.getByTestId('test-accordion')).toHaveClass('mono-accordion--disabled');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('handles aria attributes correctly', () => {
|
|
59
|
+
const { rerender } = render(
|
|
60
|
+
<MonoAccordion {...defaultProps}>
|
|
61
|
+
<div>Accordion Content</div>
|
|
62
|
+
</MonoAccordion>,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false');
|
|
66
|
+
|
|
67
|
+
rerender(
|
|
68
|
+
<MonoAccordion {...defaultProps} isOpen={true}>
|
|
69
|
+
<div>Accordion Content</div>
|
|
70
|
+
</MonoAccordion>,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -1 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import "./MonoAccordion.scss";
|
|
6
|
+
|
|
7
|
+
const RC = "mono-accordion";
|
|
8
|
+
|
|
9
|
+
const MonoAccordion = ({
|
|
10
|
+
titleJSX,
|
|
11
|
+
icon,
|
|
12
|
+
children,
|
|
13
|
+
isOpen,
|
|
14
|
+
onClick,
|
|
15
|
+
className,
|
|
16
|
+
disabled,
|
|
17
|
+
testId = "mono-accordion",
|
|
18
|
+
datasetProp = {},
|
|
19
|
+
}) => {
|
|
20
|
+
const [maxHeight, setMaxHeight] = useState();
|
|
21
|
+
const titleRef = useRef();
|
|
22
|
+
const containerRef = useRef();
|
|
23
|
+
|
|
24
|
+
const setHeight = (value) => {
|
|
25
|
+
if (value !== undefined) setMaxHeight((state) => `${value}px`);
|
|
26
|
+
else
|
|
27
|
+
setMaxHeight(
|
|
28
|
+
(state) =>
|
|
29
|
+
`${Array.from(containerRef.current?.childNodes)?.reduce?.((acc, el) => acc + el.offsetHeight, 0)}px`,
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleClick = (e) => {
|
|
34
|
+
if (
|
|
35
|
+
!Array.from(titleRef.current.childNodes).some((el) =>
|
|
36
|
+
el.contains(e.target),
|
|
37
|
+
)
|
|
38
|
+
) {
|
|
39
|
+
onClick(e);
|
|
40
|
+
e?.preventDefault();
|
|
41
|
+
e?.stopPropagation();
|
|
42
|
+
} else return e;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!isOpen) setHeight(0);
|
|
47
|
+
else setHeight();
|
|
48
|
+
}, [isOpen, children]);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
{...datasetProp}
|
|
53
|
+
data-testid={testId}
|
|
54
|
+
className={cn(RC, className, {
|
|
55
|
+
[`${RC}_is-open`]: isOpen,
|
|
56
|
+
[`${RC}_disabled`]: disabled,
|
|
57
|
+
})}
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
className={`${RC}__head`}
|
|
61
|
+
onClick={handleClick}
|
|
62
|
+
>
|
|
63
|
+
<div ref={titleRef} className={`${RC}__tile-container`}>
|
|
64
|
+
{titleJSX}
|
|
65
|
+
</div>
|
|
66
|
+
<span className={`${RC}__icon-container`}>{icon}</span>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div
|
|
70
|
+
ref={containerRef}
|
|
71
|
+
style={{ maxHeight }}
|
|
72
|
+
className={cn(`${RC}__container`)}
|
|
73
|
+
>
|
|
74
|
+
<div className={`${RC}__content-wrapper`}>{children}</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default MonoAccordion;
|