intelicoreact 1.4.11 → 1.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +9 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +10 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +24 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +10 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +14 -2
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +54 -5
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +21 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +144 -51
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +91 -25
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +15 -3
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +29 -15
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +15 -5
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +26 -6
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +35 -19
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +38 -9
- package/dist/Atomic/FormElements/Input/Input.js +60 -25
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +31 -4
- package/dist/Atomic/FormElements/InputColor/InputColor.js +14 -4
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +29 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +43 -8
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +21 -3
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -58
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +41 -6
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +46 -16
- package/dist/Atomic/FormElements/InputLink/InputLink.js +23 -6
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +4 -0
- package/dist/Atomic/FormElements/InputMask/InputMask.js +208 -77
- package/dist/Atomic/FormElements/InputMask/functions.js +28 -2
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +119 -43
- package/dist/Atomic/FormElements/InputMask2/functions.js +28 -2
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +137 -44
- package/dist/Atomic/FormElements/InputMask3/functions.js +28 -2
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +17 -3
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +24 -5
- package/dist/Atomic/FormElements/Label/Label.js +9 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +73 -35
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +15 -3
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +44 -23
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +17 -7
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +14 -3
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +10 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +14 -3
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +23 -3
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +34 -17
- package/dist/Atomic/FormElements/RangeList/RangeList.js +25 -6
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +11 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +85 -14
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +132 -43
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +10 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +10 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +13 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +10 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +17 -2
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +17 -3
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +11 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +29 -6
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +12 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +30 -8
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +189 -98
- package/dist/Atomic/FormElements/Text/Text.js +16 -10
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +9 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +17 -3
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +35 -6
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +13 -4
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +21 -7
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +35 -8
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +18 -5
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +10 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +11 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +12 -5
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +15 -3
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +20 -3
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +19 -3
- package/dist/Atomic/UI/Accordion/AccordionItem.js +23 -9
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +32 -7
- package/dist/Atomic/UI/AccordionText/AccordionText.js +15 -3
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +21 -4
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +15 -3
- package/dist/Atomic/UI/Alert/Alert.js +19 -3
- package/dist/Atomic/UI/Arrow/Arrow.js +16 -3
- package/dist/Atomic/UI/Box/Box.js +9 -3
- package/dist/Atomic/UI/Button/Button.js +11 -2
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +10 -1
- package/dist/Atomic/UI/Chart/Chart.js +29 -4
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +19 -11
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +12 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +34 -11
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +56 -82
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +19 -15
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -6
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +13 -3
- package/dist/Atomic/UI/DateTime/DateTime.js +14 -3
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +16 -4
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +11 -3
- package/dist/Atomic/UI/DoubleString/DoubleString.js +17 -5
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +10 -3
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +52 -17
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +29 -1
- package/dist/Atomic/UI/Hint/Hint.js +31 -5
- package/dist/Atomic/UI/Modal/Modal.js +28 -6
- package/dist/Atomic/UI/Modal/ModalHOC.js +9 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +8 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +49 -32
- package/dist/Atomic/UI/ModalBackup/Modal.js +174 -0
- package/dist/Atomic/UI/ModalBackup/Modal.scss +333 -0
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +51 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +24 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +41 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +21 -6
- package/dist/Atomic/UI/NavLine/NavLine.js +55 -26
- package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
- package/dist/Atomic/UI/PageTitle/PageTitle.js +10 -2
- package/dist/Atomic/UI/PieChart/PieChart.js +10 -1
- package/dist/Atomic/UI/Price/Price.js +8 -3
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +16 -1
- package/dist/Atomic/UI/Status/Status.js +8 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +29 -5
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +11 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +17 -5
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +14 -3
- package/dist/Atomic/UI/Table/Table.js +12 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -2
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +4 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +13 -1
- package/dist/Atomic/UI/Tag/Tag.js +19 -7
- package/dist/Atomic/UI/TagList/TagList.js +39 -21
- package/dist/Atomic/UI/UserBox/UserBox.js +13 -1
- package/dist/Classes/AbortableFetch.js +93 -36
- package/dist/Classes/AnimatedHandler.js +7 -3
- package/dist/Classes/RESTAPI/index.js +44 -39
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +93 -35
- package/dist/Classes/RESTAPI/partials/ApiBase.js +9 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +32 -24
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +41 -34
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +44 -21
- package/dist/Classes/RESTAPI/partials/Utils.js +19 -6
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
- package/dist/Classes/RESTAPI/partials/_utils.js +36 -13
- package/dist/Constants/index.constants.js +15 -8
- package/dist/Functions/Portal.js +16 -5
- package/dist/Functions/customEventListener.js +17 -4
- package/dist/Functions/fieldValueFormatters.js +83 -43
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +26 -23
- package/dist/Functions/locale/createTranslator.js +9 -4
- package/dist/Functions/operations.js +22 -12
- package/dist/Functions/presets/inputMaskPresets.js +11 -9
- package/dist/Functions/presets/inputPresets.js +11 -8
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
- package/dist/Functions/schemas.js +13 -6
- package/dist/Functions/useBodyScrollLock.js +6 -1
- package/dist/Functions/useClickOutside.js +4 -0
- package/dist/Functions/useDebounce.js +7 -2
- package/dist/Functions/useFieldFocus.js +18 -6
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +9 -0
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +23 -12
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +15 -6
- package/dist/Functions/useFormTools/functions/General.js +28 -18
- package/dist/Functions/useFormTools/functions/RenderFields.js +11 -2
- package/dist/Functions/useFormTools/functions/usePrevious.js +5 -1
- package/dist/Functions/useFormTools/index.js +144 -85
- package/dist/Functions/useInputHighlightError.js +12 -3
- package/dist/Functions/useIsMobile.js +13 -7
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +7 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +9 -1
- package/dist/Functions/useLocalStorage.js +9 -1
- package/dist/Functions/useLocationParams.js +5 -4
- package/dist/Functions/useMediaQuery.js +9 -3
- package/dist/Functions/useMetaInfo.js +10 -3
- package/dist/Functions/useMouseUpOutside.js +3 -0
- package/dist/Functions/useOnlineStatus.js +9 -1
- package/dist/Functions/usePasswordChecker.js +20 -4
- package/dist/Functions/usePrevious.js +5 -1
- package/dist/Functions/useResize.js +10 -2
- package/dist/Functions/useScrollTo.js +7 -2
- package/dist/Functions/useToggle.js +5 -1
- package/dist/Functions/utils.js +131 -56
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +9 -2
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +9 -2
- package/dist/Molecular/CustomIcons/components/AppStore.js +9 -2
- package/dist/Molecular/CustomIcons/components/Arrow.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +9 -2
- package/dist/Molecular/CustomIcons/components/Bell.js +9 -2
- package/dist/Molecular/CustomIcons/components/Button.js +9 -2
- package/dist/Molecular/CustomIcons/components/Campaigns.js +9 -2
- package/dist/Molecular/CustomIcons/components/Check.js +9 -2
- package/dist/Molecular/CustomIcons/components/Check2.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/Close.js +9 -2
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +9 -2
- package/dist/Molecular/CustomIcons/components/Delete.js +9 -2
- package/dist/Molecular/CustomIcons/components/Edit.js +9 -2
- package/dist/Molecular/CustomIcons/components/Email.js +9 -2
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +9 -2
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +9 -2
- package/dist/Molecular/CustomIcons/components/Flows.js +9 -2
- package/dist/Molecular/CustomIcons/components/Gift.js +9 -2
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +9 -2
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +9 -2
- package/dist/Molecular/CustomIcons/components/Home.js +9 -2
- package/dist/Molecular/CustomIcons/components/Home2.js +9 -2
- package/dist/Molecular/CustomIcons/components/Key.js +9 -2
- package/dist/Molecular/CustomIcons/components/Landers.js +9 -2
- package/dist/Molecular/CustomIcons/components/Lock.js +9 -2
- package/dist/Molecular/CustomIcons/components/Mail.js +9 -2
- package/dist/Molecular/CustomIcons/components/Mastercard.js +9 -2
- package/dist/Molecular/CustomIcons/components/Minus.js +9 -2
- package/dist/Molecular/CustomIcons/components/Offers.js +9 -2
- package/dist/Molecular/CustomIcons/components/Pause.js +9 -2
- package/dist/Molecular/CustomIcons/components/PayPal.js +9 -2
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +9 -2
- package/dist/Molecular/CustomIcons/components/Phone.js +9 -2
- package/dist/Molecular/CustomIcons/components/Play.js +9 -2
- package/dist/Molecular/CustomIcons/components/Plus.js +9 -2
- package/dist/Molecular/CustomIcons/components/Profile.js +9 -2
- package/dist/Molecular/CustomIcons/components/QRCode.js +9 -2
- package/dist/Molecular/CustomIcons/components/Rectangle.js +9 -2
- package/dist/Molecular/CustomIcons/components/Revert.js +9 -2
- package/dist/Molecular/CustomIcons/components/Star.js +9 -2
- package/dist/Molecular/CustomIcons/components/Star2.js +9 -2
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +9 -2
- package/dist/Molecular/CustomIcons/components/Trash.js +9 -2
- package/dist/Molecular/CustomIcons/components/TrashRed.js +9 -2
- package/dist/Molecular/CustomIcons/components/Triggers.js +9 -2
- package/dist/Molecular/CustomIcons/components/User.js +9 -2
- package/dist/Molecular/CustomIcons/components/Visa.js +9 -2
- package/dist/Molecular/CustomIcons/components/X.js +9 -2
- package/dist/Molecular/CustomIcons/index.js +122 -0
- package/dist/Molecular/FormElement/FormElement.js +12 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +31 -30
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +12 -9
- package/dist/Molecular/InputAddress/InputAddress.js +114 -65
- package/dist/Molecular/InputPassword/InputPassword.js +19 -5
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -4,10 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInputHighlightError = exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _index = require("../Constants/index.constants");
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
11
16
|
const useInputHighlightError = _ref => {
|
|
12
17
|
let {
|
|
13
18
|
value,
|
|
@@ -18,6 +23,7 @@ const useInputHighlightError = _ref => {
|
|
|
18
23
|
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
19
24
|
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
20
25
|
const [prevValue, setPreviousValue] = (0, _react.useState)(value);
|
|
26
|
+
|
|
21
27
|
function hasHighlightError(e) {
|
|
22
28
|
const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
|
|
23
29
|
const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : "");
|
|
@@ -39,6 +45,7 @@ const useInputHighlightError = _ref => {
|
|
|
39
45
|
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
40
46
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
41
47
|
}
|
|
48
|
+
|
|
42
49
|
(0, _react.useEffect)(() => {
|
|
43
50
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
44
51
|
setIsAttemptToChange(null);
|
|
@@ -55,5 +62,7 @@ const useInputHighlightError = _ref => {
|
|
|
55
62
|
hasHighlightError
|
|
56
63
|
};
|
|
57
64
|
};
|
|
65
|
+
|
|
58
66
|
exports.useInputHighlightError = useInputHighlightError;
|
|
59
|
-
var _default =
|
|
67
|
+
var _default = useInputHighlightError;
|
|
68
|
+
exports.default = _default;
|
|
@@ -4,23 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
|
|
9
|
-
function
|
|
9
|
+
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
|
|
10
14
|
const useIsMobile = function () {
|
|
11
15
|
let {
|
|
12
16
|
isWithoutWidthCheck = false
|
|
13
17
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
|
|
14
19
|
const getIsMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
15
|
-
const [isMobile, setIsMobile] = (0, _react.useState)(getIsMobile());
|
|
16
20
|
|
|
17
|
-
// Detect Mobile
|
|
21
|
+
const [isMobile, setIsMobile] = (0, _react.useState)(getIsMobile()); // Detect Mobile
|
|
22
|
+
|
|
18
23
|
(0, _react.useEffect)(() => {
|
|
19
24
|
if (getIsMobile()) setIsMobile(true);
|
|
20
25
|
}, [navigator.userAgent]);
|
|
21
|
-
return {
|
|
22
|
-
...navigator,
|
|
26
|
+
return { ...navigator,
|
|
23
27
|
isMobile: isMobile && (isWithoutWidthCheck || window.screen.width <= 768)
|
|
24
28
|
};
|
|
25
29
|
};
|
|
26
|
-
|
|
30
|
+
|
|
31
|
+
var _default = useIsMobile;
|
|
32
|
+
exports.default = _default;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = require("react");
|
|
11
|
+
|
|
9
12
|
var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
* @function useHandleKeyPress
|
|
12
16
|
* @param {Object} props - объект с действиями и состоянием обновления.
|
|
@@ -42,4 +46,6 @@ const useHandleKeyPress = _ref => {
|
|
|
42
46
|
if (isPressEscape && typeof escCallback === "function") escCallback();
|
|
43
47
|
}, [enterCallback, escCallback, isPressEnter, isPressEscape]);
|
|
44
48
|
};
|
|
45
|
-
|
|
49
|
+
|
|
50
|
+
var _default = useHandleKeyPress;
|
|
51
|
+
exports.default = _default;
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useKeyPress = function (targetKey) {
|
|
9
11
|
let clamping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10
12
|
const [keyPressed, setKeyPressed] = (0, _react.useState)(false);
|
|
@@ -13,6 +15,7 @@ const useKeyPress = function (targetKey) {
|
|
|
13
15
|
key,
|
|
14
16
|
repeat
|
|
15
17
|
} = _ref;
|
|
18
|
+
|
|
16
19
|
if (key === targetKey) {
|
|
17
20
|
if (!clamping && repeat) return;
|
|
18
21
|
setKeyPressed(true);
|
|
@@ -23,6 +26,7 @@ const useKeyPress = function (targetKey) {
|
|
|
23
26
|
key,
|
|
24
27
|
repeat
|
|
25
28
|
} = _ref2;
|
|
29
|
+
|
|
26
30
|
if (key === targetKey) {
|
|
27
31
|
if (!clamping && repeat) return;
|
|
28
32
|
setKeyPressed(false);
|
|
@@ -30,7 +34,9 @@ const useKeyPress = function (targetKey) {
|
|
|
30
34
|
}, [clamping, targetKey]);
|
|
31
35
|
(0, _react.useEffect)(() => {
|
|
32
36
|
const handleDown = event => downHandler(event);
|
|
37
|
+
|
|
33
38
|
const handleUp = event => upHandler(event);
|
|
39
|
+
|
|
34
40
|
window.addEventListener("keydown", handleDown);
|
|
35
41
|
window.addEventListener("keyup", handleUp);
|
|
36
42
|
return () => {
|
|
@@ -40,4 +46,6 @@ const useKeyPress = function (targetKey) {
|
|
|
40
46
|
}, [downHandler, upHandler]);
|
|
41
47
|
return keyPressed;
|
|
42
48
|
};
|
|
43
|
-
|
|
49
|
+
|
|
50
|
+
var _default = useKeyPress;
|
|
51
|
+
exports.default = _default;
|
|
@@ -4,12 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useLocalStorage = (key, initialValue) => {
|
|
9
11
|
const [storedValue, setStoredValue] = (0, _react.useState)(() => {
|
|
10
12
|
if (typeof window === "undefined") {
|
|
11
13
|
return initialValue;
|
|
12
14
|
}
|
|
15
|
+
|
|
13
16
|
try {
|
|
14
17
|
const item = window.localStorage.getItem(key);
|
|
15
18
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -19,10 +22,12 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
19
22
|
return initialValue;
|
|
20
23
|
}
|
|
21
24
|
});
|
|
25
|
+
|
|
22
26
|
const setValue = value => {
|
|
23
27
|
try {
|
|
24
28
|
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
25
29
|
setStoredValue(valueToStore);
|
|
30
|
+
|
|
26
31
|
if (typeof window !== "undefined") {
|
|
27
32
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
28
33
|
}
|
|
@@ -31,6 +36,9 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
31
36
|
console.log(error);
|
|
32
37
|
}
|
|
33
38
|
};
|
|
39
|
+
|
|
34
40
|
return [storedValue, setValue];
|
|
35
41
|
};
|
|
36
|
-
|
|
42
|
+
|
|
43
|
+
var _default = useLocalStorage;
|
|
44
|
+
exports.default = _default;
|
|
@@ -4,21 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useLocationParams;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
function useLocationParams() {
|
|
9
11
|
const [params, setParams] = (0, _react.useState)({});
|
|
10
12
|
(0, _react.useEffect)(() => {
|
|
11
13
|
setParams(state => {
|
|
12
14
|
var _window$location$sear;
|
|
15
|
+
|
|
13
16
|
const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace("?", "").split("&");
|
|
14
|
-
return {
|
|
15
|
-
...state,
|
|
17
|
+
return { ...state,
|
|
16
18
|
...arr.reduce((obj, item) => {
|
|
17
19
|
const keyVal = item.split("=");
|
|
18
20
|
const key = keyVal[0];
|
|
19
21
|
const value = keyVal[1];
|
|
20
|
-
return {
|
|
21
|
-
...obj,
|
|
22
|
+
return { ...obj,
|
|
22
23
|
[key]: value
|
|
23
24
|
};
|
|
24
25
|
}, {})
|
|
@@ -4,14 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
var _utils = require("./utils");
|
|
11
|
+
|
|
9
12
|
function useMediaQuery(query) {
|
|
10
13
|
const getMatches = (0, _react.useMemo)(() => {
|
|
11
14
|
return inputQuery => {
|
|
12
15
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
13
16
|
return window.matchMedia(inputQuery).matches;
|
|
14
17
|
}
|
|
18
|
+
|
|
15
19
|
return false;
|
|
16
20
|
};
|
|
17
21
|
}, []);
|
|
@@ -20,12 +24,14 @@ function useMediaQuery(query) {
|
|
|
20
24
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
21
25
|
const matchMedia = window.matchMedia(query);
|
|
22
26
|
const debouncedChangeHandler = (0, _utils.debounce)(() => setMatches(getMatches(query)), 300);
|
|
23
|
-
matchMedia === null || matchMedia === void 0
|
|
27
|
+
matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia.addEventListener("change", debouncedChangeHandler);
|
|
24
28
|
return () => {
|
|
25
|
-
matchMedia === null || matchMedia === void 0
|
|
29
|
+
matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia.removeEventListener("change", debouncedChangeHandler);
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
}, [query, getMatches]);
|
|
29
33
|
return matches;
|
|
30
34
|
}
|
|
31
|
-
|
|
35
|
+
|
|
36
|
+
var _default = useMediaQuery;
|
|
37
|
+
exports.default = _default;
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useMetaInfo = exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useMetaInfo = () => {
|
|
9
11
|
const [browser, setBrowser] = (0, _react.useState)("Other");
|
|
10
12
|
const [device, setDevice] = (0, _react.useState)("desktop");
|
|
@@ -13,19 +15,22 @@ const useMetaInfo = () => {
|
|
|
13
15
|
const [iOSVersion, setiOSVersion] = (0, _react.useState)(null);
|
|
14
16
|
(0, _react.useEffect)(() => {
|
|
15
17
|
const userAgent = navigator.userAgent;
|
|
18
|
+
|
|
16
19
|
if (userAgent.indexOf("Chrome") !== -1) {
|
|
17
|
-
setBrowser("Chrome");
|
|
20
|
+
setBrowser("Chrome"); // Извлечение версии Chrome
|
|
18
21
|
|
|
19
|
-
// Извлечение версии Chrome
|
|
20
22
|
const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
21
23
|
setChromeVersion(version);
|
|
22
24
|
} else if (userAgent.indexOf("Safari") !== -1) setBrowser("Safari");
|
|
25
|
+
|
|
23
26
|
const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || "0").replace("_", ".");
|
|
24
27
|
const iOSVersion = parseFloat(iOSV);
|
|
25
28
|
setIsiOS(!isNaN(iOSVersion));
|
|
29
|
+
|
|
26
30
|
if (!isNaN(iOSVersion)) {
|
|
27
31
|
setiOSVersion(iOSV); // Записываем версию iOS
|
|
28
32
|
}
|
|
33
|
+
|
|
29
34
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice("mobile");
|
|
30
35
|
}, []);
|
|
31
36
|
return {
|
|
@@ -36,5 +41,7 @@ const useMetaInfo = () => {
|
|
|
36
41
|
iOSVersion
|
|
37
42
|
}; // Возврат версий Chrome и iOS
|
|
38
43
|
};
|
|
44
|
+
|
|
39
45
|
exports.useMetaInfo = useMetaInfo;
|
|
40
|
-
var _default =
|
|
46
|
+
var _default = useMetaInfo;
|
|
47
|
+
exports.default = _default;
|
|
@@ -4,13 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useMouseUpOutside;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
function useMouseUpOutside(ref, setOut, open) {
|
|
9
11
|
function handleMouseUpOutside(event) {
|
|
10
12
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
11
13
|
setOut(open);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
16
|
+
|
|
14
17
|
(0, _react.useEffect)(() => {
|
|
15
18
|
document.addEventListener("mouseup", handleMouseUpOutside);
|
|
16
19
|
return () => {
|
|
@@ -4,14 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useOnlineStatus = () => {
|
|
9
11
|
function getOnlineStatus() {
|
|
10
12
|
return typeof navigator !== "undefined" && typeof navigator.onLine === "boolean" ? navigator.onLine : true;
|
|
11
13
|
}
|
|
14
|
+
|
|
12
15
|
const [onlineStatus, setOnlineStatus] = (0, _react.useState)(getOnlineStatus());
|
|
16
|
+
|
|
13
17
|
const goOnline = () => setOnlineStatus(true);
|
|
18
|
+
|
|
14
19
|
const goOffline = () => setOnlineStatus(false);
|
|
20
|
+
|
|
15
21
|
(0, _react.useEffect)(() => {
|
|
16
22
|
window.addEventListener("online", goOnline);
|
|
17
23
|
window.addEventListener("offline", goOffline);
|
|
@@ -22,4 +28,6 @@ const useOnlineStatus = () => {
|
|
|
22
28
|
}, []);
|
|
23
29
|
return onlineStatus;
|
|
24
30
|
};
|
|
25
|
-
|
|
31
|
+
|
|
32
|
+
var _default = useOnlineStatus;
|
|
33
|
+
exports.default = _default;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = usePasswordChecker;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
|
|
11
|
-
function
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
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
|
+
|
|
12
18
|
function usePasswordChecker() {
|
|
13
19
|
const [checkRules, setCheckRules] = (0, _react.useState)([]);
|
|
20
|
+
|
|
14
21
|
const addCheckRule = data => setCheckRules(state => [...state, data]);
|
|
22
|
+
|
|
15
23
|
const handleCheckRule = function (type) {
|
|
16
24
|
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
25
|
let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
@@ -19,11 +27,13 @@ function usePasswordChecker() {
|
|
|
19
27
|
min,
|
|
20
28
|
max
|
|
21
29
|
} = props;
|
|
30
|
+
|
|
22
31
|
switch (type) {
|
|
23
32
|
case "len":
|
|
24
33
|
if (min && value.length < min) return false;
|
|
25
34
|
if (max && value.length > max) return false;
|
|
26
35
|
return true;
|
|
36
|
+
|
|
27
37
|
case "lowerCaseContains":
|
|
28
38
|
{
|
|
29
39
|
const toUpperCase = value.slice().toUpperCase().split("");
|
|
@@ -33,6 +43,7 @@ function usePasswordChecker() {
|
|
|
33
43
|
return isMatch;
|
|
34
44
|
}, false);
|
|
35
45
|
}
|
|
46
|
+
|
|
36
47
|
case "upperCaseContains":
|
|
37
48
|
{
|
|
38
49
|
const toLowerCase = value.slice().toLowerCase().split("");
|
|
@@ -42,6 +53,7 @@ function usePasswordChecker() {
|
|
|
42
53
|
return isMatch;
|
|
43
54
|
}, false);
|
|
44
55
|
}
|
|
56
|
+
|
|
45
57
|
case "numberContains":
|
|
46
58
|
{
|
|
47
59
|
const original = value.slice().split("");
|
|
@@ -50,6 +62,7 @@ function usePasswordChecker() {
|
|
|
50
62
|
return isMatch;
|
|
51
63
|
}, false);
|
|
52
64
|
}
|
|
65
|
+
|
|
53
66
|
case "specialContains":
|
|
54
67
|
{
|
|
55
68
|
const original = value.slice().split("");
|
|
@@ -58,10 +71,12 @@ function usePasswordChecker() {
|
|
|
58
71
|
return isMatch;
|
|
59
72
|
}, false);
|
|
60
73
|
}
|
|
74
|
+
|
|
61
75
|
default:
|
|
62
76
|
return false;
|
|
63
77
|
}
|
|
64
78
|
};
|
|
79
|
+
|
|
65
80
|
const testCheckRules = value => {
|
|
66
81
|
let result = true;
|
|
67
82
|
setCheckRules(state => {
|
|
@@ -69,14 +84,14 @@ function usePasswordChecker() {
|
|
|
69
84
|
return rules.map(rule => {
|
|
70
85
|
const isMatch = handleCheckRule(rule.type, rule.props, value);
|
|
71
86
|
if (!isMatch) result = false;
|
|
72
|
-
return {
|
|
73
|
-
...rule,
|
|
87
|
+
return { ...rule,
|
|
74
88
|
isMatch
|
|
75
89
|
};
|
|
76
90
|
});
|
|
77
91
|
});
|
|
78
92
|
return result;
|
|
79
93
|
};
|
|
94
|
+
|
|
80
95
|
const renderPasswordChecker = () => {
|
|
81
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
82
97
|
className: "password-checker"
|
|
@@ -106,6 +121,7 @@ function usePasswordChecker() {
|
|
|
106
121
|
}, " ", text, " "), " ");
|
|
107
122
|
}), " "), " ");
|
|
108
123
|
};
|
|
124
|
+
|
|
109
125
|
return {
|
|
110
126
|
addCheckRule,
|
|
111
127
|
testCheckRules,
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
function usePrevious(value) {
|
|
9
11
|
const ref = (0, _react.useRef)();
|
|
10
12
|
(0, _react.useEffect)(() => {
|
|
@@ -12,4 +14,6 @@ function usePrevious(value) {
|
|
|
12
14
|
}, [value]);
|
|
13
15
|
return ref.current;
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
var _default = usePrevious;
|
|
19
|
+
exports.default = _default;
|
|
@@ -4,18 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useResize = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useResize = function () {
|
|
9
11
|
let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
10
12
|
const [elemPosition, setElemPosition] = (0, _react.useState)("");
|
|
13
|
+
|
|
11
14
|
const onResize = elemRightPosition => {
|
|
12
15
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
13
16
|
return setElemPosition("left");
|
|
14
17
|
} else setElemPosition("");
|
|
15
18
|
};
|
|
19
|
+
|
|
16
20
|
(0, _react.useEffect)(() => {
|
|
17
21
|
var _element$current;
|
|
18
|
-
|
|
22
|
+
|
|
23
|
+
const elemRightPosition = (element === null || element === void 0 ? void 0 : (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.getBoundingClientRect().right) + 20;
|
|
19
24
|
window.addEventListener("resize", () => onResize(elemRightPosition));
|
|
20
25
|
return () => {
|
|
21
26
|
window.removeEventListener("resize", () => setElemPosition(""));
|
|
@@ -23,7 +28,9 @@ const useResize = function () {
|
|
|
23
28
|
}, []);
|
|
24
29
|
(0, _react.useLayoutEffect)(() => {
|
|
25
30
|
var _element$current2;
|
|
26
|
-
|
|
31
|
+
|
|
32
|
+
const elemRightPosition = (element === null || element === void 0 ? void 0 : (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.getBoundingClientRect().right) + 20;
|
|
33
|
+
|
|
27
34
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
28
35
|
return setElemPosition("left");
|
|
29
36
|
}
|
|
@@ -32,4 +39,5 @@ const useResize = function () {
|
|
|
32
39
|
elemPosition
|
|
33
40
|
};
|
|
34
41
|
};
|
|
42
|
+
|
|
35
43
|
exports.useResize = useResize;
|
|
@@ -4,14 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useScrollTo = reference => {
|
|
9
11
|
const ref = (0, _react.useRef)(reference);
|
|
10
12
|
const [shouldScrollTo, setShouldScrollTo] = (0, _react.useState)(false);
|
|
11
13
|
(0, _react.useEffect)(() => {
|
|
12
14
|
if (ref !== null && ref !== void 0 && ref.current && shouldScrollTo) {
|
|
13
15
|
var _ref$current, _ref$current$scrollIn;
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$scrollIn = _ref$current.scrollIntoView) === null || _ref$current$scrollIn === void 0 ? void 0 : _ref$current$scrollIn.call(_ref$current, {
|
|
15
18
|
behavior: "smooth"
|
|
16
19
|
});
|
|
17
20
|
setShouldScrollTo(false);
|
|
@@ -19,4 +22,6 @@ const useScrollTo = reference => {
|
|
|
19
22
|
}, [shouldScrollTo]);
|
|
20
23
|
return [ref, setShouldScrollTo];
|
|
21
24
|
};
|
|
22
|
-
|
|
25
|
+
|
|
26
|
+
var _default = useScrollTo;
|
|
27
|
+
exports.default = _default;
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = require("react");
|
|
9
|
+
|
|
8
10
|
const useToggle = initialState => {
|
|
9
11
|
const [isToggled, setToggle] = (0, _react.useState)(Boolean(initialState));
|
|
10
12
|
const toggle = (0, _react.useCallback)(() => setToggle(isOn => !isOn), []);
|
|
@@ -17,4 +19,6 @@ const useToggle = initialState => {
|
|
|
17
19
|
toggleOff
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
|
-
|
|
22
|
+
|
|
23
|
+
var _default = useToggle;
|
|
24
|
+
exports.default = _default;
|