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,27 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
4
7
|
Object.defineProperty(exports, "__esModule", {
|
|
5
8
|
value: true
|
|
6
9
|
});
|
|
7
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
|
+
|
|
8
16
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
9
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
10
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
11
22
|
var _index = require("../../../Constants/index.constants");
|
|
23
|
+
|
|
12
24
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
25
|
+
|
|
13
26
|
var _utils = require("../../../Functions/utils");
|
|
27
|
+
|
|
14
28
|
var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
29
|
+
|
|
15
30
|
require("./Input.scss");
|
|
31
|
+
|
|
16
32
|
var _DynamicIcon = _interopRequireDefault(require("../../UI/DynamicIcon/DynamicIcon"));
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
/* eslint-disable react/display-name */
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
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; }
|
|
24
39
|
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
var HIDE_SYMBOL = "\u2022";
|
|
25
43
|
/**
|
|
26
44
|
* Input компонент.
|
|
27
45
|
*
|
|
@@ -57,195 +75,259 @@ const HIDE_SYMBOL = '\u2022';
|
|
|
57
75
|
* @param {boolean} props.isNotValidateASCII - Отключает проверку ASCII для вводимых символов.
|
|
58
76
|
* @param {boolean} props.isNumericMobileKeyboard - Отображает цифровую клавиатуру на мобильных устройствах.
|
|
59
77
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
78
|
+
|
|
79
|
+
var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
80
|
+
var blurTrim = _ref.blurTrim,
|
|
81
|
+
_ref$autocomplete = _ref.autocomplete,
|
|
82
|
+
autocomplete = _ref$autocomplete === void 0 ? 'off' : _ref$autocomplete,
|
|
83
|
+
isSelect = _ref.isSelect,
|
|
84
|
+
_ref$onChange = _ref.onChange,
|
|
85
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
86
|
+
_ref$onBlur = _ref.onBlur,
|
|
87
|
+
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
88
|
+
_ref$onFocus = _ref.onFocus,
|
|
89
|
+
onFocus = _ref$onFocus === void 0 ? function () {} : _ref$onFocus,
|
|
90
|
+
_ref$onKeyUp = _ref.onKeyUp,
|
|
91
|
+
onKeyUp = _ref$onKeyUp === void 0 ? function () {} : _ref$onKeyUp,
|
|
92
|
+
_ref$onKeyDown = _ref.onKeyDown,
|
|
93
|
+
onKeyDown = _ref$onKeyDown === void 0 ? function () {} : _ref$onKeyDown,
|
|
94
|
+
isNotBlinkErrors = _ref.isNotBlinkErrors,
|
|
95
|
+
isPriceInput = _ref.isPriceInput,
|
|
96
|
+
onlyNumbers = _ref.onlyNumbers,
|
|
97
|
+
disabled = _ref.disabled,
|
|
98
|
+
withDelete = _ref.withDelete,
|
|
99
|
+
value = _ref.value,
|
|
100
|
+
placeholder = _ref.placeholder,
|
|
101
|
+
className = _ref.className,
|
|
102
|
+
_ref$type = _ref.type,
|
|
103
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
104
|
+
mask = _ref.mask,
|
|
105
|
+
maskChar = _ref.maskChar,
|
|
106
|
+
formatChars = _ref.formatChars,
|
|
107
|
+
error = _ref.error,
|
|
108
|
+
icon = _ref.icon,
|
|
109
|
+
iconDynamicKey = _ref.iconDynamicKey,
|
|
110
|
+
_ref$iconDynamicProps = _ref.iconDynamicProps,
|
|
111
|
+
iconDynamicProps = _ref$iconDynamicProps === void 0 ? {} : _ref$iconDynamicProps,
|
|
112
|
+
symbolsLimit = _ref.symbolsLimit,
|
|
113
|
+
blinkTime = _ref.blinkTime,
|
|
114
|
+
_ref$isFocusDefault = _ref.isFocusDefault,
|
|
115
|
+
isFocusDefault = _ref$isFocusDefault === void 0 ? false : _ref$isFocusDefault,
|
|
116
|
+
_ref$isNotValidateASC = _ref.isNotValidateASCII,
|
|
117
|
+
isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
|
|
118
|
+
_ref$isNumericMobileK = _ref.isNumericMobileKeyboard,
|
|
119
|
+
isNumericMobileKeyboard = _ref$isNumericMobileK === void 0 ? false : _ref$isNumericMobileK,
|
|
120
|
+
_ref$isCropFirstNool = _ref.isCropFirstNool,
|
|
121
|
+
isCropFirstNool = _ref$isCropFirstNool === void 0 ? false : _ref$isCropFirstNool,
|
|
122
|
+
_ref$testId = _ref.testId,
|
|
123
|
+
testId = _ref$testId === void 0 ? 'input' : _ref$testId,
|
|
124
|
+
action = _ref.action,
|
|
125
|
+
_ref$isUseAutoSelect = _ref.isUseAutoSelect,
|
|
126
|
+
isUseAutoSelect = _ref$isUseAutoSelect === void 0 ? true : _ref$isUseAutoSelect,
|
|
127
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
128
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
129
|
+
_ref$isLoading = _ref.isLoading,
|
|
130
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
131
|
+
name = _ref.name,
|
|
132
|
+
fieldKey = _ref.fieldKey,
|
|
133
|
+
id = _ref.id,
|
|
134
|
+
key = _ref.key,
|
|
135
|
+
_ref$attributesOfNati = _ref.attributesOfNativeInput,
|
|
136
|
+
attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati;
|
|
137
|
+
|
|
138
|
+
var _ref2 = blurTrim || {},
|
|
139
|
+
trimStart = _ref2.trimStart,
|
|
140
|
+
trimEnd = _ref2.trimEnd,
|
|
141
|
+
characters = _ref2.characters;
|
|
142
|
+
|
|
143
|
+
var DynamicIconComponent = iconDynamicKey && !icon ? /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, (0, _extends2.default)({
|
|
109
144
|
iconKey: iconDynamicKey
|
|
110
145
|
}, iconDynamicProps)) : null;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
146
|
+
var DEFAULT_BLINK_TIME = 100; // STATES
|
|
147
|
+
|
|
148
|
+
var _useState = (0, _react.useState)(false),
|
|
149
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
150
|
+
isFocused = _useState2[0],
|
|
151
|
+
setIsFocused = _useState2[1];
|
|
152
|
+
|
|
153
|
+
var _useState3 = (0, _react.useState)(false),
|
|
154
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
155
|
+
isEditing = _useState4[0],
|
|
156
|
+
setEditing = _useState4[1];
|
|
157
|
+
|
|
158
|
+
var inputInnerRef = (0, _react.useRef)(null);
|
|
159
|
+
var inputRef = (0, _react.useMemo)(function () {
|
|
160
|
+
return ref || inputInnerRef;
|
|
161
|
+
}, [ref]); // const previousValueRef = useRef(value);
|
|
162
|
+
|
|
163
|
+
var _useState5 = (0, _react.useState)(false),
|
|
164
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
165
|
+
isAttemptToChange = _useState6[0],
|
|
166
|
+
setIsAttemptToChange = _useState6[1];
|
|
167
|
+
|
|
168
|
+
var _useState7 = (0, _react.useState)(false),
|
|
169
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
170
|
+
isToHighlightError = _useState8[0],
|
|
171
|
+
setIsToHighlightError = _useState8[1];
|
|
172
|
+
|
|
173
|
+
var _useState9 = (0, _react.useState)(false),
|
|
174
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
175
|
+
onInputHover = _useState10[0],
|
|
176
|
+
setOnInputHover = _useState10[1];
|
|
177
|
+
|
|
178
|
+
var _useState11 = (0, _react.useState)(value),
|
|
179
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
180
|
+
prevValue = _useState12[0],
|
|
181
|
+
setPreviousValue = _useState12[1];
|
|
182
|
+
|
|
183
|
+
var _useState13 = (0, _react.useState)({
|
|
123
184
|
start: null,
|
|
124
185
|
end: null,
|
|
125
186
|
keyCode: null
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
187
|
+
}),
|
|
188
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
189
|
+
keyDownData = _useState14[0],
|
|
190
|
+
setKeyDownData = _useState14[1];
|
|
191
|
+
|
|
192
|
+
var isUseBitDepthPoints = !!onlyNumbers && isPriceInput;
|
|
193
|
+
var isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
194
|
+
var inputName = name || fieldKey || id || key;
|
|
195
|
+
var isPseudoPasswordMode = type === 'pseudoPassword'; // HANDLES
|
|
196
|
+
|
|
197
|
+
var handle = {
|
|
198
|
+
correctMinMax: function correctMinMax(value, correctionType) {
|
|
135
199
|
if (!onlyNumbers) return value;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
200
|
+
|
|
201
|
+
var _ref3 = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {},
|
|
202
|
+
min = _ref3.min,
|
|
203
|
+
max = _ref3.max,
|
|
204
|
+
isOnlyPositive = _ref3.isOnlyPositive,
|
|
205
|
+
isNoEmptyValues = _ref3.isNoEmptyValues;
|
|
206
|
+
|
|
207
|
+
var minimum = !Number.isNaN(+min) && min !== null && (min >= 0 || !isOnlyPositive) ? min : undefined;
|
|
208
|
+
var maximum = !Number.isNaN(+max) && max !== null && (max >= 0 || !isOnlyPositive) ? max : undefined;
|
|
209
|
+
var minusSymbol;
|
|
210
|
+
var inputValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
211
|
+
|
|
212
|
+
var checkMin = function checkMin() {
|
|
147
213
|
var _minusSymbol;
|
|
214
|
+
|
|
148
215
|
if (!inputValue && isNoEmptyValues) inputValue = minimum !== undefined ? minimum : '0';else if (inputValue && !Number.isNaN(+minimum) && +minimum > +(((_minusSymbol = minusSymbol) !== null && _minusSymbol !== void 0 ? _minusSymbol : '') + inputValue)) inputValue = minimum;
|
|
149
216
|
};
|
|
150
|
-
|
|
217
|
+
|
|
218
|
+
var checkMax = function checkMax() {
|
|
151
219
|
var _minusSymbol2;
|
|
220
|
+
|
|
152
221
|
if (!Number.isNaN(+maximum) && +maximum < +(((_minusSymbol2 = minusSymbol) !== null && _minusSymbol2 !== void 0 ? _minusSymbol2 : '') + inputValue)) {
|
|
153
222
|
inputValue = maximum;
|
|
154
223
|
minusSymbol = null;
|
|
155
224
|
}
|
|
156
225
|
};
|
|
226
|
+
|
|
157
227
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
228
|
+
|
|
158
229
|
if (!isOnlyPositive && inputValue[0] === '-') {
|
|
159
230
|
minusSymbol = '-';
|
|
160
231
|
inputValue = inputValue.slice(1);
|
|
161
232
|
}
|
|
233
|
+
|
|
162
234
|
inputValue = (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
|
|
235
|
+
|
|
163
236
|
switch (correctionType) {
|
|
164
237
|
case 'min':
|
|
165
238
|
checkMin();
|
|
166
239
|
break;
|
|
240
|
+
|
|
167
241
|
case 'max':
|
|
168
242
|
checkMax();
|
|
169
243
|
break;
|
|
244
|
+
|
|
170
245
|
default:
|
|
171
246
|
checkMin();
|
|
172
247
|
checkMax();
|
|
173
248
|
break;
|
|
174
249
|
}
|
|
250
|
+
|
|
175
251
|
return inputValue;
|
|
176
252
|
},
|
|
177
|
-
processPseudoValue: (newValue, oldValue)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
//? Если insertedPart.length > 1, то это точно копи-паст
|
|
253
|
+
processPseudoValue: function processPseudoValue(newValue, oldValue) {
|
|
254
|
+
var insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, 'g'), ''); //? Если insertedPart.length > 1, то это точно копи-паст
|
|
181
255
|
//? По договоренности любой копипаст заменяет текущее велью
|
|
256
|
+
|
|
182
257
|
if (insertedPart.length > 1) return insertedPart;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
258
|
+
var isOldValueHasBeenReduced = newValue.replace(new RegExp(/^HIDE_SYMBOL/g), '').length < oldValue.length;
|
|
259
|
+
var oldValueArr = oldValue.split('');
|
|
260
|
+
|
|
261
|
+
var getIsInclude = function getIsInclude(idx) {
|
|
262
|
+
var BACKSPACE_CODE = 8; //? Если позиции не равны, значит была выделена область, значит будем воспринимать как копи-паст
|
|
187
263
|
|
|
188
|
-
//? Если позиции
|
|
189
|
-
if (keyDownData.start !== keyDownData.end) return false;
|
|
264
|
+
if (keyDownData.start !== keyDownData.end) return false; //? Если позиции равны и есть вставляемое значение - обрезаем "хвост"
|
|
190
265
|
|
|
191
|
-
//? Если позиции равны и
|
|
192
|
-
if (insertedPart) return idx < keyDownData.start;
|
|
266
|
+
if (insertedPart) return idx < keyDownData.start; //? Если позиции равны и нет вставляемого значения - значит симвовол удалили
|
|
193
267
|
|
|
194
|
-
//? Если позиции равны и нет вставляемого значения - значит симвовол удалили
|
|
195
268
|
return keyDownData.keyCode === BACKSPACE_CODE ? idx < keyDownData.start - 1 || idx > keyDownData.end - 1 : idx < keyDownData.start || idx > keyDownData.end;
|
|
196
269
|
};
|
|
197
|
-
|
|
198
|
-
|
|
270
|
+
|
|
271
|
+
if (!insertedPart) return oldValueArr.reduce(function (acc, sym, idx) {
|
|
272
|
+
return getIsInclude(idx) ? "".concat(acc).concat(sym) : acc;
|
|
273
|
+
}, '');
|
|
274
|
+
var outputStructure = oldValueArr.reduce(function (acc, sym, idx) {
|
|
199
275
|
if (getIsInclude(idx)) acc.result = "".concat(acc.result).concat(sym);else if (!acc.position) acc.position = insertedPart ? idx : idx - 1;
|
|
200
276
|
return acc;
|
|
201
277
|
}, {
|
|
202
278
|
result: '',
|
|
203
279
|
position: !isOldValueHasBeenReduced ? keyDownData.start : null
|
|
204
280
|
});
|
|
205
|
-
|
|
281
|
+
var output = "".concat(outputStructure.result.slice(0, outputStructure.position)).concat(insertedPart).concat(outputStructure.result.slice(outputStructure.position));
|
|
206
282
|
return output;
|
|
207
283
|
},
|
|
208
|
-
change: e
|
|
284
|
+
change: function change(e) {
|
|
209
285
|
var _minusSymbol3;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
286
|
+
|
|
287
|
+
var _ref4 = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {},
|
|
288
|
+
isOnlyPositive = _ref4.isOnlyPositive;
|
|
289
|
+
|
|
290
|
+
var minusSymbol;
|
|
291
|
+
var inputValue = e.target ? e.target.value : e;
|
|
215
292
|
if (isPseudoPasswordMode) inputValue = inputValue.includes(HIDE_SYMBOL) ? handle.processPseudoValue(inputValue, value, e) : inputValue;
|
|
216
293
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
217
294
|
if (onlyNumbers) inputValue = inputValue.replace(/,/g, '.');
|
|
295
|
+
|
|
218
296
|
if (onlyNumbers && !isOnlyPositive && inputValue[0] === '-') {
|
|
219
297
|
minusSymbol = '-';
|
|
220
298
|
inputValue = inputValue.slice(1);
|
|
221
299
|
}
|
|
300
|
+
|
|
222
301
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
223
302
|
if (symbolsLimit && inputValue.length > +symbolsLimit) inputValue = inputValue.substring(0, +symbolsLimit);
|
|
224
303
|
if (isCropFirstNool && inputValue[0] == 0) return '';else if (onlyNumbers) inputValue = handle.correctMinMax(inputValue, 'max');
|
|
225
304
|
onChange((((_minusSymbol3 = minusSymbol) !== null && _minusSymbol3 !== void 0 ? _minusSymbol3 : '') + inputValue).toString());
|
|
226
305
|
},
|
|
227
|
-
toggleEdit: ()
|
|
306
|
+
toggleEdit: function toggleEdit() {
|
|
228
307
|
setEditing(!isEditing);
|
|
229
308
|
onChange('');
|
|
230
309
|
},
|
|
231
|
-
focus: e
|
|
310
|
+
focus: function focus(e) {
|
|
232
311
|
setIsFocused(true);
|
|
233
312
|
onFocus(e);
|
|
234
313
|
},
|
|
235
|
-
blur: e
|
|
236
|
-
|
|
314
|
+
blur: function blur(e) {
|
|
315
|
+
var inputValue = handle.correctMinMax((0, _fieldValueFormatters.getSafelyValue)(value), 'min');
|
|
237
316
|
if (trimStart) inputValue = inputValue.replace(new RegExp("^[".concat(characters, "]+")), '');
|
|
238
317
|
if (trimEnd) inputValue = inputValue.replace(new RegExp("[".concat(characters, "]+$")), '');
|
|
239
318
|
if (value !== inputValue) onChange(inputValue);
|
|
240
319
|
setIsFocused(false);
|
|
241
|
-
setEditing(false);
|
|
242
|
-
// использую setTimeout для того чтоб прошли переназначения велью, если они есть,
|
|
320
|
+
setEditing(false); // использую setTimeout для того чтоб прошли переназначения велью, если они есть,
|
|
243
321
|
// для того, чтоб верхний onBlur при обращении к e.target.value получал обновленное велью
|
|
244
|
-
|
|
322
|
+
|
|
323
|
+
if (onBlur) setTimeout(function () {
|
|
324
|
+
return onBlur(e);
|
|
325
|
+
}, 0);
|
|
245
326
|
},
|
|
246
|
-
keyDown: e
|
|
327
|
+
keyDown: function keyDown(e) {
|
|
247
328
|
var _e$target;
|
|
248
|
-
|
|
329
|
+
|
|
330
|
+
setPreviousValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
249
331
|
setKeyDownData({
|
|
250
332
|
start: e.target.selectionStart,
|
|
251
333
|
end: e.target.selectionEnd,
|
|
@@ -253,13 +335,13 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
253
335
|
});
|
|
254
336
|
onKeyDown(e.keyCode, e);
|
|
255
337
|
},
|
|
256
|
-
keyUp: e
|
|
338
|
+
keyUp: function keyUp(e) {
|
|
257
339
|
if (isUseErrorsBlink) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
340
|
+
var changedValue = "".concat(value !== null && value !== void 0 ? value : '');
|
|
341
|
+
var previousValue = "".concat(prevValue);
|
|
342
|
+
var short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
343
|
+
var long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
344
|
+
var infoAboutDifferencesSameness = short.split('').reduce(function (acc, symbol, idx) {
|
|
263
345
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
264
346
|
acc.countOn = false;
|
|
265
347
|
acc.differences.push([idx, symbol]);
|
|
@@ -270,78 +352,86 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
270
352
|
countOn: true,
|
|
271
353
|
differences: []
|
|
272
354
|
});
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
355
|
+
var samePart = infoAboutDifferencesSameness.same.join('');
|
|
356
|
+
var differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
357
|
+
var currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, '');
|
|
276
358
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
277
359
|
}
|
|
360
|
+
|
|
278
361
|
onKeyUp(e.keyCode, e);
|
|
279
362
|
}
|
|
280
363
|
};
|
|
281
|
-
(0, _react.useEffect)(()
|
|
364
|
+
(0, _react.useEffect)(function () {
|
|
282
365
|
var _inputRef$current, _inputRef$current$foc;
|
|
283
|
-
|
|
366
|
+
|
|
367
|
+
if (isEditing) inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$foc = _inputRef$current.focus) === null || _inputRef$current$foc === void 0 ? void 0 : _inputRef$current$foc.call(_inputRef$current);
|
|
284
368
|
}, [isEditing, isFocused]);
|
|
285
|
-
(0, _react.useEffect)(()
|
|
369
|
+
(0, _react.useEffect)(function () {
|
|
286
370
|
setEditing(isSelect !== null && isSelect !== void 0 ? isSelect : false);
|
|
287
371
|
}, [isSelect]);
|
|
288
|
-
(0, _react.useEffect)(()
|
|
372
|
+
(0, _react.useEffect)(function () {
|
|
289
373
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
290
374
|
setIsAttemptToChange(null);
|
|
291
375
|
setIsToHighlightError(true);
|
|
292
|
-
setTimeout(()
|
|
376
|
+
setTimeout(function () {
|
|
293
377
|
setIsToHighlightError(false);
|
|
294
378
|
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
295
379
|
}
|
|
296
380
|
}, [isAttemptToChange]);
|
|
297
|
-
(0, _react.useEffect)(()
|
|
381
|
+
(0, _react.useEffect)(function () {
|
|
298
382
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === 'boolean') setIsFocused(isFocusDefault);
|
|
299
383
|
setEditing(isFocusDefault);
|
|
300
384
|
}, [inputRef, isFocusDefault]);
|
|
301
|
-
|
|
385
|
+
|
|
386
|
+
var getInputType = function getInputType() {
|
|
302
387
|
if (isPriceInput || isPseudoPasswordMode) return 'text';
|
|
303
388
|
return type;
|
|
304
389
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
390
|
+
|
|
391
|
+
var formatedValue = function () {
|
|
392
|
+
var safelyValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
393
|
+
|
|
394
|
+
var hideSymbols = function hideSymbols() {
|
|
395
|
+
return safelyValue.split('').map(function () {
|
|
396
|
+
return HIDE_SYMBOL;
|
|
397
|
+
}).join('');
|
|
398
|
+
};
|
|
399
|
+
|
|
308
400
|
if (isPseudoPasswordMode) return hideSymbols();
|
|
309
401
|
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) safelyValue = handle.correctMinMax(safelyValue, 'min');
|
|
310
402
|
if (isUseBitDepthPoints) safelyValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(safelyValue, onlyNumbers);
|
|
311
403
|
return safelyValue;
|
|
312
|
-
}
|
|
313
|
-
|
|
404
|
+
}();
|
|
405
|
+
|
|
406
|
+
var uniProps = _objectSpread(_objectSpread({
|
|
314
407
|
name: inputName,
|
|
315
408
|
className: (0, _classnames.default)('input', className, {
|
|
316
409
|
'input--with-icon': icon,
|
|
317
410
|
'input--with-delete': withDelete
|
|
318
411
|
}),
|
|
319
|
-
placeholder,
|
|
412
|
+
placeholder: placeholder,
|
|
320
413
|
value: formatedValue,
|
|
321
414
|
inputMode: isNumericMobileKeyboard ? 'numeric' : 'text',
|
|
322
|
-
disabled,
|
|
415
|
+
disabled: disabled,
|
|
323
416
|
onChange: handle.change,
|
|
324
417
|
onFocus: handle.focus,
|
|
325
418
|
onBlur: handle.blur,
|
|
326
419
|
onKeyUp: handle.keyUp,
|
|
327
|
-
onKeyDown: handle.keyDown
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
};
|
|
420
|
+
onKeyDown: handle.keyDown
|
|
421
|
+
}, maskChar ? {
|
|
422
|
+
maskChar: maskChar
|
|
423
|
+
} : {}), formatChars ? {
|
|
424
|
+
formatChars: formatChars
|
|
425
|
+
} : {});
|
|
426
|
+
|
|
335
427
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
336
|
-
className: (0, _classnames.default)("input__wrap", {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
onMouseEnter: () => setOnInputHover(true),
|
|
344
|
-
onMouseLeave: () => setOnInputHover(false)
|
|
428
|
+
className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap--disabled", disabled || isLoading)),
|
|
429
|
+
onMouseEnter: function onMouseEnter() {
|
|
430
|
+
return setOnInputHover(true);
|
|
431
|
+
},
|
|
432
|
+
onMouseLeave: function onMouseLeave() {
|
|
433
|
+
return setOnInputHover(false);
|
|
434
|
+
}
|
|
345
435
|
}, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
346
436
|
readOnly: isReadOnly,
|
|
347
437
|
"data-testid": "input--key-".concat(testId, "--type-").concat(type)
|
|
@@ -349,9 +439,9 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
349
439
|
ref: inputRef,
|
|
350
440
|
type: getInputType(),
|
|
351
441
|
autoComplete: isPseudoPasswordMode ? 'off' : autocomplete,
|
|
352
|
-
onFocus: function () {
|
|
442
|
+
onFocus: function onFocus() {
|
|
353
443
|
if (isUseAutoSelect) inputRef.current.select();
|
|
354
|
-
if (uniProps.onFocus) uniProps.onFocus(
|
|
444
|
+
if (uniProps.onFocus) uniProps.onFocus.apply(uniProps, arguments);
|
|
355
445
|
}
|
|
356
446
|
}, attributesOfNativeInput)), DynamicIconComponent !== null && DynamicIconComponent !== void 0 ? DynamicIconComponent : icon, action, withDelete && onInputHover && /*#__PURE__*/_react.default.createElement("span", {
|
|
357
447
|
"data-testid": "icon-close",
|
|
@@ -363,4 +453,6 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
363
453
|
size: "small"
|
|
364
454
|
}));
|
|
365
455
|
});
|
|
366
|
-
|
|
456
|
+
|
|
457
|
+
var _default = Input;
|
|
458
|
+
exports.default = _default;
|