intelicoreact 1.4.83 → 1.4.84
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 +14 -22
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +14 -22
- package/dist/Atomic/FormElements/Calendar/Calendar.js +67 -122
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +266 -430
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +161 -283
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +79 -138
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +55 -77
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +75 -126
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
- package/dist/Atomic/FormElements/Input/Input.js +160 -256
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
- package/dist/Atomic/FormElements/InputColor/InputColor.js +26 -41
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +38 -76
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +109 -177
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +77 -194
- package/dist/Atomic/FormElements/InputLink/InputLink.js +32 -58
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
- package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +299 -459
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +51 -113
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
- package/dist/Atomic/FormElements/Label/Label.js +14 -24
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
- package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +148 -326
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +389 -588
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
- package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +23 -41
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +47 -98
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +485 -713
- package/dist/Atomic/FormElements/Text/Text.js +47 -53
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
- package/dist/Atomic/FormElements/Textarea/Textarea.js +31 -47
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -123
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +21 -48
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +35 -77
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
- package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
- package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +48 -104
- package/dist/Atomic/UI/AccordionText/AccordionText.js +21 -54
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +47 -92
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
- package/dist/Atomic/UI/Alert/Alert.js +22 -51
- package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
- package/dist/Atomic/UI/Box/Box.js +14 -21
- package/dist/Atomic/UI/Button/Button.js +26 -35
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
- package/dist/Atomic/UI/Chart/Chart.js +45 -86
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
- package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +13 -37
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
- package/dist/Atomic/UI/DoubleString/DoubleString.js +34 -63
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
- package/dist/Atomic/UI/Hint/Hint.js +67 -122
- package/dist/Atomic/UI/Hint/partial/_utils.js +52 -0
- package/dist/Atomic/UI/Hint/partials/_utils.js +14 -29
- package/dist/Atomic/UI/Modal/Modal.js +147 -184
- package/dist/Atomic/UI/Modal/ModalHOC.js +15 -26
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +99 -161
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
- package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
- package/dist/Atomic/UI/Price/Price.js +10 -13
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +28 -58
- package/dist/Atomic/UI/Status/Status.js +19 -30
- package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
- package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
- package/dist/Atomic/UI/Table/Table.js +27 -47
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -6
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +22 -39
- package/dist/Atomic/UI/Tag/Tag.js +59 -94
- package/dist/Atomic/UI/TagList/TagList.js +81 -144
- package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
- package/dist/Atomic/UI/WizardStepper/constructor.js +7 -15
- package/dist/Atomic/UI/WizardStepper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +20 -26
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +26 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +23 -42
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +40 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
- package/dist/Classes/AbortableFetch.js +283 -422
- package/dist/Classes/AnimatedHandler.js +44 -56
- package/dist/Classes/RESTAPI/index.js +158 -441
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
- package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +83 -353
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +161 -403
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +159 -400
- package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +103 -398
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +14 -33
- package/dist/Functions/customEventListener.js +9 -24
- package/dist/Functions/fieldValueFormatters.js +147 -209
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
- package/dist/Functions/locale/createTranslator.js +13 -28
- package/dist/Functions/operations.js +35 -49
- package/dist/Functions/presets/inputMaskPresets.js +25 -27
- package/dist/Functions/presets/inputPresets.js +19 -22
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -15
- package/dist/Functions/useBodyScrollLock.js +4 -9
- package/dist/Functions/useClickOutside.js +3 -7
- package/dist/Functions/useDebounce.js +11 -25
- package/dist/Functions/useFieldFocus.js +42 -67
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
- package/dist/Functions/useFormTools/functions/General.js +80 -99
- package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
- package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
- package/dist/Functions/useFormTools/index.js +380 -592
- package/dist/Functions/useInputHighlightError.js +27 -52
- package/dist/Functions/useIsMobile.js +15 -39
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +10 -15
- package/dist/Functions/useKeyPress/useKeyPress.js +18 -35
- package/dist/Functions/useLocalStorage.js +7 -22
- package/dist/Functions/useLocationParams.js +16 -27
- package/dist/Functions/useMediaQuery.js +10 -27
- package/dist/Functions/useMetaInfo.js +19 -50
- package/dist/Functions/useMouseUpOutside.js +2 -5
- package/dist/Functions/useOnlineStatus.js +7 -26
- package/dist/Functions/usePasswordChecker.js +42 -77
- package/dist/Functions/usePrevious.js +3 -7
- package/dist/Functions/useResize.js +12 -32
- package/dist/Functions/useScrollTo.js +6 -20
- package/dist/Functions/useToggle.js +10 -30
- package/dist/Functions/utils.js +188 -386
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
- package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
- package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
- package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
- package/dist/Molecular/CustomIcons/components/Button.js +11 -22
- package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
- package/dist/Molecular/CustomIcons/components/Close.js +13 -24
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
- package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
- package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
- package/dist/Molecular/CustomIcons/components/Email.js +29 -40
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
- package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
- package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
- package/dist/Molecular/CustomIcons/components/Key.js +19 -30
- package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
- package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
- package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
- package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
- package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
- package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
- package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
- package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
- package/dist/Molecular/CustomIcons/components/Play.js +24 -35
- package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
- package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
- package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
- package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
- package/dist/Molecular/CustomIcons/components/Star.js +10 -21
- package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
- package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
- package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
- package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
- package/dist/Molecular/CustomIcons/components/User.js +16 -27
- package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
- package/dist/Molecular/CustomIcons/components/X.js +11 -22
- package/dist/Molecular/CustomIcons/index.js +61 -183
- package/dist/Molecular/FormElement/FormElement.js +19 -28
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +91 -112
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -37
- package/dist/Molecular/InputAddress/InputAddress.js +176 -312
- package/dist/Molecular/InputPassword/InputPassword.js +15 -39
- package/dist/index.js +1 -3
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -119
- 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
- package/dist/Functions/presets/inputMaskPreset.js +0 -176
|
@@ -1,51 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports.useInputHighlightError = exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
8
|
var _index = require("../Constants/index.constants");
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
-
isToHighlightError = _useState2[0],
|
|
31
|
-
setIsToHighlightError = _useState2[1];
|
|
32
|
-
|
|
33
|
-
var _useState3 = (0, _react.useState)(false),
|
|
34
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
35
|
-
isAttemptToChange = _useState4[0],
|
|
36
|
-
setIsAttemptToChange = _useState4[1];
|
|
37
|
-
|
|
38
|
-
var _useState5 = (0, _react.useState)(value),
|
|
39
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
40
|
-
prevValue = _useState6[0],
|
|
41
|
-
setPreviousValue = _useState6[1];
|
|
42
|
-
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
const useInputHighlightError = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
value,
|
|
14
|
+
blinkTime,
|
|
15
|
+
isUseErrorsBlink
|
|
16
|
+
} = _ref;
|
|
17
|
+
const DEFAULT_BLINK_TIME = 100;
|
|
18
|
+
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
19
|
+
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
20
|
+
const [prevValue, setPreviousValue] = (0, _react.useState)(value);
|
|
43
21
|
function hasHighlightError(e) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
|
|
23
|
+
const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : "");
|
|
24
|
+
const short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
25
|
+
const long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
26
|
+
const infoAboutDifferencesSameness = short.split("").reduce((acc, symbol, idx) => {
|
|
49
27
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
50
28
|
acc.countOn = false;
|
|
51
29
|
acc.differences.push([idx, symbol]);
|
|
@@ -56,29 +34,26 @@ var useInputHighlightError = function useInputHighlightError(_ref) {
|
|
|
56
34
|
countOn: true,
|
|
57
35
|
differences: []
|
|
58
36
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
37
|
+
const samePart = infoAboutDifferencesSameness.same.join("");
|
|
38
|
+
const differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
39
|
+
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
62
40
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
63
41
|
}
|
|
64
|
-
|
|
65
|
-
(0, _react.useEffect)(function () {
|
|
42
|
+
(0, _react.useEffect)(() => {
|
|
66
43
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
67
44
|
setIsAttemptToChange(null);
|
|
68
45
|
setIsToHighlightError(true);
|
|
69
|
-
setTimeout(
|
|
46
|
+
setTimeout(() => {
|
|
70
47
|
setIsToHighlightError(false);
|
|
71
48
|
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
72
49
|
}
|
|
73
50
|
}, [isAttemptToChange]);
|
|
74
51
|
return {
|
|
75
|
-
isToHighlightError
|
|
76
|
-
setPreviousValue
|
|
77
|
-
setIsToHighlightError
|
|
78
|
-
hasHighlightError
|
|
52
|
+
isToHighlightError,
|
|
53
|
+
setPreviousValue,
|
|
54
|
+
setIsToHighlightError,
|
|
55
|
+
hasHighlightError
|
|
79
56
|
};
|
|
80
57
|
};
|
|
81
|
-
|
|
82
58
|
exports.useInputHighlightError = useInputHighlightError;
|
|
83
|
-
var _default = useInputHighlightError;
|
|
84
|
-
exports.default = _default;
|
|
59
|
+
var _default = exports.default = useInputHighlightError;
|
|
@@ -1,50 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_ref$isWithoutWidthCh = _ref.isWithoutWidthCheck,
|
|
29
|
-
isWithoutWidthCheck = _ref$isWithoutWidthCh === void 0 ? false : _ref$isWithoutWidthCh;
|
|
30
|
-
|
|
31
|
-
var getIsMobile = function getIsMobile() {
|
|
32
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var _useState = (0, _react.useState)(getIsMobile()),
|
|
36
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
-
isMobile = _useState2[0],
|
|
38
|
-
setIsMobile = _useState2[1]; // Detect Mobile
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(0, _react.useEffect)(function () {
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
const useIsMobile = function () {
|
|
11
|
+
let {
|
|
12
|
+
isWithoutWidthCheck = false
|
|
13
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
|
+
const getIsMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
15
|
+
const [isMobile, setIsMobile] = (0, _react.useState)(getIsMobile());
|
|
16
|
+
|
|
17
|
+
// Detect Mobile
|
|
18
|
+
(0, _react.useEffect)(() => {
|
|
42
19
|
if (getIsMobile()) setIsMobile(true);
|
|
43
20
|
}, [navigator.userAgent]);
|
|
44
|
-
return
|
|
21
|
+
return {
|
|
22
|
+
...navigator,
|
|
45
23
|
isMobile: isMobile && (isWithoutWidthCheck || window.screen.width <= 768)
|
|
46
|
-
}
|
|
24
|
+
};
|
|
47
25
|
};
|
|
48
|
-
|
|
49
|
-
var _default = useIsMobile;
|
|
50
|
-
exports.default = _default;
|
|
26
|
+
var _default = exports.default = useIsMobile;
|
|
@@ -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 = require("react");
|
|
11
|
-
|
|
12
9
|
var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* @function useHandleKeyPress
|
|
16
12
|
* @param {Object} props - объект с действиями и состоянием обновления.
|
|
@@ -33,18 +29,17 @@ var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
|
|
|
33
29
|
* }
|
|
34
30
|
*
|
|
35
31
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(0,
|
|
32
|
+
const useHandleKeyPress = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
escCallback,
|
|
35
|
+
enterCallback,
|
|
36
|
+
withClamping = true
|
|
37
|
+
} = _ref;
|
|
38
|
+
const isPressEnter = (0, _useKeyPress.default)("Enter", withClamping);
|
|
39
|
+
const isPressEscape = (0, _useKeyPress.default)("Escape", withClamping);
|
|
40
|
+
(0, _react.useEffect)(() => {
|
|
44
41
|
if (isPressEnter && typeof enterCallback === "function") enterCallback();
|
|
45
42
|
if (isPressEscape && typeof escCallback === "function") escCallback();
|
|
46
43
|
}, [enterCallback, escCallback, isPressEnter, isPressEscape]);
|
|
47
44
|
};
|
|
48
|
-
|
|
49
|
-
var _default = useHandleKeyPress;
|
|
50
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = useHandleKeyPress;
|
|
@@ -1,60 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var downHandler = (0, _react.useCallback)(function (_ref) {
|
|
23
|
-
var key = _ref.key,
|
|
24
|
-
repeat = _ref.repeat;
|
|
25
|
-
|
|
8
|
+
const useKeyPress = function (targetKey) {
|
|
9
|
+
let clamping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10
|
+
const [keyPressed, setKeyPressed] = (0, _react.useState)(false);
|
|
11
|
+
const downHandler = (0, _react.useCallback)(_ref => {
|
|
12
|
+
let {
|
|
13
|
+
key,
|
|
14
|
+
repeat
|
|
15
|
+
} = _ref;
|
|
26
16
|
if (key === targetKey) {
|
|
27
17
|
if (!clamping && repeat) return;
|
|
28
18
|
setKeyPressed(true);
|
|
29
19
|
}
|
|
30
20
|
}, [clamping, targetKey]);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
const upHandler = (0, _react.useCallback)(_ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
key,
|
|
24
|
+
repeat
|
|
25
|
+
} = _ref2;
|
|
35
26
|
if (key === targetKey) {
|
|
36
27
|
if (!clamping && repeat) return;
|
|
37
28
|
setKeyPressed(false);
|
|
38
29
|
}
|
|
39
30
|
}, [clamping, targetKey]);
|
|
40
|
-
(0, _react.useEffect)(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var handleUp = function handleUp(event) {
|
|
46
|
-
return upHandler(event);
|
|
47
|
-
};
|
|
48
|
-
|
|
31
|
+
(0, _react.useEffect)(() => {
|
|
32
|
+
const handleDown = event => downHandler(event);
|
|
33
|
+
const handleUp = event => upHandler(event);
|
|
49
34
|
window.addEventListener("keydown", handleDown);
|
|
50
35
|
window.addEventListener("keyup", handleUp);
|
|
51
|
-
return
|
|
36
|
+
return () => {
|
|
52
37
|
window.removeEventListener("keydown", handleDown);
|
|
53
38
|
window.removeEventListener("keyup", handleUp);
|
|
54
39
|
};
|
|
55
40
|
}, [downHandler, upHandler]);
|
|
56
41
|
return keyPressed;
|
|
57
42
|
};
|
|
58
|
-
|
|
59
|
-
var _default = useKeyPress;
|
|
60
|
-
exports.default = _default;
|
|
43
|
+
var _default = exports.default = useKeyPress;
|
|
@@ -1,40 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _useState = (0, _react.useState)(function () {
|
|
8
|
+
const useLocalStorage = (key, initialValue) => {
|
|
9
|
+
const [storedValue, setStoredValue] = (0, _react.useState)(() => {
|
|
16
10
|
if (typeof window === "undefined") {
|
|
17
11
|
return initialValue;
|
|
18
12
|
}
|
|
19
|
-
|
|
20
13
|
try {
|
|
21
|
-
|
|
14
|
+
const item = window.localStorage.getItem(key);
|
|
22
15
|
return item ? JSON.parse(item) : initialValue;
|
|
23
16
|
} catch (error) {
|
|
24
17
|
// eslint-disable-next-line no-console
|
|
25
18
|
console.log(error);
|
|
26
19
|
return initialValue;
|
|
27
20
|
}
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
storedValue = _useState2[0],
|
|
31
|
-
setStoredValue = _useState2[1];
|
|
32
|
-
|
|
33
|
-
var setValue = function setValue(value) {
|
|
21
|
+
});
|
|
22
|
+
const setValue = value => {
|
|
34
23
|
try {
|
|
35
|
-
|
|
24
|
+
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
36
25
|
setStoredValue(valueToStore);
|
|
37
|
-
|
|
38
26
|
if (typeof window !== "undefined") {
|
|
39
27
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
40
28
|
}
|
|
@@ -43,9 +31,6 @@ var useLocalStorage = function useLocalStorage(key, initialValue) {
|
|
|
43
31
|
console.log(error);
|
|
44
32
|
}
|
|
45
33
|
};
|
|
46
|
-
|
|
47
34
|
return [storedValue, setValue];
|
|
48
35
|
};
|
|
49
|
-
|
|
50
|
-
var _default = useLocalStorage;
|
|
51
|
-
exports.default = _default;
|
|
36
|
+
var _default = exports.default = useLocalStorage;
|
|
@@ -1,39 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = useLocationParams;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
7
|
var _react = require("react");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
8
|
function useLocationParams() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setParams = _useState2[1];
|
|
25
|
-
|
|
26
|
-
(0, _react.useEffect)(function () {
|
|
27
|
-
setParams(function (state) {
|
|
9
|
+
const [params, setParams] = (0, _react.useState)({});
|
|
10
|
+
(0, _react.useEffect)(() => {
|
|
11
|
+
setParams(state => {
|
|
28
12
|
var _window$location$sear;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
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,
|
|
16
|
+
...arr.reduce((obj, item) => {
|
|
17
|
+
const keyVal = item.split("=");
|
|
18
|
+
const key = keyVal[0];
|
|
19
|
+
const value = keyVal[1];
|
|
20
|
+
return {
|
|
21
|
+
...obj,
|
|
22
|
+
[key]: value
|
|
23
|
+
};
|
|
24
|
+
}, {})
|
|
25
|
+
};
|
|
37
26
|
});
|
|
38
27
|
}, [window.location.search]);
|
|
39
28
|
return params;
|
|
@@ -1,48 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
8
|
var _utils = require("./utils");
|
|
15
|
-
|
|
16
9
|
function useMediaQuery(query) {
|
|
17
|
-
|
|
18
|
-
return
|
|
10
|
+
const getMatches = (0, _react.useMemo)(() => {
|
|
11
|
+
return inputQuery => {
|
|
19
12
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
20
13
|
return window.matchMedia(inputQuery).matches;
|
|
21
14
|
}
|
|
22
|
-
|
|
23
15
|
return false;
|
|
24
16
|
};
|
|
25
17
|
}, []);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
29
|
-
matches = _useState2[0],
|
|
30
|
-
setMatches = _useState2[1];
|
|
31
|
-
|
|
32
|
-
(0, _react.useEffect)(function () {
|
|
18
|
+
const [matches, setMatches] = (0, _react.useState)(getMatches(query));
|
|
19
|
+
(0, _react.useEffect)(() => {
|
|
33
20
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return function () {
|
|
40
|
-
matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia.removeEventListener("change", debouncedChangeHandler);
|
|
21
|
+
const matchMedia = window.matchMedia(query);
|
|
22
|
+
const debouncedChangeHandler = (0, _utils.debounce)(() => setMatches(getMatches(query)), 300);
|
|
23
|
+
matchMedia === null || matchMedia === void 0 || matchMedia.addEventListener("change", debouncedChangeHandler);
|
|
24
|
+
return () => {
|
|
25
|
+
matchMedia === null || matchMedia === void 0 || matchMedia.removeEventListener("change", debouncedChangeHandler);
|
|
41
26
|
};
|
|
42
27
|
}
|
|
43
28
|
}, [query, getMatches]);
|
|
44
29
|
return matches;
|
|
45
30
|
}
|
|
46
|
-
|
|
47
|
-
var _default = useMediaQuery;
|
|
48
|
-
exports.default = _default;
|
|
31
|
+
var _default = exports.default = useMediaQuery;
|
|
@@ -1,71 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.useMetaInfo = exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
22
|
-
device = _useState4[0],
|
|
23
|
-
setDevice = _useState4[1];
|
|
24
|
-
|
|
25
|
-
var _useState5 = (0, _react.useState)(false),
|
|
26
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
27
|
-
isiOS = _useState6[0],
|
|
28
|
-
setIsiOS = _useState6[1];
|
|
29
|
-
|
|
30
|
-
var _useState7 = (0, _react.useState)(null),
|
|
31
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
32
|
-
chromeVersion = _useState8[0],
|
|
33
|
-
setChromeVersion = _useState8[1];
|
|
34
|
-
|
|
35
|
-
var _useState9 = (0, _react.useState)(null),
|
|
36
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
37
|
-
iOSVersion = _useState10[0],
|
|
38
|
-
setiOSVersion = _useState10[1];
|
|
39
|
-
|
|
40
|
-
(0, _react.useEffect)(function () {
|
|
41
|
-
var userAgent = navigator.userAgent;
|
|
42
|
-
|
|
8
|
+
const useMetaInfo = () => {
|
|
9
|
+
const [browser, setBrowser] = (0, _react.useState)("Other");
|
|
10
|
+
const [device, setDevice] = (0, _react.useState)("desktop");
|
|
11
|
+
const [isiOS, setIsiOS] = (0, _react.useState)(false);
|
|
12
|
+
const [chromeVersion, setChromeVersion] = (0, _react.useState)(null);
|
|
13
|
+
const [iOSVersion, setiOSVersion] = (0, _react.useState)(null);
|
|
14
|
+
(0, _react.useEffect)(() => {
|
|
15
|
+
const userAgent = navigator.userAgent;
|
|
43
16
|
if (userAgent.indexOf("Chrome") !== -1) {
|
|
44
|
-
setBrowser("Chrome");
|
|
17
|
+
setBrowser("Chrome");
|
|
45
18
|
|
|
46
|
-
|
|
19
|
+
// Извлечение версии Chrome
|
|
20
|
+
const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
47
21
|
setChromeVersion(version);
|
|
48
22
|
} else if (userAgent.indexOf("Safari") !== -1) setBrowser("Safari");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var iOSVersion = parseFloat(iOSV);
|
|
23
|
+
const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || "0").replace("_", ".");
|
|
24
|
+
const iOSVersion = parseFloat(iOSV);
|
|
52
25
|
setIsiOS(!isNaN(iOSVersion));
|
|
53
|
-
|
|
54
26
|
if (!isNaN(iOSVersion)) {
|
|
55
27
|
setiOSVersion(iOSV); // Записываем версию iOS
|
|
56
28
|
}
|
|
57
|
-
|
|
58
29
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice("mobile");
|
|
59
30
|
}, []);
|
|
60
31
|
return {
|
|
61
|
-
browser
|
|
62
|
-
device
|
|
63
|
-
isiOS
|
|
64
|
-
chromeVersion
|
|
65
|
-
iOSVersion
|
|
32
|
+
browser,
|
|
33
|
+
device,
|
|
34
|
+
isiOS,
|
|
35
|
+
chromeVersion,
|
|
36
|
+
iOSVersion
|
|
66
37
|
}; // Возврат версий Chrome и iOS
|
|
67
38
|
};
|
|
68
|
-
|
|
69
39
|
exports.useMetaInfo = useMetaInfo;
|
|
70
|
-
var _default = useMetaInfo;
|
|
71
|
-
exports.default = _default;
|
|
40
|
+
var _default = exports.default = useMetaInfo;
|
|
@@ -4,19 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useMouseUpOutside;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function useMouseUpOutside(ref, setOut, open) {
|
|
11
9
|
function handleMouseUpOutside(event) {
|
|
12
10
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
13
11
|
setOut(open);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
(0, _react.useEffect)(function () {
|
|
14
|
+
(0, _react.useEffect)(() => {
|
|
18
15
|
document.addEventListener("mouseup", handleMouseUpOutside);
|
|
19
|
-
return
|
|
16
|
+
return () => {
|
|
20
17
|
document.removeEventListener("mouseup", handleMouseUpOutside);
|
|
21
18
|
};
|
|
22
19
|
}, [ref]);
|
|
@@ -1,44 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
var useOnlineStatus = function useOnlineStatus() {
|
|
8
|
+
const useOnlineStatus = () => {
|
|
15
9
|
function getOnlineStatus() {
|
|
16
10
|
return typeof navigator !== "undefined" && typeof navigator.onLine === "boolean" ? navigator.onLine : true;
|
|
17
11
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setOnlineStatus = _useState2[1];
|
|
23
|
-
|
|
24
|
-
var goOnline = function goOnline() {
|
|
25
|
-
return setOnlineStatus(true);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var goOffline = function goOffline() {
|
|
29
|
-
return setOnlineStatus(false);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
(0, _react.useEffect)(function () {
|
|
12
|
+
const [onlineStatus, setOnlineStatus] = (0, _react.useState)(getOnlineStatus());
|
|
13
|
+
const goOnline = () => setOnlineStatus(true);
|
|
14
|
+
const goOffline = () => setOnlineStatus(false);
|
|
15
|
+
(0, _react.useEffect)(() => {
|
|
33
16
|
window.addEventListener("online", goOnline);
|
|
34
17
|
window.addEventListener("offline", goOffline);
|
|
35
|
-
return
|
|
18
|
+
return () => {
|
|
36
19
|
window.removeEventListener("online", goOnline);
|
|
37
20
|
window.removeEventListener("offline", goOffline);
|
|
38
21
|
};
|
|
39
22
|
}, []);
|
|
40
23
|
return onlineStatus;
|
|
41
24
|
};
|
|
42
|
-
|
|
43
|
-
var _default = useOnlineStatus;
|
|
44
|
-
exports.default = _default;
|
|
25
|
+
var _default = exports.default = useOnlineStatus;
|