intelicoreact 1.5.30 → 1.5.32
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 +1 -10
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -10
- package/dist/Atomic/FormElements/Calendar/Calendar.js +4 -24
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -10
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +2 -14
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +5 -54
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +3 -21
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +51 -144
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -7
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +24 -90
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +3 -15
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +15 -29
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +5 -15
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +16 -36
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +18 -38
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +18 -31
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +9 -38
- package/dist/Atomic/FormElements/Input/Input.js +29 -63
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
- package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +16 -46
- package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
- package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
- package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
- package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +50 -141
- package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
- package/dist/Atomic/FormElements/Label/Label.js +1 -9
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
- package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +6 -23
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +105 -223
- package/dist/Atomic/FormElements/Text/Text.js +10 -16
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
- package/dist/Atomic/FormElements/Textarea/Textarea.js +5 -16
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +3 -15
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
- package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
- package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
- package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -17
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
- package/dist/Atomic/UI/Alert/Alert.js +3 -19
- package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
- package/dist/Atomic/UI/Box/Box.js +3 -9
- package/dist/Atomic/UI/Button/Button.js +2 -11
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
- package/dist/Atomic/UI/Chart/Chart.js +4 -29
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
- package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
- package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
- package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -18
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
- package/dist/Atomic/UI/Hint/Hint.js +12 -42
- package/dist/Atomic/UI/Hint/partial/_utils.js +52 -0
- package/dist/Atomic/UI/Hint/partials/_utils.js +4 -19
- package/dist/Atomic/UI/Modal/Modal.js +6 -28
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
- package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
- package/dist/Atomic/UI/Price/Price.js +1 -7
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
- package/dist/Atomic/UI/Status/Status.js +1 -8
- package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
- package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
- package/dist/Atomic/UI/Table/Table.js +1 -12
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
- package/dist/Atomic/UI/Tag/Tag.js +11 -26
- package/dist/Atomic/UI/TagList/TagList.js +21 -47
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
- package/dist/Atomic/UI/WizardStepper/constructor.js +3 -11
- package/dist/Atomic/UI/WizardStepper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +0 -10
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -4
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +2 -17
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -15
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -5
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +2 -9
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -5
- package/dist/Classes/AbortableFetch.js +36 -93
- package/dist/Classes/AnimatedHandler.js +3 -7
- package/dist/Classes/RESTAPI/index.js +39 -43
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -46
- package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +19 -43
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +5 -16
- package/dist/Functions/customEventListener.js +4 -17
- package/dist/Functions/dateTime.js +5 -15
- package/dist/Functions/fieldValueFormatters.js +58 -90
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
- package/dist/Functions/locale/createTranslator.js +4 -9
- package/dist/Functions/operations.js +12 -22
- package/dist/Functions/presets/inputMaskPresets.js +9 -11
- package/dist/Functions/presets/inputPresets.js +8 -11
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -13
- package/dist/Functions/useBodyScrollLock.js +1 -6
- package/dist/Functions/useClickOutside.js +0 -4
- package/dist/Functions/useDebounce.js +2 -7
- package/dist/Functions/useFieldFocus.js +6 -18
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
- package/dist/Functions/useFormTools/functions/General.js +18 -28
- package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
- package/dist/Functions/useFormTools/index.js +85 -144
- package/dist/Functions/useInputHighlightError.js +3 -12
- package/dist/Functions/useIsMobile.js +7 -13
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
- package/dist/Functions/useLocalStorage.js +1 -9
- package/dist/Functions/useLocationParams.js +4 -5
- package/dist/Functions/useMediaQuery.js +1 -6
- package/dist/Functions/useMetaInfo.js +3 -10
- package/dist/Functions/useMouseUpOutside.js +0 -3
- package/dist/Functions/useOnlineStatus.js +1 -9
- package/dist/Functions/usePasswordChecker.js +4 -20
- package/dist/Functions/usePrevious.js +1 -5
- package/dist/Functions/useResize.js +2 -10
- package/dist/Functions/useScrollTo.js +2 -7
- package/dist/Functions/useToggle.js +1 -5
- package/dist/Functions/utils.js +76 -151
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
- package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
- package/dist/Molecular/CustomIcons/components/Button.js +2 -9
- package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/Close.js +2 -9
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
- package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
- package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
- package/dist/Molecular/CustomIcons/components/Email.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
- package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Key.js +2 -9
- package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
- package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
- package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
- package/dist/Molecular/CustomIcons/components/Play.js +2 -9
- package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
- package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
- package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
- package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
- package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
- package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
- package/dist/Molecular/CustomIcons/components/User.js +2 -9
- package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
- package/dist/Molecular/CustomIcons/components/X.js +2 -9
- package/dist/Molecular/CustomIcons/index.js +0 -122
- package/dist/Molecular/FormElement/FormElement.js +1 -12
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +33 -33
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +11 -13
- package/dist/Molecular/InputAddress/InputAddress.js +65 -114
- package/dist/Molecular/InputPassword/InputPassword.js +5 -19
- package/dist/index.js +0 -2
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
- 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
|
@@ -1,36 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _index = require("../../../Constants/index.constants");
|
|
17
|
-
|
|
18
12
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
19
|
-
|
|
20
13
|
var _utils = require("../../../Functions/utils");
|
|
21
|
-
|
|
22
14
|
var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
23
|
-
|
|
24
15
|
var _DynamicIcon = _interopRequireDefault(require("../../UI/DynamicIcon/DynamicIcon"));
|
|
25
|
-
|
|
26
16
|
require("./Input.scss");
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
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; }
|
|
32
19
|
// import InputMask from 'react-input-mask';
|
|
20
|
+
|
|
33
21
|
const HIDE_SYMBOL = "\u2022";
|
|
22
|
+
|
|
34
23
|
/**
|
|
35
24
|
* Input компонент.
|
|
36
25
|
*
|
|
@@ -66,7 +55,6 @@ const HIDE_SYMBOL = "\u2022";
|
|
|
66
55
|
* @param {boolean} props.isNotValidateASCII - Отключает проверку ASCII для вводимых символов.
|
|
67
56
|
* @param {boolean} props.isNumericMobileKeyboard - Отображает цифровую клавиатуру на мобильных устройствах.
|
|
68
57
|
*/
|
|
69
|
-
|
|
70
58
|
const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
71
59
|
let {
|
|
72
60
|
blurTrim,
|
|
@@ -117,13 +105,13 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
117
105
|
const DynamicIconComponent = iconDynamicKey && !icon ? /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, (0, _extends2.default)({
|
|
118
106
|
iconKey: iconDynamicKey
|
|
119
107
|
}, iconDynamicProps)) : null;
|
|
120
|
-
const DEFAULT_BLINK_TIME = 100;
|
|
121
|
-
|
|
108
|
+
const DEFAULT_BLINK_TIME = 100;
|
|
109
|
+
// STATES
|
|
122
110
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
123
111
|
const [isEditing, setEditing] = (0, _react.useState)(false);
|
|
124
112
|
const inputInnerRef = (0, _react.useRef)(null);
|
|
125
|
-
const inputRef = (0, _react.useMemo)(() => ref || inputInnerRef, [ref]);
|
|
126
|
-
|
|
113
|
+
const inputRef = (0, _react.useMemo)(() => ref || inputInnerRef, [ref]);
|
|
114
|
+
// const previousValueRef = useRef(value);
|
|
127
115
|
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
128
116
|
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
129
117
|
const [onInputHover, setOnInputHover] = (0, _react.useState)(false);
|
|
@@ -136,8 +124,9 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
136
124
|
const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
|
|
137
125
|
const isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
138
126
|
const inputName = name || fieldKey || id;
|
|
139
|
-
const isPseudoPasswordMode = type === "pseudoPassword";
|
|
127
|
+
const isPseudoPasswordMode = type === "pseudoPassword";
|
|
140
128
|
|
|
129
|
+
// HANDLES
|
|
141
130
|
const handle = {
|
|
142
131
|
correctMinMax: (value, correctionType) => {
|
|
143
132
|
if (!onlyNumbers) return value;
|
|
@@ -151,66 +140,57 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
151
140
|
const maximum = !Number.isNaN(Number(max)) && max !== null && (max >= 0 || !isOnlyPositive) ? max : undefined;
|
|
152
141
|
let minusSymbol;
|
|
153
142
|
let inputValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
154
|
-
|
|
155
143
|
const checkMin = () => {
|
|
156
144
|
var _minusSymbol;
|
|
157
|
-
|
|
158
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;
|
|
159
146
|
};
|
|
160
|
-
|
|
161
147
|
const checkMax = () => {
|
|
162
148
|
var _minusSymbol2;
|
|
163
|
-
|
|
164
149
|
if (!Number.isNaN(Number(maximum)) && Number(maximum) < Number(((_minusSymbol2 = minusSymbol) !== null && _minusSymbol2 !== void 0 ? _minusSymbol2 : "") + inputValue)) {
|
|
165
150
|
inputValue = maximum;
|
|
166
151
|
minusSymbol = null;
|
|
167
152
|
}
|
|
168
153
|
};
|
|
169
|
-
|
|
170
154
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
171
|
-
|
|
172
155
|
if (!isOnlyPositive && inputValue[0] === "-") {
|
|
173
156
|
minusSymbol = "-";
|
|
174
157
|
inputValue = inputValue.slice(1);
|
|
175
158
|
}
|
|
176
|
-
|
|
177
159
|
inputValue = (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
|
|
178
|
-
|
|
179
160
|
switch (correctionType) {
|
|
180
161
|
case "min":
|
|
181
162
|
checkMin();
|
|
182
163
|
break;
|
|
183
|
-
|
|
184
164
|
case "max":
|
|
185
165
|
checkMax();
|
|
186
166
|
break;
|
|
187
|
-
|
|
188
167
|
default:
|
|
189
168
|
checkMin();
|
|
190
169
|
checkMax();
|
|
191
170
|
break;
|
|
192
171
|
}
|
|
193
|
-
|
|
194
172
|
return inputValue;
|
|
195
173
|
},
|
|
196
174
|
processPseudoValue: (newValue, oldValue) => {
|
|
197
|
-
const insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, "g"), "");
|
|
198
|
-
//? По договоренности любой копипаст заменяет текущее велью
|
|
175
|
+
const insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, "g"), "");
|
|
199
176
|
|
|
177
|
+
//? Если insertedPart.length > 1, то это точно копи-паст
|
|
178
|
+
//? По договоренности любой копипаст заменяет текущее велью
|
|
200
179
|
if (insertedPart.length > 1) return insertedPart;
|
|
201
180
|
const isOldValueHasBeenReduced = newValue.replace(new RegExp(/^HIDE_SYMBOL/g), "").length < oldValue.length;
|
|
202
181
|
const oldValueArr = oldValue.split("");
|
|
203
|
-
|
|
204
182
|
const getIsInclude = idx => {
|
|
205
|
-
const BACKSPACE_CODE = 8;
|
|
183
|
+
const BACKSPACE_CODE = 8;
|
|
206
184
|
|
|
207
|
-
|
|
185
|
+
//? Если позиции не равны, значит была выделена область, значит будем воспринимать как копи-паст
|
|
186
|
+
if (keyDownData.start !== keyDownData.end) return false;
|
|
208
187
|
|
|
209
|
-
|
|
188
|
+
//? Если позиции равны и есть вставляемое значение - обрезаем "хвост"
|
|
189
|
+
if (insertedPart) return idx < keyDownData.start;
|
|
210
190
|
|
|
191
|
+
//? Если позиции равны и нет вставляемого значения - значит симвовол удалили
|
|
211
192
|
return keyDownData.keyCode === BACKSPACE_CODE ? idx < keyDownData.start - 1 || idx > keyDownData.end - 1 : idx < keyDownData.start || idx > keyDownData.end;
|
|
212
193
|
};
|
|
213
|
-
|
|
214
194
|
if (!insertedPart) return oldValueArr.reduce((acc, sym, idx) => getIsInclude(idx) ? "".concat(acc).concat(sym) : acc, "");
|
|
215
195
|
const outputStructure = oldValueArr.reduce((acc, sym, idx) => {
|
|
216
196
|
if (getIsInclude(idx)) acc.result = "".concat(acc.result).concat(sym);else if (!acc.position) acc.position = insertedPart ? idx : idx - 1;
|
|
@@ -224,21 +204,21 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
224
204
|
},
|
|
225
205
|
change: e => {
|
|
226
206
|
var _minusSymbol3;
|
|
227
|
-
|
|
228
207
|
const {
|
|
229
208
|
isOnlyPositive
|
|
230
209
|
} = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {};
|
|
231
210
|
let minusSymbol;
|
|
232
211
|
let inputValue = e.target ? e.target.value : e;
|
|
233
212
|
if (isPseudoPasswordMode) inputValue = inputValue.includes(HIDE_SYMBOL) ? handle.processPseudoValue(inputValue, value, e) : inputValue;
|
|
213
|
+
|
|
214
|
+
// If user typed comma(',') replace it to dot('.') for float value typing
|
|
215
|
+
if (isPriceInput && inputValue.charAt(inputValue.length - 1) === ',') inputValue = inputValue.substring(0, inputValue.length - 1).concat('.');
|
|
234
216
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
235
217
|
if (onlyNumbers) inputValue = inputValue.replace(/,/g, ".");
|
|
236
|
-
|
|
237
218
|
if (onlyNumbers && !isOnlyPositive && inputValue[0] === "-") {
|
|
238
219
|
minusSymbol = "-";
|
|
239
220
|
inputValue = inputValue.slice(1);
|
|
240
221
|
}
|
|
241
|
-
|
|
242
222
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
243
223
|
if (symbolsLimit && inputValue.length > Number(symbolsLimit)) inputValue = inputValue.substring(0, Number(symbolsLimit));
|
|
244
224
|
if (isCropFirstNool && inputValue[0] == 0) return "";else if (onlyNumbers) inputValue = handle.correctMinMax(inputValue, "max");
|
|
@@ -258,15 +238,14 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
258
238
|
if (trimEnd) inputValue = inputValue.replace(new RegExp("[".concat(characters, "]+$")), "");
|
|
259
239
|
if (value !== inputValue) onChange(inputValue);
|
|
260
240
|
setIsFocused(false);
|
|
261
|
-
setEditing(false);
|
|
241
|
+
setEditing(false);
|
|
242
|
+
// использую setTimeout для того чтоб прошли переназначения велью, если они есть,
|
|
262
243
|
// для того, чтоб верхний onBlur при обращении к e.target.value получал обновленное велью
|
|
263
|
-
|
|
264
244
|
if (onBlur) setTimeout(() => onBlur(e), 0);
|
|
265
245
|
},
|
|
266
246
|
keyDown: e => {
|
|
267
247
|
var _e$target;
|
|
268
|
-
|
|
269
|
-
setPreviousValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
248
|
+
setPreviousValue(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
270
249
|
setKeyDownData({
|
|
271
250
|
start: e.target.selectionStart,
|
|
272
251
|
end: e.target.selectionEnd,
|
|
@@ -296,14 +275,12 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
296
275
|
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
297
276
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
298
277
|
}
|
|
299
|
-
|
|
300
278
|
onKeyUp(e.keyCode, e);
|
|
301
279
|
}
|
|
302
280
|
};
|
|
303
281
|
(0, _react.useEffect)(() => {
|
|
304
282
|
var _inputRef$current, _inputRef$current$foc;
|
|
305
|
-
|
|
306
|
-
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);
|
|
283
|
+
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);
|
|
307
284
|
}, [isEditing, isFocused]);
|
|
308
285
|
(0, _react.useEffect)(() => {
|
|
309
286
|
setEditing(isSelect !== null && isSelect !== void 0 ? isSelect : false);
|
|
@@ -321,23 +298,18 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
321
298
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === "boolean") setIsFocused(isFocusDefault);
|
|
322
299
|
setEditing(isFocusDefault);
|
|
323
300
|
}, [inputRef, isFocusDefault]);
|
|
324
|
-
|
|
325
301
|
const getInputType = () => {
|
|
326
302
|
if (isPriceInput || isPseudoPasswordMode) return "text";
|
|
327
303
|
return type;
|
|
328
304
|
};
|
|
329
|
-
|
|
330
305
|
const formatedValue = (() => {
|
|
331
306
|
let safelyValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
332
|
-
|
|
333
307
|
const hideSymbols = () => safelyValue.split("").map(() => HIDE_SYMBOL).join("");
|
|
334
|
-
|
|
335
308
|
if (isPseudoPasswordMode) return hideSymbols();
|
|
336
309
|
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) safelyValue = handle.correctMinMax(safelyValue, "min");
|
|
337
310
|
if (isUseBitDepthPoints) safelyValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(safelyValue, onlyNumbers);
|
|
338
311
|
return safelyValue;
|
|
339
312
|
})();
|
|
340
|
-
|
|
341
313
|
const uniProps = {
|
|
342
314
|
name: inputName,
|
|
343
315
|
className: (0, _classnames.default)("input", className, {
|
|
@@ -380,23 +352,19 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
380
352
|
}, attributesOfNativeInput, {
|
|
381
353
|
onFocus: function () {
|
|
382
354
|
var _attributesOfNativeIn;
|
|
383
|
-
|
|
384
355
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
385
356
|
params[_key] = arguments[_key];
|
|
386
357
|
}
|
|
387
|
-
|
|
388
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 ? void 0 : _attributesOfNativeIn.call(attributesOfNativeInput, ...params);
|
|
358
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 || _attributesOfNativeIn.call(attributesOfNativeInput, ...params);
|
|
389
359
|
if (isUseAutoSelect) inputRef.current.select();
|
|
390
360
|
if (uniProps.onFocus) uniProps.onFocus(...params);
|
|
391
361
|
},
|
|
392
362
|
onBlur: function () {
|
|
393
363
|
var _attributesOfNativeIn2;
|
|
394
|
-
|
|
395
364
|
for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
396
365
|
params[_key2] = arguments[_key2];
|
|
397
366
|
}
|
|
398
|
-
|
|
399
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn2 = attributesOfNativeInput.onBlur) === null || _attributesOfNativeIn2 === void 0 ? void 0 : _attributesOfNativeIn2.call(attributesOfNativeInput, ...params);
|
|
367
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn2 = attributesOfNativeInput.onBlur) === null || _attributesOfNativeIn2 === void 0 || _attributesOfNativeIn2.call(attributesOfNativeInput, ...params);
|
|
400
368
|
if (uniProps.onBlur) uniProps.onBlur(...params);
|
|
401
369
|
}
|
|
402
370
|
})), DynamicIconComponent !== null && DynamicIconComponent !== void 0 ? DynamicIconComponent : icon, action, withDelete && onInputHover && /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -408,6 +376,4 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
408
376
|
size: "small"
|
|
409
377
|
}));
|
|
410
378
|
});
|
|
411
|
-
|
|
412
|
-
var _default = Input;
|
|
413
|
-
exports.default = _default;
|
|
379
|
+
var _default = exports.default = Input;
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
15
|
-
|
|
16
11
|
var _reactInputMask = _interopRequireDefault(require("react-input-mask"));
|
|
17
|
-
|
|
18
12
|
var _useClickOutside = require("../../../Functions/useClickOutside");
|
|
19
|
-
|
|
20
13
|
var _Calendar = _interopRequireDefault(require("../Calendar/Calendar"));
|
|
21
|
-
|
|
22
14
|
require("./InputCalendar.scss");
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
28
17
|
const InputCalendar = _ref => {
|
|
29
18
|
let {
|
|
30
19
|
value,
|
|
@@ -53,64 +42,50 @@ const InputCalendar = _ref => {
|
|
|
53
42
|
const momentMinDate = (0, _momentTimezone.default)(formattedMinDate, format).startOf("day");
|
|
54
43
|
const momentMaxDate = (0, _momentTimezone.default)(formattedMaxDate, format).startOf("day");
|
|
55
44
|
(0, _useClickOutside.useClickOutside)(calendarRef, () => setIsOpened(false));
|
|
56
|
-
|
|
57
45
|
const changeInputValue = val => {
|
|
58
46
|
if (onChange) onChange(val);
|
|
59
47
|
};
|
|
60
|
-
|
|
61
48
|
const changeCalendarDay = val => {
|
|
62
49
|
if (onChange) onChange(val);
|
|
63
50
|
};
|
|
64
|
-
|
|
65
51
|
const getCalendarValue = value => {
|
|
66
52
|
const date = (0, _momentTimezone.default)(value).format("L");
|
|
67
53
|
if (date !== "Invalid date") return date;
|
|
68
54
|
return (0, _momentTimezone.default)(new Date()).format("L");
|
|
69
55
|
};
|
|
70
|
-
|
|
71
56
|
(0, _react.useEffect)(() => {
|
|
72
57
|
if (typeof isOpened === "boolean" && !isOpened) {
|
|
73
58
|
handleBlur();
|
|
74
59
|
}
|
|
75
60
|
}, [isOpened]);
|
|
76
|
-
|
|
77
61
|
const handleBlur = e => {
|
|
78
62
|
var _inputRef$current;
|
|
79
|
-
|
|
80
|
-
let value = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
|
|
63
|
+
let value = inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
|
|
81
64
|
if ((0, _momentTimezone.default)(value, format).format(format) === "Invalid date" || value.indexOf("_") > -1) value = "";
|
|
82
65
|
if (value && typeof isOpened === "boolean" && (0, _momentTimezone.default)(value, format).startOf("day").isBefore(momentMinDate, "days")) onChange(formattedMinDate);else if (value && typeof isOpened === "boolean" && (0, _momentTimezone.default)(value, format).endOf("day").isAfter(momentMaxDate, "days")) onChange(formattedMaxDate);else if (value) onChange((0, _momentTimezone.default)(value, format).format(format));
|
|
83
66
|
};
|
|
84
|
-
|
|
85
67
|
const onKeyDown = e => {
|
|
86
68
|
if (isOpened && [9, 13].includes(e.keyCode)) {
|
|
87
69
|
setIsOpened(false);
|
|
88
70
|
setOpenedByEnter(true);
|
|
89
71
|
}
|
|
90
|
-
|
|
91
72
|
onKeyDownProp(e);
|
|
92
73
|
};
|
|
93
|
-
|
|
94
74
|
const onKeyUp = e => {
|
|
95
75
|
var _e$target$value;
|
|
96
|
-
|
|
97
76
|
const isValidLenght = ((_e$target$value = e.target.value) === null || _e$target$value === void 0 ? void 0 : _e$target$value.replace(/[^0-9]/g, "").length) === 8;
|
|
98
|
-
|
|
99
77
|
if ([9, 13].includes(e.keyCode)) {
|
|
100
78
|
setIsOpened(true);
|
|
101
79
|
setOpenedByEnter(true);
|
|
102
80
|
}
|
|
103
|
-
|
|
104
81
|
if (isValidLenght) {
|
|
105
82
|
setIsOpened(false);
|
|
106
83
|
handleBlur();
|
|
107
84
|
} else {
|
|
108
85
|
setIsOpened(true);
|
|
109
86
|
}
|
|
110
|
-
|
|
111
87
|
onKeyUpProp(e);
|
|
112
88
|
};
|
|
113
|
-
|
|
114
89
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
115
90
|
"data-testid": testId,
|
|
116
91
|
className: (0, _classnames.default)("input__wrap calendar-container", className, {
|
|
@@ -143,6 +118,4 @@ const InputCalendar = _ref => {
|
|
|
143
118
|
setIsOpened: setIsOpened
|
|
144
119
|
}) : null);
|
|
145
120
|
};
|
|
146
|
-
|
|
147
|
-
var _default = InputCalendar;
|
|
148
|
-
exports.default = _default;
|
|
121
|
+
var _default = exports.default = InputCalendar;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
17
|
-
|
|
18
12
|
var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
19
|
-
|
|
20
13
|
require("./InputColor.scss");
|
|
21
|
-
|
|
22
14
|
const InputColor = _ref => {
|
|
23
15
|
let {
|
|
24
16
|
value,
|
|
@@ -37,8 +29,8 @@ const InputColor = _ref => {
|
|
|
37
29
|
const {
|
|
38
30
|
withSharp,
|
|
39
31
|
isTurnOn: isHex
|
|
40
|
-
} = withHexFormat;
|
|
41
|
-
|
|
32
|
+
} = withHexFormat;
|
|
33
|
+
// HANDLES
|
|
42
34
|
const handle = {
|
|
43
35
|
change: e => {
|
|
44
36
|
let inputValue = e !== null && e !== void 0 && e.target ? e.target.value : e;
|
|
@@ -48,7 +40,7 @@ const InputColor = _ref => {
|
|
|
48
40
|
withSharp: withSharp
|
|
49
41
|
});
|
|
50
42
|
if (symbolsLimit && inputValue.length > Number(symbolsLimit)) inputValue = inputValue.substring(0, Number(symbolsLimit));
|
|
51
|
-
onChange === null || onChange === void 0
|
|
43
|
+
onChange === null || onChange === void 0 || onChange(inputValue);
|
|
52
44
|
}
|
|
53
45
|
};
|
|
54
46
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -68,6 +60,4 @@ const InputColor = _ref => {
|
|
|
68
60
|
type: "text"
|
|
69
61
|
})));
|
|
70
62
|
};
|
|
71
|
-
|
|
72
|
-
var _default = InputColor;
|
|
73
|
-
exports.default = _default;
|
|
63
|
+
var _default = exports.default = InputColor;
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
17
|
-
|
|
18
12
|
require("./InputCurrency.scss");
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
24
15
|
const InputCurrency = _ref => {
|
|
25
16
|
let {
|
|
26
17
|
currencySymbol = "$",
|
|
@@ -42,11 +33,9 @@ const InputCurrency = _ref => {
|
|
|
42
33
|
const [inputValue, setInputValue] = (0, _react.useState)(currencySymbol);
|
|
43
34
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
44
35
|
const inputRef = (0, _react.useRef)(null);
|
|
45
|
-
|
|
46
36
|
const formatNumberWithCommas = number => {
|
|
47
37
|
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
48
38
|
};
|
|
49
|
-
|
|
50
39
|
const formatCurrencyInput = event => {
|
|
51
40
|
let newValue = event.target.value;
|
|
52
41
|
newValue = newValue.replace(currencySymbol, "");
|
|
@@ -56,40 +45,32 @@ const InputCurrency = _ref => {
|
|
|
56
45
|
setInputValue(newValue);
|
|
57
46
|
if (value !== parseFloat(preparedValue)) onChange(!isNaN(parseFloat(preparedValue)) ? parseFloat(preparedValue) : "");
|
|
58
47
|
};
|
|
59
|
-
|
|
60
48
|
const onInputClick = () => {
|
|
61
49
|
if (!inputValue) {
|
|
62
50
|
inputRef.current.selectionStart = inputRef.current.selectionEnd = currencySymbol ? currencySymbol.length : 1;
|
|
63
51
|
}
|
|
64
52
|
};
|
|
65
|
-
|
|
66
53
|
const onKeyDown = event => {
|
|
67
54
|
if (event.key.match(/^[a-zA-Z0-9]$/)) {
|
|
68
55
|
setInputValue(inputValue.slice(0, inputRef.current.selectionStart));
|
|
69
56
|
}
|
|
70
57
|
};
|
|
71
|
-
|
|
72
58
|
const checkMinMax = (event, value) => {
|
|
73
59
|
var _event$target;
|
|
74
|
-
|
|
75
|
-
const clearValue = value !== null && value !== void 0 ? value : (0, _fieldValueFormatters.filterNumeric)(event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, onlyNumbers);
|
|
60
|
+
const clearValue = value !== null && value !== void 0 ? value : (0, _fieldValueFormatters.filterNumeric)(event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, onlyNumbers);
|
|
76
61
|
if (!clearValue) return false;
|
|
77
|
-
|
|
78
62
|
if (clearValue < min) {
|
|
79
63
|
setInputValue("".concat(currencySymbol).concat(formatNumberWithCommas(min)));
|
|
80
64
|
onChange(min);
|
|
81
65
|
return false;
|
|
82
66
|
}
|
|
83
|
-
|
|
84
67
|
if (max && clearValue > max) {
|
|
85
68
|
setInputValue("".concat(currencySymbol).concat(formatNumberWithCommas(max)));
|
|
86
69
|
onChange(max);
|
|
87
70
|
return false;
|
|
88
71
|
}
|
|
89
|
-
|
|
90
72
|
return true;
|
|
91
73
|
};
|
|
92
|
-
|
|
93
74
|
(0, _react.useEffect)(() => {
|
|
94
75
|
if (value && parseFloat(value) !== parseFloat((0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers))) {
|
|
95
76
|
if (checkMinMax(null, value)) setInputValue("".concat(currencySymbol).concat(formatNumberWithCommas(value)));
|
|
@@ -112,19 +93,15 @@ const InputCurrency = _ref => {
|
|
|
112
93
|
}, attributesOfNativeInput, {
|
|
113
94
|
onFocus: e => {
|
|
114
95
|
var _attributesOfNativeIn;
|
|
115
|
-
|
|
116
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 ? void 0 : _attributesOfNativeIn.call(attributesOfNativeInput, e);
|
|
96
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 || _attributesOfNativeIn.call(attributesOfNativeInput, e);
|
|
117
97
|
setIsFocused(true);
|
|
118
98
|
},
|
|
119
99
|
onBlur: (e, value) => {
|
|
120
100
|
var _attributesOfNativeIn2;
|
|
121
|
-
|
|
122
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn2 = attributesOfNativeInput.onBlur) === null || _attributesOfNativeIn2 === void 0 ? void 0 : _attributesOfNativeIn2.call(attributesOfNativeInput, e);
|
|
101
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn2 = attributesOfNativeInput.onBlur) === null || _attributesOfNativeIn2 === void 0 || _attributesOfNativeIn2.call(attributesOfNativeInput, e);
|
|
123
102
|
if (!isNoCheckMinMax) checkMinMax(e, value);
|
|
124
103
|
setIsFocused(false);
|
|
125
104
|
}
|
|
126
105
|
})));
|
|
127
106
|
};
|
|
128
|
-
|
|
129
|
-
var _default = InputCurrency;
|
|
130
|
-
exports.default = _default;
|
|
107
|
+
var _default = exports.default = InputCurrency;
|