intelicoreact 1.3.19 → 1.3.21
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 +23 -15
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +23 -15
- package/dist/Atomic/FormElements/Calendar/Calendar.js +124 -69
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +36 -27
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +39 -23
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +246 -110
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +85 -44
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +414 -246
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +9 -5
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +165 -93
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +64 -39
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +132 -51
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +73 -34
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +75 -54
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +110 -67
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +83 -33
- package/dist/Atomic/FormElements/Input/Input.js +253 -161
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +102 -48
- package/dist/Atomic/FormElements/InputColor/InputColor.js +40 -27
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +58 -28
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +176 -108
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +57 -32
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +302 -184
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +157 -85
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +16 -11
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +193 -76
- package/dist/Atomic/FormElements/InputLink/InputLink.js +58 -34
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +12 -8
- package/dist/Atomic/FormElements/InputMask/InputMask.js +964 -554
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +43 -17
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +404 -268
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +43 -17
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +459 -299
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +43 -17
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +113 -53
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +118 -64
- package/dist/Atomic/FormElements/Label/Label.js +23 -13
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +349 -217
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +47 -25
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +207 -133
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +61 -29
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +42 -20
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +33 -22
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +43 -20
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +101 -54
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +102 -59
- package/dist/Atomic/FormElements/RangeList/RangeList.js +150 -89
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +29 -23
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +300 -135
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +571 -381
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +24 -14
- package/dist/Atomic/FormElements/Switcher/Switcher.js +29 -24
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +47 -25
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +32 -20
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +55 -32
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +42 -22
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +33 -23
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +120 -51
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +46 -23
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +417 -253
- package/dist/Atomic/FormElements/Text/Text.js +53 -47
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +31 -21
- package/dist/Atomic/FormElements/Textarea/Textarea.js +27 -16
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +128 -68
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +36 -25
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +70 -33
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +124 -58
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +80 -48
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +42 -32
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +60 -40
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +3 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +69 -50
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +48 -21
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +79 -36
- package/dist/Atomic/Layout/Spinner/Spinner.js +14 -8
- package/dist/Atomic/UI/Accordion/Accordion.js +48 -18
- package/dist/Atomic/UI/Accordion/AccordionItem.js +60 -35
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +106 -49
- package/dist/Atomic/UI/AccordionText/AccordionText.js +37 -13
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +94 -48
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +50 -22
- package/dist/Atomic/UI/Alert/Alert.js +44 -20
- package/dist/Atomic/UI/Arrow/Arrow.js +35 -15
- package/dist/Atomic/UI/Box/Box.js +21 -14
- package/dist/Atomic/UI/Button/Button.js +35 -26
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +31 -22
- package/dist/Atomic/UI/Chart/Chart.js +86 -45
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +24 -14
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +22 -13
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +113 -68
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +140 -158
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +42 -26
- package/dist/Atomic/UI/Chart/partial/utils.js +48 -20
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +42 -22
- package/dist/Atomic/UI/DateTime/DateTime.js +38 -23
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +36 -12
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +21 -5
- package/dist/Atomic/UI/DoubleString/DoubleString.js +50 -27
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +63 -15
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +157 -62
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +110 -47
- package/dist/Atomic/UI/Hint/Hint.js +94 -49
- package/dist/Atomic/UI/Modal/Modal.js +179 -149
- package/dist/Atomic/UI/Modal/ModalHOC.js +21 -12
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +12 -7
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +21 -17
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +167 -94
- package/dist/Atomic/UI/ModalBackup/Modal.js +90 -65
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +62 -32
- package/dist/Atomic/UI/NavLine/NavLine.js +211 -120
- package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
- package/dist/Atomic/UI/PageTitle/PageTitle.js +17 -13
- package/dist/Atomic/UI/PieChart/PieChart.js +21 -11
- package/dist/Atomic/UI/Price/Price.js +13 -10
- package/dist/Atomic/UI/PriceRange/PriceRange.js +11 -7
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +56 -27
- package/dist/Atomic/UI/Status/Status.js +30 -19
- package/dist/Atomic/UI/Table/Partials/TdCell.js +71 -28
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +16 -7
- package/dist/Atomic/UI/Table/Partials/TdRow.js +65 -29
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +40 -16
- package/dist/Atomic/UI/Table/Table.js +47 -27
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +48 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +19 -9
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +8 -5
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +47 -25
- package/dist/Atomic/UI/Tag/Tag.js +48 -20
- package/dist/Atomic/UI/TagList/TagList.js +150 -80
- package/dist/Atomic/UI/UserBox/UserBox.js +26 -14
- package/dist/Classes/AbortableFetch.js +422 -283
- package/dist/Classes/AnimatedHandler.js +56 -44
- package/dist/Classes/RESTAPI/index.js +433 -154
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +428 -290
- package/dist/Classes/RESTAPI/partials/ApiBase.js +67 -24
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +275 -57
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +377 -146
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +403 -155
- package/dist/Classes/RESTAPI/partials/Utils.js +135 -81
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
- package/dist/Classes/RESTAPI/partials/_utils.js +395 -101
- package/dist/Constants/index.constants.js +15 -8
- package/dist/Functions/Portal.js +33 -14
- package/dist/Functions/customEventListener.js +20 -5
- package/dist/Functions/fieldValueFormatters.js +211 -148
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +137 -75
- package/dist/Functions/locale/createTranslator.js +27 -13
- package/dist/Functions/operations.js +49 -35
- package/dist/Functions/presets/inputMaskPresets.js +27 -25
- package/dist/Functions/presets/inputPresets.js +22 -19
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
- package/dist/Functions/schemas.js +15 -6
- package/dist/Functions/useClickOutside.js +7 -3
- package/dist/Functions/useDebounce.js +25 -11
- package/dist/Functions/useFieldFocus.js +67 -42
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +54 -35
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +95 -74
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +91 -55
- package/dist/Functions/useFormTools/functions/General.js +99 -80
- package/dist/Functions/useFormTools/functions/RenderFields.js +72 -45
- package/dist/Functions/useFormTools/functions/usePrevious.js +7 -3
- package/dist/Functions/useFormTools/index.js +598 -382
- package/dist/Functions/useInputHighlightError.js +52 -27
- package/dist/Functions/useIsMobile.js +36 -13
- package/dist/Functions/useLocalStorage.js +22 -7
- package/dist/Functions/useLocationParams.js +27 -16
- package/dist/Functions/useMetaInfo.js +50 -19
- package/dist/Functions/useMouseUpOutside.js +5 -2
- package/dist/Functions/useOnlineStatus.js +26 -7
- package/dist/Functions/usePasswordChecker.js +77 -42
- package/dist/Functions/usePrevious.js +7 -3
- package/dist/Functions/useResize.js +32 -12
- package/dist/Functions/useScrollTo.js +20 -6
- package/dist/Functions/useToggle.js +30 -10
- package/dist/Functions/utils.js +366 -186
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +32 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +32 -21
- package/dist/Molecular/CustomIcons/components/AppStore.js +36 -25
- package/dist/Molecular/CustomIcons/components/Arrow.js +42 -31
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +24 -13
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +27 -16
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +27 -16
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +24 -13
- package/dist/Molecular/CustomIcons/components/Bell.js +22 -11
- package/dist/Molecular/CustomIcons/components/Button.js +22 -11
- package/dist/Molecular/CustomIcons/components/Campaigns.js +23 -12
- package/dist/Molecular/CustomIcons/components/Check.js +23 -12
- package/dist/Molecular/CustomIcons/components/Check2.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +37 -26
- package/dist/Molecular/CustomIcons/components/Close.js +24 -13
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +49 -38
- package/dist/Molecular/CustomIcons/components/Delete.js +23 -12
- package/dist/Molecular/CustomIcons/components/Edit.js +22 -11
- package/dist/Molecular/CustomIcons/components/Email.js +40 -29
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +30 -19
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +38 -27
- package/dist/Molecular/CustomIcons/components/Flows.js +22 -11
- package/dist/Molecular/CustomIcons/components/Gift.js +27 -16
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +36 -25
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +36 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +25 -14
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +26 -15
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +25 -14
- package/dist/Molecular/CustomIcons/components/Home.js +25 -14
- package/dist/Molecular/CustomIcons/components/Home2.js +28 -17
- package/dist/Molecular/CustomIcons/components/Key.js +30 -19
- package/dist/Molecular/CustomIcons/components/Landers.js +26 -15
- package/dist/Molecular/CustomIcons/components/Lock.js +22 -11
- package/dist/Molecular/CustomIcons/components/Mail.js +30 -19
- package/dist/Molecular/CustomIcons/components/Mastercard.js +72 -61
- package/dist/Molecular/CustomIcons/components/Minus.js +35 -24
- package/dist/Molecular/CustomIcons/components/Offers.js +23 -12
- package/dist/Molecular/CustomIcons/components/Pause.js +35 -24
- package/dist/Molecular/CustomIcons/components/PayPal.js +49 -38
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +36 -25
- package/dist/Molecular/CustomIcons/components/Phone.js +37 -26
- package/dist/Molecular/CustomIcons/components/Play.js +35 -24
- package/dist/Molecular/CustomIcons/components/Plus.js +35 -24
- package/dist/Molecular/CustomIcons/components/Profile.js +27 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +37 -26
- package/dist/Molecular/CustomIcons/components/Rectangle.js +22 -11
- package/dist/Molecular/CustomIcons/components/Revert.js +25 -14
- package/dist/Molecular/CustomIcons/components/Star.js +21 -10
- package/dist/Molecular/CustomIcons/components/Star2.js +23 -12
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +25 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +22 -11
- package/dist/Molecular/CustomIcons/components/TrashRed.js +22 -11
- package/dist/Molecular/CustomIcons/components/Triggers.js +22 -11
- package/dist/Molecular/CustomIcons/components/User.js +27 -16
- package/dist/Molecular/CustomIcons/components/Visa.js +38 -27
- package/dist/Molecular/CustomIcons/components/X.js +22 -11
- package/dist/Molecular/CustomIcons/index.js +183 -61
- package/dist/Molecular/FormElement/FormElement.js +27 -18
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +108 -86
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +34 -29
- package/dist/Molecular/InputAddress/InputAddress.js +312 -176
- package/dist/Molecular/InputPassword/InputPassword.js +39 -15
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,29 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports.useInputHighlightError = exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
7
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
8
16
|
var _index = require("../Constants/index.constants");
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
var useInputHighlightError = function useInputHighlightError(_ref) {
|
|
23
|
+
var value = _ref.value,
|
|
24
|
+
blinkTime = _ref.blinkTime,
|
|
25
|
+
isUseErrorsBlink = _ref.isUseErrorsBlink;
|
|
26
|
+
var DEFAULT_BLINK_TIME = 100;
|
|
27
|
+
|
|
28
|
+
var _useState = (0, _react.useState)(false),
|
|
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
|
+
|
|
21
43
|
function hasHighlightError(e) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
44
|
+
var changedValue = "".concat(value !== null && value !== void 0 ? value : '');
|
|
45
|
+
var previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : '');
|
|
46
|
+
var short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
47
|
+
var long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
48
|
+
var infoAboutDifferencesSameness = short.split('').reduce(function (acc, symbol, idx) {
|
|
27
49
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
28
50
|
acc.countOn = false;
|
|
29
51
|
acc.differences.push([idx, symbol]);
|
|
@@ -34,26 +56,29 @@ const useInputHighlightError = _ref => {
|
|
|
34
56
|
countOn: true,
|
|
35
57
|
differences: []
|
|
36
58
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
var samePart = infoAboutDifferencesSameness.same.join('');
|
|
60
|
+
var differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
61
|
+
var currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, '');
|
|
40
62
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
41
63
|
}
|
|
42
|
-
|
|
64
|
+
|
|
65
|
+
(0, _react.useEffect)(function () {
|
|
43
66
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
44
67
|
setIsAttemptToChange(null);
|
|
45
68
|
setIsToHighlightError(true);
|
|
46
|
-
setTimeout(()
|
|
69
|
+
setTimeout(function () {
|
|
47
70
|
setIsToHighlightError(false);
|
|
48
71
|
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
49
72
|
}
|
|
50
73
|
}, [isAttemptToChange]);
|
|
51
74
|
return {
|
|
52
|
-
isToHighlightError,
|
|
53
|
-
setPreviousValue,
|
|
54
|
-
setIsToHighlightError,
|
|
55
|
-
hasHighlightError
|
|
75
|
+
isToHighlightError: isToHighlightError,
|
|
76
|
+
setPreviousValue: setPreviousValue,
|
|
77
|
+
setIsToHighlightError: setIsToHighlightError,
|
|
78
|
+
hasHighlightError: hasHighlightError
|
|
56
79
|
};
|
|
57
80
|
};
|
|
81
|
+
|
|
58
82
|
exports.useInputHighlightError = useInputHighlightError;
|
|
59
|
-
var _default =
|
|
83
|
+
var _default = useInputHighlightError;
|
|
84
|
+
exports.default = _default;
|
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
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
|
+
|
|
7
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
var useIsMobile = function useIsMobile() {
|
|
27
|
+
var getIsMobile = function getIsMobile() {
|
|
28
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var _useState = (0, _react.useState)(getIsMobile()),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
isMobile = _useState2[0],
|
|
34
|
+
setIsMobile = _useState2[1]; // Detect Mobile
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
(0, _react.useEffect)(function () {
|
|
16
38
|
if (getIsMobile()) setIsMobile(true);
|
|
17
39
|
}, [navigator.userAgent]);
|
|
18
|
-
return {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
40
|
+
return _objectSpread(_objectSpread({}, navigator), {}, {
|
|
41
|
+
isMobile: isMobile
|
|
42
|
+
});
|
|
22
43
|
};
|
|
23
|
-
|
|
44
|
+
|
|
45
|
+
var _default = useIsMobile;
|
|
46
|
+
exports.default = _default;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
7
12
|
var _react = require("react");
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* The useLocalStorage function is a hook that allows you to store and retrieve data from localStorage.
|
|
10
16
|
*
|
|
@@ -16,24 +22,30 @@ var _react = require("react");
|
|
|
16
22
|
*
|
|
17
23
|
* @docauthor Trelent
|
|
18
24
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
var useLocalStorage = function useLocalStorage(key, initialValue) {
|
|
26
|
+
var _useState = (0, _react.useState)(function () {
|
|
21
27
|
if (typeof window === 'undefined') {
|
|
22
28
|
return initialValue;
|
|
23
29
|
}
|
|
30
|
+
|
|
24
31
|
try {
|
|
25
|
-
|
|
32
|
+
var item = window.localStorage.getItem(key);
|
|
26
33
|
return item ? JSON.parse(item) : initialValue;
|
|
27
34
|
} catch (error) {
|
|
28
35
|
// eslint-disable-next-line no-console
|
|
29
36
|
console.log(error);
|
|
30
37
|
return initialValue;
|
|
31
38
|
}
|
|
32
|
-
})
|
|
33
|
-
|
|
39
|
+
}),
|
|
40
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
41
|
+
storedValue = _useState2[0],
|
|
42
|
+
setStoredValue = _useState2[1];
|
|
43
|
+
|
|
44
|
+
var setValue = function setValue(value) {
|
|
34
45
|
try {
|
|
35
|
-
|
|
46
|
+
var valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
36
47
|
setStoredValue(valueToStore);
|
|
48
|
+
|
|
37
49
|
if (typeof window !== 'undefined') {
|
|
38
50
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
39
51
|
}
|
|
@@ -42,6 +54,9 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
42
54
|
console.log(error);
|
|
43
55
|
}
|
|
44
56
|
};
|
|
57
|
+
|
|
45
58
|
return [storedValue, setValue];
|
|
46
59
|
};
|
|
47
|
-
|
|
60
|
+
|
|
61
|
+
var _default = useLocalStorage;
|
|
62
|
+
exports.default = _default;
|
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = useLocationParams;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
7
14
|
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
|
+
|
|
8
20
|
function useLocationParams() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
var _useState = (0, _react.useState)({}),
|
|
22
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
+
params = _useState2[0],
|
|
24
|
+
setParams = _useState2[1];
|
|
25
|
+
|
|
26
|
+
(0, _react.useEffect)(function () {
|
|
27
|
+
setParams(function (state) {
|
|
12
28
|
var _window$location$sear;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...obj,
|
|
22
|
-
[key]: value
|
|
23
|
-
};
|
|
24
|
-
}, {})
|
|
25
|
-
};
|
|
29
|
+
|
|
30
|
+
var arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace('?', '').split('&');
|
|
31
|
+
return _objectSpread(_objectSpread({}, state), arr.reduce(function (obj, item) {
|
|
32
|
+
var keyVal = item.split('=');
|
|
33
|
+
var key = keyVal[0];
|
|
34
|
+
var value = keyVal[1];
|
|
35
|
+
return _objectSpread(_objectSpread({}, obj), {}, (0, _defineProperty2.default)({}, key, value));
|
|
36
|
+
}, {}));
|
|
26
37
|
});
|
|
27
38
|
}, [window.location.search]);
|
|
28
39
|
return params;
|
|
@@ -1,40 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.useMetaInfo = exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
7
12
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
var useMetaInfo = function useMetaInfo() {
|
|
15
|
+
var _useState = (0, _react.useState)('Other'),
|
|
16
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
17
|
+
browser = _useState2[0],
|
|
18
|
+
setBrowser = _useState2[1];
|
|
19
|
+
|
|
20
|
+
var _useState3 = (0, _react.useState)('desktop'),
|
|
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
|
+
|
|
16
43
|
if (userAgent.indexOf('Chrome') !== -1) {
|
|
17
|
-
setBrowser('Chrome');
|
|
44
|
+
setBrowser('Chrome'); // Извлечение версии Chrome
|
|
18
45
|
|
|
19
|
-
|
|
20
|
-
const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
46
|
+
var version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
21
47
|
setChromeVersion(version);
|
|
22
48
|
} else if (userAgent.indexOf('Safari') !== -1) setBrowser('Safari');
|
|
23
|
-
|
|
24
|
-
|
|
49
|
+
|
|
50
|
+
var iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || '0').replace('_', '.');
|
|
51
|
+
var iOSVersion = parseFloat(iOSV);
|
|
25
52
|
setIsiOS(!isNaN(iOSVersion));
|
|
53
|
+
|
|
26
54
|
if (!isNaN(iOSVersion)) {
|
|
27
55
|
setiOSVersion(iOSV); // Записываем версию iOS
|
|
28
56
|
}
|
|
57
|
+
|
|
29
58
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice('mobile');
|
|
30
59
|
}, []);
|
|
31
60
|
return {
|
|
32
|
-
browser,
|
|
33
|
-
device,
|
|
34
|
-
isiOS,
|
|
35
|
-
chromeVersion,
|
|
36
|
-
iOSVersion
|
|
61
|
+
browser: browser,
|
|
62
|
+
device: device,
|
|
63
|
+
isiOS: isiOS,
|
|
64
|
+
chromeVersion: chromeVersion,
|
|
65
|
+
iOSVersion: iOSVersion
|
|
37
66
|
}; // Возврат версий Chrome и iOS
|
|
38
67
|
};
|
|
68
|
+
|
|
39
69
|
exports.useMetaInfo = useMetaInfo;
|
|
40
|
-
var _default =
|
|
70
|
+
var _default = useMetaInfo;
|
|
71
|
+
exports.default = _default;
|
|
@@ -4,16 +4,19 @@ 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
|
}
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
(0, _react.useEffect)(function () {
|
|
15
18
|
document.addEventListener('mouseup', handleMouseUpOutside);
|
|
16
|
-
return ()
|
|
19
|
+
return function () {
|
|
17
20
|
document.removeEventListener('mouseup', handleMouseUpOutside);
|
|
18
21
|
};
|
|
19
22
|
}, [ref]);
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
7
12
|
var _react = require("react");
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* The useOnlineStatus function returns a boolean value that indicates whether the user is online or not.
|
|
10
16
|
* It also updates the state of this boolean value whenever the user goes online or offline.
|
|
@@ -14,21 +20,34 @@ var _react = require("react");
|
|
|
14
20
|
* @return The online status of the user
|
|
15
21
|
|
|
16
22
|
*/
|
|
17
|
-
|
|
23
|
+
var useOnlineStatus = function useOnlineStatus() {
|
|
18
24
|
function getOnlineStatus() {
|
|
19
25
|
return typeof navigator !== 'undefined' && typeof navigator.onLine === 'boolean' ? navigator.onLine : true;
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
|
|
28
|
+
var _useState = (0, _react.useState)(getOnlineStatus()),
|
|
29
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
+
onlineStatus = _useState2[0],
|
|
31
|
+
setOnlineStatus = _useState2[1];
|
|
32
|
+
|
|
33
|
+
var goOnline = function goOnline() {
|
|
34
|
+
return setOnlineStatus(true);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var goOffline = function goOffline() {
|
|
38
|
+
return setOnlineStatus(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
(0, _react.useEffect)(function () {
|
|
25
42
|
window.addEventListener('online', goOnline);
|
|
26
43
|
window.addEventListener('offline', goOffline);
|
|
27
|
-
return ()
|
|
44
|
+
return function () {
|
|
28
45
|
window.removeEventListener('online', goOnline);
|
|
29
46
|
window.removeEventListener('offline', goOffline);
|
|
30
47
|
};
|
|
31
48
|
}, []);
|
|
32
49
|
return onlineStatus;
|
|
33
50
|
};
|
|
34
|
-
|
|
51
|
+
|
|
52
|
+
var _default = useOnlineStatus;
|
|
53
|
+
exports.default = _default;
|