intelicoreact 1.4.83 → 1.4.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +14 -22
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +14 -22
- package/dist/Atomic/FormElements/Calendar/Calendar.js +67 -122
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +266 -430
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +161 -283
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +85 -141
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +62 -79
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +4 -0
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +75 -126
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
- package/dist/Atomic/FormElements/Input/Input.js +160 -256
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
- package/dist/Atomic/FormElements/InputColor/InputColor.js +26 -41
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +38 -76
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +109 -177
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +77 -194
- package/dist/Atomic/FormElements/InputLink/InputLink.js +32 -58
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
- package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +299 -459
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +51 -113
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
- package/dist/Atomic/FormElements/Label/Label.js +14 -24
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
- package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +148 -326
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +389 -588
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
- package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +23 -41
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +47 -98
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +485 -713
- package/dist/Atomic/FormElements/Text/Text.js +47 -53
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
- package/dist/Atomic/FormElements/Textarea/Textarea.js +31 -47
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -123
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +21 -48
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +35 -77
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
- package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
- package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +48 -104
- package/dist/Atomic/UI/AccordionText/AccordionText.js +21 -54
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +47 -92
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
- package/dist/Atomic/UI/Alert/Alert.js +22 -51
- package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
- package/dist/Atomic/UI/Box/Box.js +14 -21
- package/dist/Atomic/UI/Button/Button.js +26 -35
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
- package/dist/Atomic/UI/Chart/Chart.js +45 -86
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
- package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +13 -37
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
- package/dist/Atomic/UI/DoubleString/DoubleString.js +34 -63
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
- package/dist/Atomic/UI/Hint/Hint.js +67 -122
- package/dist/Atomic/UI/Hint/partial/_utils.js +52 -0
- package/dist/Atomic/UI/Hint/partials/_utils.js +14 -29
- package/dist/Atomic/UI/Modal/Modal.js +147 -184
- package/dist/Atomic/UI/Modal/ModalHOC.js +15 -26
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +99 -161
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
- package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
- package/dist/Atomic/UI/Price/Price.js +10 -13
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +28 -58
- package/dist/Atomic/UI/Status/Status.js +19 -30
- package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
- package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
- package/dist/Atomic/UI/Table/Table.js +27 -47
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -6
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +22 -39
- package/dist/Atomic/UI/Tag/Tag.js +59 -94
- package/dist/Atomic/UI/TagList/TagList.js +81 -144
- package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
- package/dist/Atomic/UI/WizardStepper/constructor.js +7 -15
- package/dist/Atomic/UI/WizardStepper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +20 -26
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +26 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +23 -42
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +40 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
- package/dist/Classes/AbortableFetch.js +283 -422
- package/dist/Classes/AnimatedHandler.js +44 -56
- package/dist/Classes/RESTAPI/index.js +158 -441
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
- package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +83 -353
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +161 -403
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +159 -400
- package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +103 -398
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +14 -33
- package/dist/Functions/customEventListener.js +9 -24
- package/dist/Functions/fieldValueFormatters.js +147 -209
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
- package/dist/Functions/locale/createTranslator.js +13 -28
- package/dist/Functions/operations.js +35 -49
- package/dist/Functions/presets/inputMaskPresets.js +25 -27
- package/dist/Functions/presets/inputPresets.js +19 -22
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -15
- package/dist/Functions/useBodyScrollLock.js +4 -9
- package/dist/Functions/useClickOutside.js +3 -7
- package/dist/Functions/useDebounce.js +11 -25
- package/dist/Functions/useFieldFocus.js +42 -67
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
- package/dist/Functions/useFormTools/functions/General.js +80 -99
- package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
- package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
- package/dist/Functions/useFormTools/index.js +380 -592
- package/dist/Functions/useInputHighlightError.js +27 -52
- package/dist/Functions/useIsMobile.js +15 -39
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +10 -15
- package/dist/Functions/useKeyPress/useKeyPress.js +18 -35
- package/dist/Functions/useLocalStorage.js +7 -22
- package/dist/Functions/useLocationParams.js +16 -27
- package/dist/Functions/useMediaQuery.js +10 -27
- package/dist/Functions/useMetaInfo.js +19 -50
- package/dist/Functions/useMouseUpOutside.js +2 -5
- package/dist/Functions/useOnlineStatus.js +7 -26
- package/dist/Functions/usePasswordChecker.js +42 -77
- package/dist/Functions/usePrevious.js +3 -7
- package/dist/Functions/useResize.js +12 -32
- package/dist/Functions/useScrollTo.js +6 -20
- package/dist/Functions/useToggle.js +10 -30
- package/dist/Functions/utils.js +188 -386
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
- package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
- package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
- package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
- package/dist/Molecular/CustomIcons/components/Button.js +11 -22
- package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
- package/dist/Molecular/CustomIcons/components/Close.js +13 -24
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
- package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
- package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
- package/dist/Molecular/CustomIcons/components/Email.js +29 -40
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
- package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
- package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
- package/dist/Molecular/CustomIcons/components/Key.js +19 -30
- package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
- package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
- package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
- package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
- package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
- package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
- package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
- package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
- package/dist/Molecular/CustomIcons/components/Play.js +24 -35
- package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
- package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
- package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
- package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
- package/dist/Molecular/CustomIcons/components/Star.js +10 -21
- package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
- package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
- package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
- package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
- package/dist/Molecular/CustomIcons/components/User.js +16 -27
- package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
- package/dist/Molecular/CustomIcons/components/X.js +11 -22
- package/dist/Molecular/CustomIcons/index.js +61 -183
- package/dist/Molecular/FormElement/FormElement.js +19 -28
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +91 -112
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -37
- package/dist/Molecular/InputAddress/InputAddress.js +176 -312
- package/dist/Molecular/InputPassword/InputPassword.js +15 -39
- package/dist/index.js +1 -3
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -119
- package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
- package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
- package/dist/Functions/presets/inputMaskPreset.js +0 -176
|
@@ -1,45 +1,25 @@
|
|
|
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
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
|
|
18
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
11
|
var _index = require("../../../Constants/index.constants");
|
|
23
|
-
|
|
24
12
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
25
|
-
|
|
26
13
|
var _utils = require("../../../Functions/utils");
|
|
27
|
-
|
|
28
14
|
var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
29
|
-
|
|
30
15
|
var _DynamicIcon = _interopRequireDefault(require("../../UI/DynamicIcon/DynamicIcon"));
|
|
31
|
-
|
|
32
16
|
require("./Input.scss");
|
|
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
|
+
// import InputMask from 'react-input-mask';
|
|
33
20
|
|
|
34
|
-
|
|
21
|
+
const HIDE_SYMBOL = "\u2022";
|
|
35
22
|
|
|
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; }
|
|
37
|
-
|
|
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; }
|
|
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";
|
|
43
23
|
/**
|
|
44
24
|
* Input компонент.
|
|
45
25
|
*
|
|
@@ -75,258 +55,194 @@ var HIDE_SYMBOL = "\u2022";
|
|
|
75
55
|
* @param {boolean} props.isNotValidateASCII - Отключает проверку ASCII для вводимых символов.
|
|
76
56
|
* @param {boolean} props.isNumericMobileKeyboard - Отображает цифровую клавиатуру на мобильных устройствах.
|
|
77
57
|
*/
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
_ref$attributesOfNati = _ref.attributesOfNativeInput,
|
|
135
|
-
attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati;
|
|
136
|
-
|
|
137
|
-
var _ref2 = blurTrim || {},
|
|
138
|
-
trimStart = _ref2.trimStart,
|
|
139
|
-
trimEnd = _ref2.trimEnd,
|
|
140
|
-
characters = _ref2.characters;
|
|
141
|
-
|
|
142
|
-
var DynamicIconComponent = iconDynamicKey && !icon ? /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, (0, _extends2.default)({
|
|
58
|
+
const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
59
|
+
let {
|
|
60
|
+
blurTrim,
|
|
61
|
+
autocomplete = "off",
|
|
62
|
+
isSelect,
|
|
63
|
+
onChange = () => {},
|
|
64
|
+
onBlur = () => {},
|
|
65
|
+
onFocus = () => {},
|
|
66
|
+
onKeyUp = () => {},
|
|
67
|
+
onKeyDown = () => {},
|
|
68
|
+
isNotBlinkErrors,
|
|
69
|
+
isPriceInput,
|
|
70
|
+
onlyNumbers,
|
|
71
|
+
disabled,
|
|
72
|
+
withDelete,
|
|
73
|
+
value,
|
|
74
|
+
placeholder,
|
|
75
|
+
className,
|
|
76
|
+
type = "text",
|
|
77
|
+
mask,
|
|
78
|
+
maskChar,
|
|
79
|
+
formatChars,
|
|
80
|
+
error,
|
|
81
|
+
icon,
|
|
82
|
+
iconDynamicKey,
|
|
83
|
+
iconDynamicProps = {},
|
|
84
|
+
symbolsLimit,
|
|
85
|
+
blinkTime,
|
|
86
|
+
isFocusDefault = false,
|
|
87
|
+
isNotValidateASCII = false,
|
|
88
|
+
isNumericMobileKeyboard = false,
|
|
89
|
+
isCropFirstNool = false,
|
|
90
|
+
testId = "input",
|
|
91
|
+
action,
|
|
92
|
+
isUseAutoSelect = true,
|
|
93
|
+
isReadOnly = false,
|
|
94
|
+
isLoading = false,
|
|
95
|
+
name,
|
|
96
|
+
fieldKey,
|
|
97
|
+
id,
|
|
98
|
+
attributesOfNativeInput = {}
|
|
99
|
+
} = _ref;
|
|
100
|
+
const {
|
|
101
|
+
trimStart,
|
|
102
|
+
trimEnd,
|
|
103
|
+
characters
|
|
104
|
+
} = blurTrim || {};
|
|
105
|
+
const DynamicIconComponent = iconDynamicKey && !icon ? /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, (0, _extends2.default)({
|
|
143
106
|
iconKey: iconDynamicKey
|
|
144
107
|
}, iconDynamicProps)) : null;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
var inputInnerRef = (0, _react.useRef)(null);
|
|
158
|
-
var inputRef = (0, _react.useMemo)(function () {
|
|
159
|
-
return ref || inputInnerRef;
|
|
160
|
-
}, [ref]); // const previousValueRef = useRef(value);
|
|
161
|
-
|
|
162
|
-
var _useState5 = (0, _react.useState)(false),
|
|
163
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
164
|
-
isAttemptToChange = _useState6[0],
|
|
165
|
-
setIsAttemptToChange = _useState6[1];
|
|
166
|
-
|
|
167
|
-
var _useState7 = (0, _react.useState)(false),
|
|
168
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
169
|
-
isToHighlightError = _useState8[0],
|
|
170
|
-
setIsToHighlightError = _useState8[1];
|
|
171
|
-
|
|
172
|
-
var _useState9 = (0, _react.useState)(false),
|
|
173
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
174
|
-
onInputHover = _useState10[0],
|
|
175
|
-
setOnInputHover = _useState10[1];
|
|
176
|
-
|
|
177
|
-
var _useState11 = (0, _react.useState)(value),
|
|
178
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
179
|
-
prevValue = _useState12[0],
|
|
180
|
-
setPreviousValue = _useState12[1];
|
|
181
|
-
|
|
182
|
-
var _useState13 = (0, _react.useState)({
|
|
108
|
+
const DEFAULT_BLINK_TIME = 100;
|
|
109
|
+
// STATES
|
|
110
|
+
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
111
|
+
const [isEditing, setEditing] = (0, _react.useState)(false);
|
|
112
|
+
const inputInnerRef = (0, _react.useRef)(null);
|
|
113
|
+
const inputRef = (0, _react.useMemo)(() => ref || inputInnerRef, [ref]);
|
|
114
|
+
// const previousValueRef = useRef(value);
|
|
115
|
+
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
116
|
+
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
117
|
+
const [onInputHover, setOnInputHover] = (0, _react.useState)(false);
|
|
118
|
+
const [prevValue, setPreviousValue] = (0, _react.useState)(value);
|
|
119
|
+
const [keyDownData, setKeyDownData] = (0, _react.useState)({
|
|
183
120
|
start: null,
|
|
184
121
|
end: null,
|
|
185
122
|
keyCode: null
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var handle = {
|
|
197
|
-
correctMinMax: function correctMinMax(value, correctionType) {
|
|
123
|
+
});
|
|
124
|
+
const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
|
|
125
|
+
const isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
126
|
+
const inputName = name || fieldKey || id;
|
|
127
|
+
const isPseudoPasswordMode = type === "pseudoPassword";
|
|
128
|
+
|
|
129
|
+
// HANDLES
|
|
130
|
+
const handle = {
|
|
131
|
+
correctMinMax: (value, correctionType) => {
|
|
198
132
|
if (!onlyNumbers) return value;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var checkMin = function checkMin() {
|
|
133
|
+
const {
|
|
134
|
+
min,
|
|
135
|
+
max,
|
|
136
|
+
isOnlyPositive,
|
|
137
|
+
isNoEmptyValues
|
|
138
|
+
} = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {};
|
|
139
|
+
const minimum = !Number.isNaN(Number(min)) && min !== null && (min >= 0 || !isOnlyPositive) ? min : undefined;
|
|
140
|
+
const maximum = !Number.isNaN(Number(max)) && max !== null && (max >= 0 || !isOnlyPositive) ? max : undefined;
|
|
141
|
+
let minusSymbol;
|
|
142
|
+
let inputValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
143
|
+
const checkMin = () => {
|
|
212
144
|
var _minusSymbol;
|
|
213
|
-
|
|
214
145
|
if (!inputValue && isNoEmptyValues) inputValue = minimum !== undefined ? minimum : "0";else if (inputValue && !Number.isNaN(Number(minimum)) && Number(minimum) > Number(((_minusSymbol = minusSymbol) !== null && _minusSymbol !== void 0 ? _minusSymbol : "") + inputValue)) inputValue = minimum;
|
|
215
146
|
};
|
|
216
|
-
|
|
217
|
-
var checkMax = function checkMax() {
|
|
147
|
+
const checkMax = () => {
|
|
218
148
|
var _minusSymbol2;
|
|
219
|
-
|
|
220
149
|
if (!Number.isNaN(Number(maximum)) && Number(maximum) < Number(((_minusSymbol2 = minusSymbol) !== null && _minusSymbol2 !== void 0 ? _minusSymbol2 : "") + inputValue)) {
|
|
221
150
|
inputValue = maximum;
|
|
222
151
|
minusSymbol = null;
|
|
223
152
|
}
|
|
224
153
|
};
|
|
225
|
-
|
|
226
154
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
227
|
-
|
|
228
155
|
if (!isOnlyPositive && inputValue[0] === "-") {
|
|
229
156
|
minusSymbol = "-";
|
|
230
157
|
inputValue = inputValue.slice(1);
|
|
231
158
|
}
|
|
232
|
-
|
|
233
159
|
inputValue = (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
|
|
234
|
-
|
|
235
160
|
switch (correctionType) {
|
|
236
161
|
case "min":
|
|
237
162
|
checkMin();
|
|
238
163
|
break;
|
|
239
|
-
|
|
240
164
|
case "max":
|
|
241
165
|
checkMax();
|
|
242
166
|
break;
|
|
243
|
-
|
|
244
167
|
default:
|
|
245
168
|
checkMin();
|
|
246
169
|
checkMax();
|
|
247
170
|
break;
|
|
248
171
|
}
|
|
249
|
-
|
|
250
172
|
return inputValue;
|
|
251
173
|
},
|
|
252
|
-
processPseudoValue:
|
|
253
|
-
|
|
254
|
-
//? По договоренности любой копипаст заменяет текущее велью
|
|
174
|
+
processPseudoValue: (newValue, oldValue) => {
|
|
175
|
+
const insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, "g"), "");
|
|
255
176
|
|
|
177
|
+
//? Если insertedPart.length > 1, то это точно копи-паст
|
|
178
|
+
//? По договоренности любой копипаст заменяет текущее велью
|
|
256
179
|
if (insertedPart.length > 1) return insertedPart;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var BACKSPACE_CODE = 8; //? Если позиции не равны, значит была выделена область, значит будем воспринимать как копи-паст
|
|
180
|
+
const isOldValueHasBeenReduced = newValue.replace(new RegExp(/^HIDE_SYMBOL/g), "").length < oldValue.length;
|
|
181
|
+
const oldValueArr = oldValue.split("");
|
|
182
|
+
const getIsInclude = idx => {
|
|
183
|
+
const BACKSPACE_CODE = 8;
|
|
262
184
|
|
|
263
|
-
|
|
185
|
+
//? Если позиции не равны, значит была выделена область, значит будем воспринимать как копи-паст
|
|
186
|
+
if (keyDownData.start !== keyDownData.end) return false;
|
|
264
187
|
|
|
265
|
-
|
|
188
|
+
//? Если позиции равны и есть вставляемое значение - обрезаем "хвост"
|
|
189
|
+
if (insertedPart) return idx < keyDownData.start;
|
|
266
190
|
|
|
191
|
+
//? Если позиции равны и нет вставляемого значения - значит симвовол удалили
|
|
267
192
|
return keyDownData.keyCode === BACKSPACE_CODE ? idx < keyDownData.start - 1 || idx > keyDownData.end - 1 : idx < keyDownData.start || idx > keyDownData.end;
|
|
268
193
|
};
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return getIsInclude(idx) ? "".concat(acc).concat(sym) : acc;
|
|
272
|
-
}, "");
|
|
273
|
-
var outputStructure = oldValueArr.reduce(function (acc, sym, idx) {
|
|
194
|
+
if (!insertedPart) return oldValueArr.reduce((acc, sym, idx) => getIsInclude(idx) ? "".concat(acc).concat(sym) : acc, "");
|
|
195
|
+
const outputStructure = oldValueArr.reduce((acc, sym, idx) => {
|
|
274
196
|
if (getIsInclude(idx)) acc.result = "".concat(acc.result).concat(sym);else if (!acc.position) acc.position = insertedPart ? idx : idx - 1;
|
|
275
197
|
return acc;
|
|
276
198
|
}, {
|
|
277
199
|
result: "",
|
|
278
200
|
position: !isOldValueHasBeenReduced ? keyDownData.start : null
|
|
279
201
|
});
|
|
280
|
-
|
|
202
|
+
const output = "".concat(outputStructure.result.slice(0, outputStructure.position)).concat(insertedPart).concat(outputStructure.result.slice(outputStructure.position));
|
|
281
203
|
return output;
|
|
282
204
|
},
|
|
283
|
-
change:
|
|
205
|
+
change: e => {
|
|
284
206
|
var _minusSymbol3;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
var inputValue = e.target ? e.target.value : e;
|
|
207
|
+
const {
|
|
208
|
+
isOnlyPositive
|
|
209
|
+
} = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {};
|
|
210
|
+
let minusSymbol;
|
|
211
|
+
let inputValue = e.target ? e.target.value : e;
|
|
291
212
|
if (isPseudoPasswordMode) inputValue = inputValue.includes(HIDE_SYMBOL) ? handle.processPseudoValue(inputValue, value, e) : inputValue;
|
|
292
213
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
293
214
|
if (onlyNumbers) inputValue = inputValue.replace(/,/g, ".");
|
|
294
|
-
|
|
295
215
|
if (onlyNumbers && !isOnlyPositive && inputValue[0] === "-") {
|
|
296
216
|
minusSymbol = "-";
|
|
297
217
|
inputValue = inputValue.slice(1);
|
|
298
218
|
}
|
|
299
|
-
|
|
300
219
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
301
220
|
if (symbolsLimit && inputValue.length > Number(symbolsLimit)) inputValue = inputValue.substring(0, Number(symbolsLimit));
|
|
302
221
|
if (isCropFirstNool && inputValue[0] == 0) return "";else if (onlyNumbers) inputValue = handle.correctMinMax(inputValue, "max");
|
|
303
222
|
onChange((((_minusSymbol3 = minusSymbol) !== null && _minusSymbol3 !== void 0 ? _minusSymbol3 : "") + inputValue).toString());
|
|
304
223
|
},
|
|
305
|
-
toggleEdit:
|
|
224
|
+
toggleEdit: () => {
|
|
306
225
|
setEditing(!isEditing);
|
|
307
226
|
onChange("");
|
|
308
227
|
},
|
|
309
|
-
focus:
|
|
228
|
+
focus: e => {
|
|
310
229
|
setIsFocused(true);
|
|
311
230
|
onFocus(e);
|
|
312
231
|
},
|
|
313
|
-
blur:
|
|
314
|
-
|
|
232
|
+
blur: e => {
|
|
233
|
+
let inputValue = handle.correctMinMax((0, _fieldValueFormatters.getSafelyValue)(value), "min");
|
|
315
234
|
if (trimStart) inputValue = inputValue.replace(new RegExp("^[".concat(characters, "]+")), "");
|
|
316
235
|
if (trimEnd) inputValue = inputValue.replace(new RegExp("[".concat(characters, "]+$")), "");
|
|
317
236
|
if (value !== inputValue) onChange(inputValue);
|
|
318
237
|
setIsFocused(false);
|
|
319
|
-
setEditing(false);
|
|
238
|
+
setEditing(false);
|
|
239
|
+
// использую setTimeout для того чтоб прошли переназначения велью, если они есть,
|
|
320
240
|
// для того, чтоб верхний onBlur при обращении к e.target.value получал обновленное велью
|
|
321
|
-
|
|
322
|
-
if (onBlur) setTimeout(function () {
|
|
323
|
-
return onBlur(e);
|
|
324
|
-
}, 0);
|
|
241
|
+
if (onBlur) setTimeout(() => onBlur(e), 0);
|
|
325
242
|
},
|
|
326
|
-
keyDown:
|
|
243
|
+
keyDown: e => {
|
|
327
244
|
var _e$target;
|
|
328
|
-
|
|
329
|
-
setPreviousValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
245
|
+
setPreviousValue(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
330
246
|
setKeyDownData({
|
|
331
247
|
start: e.target.selectionStart,
|
|
332
248
|
end: e.target.selectionEnd,
|
|
@@ -334,13 +250,13 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
334
250
|
});
|
|
335
251
|
onKeyDown(e.keyCode, e);
|
|
336
252
|
},
|
|
337
|
-
keyUp:
|
|
253
|
+
keyUp: e => {
|
|
338
254
|
if (isUseErrorsBlink) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
255
|
+
const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
|
|
256
|
+
const previousValue = "".concat(prevValue);
|
|
257
|
+
const short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
258
|
+
const long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
259
|
+
const infoAboutDifferencesSameness = short.split("").reduce((acc, symbol, idx) => {
|
|
344
260
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
345
261
|
acc.countOn = false;
|
|
346
262
|
acc.differences.push([idx, symbol]);
|
|
@@ -351,86 +267,78 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
351
267
|
countOn: true,
|
|
352
268
|
differences: []
|
|
353
269
|
});
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
270
|
+
const samePart = infoAboutDifferencesSameness.same.join("");
|
|
271
|
+
const differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
272
|
+
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
357
273
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
358
274
|
}
|
|
359
|
-
|
|
360
275
|
onKeyUp(e.keyCode, e);
|
|
361
276
|
}
|
|
362
277
|
};
|
|
363
|
-
(0, _react.useEffect)(
|
|
278
|
+
(0, _react.useEffect)(() => {
|
|
364
279
|
var _inputRef$current, _inputRef$current$foc;
|
|
365
|
-
|
|
366
|
-
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);
|
|
280
|
+
if (isEditing) inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || (_inputRef$current$foc = _inputRef$current.focus) === null || _inputRef$current$foc === void 0 || _inputRef$current$foc.call(_inputRef$current);
|
|
367
281
|
}, [isEditing, isFocused]);
|
|
368
|
-
(0, _react.useEffect)(
|
|
282
|
+
(0, _react.useEffect)(() => {
|
|
369
283
|
setEditing(isSelect !== null && isSelect !== void 0 ? isSelect : false);
|
|
370
284
|
}, [isSelect]);
|
|
371
|
-
(0, _react.useEffect)(
|
|
285
|
+
(0, _react.useEffect)(() => {
|
|
372
286
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
373
287
|
setIsAttemptToChange(null);
|
|
374
288
|
setIsToHighlightError(true);
|
|
375
|
-
setTimeout(
|
|
289
|
+
setTimeout(() => {
|
|
376
290
|
setIsToHighlightError(false);
|
|
377
291
|
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
378
292
|
}
|
|
379
293
|
}, [isAttemptToChange]);
|
|
380
|
-
(0, _react.useEffect)(
|
|
294
|
+
(0, _react.useEffect)(() => {
|
|
381
295
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === "boolean") setIsFocused(isFocusDefault);
|
|
382
296
|
setEditing(isFocusDefault);
|
|
383
297
|
}, [inputRef, isFocusDefault]);
|
|
384
|
-
|
|
385
|
-
var getInputType = function getInputType() {
|
|
298
|
+
const getInputType = () => {
|
|
386
299
|
if (isPriceInput || isPseudoPasswordMode) return "text";
|
|
387
300
|
return type;
|
|
388
301
|
};
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
var hideSymbols = function hideSymbols() {
|
|
394
|
-
return safelyValue.split("").map(function () {
|
|
395
|
-
return HIDE_SYMBOL;
|
|
396
|
-
}).join("");
|
|
397
|
-
};
|
|
398
|
-
|
|
302
|
+
const formatedValue = (() => {
|
|
303
|
+
let safelyValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
304
|
+
const hideSymbols = () => safelyValue.split("").map(() => HIDE_SYMBOL).join("");
|
|
399
305
|
if (isPseudoPasswordMode) return hideSymbols();
|
|
400
306
|
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) safelyValue = handle.correctMinMax(safelyValue, "min");
|
|
401
307
|
if (isUseBitDepthPoints) safelyValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(safelyValue, onlyNumbers);
|
|
402
308
|
return safelyValue;
|
|
403
|
-
}();
|
|
404
|
-
|
|
405
|
-
var uniProps = _objectSpread(_objectSpread({
|
|
309
|
+
})();
|
|
310
|
+
const uniProps = {
|
|
406
311
|
name: inputName,
|
|
407
312
|
className: (0, _classnames.default)("input", className, {
|
|
408
313
|
"input--with-icon": icon,
|
|
409
314
|
"input--with-delete": withDelete
|
|
410
315
|
}),
|
|
411
|
-
placeholder
|
|
316
|
+
placeholder,
|
|
412
317
|
value: formatedValue,
|
|
413
318
|
inputMode: isNumericMobileKeyboard ? "numeric" : "text",
|
|
414
|
-
disabled
|
|
319
|
+
disabled,
|
|
415
320
|
onChange: handle.change,
|
|
416
321
|
onFocus: handle.focus,
|
|
417
322
|
onBlur: handle.blur,
|
|
418
323
|
onKeyUp: handle.keyUp,
|
|
419
|
-
onKeyDown: handle.keyDown
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
formatChars
|
|
424
|
-
|
|
425
|
-
|
|
324
|
+
onKeyDown: handle.keyDown,
|
|
325
|
+
...(maskChar ? {
|
|
326
|
+
maskChar
|
|
327
|
+
} : {}),
|
|
328
|
+
...(formatChars ? {
|
|
329
|
+
formatChars
|
|
330
|
+
} : {})
|
|
331
|
+
};
|
|
426
332
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
427
|
-
className: (0, _classnames.default)("input__wrap",
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
333
|
+
className: (0, _classnames.default)("input__wrap", {
|
|
334
|
+
["input__wrap_focus"]: isFocused
|
|
335
|
+
}, {
|
|
336
|
+
["input__wrap_error"]: error || isToHighlightError
|
|
337
|
+
}, {
|
|
338
|
+
["input__wrap--disabled"]: disabled || isLoading
|
|
339
|
+
}),
|
|
340
|
+
onMouseEnter: () => setOnInputHover(true),
|
|
341
|
+
onMouseLeave: () => setOnInputHover(false)
|
|
434
342
|
}, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
435
343
|
readOnly: isReadOnly,
|
|
436
344
|
"data-testid": "input--key-".concat(testId, "--type-").concat(type)
|
|
@@ -439,16 +347,14 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
439
347
|
type: getInputType(),
|
|
440
348
|
autoComplete: isPseudoPasswordMode ? "off" : autocomplete
|
|
441
349
|
}, attributesOfNativeInput, {
|
|
442
|
-
onFocus: function
|
|
350
|
+
onFocus: function () {
|
|
443
351
|
var _attributesOfNativeIn;
|
|
444
|
-
|
|
445
352
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
446
353
|
params[_key] = arguments[_key];
|
|
447
354
|
}
|
|
448
|
-
|
|
449
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 ? void 0 : _attributesOfNativeIn.call.apply(_attributesOfNativeIn, [attributesOfNativeInput].concat(params));
|
|
355
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 || _attributesOfNativeIn.call(attributesOfNativeInput, ...params);
|
|
450
356
|
if (isUseAutoSelect) inputRef.current.select();
|
|
451
|
-
if (uniProps.onFocus) uniProps.onFocus
|
|
357
|
+
if (uniProps.onFocus) uniProps.onFocus(...params);
|
|
452
358
|
}
|
|
453
359
|
})), DynamicIconComponent !== null && DynamicIconComponent !== void 0 ? DynamicIconComponent : icon, action, withDelete && onInputHover && /*#__PURE__*/_react.default.createElement("span", {
|
|
454
360
|
"data-testid": "icon-close",
|
|
@@ -460,6 +366,4 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
460
366
|
size: "small"
|
|
461
367
|
}));
|
|
462
368
|
});
|
|
463
|
-
|
|
464
|
-
var _default = Input;
|
|
465
|
-
exports.default = _default;
|
|
369
|
+
var _default = exports.default = Input;
|