intelicoreact 1.4.81 → 1.4.83
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 +13 -13
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +12 -13
- package/dist/Atomic/FormElements/Calendar/Calendar.js +103 -68
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +26 -26
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +27 -23
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +201 -114
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +69 -46
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +301 -230
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +2 -4
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +201 -145
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +54 -41
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +112 -45
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +63 -34
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +153 -81
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +59 -57
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +98 -66
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +48 -27
- package/dist/Atomic/FormElements/Input/Input.js +209 -148
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +77 -50
- package/dist/Atomic/FormElements/InputColor/InputColor.js +28 -23
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +53 -38
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +139 -106
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +38 -31
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +230 -135
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +122 -85
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -10
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +159 -72
- package/dist/Atomic/FormElements/InputLink/InputLink.js +39 -30
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -8
- package/dist/Atomic/FormElements/InputMask/InputMask.js +800 -521
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +15 -15
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +294 -234
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +15 -15
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +332 -265
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +15 -15
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +101 -53
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +99 -64
- package/dist/Atomic/FormElements/Label/Label.js +15 -13
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +284 -190
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +34 -24
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +170 -117
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +50 -28
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +29 -18
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +24 -22
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +31 -19
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +83 -56
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +75 -49
- package/dist/Atomic/FormElements/RangeList/RangeList.js +129 -87
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +18 -22
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +250 -143
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +477 -367
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +15 -14
- package/dist/Atomic/FormElements/Switcher/Switcher.js +20 -24
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +30 -24
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +23 -20
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +40 -32
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +31 -25
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +22 -22
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +98 -52
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +34 -22
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +81 -47
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +525 -415
- package/dist/Atomic/FormElements/Text/Text.js +39 -39
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +23 -21
- package/dist/Atomic/FormElements/Textarea/Textarea.js +33 -28
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +98 -67
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +24 -22
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +57 -34
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +94 -56
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +102 -74
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +69 -50
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +33 -30
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +50 -38
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +59 -47
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -1
- package/dist/Atomic/Layout/Header/Header.js +37 -22
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +59 -34
- package/dist/Atomic/Layout/Spinner/Spinner.js +6 -7
- package/dist/Atomic/UI/Accordion/Accordion.js +31 -17
- package/dist/Atomic/UI/Accordion/AccordionItem.js +41 -30
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +81 -50
- package/dist/Atomic/UI/AccordionText/AccordionText.js +39 -20
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +74 -46
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +37 -21
- package/dist/Atomic/UI/Alert/Alert.js +36 -23
- package/dist/Atomic/UI/Arrow/Arrow.js +21 -14
- package/dist/Atomic/UI/Box/Box.js +12 -11
- package/dist/Atomic/UI/Button/Button.js +26 -26
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +21 -21
- package/dist/Atomic/UI/Chart/Chart.js +60 -44
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +13 -11
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +10 -12
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +82 -60
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +124 -116
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +30 -18
- package/dist/Atomic/UI/Chart/partial/utils.js +30 -16
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +31 -21
- package/dist/Atomic/UI/DateTime/DateTime.js +29 -25
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +23 -11
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +12 -4
- package/dist/Atomic/UI/DoubleString/DoubleString.js +53 -36
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +55 -14
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +114 -54
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +88 -53
- package/dist/Atomic/UI/Hint/Hint.js +87 -58
- package/dist/Atomic/UI/Hint/partials/_utils.js +10 -10
- package/dist/Atomic/UI/Modal/Modal.js +159 -144
- package/dist/Atomic/UI/Modal/ModalHOC.js +17 -14
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +5 -6
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +13 -16
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +118 -73
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +48 -33
- package/dist/Atomic/UI/NavLine/NavLine.js +166 -104
- package/dist/Atomic/UI/PageTitle/PageTitle.js +8 -12
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -10
- package/dist/Atomic/UI/Price/Price.js +5 -7
- package/dist/Atomic/UI/PriceRange/PriceRange.js +4 -6
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +42 -27
- package/dist/Atomic/UI/Status/Status.js +22 -18
- package/dist/Atomic/UI/Table/Partials/TdCell.js +47 -28
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +5 -6
- package/dist/Atomic/UI/Table/Partials/TdRow.js +53 -29
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +28 -15
- package/dist/Atomic/UI/Table/Table.js +36 -27
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +32 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +10 -8
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +2 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +26 -21
- package/dist/Atomic/UI/Tag/Tag.js +72 -52
- package/dist/Atomic/UI/TagList/TagList.js +102 -65
- package/dist/Atomic/UI/UserBox/UserBox.js +13 -13
- package/dist/Atomic/UI/WizardStepper/constructor.js +6 -6
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +16 -20
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +25 -27
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +27 -22
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +41 -39
- package/dist/Classes/AbortableFetch.js +393 -311
- package/dist/Classes/AnimatedHandler.js +53 -45
- package/dist/Classes/RESTAPI/index.js +431 -152
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +400 -320
- package/dist/Classes/RESTAPI/partials/ApiBase.js +59 -24
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +338 -76
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +378 -143
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +375 -159
- package/dist/Classes/RESTAPI/partials/Utils.js +128 -87
- package/dist/Classes/RESTAPI/partials/_utils.js +388 -116
- package/dist/Constants/index.constants.js +7 -7
- package/dist/Functions/Portal.js +19 -11
- package/dist/Functions/customEventListener.js +7 -5
- package/dist/Functions/fieldValueFormatters.js +131 -109
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +128 -69
- package/dist/Functions/locale/createTranslator.js +21 -11
- package/dist/Functions/operations.js +27 -23
- package/dist/Functions/presets/inputMaskPreset.js +176 -0
- package/dist/Functions/presets/inputMaskPresets.js +17 -17
- package/dist/Functions/presets/inputPresets.js +15 -15
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +3 -3
- package/dist/Functions/schemas.js +7 -5
- package/dist/Functions/useBodyScrollLock.js +3 -3
- package/dist/Functions/useClickOutside.js +3 -3
- package/dist/Functions/useDebounce.js +20 -11
- package/dist/Functions/useFieldFocus.js +51 -38
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +46 -36
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +78 -68
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +81 -54
- package/dist/Functions/useFormTools/functions/General.js +80 -71
- package/dist/Functions/useFormTools/functions/RenderFields.js +63 -45
- package/dist/Functions/useFormTools/functions/usePrevious.js +2 -2
- package/dist/Functions/useFormTools/index.js +467 -314
- package/dist/Functions/useInputHighlightError.js +42 -26
- package/dist/Functions/useIsMobile.js +29 -11
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +8 -9
- package/dist/Functions/useKeyPress/useKeyPress.js +26 -17
- package/dist/Functions/useLocalStorage.js +13 -6
- package/dist/Functions/useLocationParams.js +24 -14
- package/dist/Functions/useMediaQuery.js +18 -7
- package/dist/Functions/useMetaInfo.js +40 -16
- package/dist/Functions/useMouseUpOutside.js +2 -2
- package/dist/Functions/useOnlineStatus.js +17 -6
- package/dist/Functions/usePasswordChecker.js +61 -42
- package/dist/Functions/usePrevious.js +2 -2
- package/dist/Functions/useResize.js +24 -12
- package/dist/Functions/useScrollTo.js +13 -4
- package/dist/Functions/useToggle.js +25 -9
- package/dist/Functions/utils.js +272 -147
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +27 -23
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +27 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +31 -27
- package/dist/Molecular/CustomIcons/components/Arrow.js +37 -33
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +19 -15
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -18
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -18
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +19 -15
- package/dist/Molecular/CustomIcons/components/Bell.js +17 -13
- package/dist/Molecular/CustomIcons/components/Button.js +17 -13
- package/dist/Molecular/CustomIcons/components/Campaigns.js +18 -14
- package/dist/Molecular/CustomIcons/components/Check.js +18 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +32 -28
- package/dist/Molecular/CustomIcons/components/Close.js +19 -15
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +44 -40
- package/dist/Molecular/CustomIcons/components/Delete.js +18 -14
- package/dist/Molecular/CustomIcons/components/Edit.js +17 -13
- package/dist/Molecular/CustomIcons/components/Email.js +35 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +25 -21
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +33 -29
- package/dist/Molecular/CustomIcons/components/Flows.js +17 -13
- package/dist/Molecular/CustomIcons/components/Gift.js +22 -18
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +31 -27
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +31 -27
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +20 -16
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +21 -17
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +20 -16
- package/dist/Molecular/CustomIcons/components/Home.js +20 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +23 -19
- package/dist/Molecular/CustomIcons/components/Key.js +25 -21
- package/dist/Molecular/CustomIcons/components/Landers.js +21 -17
- package/dist/Molecular/CustomIcons/components/Lock.js +17 -13
- package/dist/Molecular/CustomIcons/components/Mail.js +25 -21
- package/dist/Molecular/CustomIcons/components/Mastercard.js +65 -61
- package/dist/Molecular/CustomIcons/components/Minus.js +30 -26
- package/dist/Molecular/CustomIcons/components/Offers.js +18 -14
- package/dist/Molecular/CustomIcons/components/Pause.js +30 -26
- package/dist/Molecular/CustomIcons/components/PayPal.js +44 -40
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +31 -27
- package/dist/Molecular/CustomIcons/components/Phone.js +32 -28
- package/dist/Molecular/CustomIcons/components/Play.js +30 -26
- package/dist/Molecular/CustomIcons/components/Plus.js +30 -26
- package/dist/Molecular/CustomIcons/components/Profile.js +22 -18
- package/dist/Molecular/CustomIcons/components/QRCode.js +32 -28
- package/dist/Molecular/CustomIcons/components/Rectangle.js +17 -13
- package/dist/Molecular/CustomIcons/components/Revert.js +20 -16
- package/dist/Molecular/CustomIcons/components/Star.js +14 -10
- package/dist/Molecular/CustomIcons/components/Star2.js +18 -14
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +20 -16
- package/dist/Molecular/CustomIcons/components/Trash.js +17 -13
- package/dist/Molecular/CustomIcons/components/TrashRed.js +17 -13
- package/dist/Molecular/CustomIcons/components/Triggers.js +17 -13
- package/dist/Molecular/CustomIcons/components/User.js +22 -18
- package/dist/Molecular/CustomIcons/components/Visa.js +33 -29
- package/dist/Molecular/CustomIcons/components/X.js +17 -13
- package/dist/Molecular/CustomIcons/index.js +61 -61
- package/dist/Molecular/FormElement/FormElement.js +17 -19
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +93 -73
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +27 -28
- package/dist/Molecular/InputAddress/InputAddress.js +213 -126
- package/dist/Molecular/InputPassword/InputPassword.js +23 -13
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,44 @@
|
|
|
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 = createTranslator;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
8
14
|
var _fieldValueFormatters = require("./../fieldValueFormatters");
|
|
9
15
|
|
|
10
|
-
|
|
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
|
+
var DEFAULT_CODE = "en";
|
|
11
21
|
|
|
12
22
|
function createTranslator(_ref) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
var langCatalogs = (0, _extends2.default)({}, _ref);
|
|
24
|
+
|
|
25
|
+
var loc = _objectSpread({}, langCatalogs);
|
|
26
|
+
|
|
27
|
+
var code = window.localStorage.getItem("lng");
|
|
18
28
|
if (!code) code = window.navigator ? window.navigator.language.split("-")[0] : DEFAULT_CODE;
|
|
19
29
|
if (!loc[code]) code = DEFAULT_CODE;
|
|
20
30
|
return function (text, values) {
|
|
21
31
|
var _Object$keys;
|
|
22
32
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
var safelyValues = values !== null && values !== void 0 ? values : {};
|
|
34
|
+
var safelyText = (0, _fieldValueFormatters.getSafelyValue)(text);
|
|
35
|
+
var translatedText = loc[code] && loc[code][safelyText] ? loc[code][safelyText] : safelyText;
|
|
26
36
|
|
|
27
37
|
if (Object !== null && Object !== void 0 && (_Object$keys = Object.keys(safelyValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
|
|
28
|
-
for (
|
|
38
|
+
for (var key in values) {
|
|
29
39
|
var _translatedText;
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
var regex = new RegExp("%".concat(key, "%"), "g");
|
|
32
42
|
translatedText = (_translatedText = translatedText) === null || _translatedText === void 0 ? void 0 : _translatedText.replace(regex, values[key]);
|
|
33
43
|
}
|
|
34
44
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
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.addRangeDefault = void 0;
|
|
7
9
|
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
8
12
|
// Взято из https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Math/round
|
|
9
13
|
// При импорте любой ф-и из этого файла отработает самовызывающаяся ф-я и расширит
|
|
10
14
|
// объект Math 3-мя ф-ми: round10, floor10, ceil10
|
|
@@ -60,30 +64,30 @@ exports.addRangeDefault = void 0;
|
|
|
60
64
|
}
|
|
61
65
|
})();
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
var addRangeDefault = function addRangeDefault(from, to, currentValues, decimalPlaces) {
|
|
64
68
|
if (!(currentValues !== null && currentValues !== void 0 && currentValues.length)) return [{
|
|
65
|
-
from,
|
|
66
|
-
to
|
|
69
|
+
from: from,
|
|
70
|
+
to: to
|
|
67
71
|
}];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
var step = decimalPlaces ? Math.pow(10, -1 * decimalPlaces) : 1;
|
|
73
|
+
var resultOfProcessAddingRange = currentValues.reduce(function (acc, range) {
|
|
74
|
+
var isIncludesFrom = Boolean(acc.from) && range.from < acc.from && range.to >= acc.from;
|
|
75
|
+
var isIncludesTo = Boolean(acc.to) && range.from <= acc.to && range.to > acc.to;
|
|
76
|
+
var isRangeMustBeIncludet = Boolean(acc.from) && Boolean(acc.to) && acc.from <= range.from && acc.to >= range.to;
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
var processTo = function processTo() {
|
|
79
|
+
var lastAccRange = acc.result[acc.result.length - 1];
|
|
76
80
|
|
|
77
81
|
if (acc.to < range.from) {
|
|
78
82
|
lastAccRange.to = acc.to;
|
|
79
83
|
acc.to = null;
|
|
80
|
-
acc.result = [
|
|
84
|
+
acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), [range]);
|
|
81
85
|
} else if (isIncludesTo) {
|
|
82
86
|
lastAccRange.to = acc.to;
|
|
83
|
-
acc.result = [
|
|
87
|
+
acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), [{
|
|
84
88
|
from: Math.round10(acc.to + step, -1 * decimalPlaces),
|
|
85
89
|
to: range.to
|
|
86
|
-
}];
|
|
90
|
+
}]);
|
|
87
91
|
acc.to = null;
|
|
88
92
|
} else if (acc.to === range.to) {
|
|
89
93
|
lastAccRange.to = acc.to;
|
|
@@ -91,36 +95,36 @@ const addRangeDefault = (from, to, currentValues, decimalPlaces) => {
|
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
|
|
94
|
-
if (!acc.from && !acc.to) acc.result = [
|
|
98
|
+
if (!acc.from && !acc.to) acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), [range]);else if (!acc.from && acc.to) processTo();else if (acc.from && acc.to) {
|
|
95
99
|
if (acc.from <= range.from) {
|
|
96
|
-
acc.result = [
|
|
100
|
+
acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), [{
|
|
97
101
|
from: acc.from
|
|
98
|
-
}];
|
|
102
|
+
}]);
|
|
99
103
|
acc.from = null;
|
|
100
104
|
processTo();
|
|
101
105
|
} else if (isIncludesFrom) {
|
|
102
|
-
acc.result = [
|
|
106
|
+
acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), [{
|
|
103
107
|
from: range.from,
|
|
104
108
|
to: Math.round10(acc.from - step, -1 * decimalPlaces)
|
|
105
109
|
}, {
|
|
106
110
|
from: acc.from
|
|
107
|
-
}];
|
|
111
|
+
}]);
|
|
108
112
|
acc.from = null;
|
|
109
113
|
processTo();
|
|
110
114
|
} else {
|
|
111
|
-
acc.result = [
|
|
115
|
+
acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), (0, _toConsumableArray2.default)(!isRangeMustBeIncludet ? [range] : []), [{
|
|
112
116
|
from: Math.round10(acc.from, -1 * decimalPlaces),
|
|
113
117
|
to: Math.round10(acc.to, -1 * decimalPlaces)
|
|
114
|
-
}];
|
|
118
|
+
}]);
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
return acc;
|
|
118
122
|
}, {
|
|
119
|
-
from,
|
|
120
|
-
to,
|
|
123
|
+
from: from,
|
|
124
|
+
to: to,
|
|
121
125
|
result: []
|
|
122
126
|
});
|
|
123
|
-
|
|
127
|
+
var result = resultOfProcessAddingRange.result;
|
|
124
128
|
if (!result[result.length - 1].to) result[result.length - 1].to = to;
|
|
125
129
|
return result;
|
|
126
130
|
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
exports.MASK_PRESET = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param type: 'inputMask',
|
|
10
|
+
* @param maskPattern: 'DD.DD.DDDD',
|
|
11
|
+
* @param maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
12
|
+
* @param usePatternPlaceholder: true,
|
|
13
|
+
* @param isNumericMobileKeyboard: true,
|
|
14
|
+
* @param blinkErrors: true,
|
|
15
|
+
* @param showErrors: false,
|
|
16
|
+
* @param autocomplete: 'bday',
|
|
17
|
+
* @param focusSelector: 'input',
|
|
18
|
+
*/
|
|
19
|
+
var DATE_PRESET = {
|
|
20
|
+
type: 'inputMask',
|
|
21
|
+
maskPattern: 'DD.DD.DDDD',
|
|
22
|
+
maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
23
|
+
usePatternPlaceholder: true,
|
|
24
|
+
isNumericMobileKeyboard: true,
|
|
25
|
+
blinkErrors: true,
|
|
26
|
+
showErrors: false,
|
|
27
|
+
autocomplete: 'bday',
|
|
28
|
+
focusSelector: 'input',
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @param type: 'inputMask',
|
|
32
|
+
* @param maskPattern: 'DDDDD',
|
|
33
|
+
* @param maskPlaceholder: 'X',
|
|
34
|
+
* @param isNumericMobileKeyboard: true,
|
|
35
|
+
* @param blinkErrors: true,
|
|
36
|
+
* @param showErrors: false,
|
|
37
|
+
* @param focusSelector: 'input',
|
|
38
|
+
* @param autocomplete: 'postal-code',
|
|
39
|
+
* @param rules: 'fieldZip'
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
var ZIP_PRESET = {
|
|
43
|
+
type: 'inputMask',
|
|
44
|
+
focusSelector: 'input',
|
|
45
|
+
maskPattern: 'DDDDD',
|
|
46
|
+
maskPlaceholder: 'X',
|
|
47
|
+
isNumericMobileKeyboard: true,
|
|
48
|
+
blinkErrors: true,
|
|
49
|
+
showErrors: false,
|
|
50
|
+
autocomplete: 'postal-code',
|
|
51
|
+
rules: 'fieldZip',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @param type: 'inputMask',
|
|
55
|
+
* @param maskPattern: 'DDDDDDDDD',
|
|
56
|
+
* @param maskPlaceholder: 'X',
|
|
57
|
+
* @param isNumericMobileKeyboard: true,
|
|
58
|
+
* @param blinkErrors: true,
|
|
59
|
+
* @param showErrors: false,
|
|
60
|
+
* @param focusSelector: 'input',
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
var SSN_PRESET = {
|
|
64
|
+
type: 'inputMask',
|
|
65
|
+
maskPattern: 'DDDDDDDDD',
|
|
66
|
+
maskPlaceholder: 'X',
|
|
67
|
+
focusSelector: 'input',
|
|
68
|
+
isNumericMobileKeyboard: true,
|
|
69
|
+
blinkErrors: true,
|
|
70
|
+
showErrors: false,
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @param type: 'inputMask',
|
|
74
|
+
* @param maskPattern: 'DDD-DDD-DDDD',
|
|
75
|
+
* @param maskPlaceholder: 'X',
|
|
76
|
+
* @param isNumericMobileKeyboard: true,
|
|
77
|
+
* @param blinkErrors: true,
|
|
78
|
+
* @param showErrors: false,
|
|
79
|
+
* @param focusSelector: 'input',
|
|
80
|
+
* @param autocomplete: 'tel-national',
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
var MOBILE_PHONE_PRESET = {
|
|
84
|
+
type: 'inputMask',
|
|
85
|
+
maskPattern: 'DDD-DDD-DDDD',
|
|
86
|
+
maskPlaceholder: 'X',
|
|
87
|
+
focusSelector: 'input',
|
|
88
|
+
isNumericMobileKeyboard: true,
|
|
89
|
+
blinkErrors: true,
|
|
90
|
+
showErrors: false,
|
|
91
|
+
autocomplete: 'tel-national',
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* @param type: 'inputMask3',
|
|
95
|
+
* @param maskPattern: 'DDDD',
|
|
96
|
+
* @param maskPlaceholder: 'X',
|
|
97
|
+
* @param isNumericMobileKeyboard: true,
|
|
98
|
+
* @param blinkErrors: true,
|
|
99
|
+
* @param showErrors: false,
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
var SHORT_SSN_PRESET = {
|
|
103
|
+
type: 'inputMask3',
|
|
104
|
+
maskPattern: 'DDDD',
|
|
105
|
+
maskPlaceholder: 'X',
|
|
106
|
+
focusSelector: 'input',
|
|
107
|
+
isNumericMobileKeyboard: true,
|
|
108
|
+
blinkErrors: true,
|
|
109
|
+
showErrors: false,
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @param type: 'inputMask',
|
|
113
|
+
* @param maskPattern: 'DDDDDDDDD',
|
|
114
|
+
* @param maskPlaceholder: 'X',
|
|
115
|
+
* @param isNumericMobileKeyboard: true,
|
|
116
|
+
* @param blinkErrors: true,
|
|
117
|
+
* @param showErrors: false,
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
var ABA_PRESET = {
|
|
121
|
+
type: 'inputMask',
|
|
122
|
+
maskPattern: 'DDDDDDDDD',
|
|
123
|
+
maskPlaceholder: 'X',
|
|
124
|
+
isNumericMobileKeyboard: true,
|
|
125
|
+
blinkErrors: true,
|
|
126
|
+
showErrors: false,
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* @param type: 'inputMask',
|
|
130
|
+
* @param maskPattern: 'MM/YY',
|
|
131
|
+
* @param maskPatternPlaceholder: 'MM/YY',
|
|
132
|
+
* @param usePatternPlaceholder: true,
|
|
133
|
+
* @param isNumericMobileKeyboard: true,
|
|
134
|
+
* @param blinkErrors: true,
|
|
135
|
+
* @param showErrors: false,
|
|
136
|
+
* @param focusSelector: 'input',
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
var CC_EXPIRATION_DATE = {
|
|
140
|
+
type: 'inputMask',
|
|
141
|
+
maskPattern: 'MM/YY',
|
|
142
|
+
maskPatternPlaceholder: 'MM/YY',
|
|
143
|
+
usePatternPlaceholder: true,
|
|
144
|
+
isNumericMobileKeyboard: true,
|
|
145
|
+
blinkErrors: true,
|
|
146
|
+
showErrors: false,
|
|
147
|
+
focusSelector: 'input',
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* @param type: 'inputMask',
|
|
151
|
+
* @param maskPattern: 'DDDDDDDDDD',
|
|
152
|
+
* @param maskPlaceholder: 'X',
|
|
153
|
+
* @param isNumericMobileKeyboard: true,
|
|
154
|
+
* @param blinkErrors: true,
|
|
155
|
+
* @param showErrors: false,
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
var BANK_ACCOUNT = {
|
|
159
|
+
type: 'inputMask',
|
|
160
|
+
maskPattern: 'DDDDDDDDDD',
|
|
161
|
+
maskPlaceholder: 'X',
|
|
162
|
+
isNumericMobileKeyboard: true,
|
|
163
|
+
blinkErrors: true,
|
|
164
|
+
showErrors: false,
|
|
165
|
+
};
|
|
166
|
+
var MASK_PRESET = {
|
|
167
|
+
BANK_ACCOUNT: BANK_ACCOUNT,
|
|
168
|
+
CC_EXPIRATION_DATE: CC_EXPIRATION_DATE,
|
|
169
|
+
DATE_PRESET: DATE_PRESET,
|
|
170
|
+
ZIP_PRESET: ZIP_PRESET,
|
|
171
|
+
SSN_PRESET: SSN_PRESET,
|
|
172
|
+
MOBILE_PHONE_PRESET: MOBILE_PHONE_PRESET,
|
|
173
|
+
SHORT_SSN_PRESET: SHORT_SSN_PRESET,
|
|
174
|
+
ABA_PRESET: ABA_PRESET,
|
|
175
|
+
};
|
|
176
|
+
exports.MASK_PRESET = MASK_PRESET;
|
|
@@ -16,7 +16,7 @@ exports.MASK_PRESETS = void 0;
|
|
|
16
16
|
* @param autocomplete: 'bday',
|
|
17
17
|
* @param focusSelector: 'input',
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
var DATE_PRESET = {
|
|
20
20
|
type: "inputMask",
|
|
21
21
|
maskPattern: "DD.DD.DDDD",
|
|
22
22
|
maskPatternPlaceholder: "MM.DD.YYYY",
|
|
@@ -39,7 +39,7 @@ const DATE_PRESET = {
|
|
|
39
39
|
* @param rules: 'fieldZip'
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
var ZIP_PRESET = {
|
|
43
43
|
type: "inputMask",
|
|
44
44
|
focusSelector: "input",
|
|
45
45
|
maskPattern: "DDDDD",
|
|
@@ -60,7 +60,7 @@ const ZIP_PRESET = {
|
|
|
60
60
|
* @param focusSelector: 'input',
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
var SSN_PRESET = {
|
|
64
64
|
type: "inputMask",
|
|
65
65
|
maskPattern: "DDDDDDDDD",
|
|
66
66
|
maskPlaceholder: "X",
|
|
@@ -80,7 +80,7 @@ const SSN_PRESET = {
|
|
|
80
80
|
* @param autocomplete: 'tel-national',
|
|
81
81
|
*/
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
var MOBILE_PHONE_PRESET = {
|
|
84
84
|
type: "inputMask",
|
|
85
85
|
// maskPattern: 'DDD-DDD-DDDD',
|
|
86
86
|
maskPattern: "(DDD) DDD-DDDD",
|
|
@@ -100,7 +100,7 @@ const MOBILE_PHONE_PRESET = {
|
|
|
100
100
|
* @param showErrors: false,
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
var SHORT_SSN_PRESET = {
|
|
104
104
|
type: "inputMask3",
|
|
105
105
|
maskPattern: "DDDD",
|
|
106
106
|
maskPlaceholder: "X",
|
|
@@ -118,7 +118,7 @@ const SHORT_SSN_PRESET = {
|
|
|
118
118
|
* @param showErrors: false,
|
|
119
119
|
*/
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
var ABA_PRESET = {
|
|
122
122
|
type: "inputMask",
|
|
123
123
|
maskPattern: "DDDDDDDDD",
|
|
124
124
|
maskPlaceholder: "X",
|
|
@@ -137,7 +137,7 @@ const ABA_PRESET = {
|
|
|
137
137
|
* @param focusSelector: 'input',
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
var CC_EXPIRATION_DATE = {
|
|
141
141
|
type: "inputMask",
|
|
142
142
|
maskPattern: "MM/YY",
|
|
143
143
|
maskPatternPlaceholder: "MM/YY",
|
|
@@ -156,7 +156,7 @@ const CC_EXPIRATION_DATE = {
|
|
|
156
156
|
* @param showErrors: false,
|
|
157
157
|
*/
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
var BANK_ACCOUNT = {
|
|
160
160
|
type: "inputMask",
|
|
161
161
|
maskPattern: "DDDDDDDDDD",
|
|
162
162
|
maskPlaceholder: "X",
|
|
@@ -164,14 +164,14 @@ const BANK_ACCOUNT = {
|
|
|
164
164
|
blinkErrors: true,
|
|
165
165
|
showErrors: false
|
|
166
166
|
};
|
|
167
|
-
|
|
168
|
-
BANK_ACCOUNT,
|
|
169
|
-
CC_EXPIRATION_DATE,
|
|
170
|
-
DATE_PRESET,
|
|
171
|
-
ZIP_PRESET,
|
|
172
|
-
SSN_PRESET,
|
|
173
|
-
MOBILE_PHONE_PRESET,
|
|
174
|
-
SHORT_SSN_PRESET,
|
|
175
|
-
ABA_PRESET
|
|
167
|
+
var MASK_PRESETS = {
|
|
168
|
+
BANK_ACCOUNT: BANK_ACCOUNT,
|
|
169
|
+
CC_EXPIRATION_DATE: CC_EXPIRATION_DATE,
|
|
170
|
+
DATE_PRESET: DATE_PRESET,
|
|
171
|
+
ZIP_PRESET: ZIP_PRESET,
|
|
172
|
+
SSN_PRESET: SSN_PRESET,
|
|
173
|
+
MOBILE_PHONE_PRESET: MOBILE_PHONE_PRESET,
|
|
174
|
+
SHORT_SSN_PRESET: SHORT_SSN_PRESET,
|
|
175
|
+
ABA_PRESET: ABA_PRESET
|
|
176
176
|
};
|
|
177
177
|
exports.MASK_PRESETS = MASK_PRESETS;
|
|
@@ -7,7 +7,7 @@ exports.INPUT_PRESETS = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _fieldValueFormatters = require("../fieldValueFormatters");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var NAME_SYMBOLS_EXCLUDER = {
|
|
11
11
|
/**
|
|
12
12
|
* @name fieldChangesMiddleware
|
|
13
13
|
* @description Обрабатывает входящую строку, удаляет все символы, которые не являются
|
|
@@ -17,16 +17,16 @@ const NAME_SYMBOLS_EXCLUDER = {
|
|
|
17
17
|
* @param {string} value - Входная строка для обработки.
|
|
18
18
|
* @returns {string} - Обработанная строка.
|
|
19
19
|
*/
|
|
20
|
-
fieldChangesMiddleware: value
|
|
20
|
+
fieldChangesMiddleware: function fieldChangesMiddleware(value) {
|
|
21
21
|
// remove invalid characters
|
|
22
|
-
|
|
22
|
+
var invalidCharacters = new RegExp(/[^a-zA-Z-\s']/g); // handle any two '-' or ''' should not be side by side
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
var sideBySideHyphenOrApostrophe = new RegExp(/['-]{2,}/g); // replace sequence of spaces with single space
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
var multipleSpaces = new RegExp(/\s{2,}/g); // remove '-' or ''' if they are followed by a space
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
var beforeSpace = new RegExp(/['-](?=\s)/g);
|
|
29
|
+
var sanitizedValue = (0, _fieldValueFormatters.getSafelyValue)(value).replace(invalidCharacters, "").replace(sideBySideHyphenOrApostrophe, "").replace(multipleSpaces, " ").replace(beforeSpace, "");
|
|
30
30
|
return sanitizedValue;
|
|
31
31
|
},
|
|
32
32
|
blurTrim: {
|
|
@@ -35,7 +35,7 @@ const NAME_SYMBOLS_EXCLUDER = {
|
|
|
35
35
|
characters: ["-", "'", " "]
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
var ONLY_STRING_AND_DASH = {
|
|
39
39
|
/**
|
|
40
40
|
* @name fieldChangesMiddleware
|
|
41
41
|
* @description Обрабатывает входную строку, удаляет все неалфавитные символы, заменяет двойные дефисы на одинарные
|
|
@@ -43,15 +43,15 @@ const ONLY_STRING_AND_DASH = {
|
|
|
43
43
|
* @param {string} value - входная строка для обработки
|
|
44
44
|
* @returns {string} обработанная строка
|
|
45
45
|
*/
|
|
46
|
-
fieldChangesMiddleware: value
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
fieldChangesMiddleware: function fieldChangesMiddleware(value) {
|
|
47
|
+
var nonAlphabeticAndNotSingleDash = new RegExp(/[^a-zA-Z-]|--/gi);
|
|
48
|
+
var consecutiveDashes = new RegExp(/-+/g);
|
|
49
|
+
var sanitizedInput = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
50
50
|
return sanitizedInput.replace(nonAlphabeticAndNotSingleDash, "").replace(consecutiveDashes, "-");
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
NAME_SYMBOLS_EXCLUDER,
|
|
55
|
-
ONLY_STRING_AND_DASH
|
|
53
|
+
var INPUT_PRESETS = {
|
|
54
|
+
NAME_SYMBOLS_EXCLUDER: NAME_SYMBOLS_EXCLUDER,
|
|
55
|
+
ONLY_STRING_AND_DASH: ONLY_STRING_AND_DASH
|
|
56
56
|
};
|
|
57
57
|
exports.INPUT_PRESETS = INPUT_PRESETS;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NUMERIC_KEYBOARD = exports.EMAIL_KEYBOARD = exports.ALL_KEYBOARD_TYPES = void 0;
|
|
7
7
|
//? Удобно использовать для расширения объекта атрибутов
|
|
8
|
-
|
|
8
|
+
var ALL_KEYBOARD_TYPES = {
|
|
9
9
|
numeric: {
|
|
10
10
|
inputMode: "numeric"
|
|
11
11
|
},
|
|
@@ -47,11 +47,11 @@ const ALL_KEYBOARD_TYPES = {
|
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
49
|
exports.ALL_KEYBOARD_TYPES = ALL_KEYBOARD_TYPES;
|
|
50
|
-
|
|
50
|
+
var NUMERIC_KEYBOARD = {
|
|
51
51
|
attributesOfNativeInput: ALL_KEYBOARD_TYPES.numeric
|
|
52
52
|
};
|
|
53
53
|
exports.NUMERIC_KEYBOARD = NUMERIC_KEYBOARD;
|
|
54
|
-
|
|
54
|
+
var EMAIL_KEYBOARD = {
|
|
55
55
|
attributesOfNativeInput: ALL_KEYBOARD_TYPES.email
|
|
56
56
|
};
|
|
57
57
|
exports.EMAIL_KEYBOARD = EMAIL_KEYBOARD;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,21 +9,21 @@ exports.registerSchema = exports.loginSchema = exports.forgotSchema = void 0;
|
|
|
7
9
|
|
|
8
10
|
var yup = _interopRequireWildcard(require("yup"));
|
|
9
11
|
|
|
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); }
|
|
12
|
+
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); }
|
|
11
13
|
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
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; }
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
var forgotSchema = yup.object().shape({
|
|
15
17
|
email: yup.string().email("Invalid email").required("E-mail is required")
|
|
16
18
|
});
|
|
17
19
|
exports.forgotSchema = forgotSchema;
|
|
18
|
-
|
|
20
|
+
var loginSchema = yup.object().shape({
|
|
19
21
|
email: yup.string().email("Invalid email").required("E-mail is required"),
|
|
20
22
|
password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
|
|
21
23
|
remember: yup.bool()
|
|
22
24
|
});
|
|
23
25
|
exports.loginSchema = loginSchema;
|
|
24
|
-
|
|
26
|
+
var registerSchema = yup.object().shape({
|
|
25
27
|
name: yup.string().required("Name is required"),
|
|
26
28
|
email: yup.string().email("Invalid email").required("E-mail is required"),
|
|
27
29
|
password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
|
|
@@ -7,15 +7,15 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
(0, _react.useEffect)(()
|
|
10
|
+
var useBodyScrollLock = function useBodyScrollLock(isScrollBodyLocked) {
|
|
11
|
+
(0, _react.useEffect)(function () {
|
|
12
12
|
if (isScrollBodyLocked) {
|
|
13
13
|
document.body.style.overflow = "hidden";
|
|
14
14
|
} else {
|
|
15
15
|
document.body.style.overflow = "auto";
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return ()
|
|
18
|
+
return function () {
|
|
19
19
|
document.body.style.overflow = "auto";
|
|
20
20
|
};
|
|
21
21
|
}, [isScrollBodyLocked]);
|
|
@@ -7,16 +7,16 @@ exports.useClickOutside = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var useClickOutside = function useClickOutside(ref, setOut, open) {
|
|
11
11
|
function handleClickOutside(event) {
|
|
12
12
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
13
13
|
setOut(open);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
(0, _react.useEffect)(()
|
|
17
|
+
(0, _react.useEffect)(function () {
|
|
18
18
|
document.addEventListener("mousedown", handleClickOutside);
|
|
19
|
-
return ()
|
|
19
|
+
return function () {
|
|
20
20
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
21
21
|
};
|
|
22
22
|
}, [ref]);
|
|
@@ -1,27 +1,36 @@
|
|
|
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.useDebounce = void 0;
|
|
7
11
|
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
8
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
15
|
|
|
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); }
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
var useDebounce = function useDebounce(_ref) {
|
|
21
|
+
var searchValue = _ref.searchValue,
|
|
22
|
+
delay = _ref.delay;
|
|
11
23
|
|
|
12
|
-
|
|
24
|
+
var _useState = (0, _react.useState)(searchValue),
|
|
25
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
|
+
debouncedValue = _useState2[0],
|
|
27
|
+
setDebouncedValue = _useState2[1];
|
|
13
28
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
searchValue,
|
|
17
|
-
delay
|
|
18
|
-
} = _ref;
|
|
19
|
-
const [debouncedValue, setDebouncedValue] = (0, _react.useState)(searchValue);
|
|
20
|
-
(0, _react.useEffect)(() => {
|
|
21
|
-
const handler = setTimeout(() => {
|
|
29
|
+
(0, _react.useEffect)(function () {
|
|
30
|
+
var handler = setTimeout(function () {
|
|
22
31
|
setDebouncedValue(searchValue);
|
|
23
32
|
}, delay);
|
|
24
|
-
return ()
|
|
33
|
+
return function () {
|
|
25
34
|
clearTimeout(handler);
|
|
26
35
|
};
|
|
27
36
|
}, [searchValue, delay]);
|