intelicoreact 1.8.3 → 1.8.5
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/Dropdown/components/DropdownLoader.jsx +18 -0
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +121 -0
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +507 -0
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +46 -0
- package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +337 -0
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +66 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +78 -0
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +54 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +183 -0
- package/dist/Atomic/FormElements/RangeList/RangeList.jsx +181 -0
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +41 -0
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +449 -0
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +865 -0
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +37 -0
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +48 -0
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +62 -0
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +175 -0
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +65 -0
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +118 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1
- package/dist/Atomic/FormElements/Text/Text.jsx +126 -0
- package/dist/Atomic/FormElements/Textarea/Textarea.jsx +61 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +181 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +60 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +83 -0
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +80 -0
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +103 -0
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +115 -0
- package/dist/Atomic/Layout/Header/Header.jsx +86 -0
- package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +250 -0
- package/dist/Atomic/UI/AccordionText/AccordionText.jsx +68 -0
- package/dist/Atomic/UI/Arrow/Arrow.jsx +134 -0
- package/dist/Atomic/UI/Box/Box.jsx +53 -0
- package/dist/Atomic/UI/Chart/Chart.jsx +178 -0
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +78 -0
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +334 -0
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +111 -0
- package/dist/Atomic/UI/DateTime/DateTime.jsx +57 -0
- package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +44 -0
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +15 -0
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +223 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +75 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +86 -0
- package/dist/Atomic/UI/PieChart/PieChart.jsx +41 -0
- package/dist/Atomic/UI/Table/Partials/TdCell.jsx +87 -0
- package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +36 -0
- package/dist/Atomic/UI/Table/Partials/TdRow.jsx +103 -0
- package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +55 -0
- package/dist/Atomic/UI/Table/Table.jsx +63 -0
- package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +80 -0
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +26 -0
- package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +13 -0
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +56 -0
- package/dist/Atomic/UI/Tag/Tag.interface.ts +1 -0
- package/dist/Atomic/UI/Tag/Tag.js +1 -1
- package/dist/Atomic/UI/TagList/TagList.jsx +256 -0
- package/dist/Atomic/UI/WizardStepper/constructor.jsx +86 -0
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +254 -0
- package/dist/Functions/customEventListener.jsx +96 -0
- package/dist/Functions/operations.jsx +138 -0
- package/dist/Functions/useFormTools/functions/RenderFields.jsx +108 -0
- package/dist/Functions/useFormTools/index.jsx +777 -0
- package/dist/Functions/usePasswordChecker.jsx +128 -0
- package/dist/Functions/utils.jsx +492 -0
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +22 -0
- package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +24 -0
- package/dist/Molecular/CustomIcons/components/AppStore.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/Arrow.jsx +33 -0
- package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/Bell.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Button.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/Campaigns.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Check.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Check2.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +28 -0
- package/dist/Molecular/CustomIcons/components/Close.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/Delete.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Edit.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Email.jsx +32 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +19 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +36 -0
- package/dist/Molecular/CustomIcons/components/Flows.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Gift.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +20 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +21 -0
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +20 -0
- package/dist/Molecular/CustomIcons/components/Home.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Home2.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/Key.jsx +24 -0
- package/dist/Molecular/CustomIcons/components/Landers.jsx +21 -0
- package/dist/Molecular/CustomIcons/components/Lock.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Mail.jsx +27 -0
- package/dist/Molecular/CustomIcons/components/Mastercard.jsx +74 -0
- package/dist/Molecular/CustomIcons/components/Minus.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Offers.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Pause.jsx +29 -0
- package/dist/Molecular/CustomIcons/components/PayPal.jsx +42 -0
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +29 -0
- package/dist/Molecular/CustomIcons/components/Phone.jsx +31 -0
- package/dist/Molecular/CustomIcons/components/Play.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Plus.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Profile.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/QRCode.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/Rectangle.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/Revert.jsx +14 -0
- package/dist/Molecular/CustomIcons/components/Star.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Star2.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Trash.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/TrashRed.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Triggers.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/User.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Visa.jsx +32 -0
- package/dist/Molecular/CustomIcons/components/X.jsx +13 -0
- package/dist/Molecular/FormElement/FormElement.jsx +52 -0
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +161 -0
- package/dist/Molecular/InputAddress/InputAddress.jsx +641 -0
- package/dist/Molecular/InputPassword/InputPassword.jsx +50 -0
- package/package.json +13 -6
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +0 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +0 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +0 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +0 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +0 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +0 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +0 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +0 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +0 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +0 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +0 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +0 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +0 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +0 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +0 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +0 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.d.ts +0 -16
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +0 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +0 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.d.ts +0 -9
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.d.ts +0 -5
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.d.ts +0 -79
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.js +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.js.map +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js.map +0 -1
- package/dist/Atomic/FormElements/Text/Text.js +0 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +0 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +0 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +0 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +0 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +0 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +0 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +0 -1
- package/dist/Atomic/Layout/Header/Header.js +0 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +0 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +0 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +0 -1
- package/dist/Atomic/UI/Box/Box.js +0 -1
- package/dist/Atomic/UI/Chart/Chart.js +0 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +0 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +0 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +0 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +0 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +0 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +0 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +0 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +0 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +0 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +0 -1
- package/dist/Atomic/UI/Table/Table.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +0 -1
- package/dist/Atomic/UI/TagList/TagList.js +0 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +0 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +0 -1
- package/dist/Functions/customEventListener.js +0 -1
- package/dist/Functions/operations.js +0 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +0 -1
- package/dist/Functions/useFormTools/index.js +0 -1
- package/dist/Functions/usePasswordChecker.js +0 -1
- package/dist/Functions/utils.js +0 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +0 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +0 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +0 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +0 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +0 -1
- package/dist/Molecular/CustomIcons/components/Button.js +0 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +0 -1
- package/dist/Molecular/CustomIcons/components/Check.js +0 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/Close.js +0 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +0 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +0 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +0 -1
- package/dist/Molecular/CustomIcons/components/Email.js +0 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +0 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +0 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +0 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +0 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +0 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +0 -1
- package/dist/Molecular/CustomIcons/components/Home.js +0 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +0 -1
- package/dist/Molecular/CustomIcons/components/Key.js +0 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +0 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +0 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +0 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +0 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +0 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +0 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +0 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +0 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +0 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +0 -1
- package/dist/Molecular/CustomIcons/components/Play.js +0 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +0 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +0 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +0 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +0 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +0 -1
- package/dist/Molecular/CustomIcons/components/Star.js +0 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +0 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +0 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +0 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +0 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +0 -1
- package/dist/Molecular/CustomIcons/components/User.js +0 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +0 -1
- package/dist/Molecular/CustomIcons/components/X.js +0 -1
- package/dist/Molecular/FormElement/FormElement.js +0 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +0 -1
- package/dist/Molecular/InputAddress/InputAddress.js +0 -1
- package/dist/Molecular/InputPassword/InputPassword.js +0 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Minus, Plus } from 'react-feather';
|
|
5
|
+
|
|
6
|
+
import { KEYBOARD_SERVICE_KEYS } from '../../../Constants/index.constants';
|
|
7
|
+
import {
|
|
8
|
+
formatToAddBitDepthPoints as addCommas,
|
|
9
|
+
filterNumeric,
|
|
10
|
+
formatToRemoveComa as removeCommas,
|
|
11
|
+
} from '../../../Functions/fieldValueFormatters';
|
|
12
|
+
import Spinner from '../../Layout/Spinner/Spinner';
|
|
13
|
+
|
|
14
|
+
import './NumericInput.scss';
|
|
15
|
+
|
|
16
|
+
function NumericInput({
|
|
17
|
+
disabled,
|
|
18
|
+
withDelete,
|
|
19
|
+
numStep = 1,
|
|
20
|
+
min = 0,
|
|
21
|
+
max,
|
|
22
|
+
value,
|
|
23
|
+
placeholder,
|
|
24
|
+
className,
|
|
25
|
+
testId = 'numeric-input',
|
|
26
|
+
name,
|
|
27
|
+
fieldKey,
|
|
28
|
+
id,
|
|
29
|
+
|
|
30
|
+
onChange = () => {},
|
|
31
|
+
onBlur = () => {},
|
|
32
|
+
onFocus = () => {},
|
|
33
|
+
onKeyUp = () => {},
|
|
34
|
+
onKeyDown = () => {},
|
|
35
|
+
|
|
36
|
+
maskChar,
|
|
37
|
+
formatChars,
|
|
38
|
+
error,
|
|
39
|
+
icon,
|
|
40
|
+
isNotBlinkErrors,
|
|
41
|
+
blinkTime,
|
|
42
|
+
isPriceInput,
|
|
43
|
+
isFocusDefault = false,
|
|
44
|
+
isNotRenderButtons = false,
|
|
45
|
+
isUseAutoSelect = true,
|
|
46
|
+
isLoading = false,
|
|
47
|
+
isAllowNullValue = false,
|
|
48
|
+
onlyNumbers = {
|
|
49
|
+
type: 'int',
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
attributesOfNativeInput = {},
|
|
53
|
+
}) {
|
|
54
|
+
const DEFAULT_BLINK_TIME = 200;
|
|
55
|
+
|
|
56
|
+
// REFS
|
|
57
|
+
const inputRef = useRef(null);
|
|
58
|
+
const decRef = useRef(null);
|
|
59
|
+
const incRef = useRef(null);
|
|
60
|
+
const wrapRef = useRef(null);
|
|
61
|
+
|
|
62
|
+
// STATES
|
|
63
|
+
const initialMin = isAllowNullValue ? '' : min;
|
|
64
|
+
const [inputValue, setInputValue] = useState(value || initialMin);
|
|
65
|
+
const [inputValueFormated, setInputValueFormated] = useState(inputValue);
|
|
66
|
+
const [intMemoVal, setIntMemoVal] = useState(0);
|
|
67
|
+
|
|
68
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
69
|
+
|
|
70
|
+
const [isAttemptToChange, setIsAttemptToChange] = useState(false);
|
|
71
|
+
const [isToHighlightError, setIsToHighlightError] = useState(false);
|
|
72
|
+
|
|
73
|
+
const [prevValue, setPreviousValue] = useState(value || initialMin);
|
|
74
|
+
|
|
75
|
+
const setCursorToEnd = () => {
|
|
76
|
+
const input = inputRef.current;
|
|
77
|
+
const cursor = input?.value?.length;
|
|
78
|
+
if (input) setTimeout(() => input.setSelectionRange(cursor, cursor), 10);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// HANDLES
|
|
82
|
+
const handle = {
|
|
83
|
+
change: (e) => {
|
|
84
|
+
const inputValue = e.target
|
|
85
|
+
? filterNumeric(e.target.value, onlyNumbers)
|
|
86
|
+
: filterNumeric(e, onlyNumbers);
|
|
87
|
+
setInputValue(inputValue.toString());
|
|
88
|
+
},
|
|
89
|
+
clear: () => {
|
|
90
|
+
handle.change(initialMin || '');
|
|
91
|
+
},
|
|
92
|
+
focus: (e) => {
|
|
93
|
+
setIsFocused(true);
|
|
94
|
+
if (onFocus) onFocus(e);
|
|
95
|
+
},
|
|
96
|
+
blur: (e) => {
|
|
97
|
+
setIsFocused(false);
|
|
98
|
+
|
|
99
|
+
if (Number.isNaN(inputValue) || inputValue < min)
|
|
100
|
+
setInputValue(initialMin);
|
|
101
|
+
if (max && Number(max) < inputValue) setInputValue(max);
|
|
102
|
+
|
|
103
|
+
if (onBlur) onBlur(e);
|
|
104
|
+
},
|
|
105
|
+
keyDown: (e) => {
|
|
106
|
+
setPreviousValue(e?.target?.value);
|
|
107
|
+
onKeyDown(e.keyCode, e);
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
keyUp: (e) => {
|
|
111
|
+
if (!isNotBlinkErrors) {
|
|
112
|
+
const changedValue = String(value ?? '');
|
|
113
|
+
const previousValue = String(prevValue);
|
|
114
|
+
|
|
115
|
+
const short
|
|
116
|
+
= previousValue.length <= changedValue.length
|
|
117
|
+
? previousValue
|
|
118
|
+
: changedValue;
|
|
119
|
+
const long
|
|
120
|
+
= previousValue.length > changedValue.length
|
|
121
|
+
? previousValue
|
|
122
|
+
: changedValue;
|
|
123
|
+
|
|
124
|
+
const infoAboutDifferencesSameness = short.split('').reduce(
|
|
125
|
+
(acc, symbol, idx) => {
|
|
126
|
+
if (acc.countOn && symbol === long[idx]) {
|
|
127
|
+
acc.same.push(symbol);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
acc.countOn = false;
|
|
131
|
+
acc.differences.push([idx, symbol]);
|
|
132
|
+
}
|
|
133
|
+
return acc;
|
|
134
|
+
},
|
|
135
|
+
{ same: [], countOn: true, differences: [] },
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const samePart = infoAboutDifferencesSameness.same.join('');
|
|
139
|
+
const differencesLength
|
|
140
|
+
= infoAboutDifferencesSameness.differences.length;
|
|
141
|
+
const currentSet = changedValue?.replace(samePart, '');
|
|
142
|
+
|
|
143
|
+
if (
|
|
144
|
+
!KEYBOARD_SERVICE_KEYS.includes(e.key)
|
|
145
|
+
&& changedValue === previousValue
|
|
146
|
+
) {
|
|
147
|
+
setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (onKeyUp) onKeyUp(e.keyCode, e.target.value);
|
|
152
|
+
},
|
|
153
|
+
decrement: (e) => {
|
|
154
|
+
let newValue = Number(intMemoVal) - Number(numStep);
|
|
155
|
+
if (newValue < min) newValue = min;
|
|
156
|
+
else if (newValue > max) newValue = max;
|
|
157
|
+
|
|
158
|
+
handle.change(newValue);
|
|
159
|
+
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
inputRef?.current?.focus();
|
|
162
|
+
setCursorToEnd();
|
|
163
|
+
}, 100);
|
|
164
|
+
},
|
|
165
|
+
increment: (e) => {
|
|
166
|
+
let newValue = Number(intMemoVal) + Number(numStep);
|
|
167
|
+
if (newValue < min) newValue = min;
|
|
168
|
+
else if (newValue > max) newValue = max;
|
|
169
|
+
|
|
170
|
+
handle.change(newValue);
|
|
171
|
+
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
inputRef?.current?.focus();
|
|
174
|
+
setCursorToEnd();
|
|
175
|
+
}, 100);
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// Check Outside Click
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
const handleClickOutside = (event) => {
|
|
182
|
+
if (!wrapRef.current.contains(event.target)) setIsFocused(false);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
document.addEventListener('mousedown', handleClickOutside, true);
|
|
186
|
+
return () =>
|
|
187
|
+
document.removeEventListener('mousedown', handleClickOutside, true);
|
|
188
|
+
}, []);
|
|
189
|
+
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if (!isNotBlinkErrors && isAttemptToChange) {
|
|
192
|
+
setIsAttemptToChange(false);
|
|
193
|
+
setIsToHighlightError(true);
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
setIsToHighlightError(false);
|
|
196
|
+
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
197
|
+
}
|
|
198
|
+
}, [isAttemptToChange]);
|
|
199
|
+
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
if (value && value !== inputValue) setInputValue(value);
|
|
202
|
+
}, [value]);
|
|
203
|
+
|
|
204
|
+
// On Input Value Change
|
|
205
|
+
useEffect(() => {
|
|
206
|
+
if (inputValue !== value) setIsFocused(true);
|
|
207
|
+
|
|
208
|
+
setInputValueFormated(
|
|
209
|
+
isPriceInput && inputValue?.length > 0
|
|
210
|
+
? isFocused
|
|
211
|
+
? removeCommas(inputValue)
|
|
212
|
+
: addCommas(inputValue)
|
|
213
|
+
: inputValue,
|
|
214
|
+
);
|
|
215
|
+
setIntMemoVal(removeCommas(inputValue));
|
|
216
|
+
|
|
217
|
+
if (typeof onChange === 'function' && value !== undefined && +inputValue !== +value) onChange(inputValue?.toString());
|
|
218
|
+
}, [inputValue]);
|
|
219
|
+
|
|
220
|
+
// On Integer Value Change
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (isNaN(intMemoVal)) setIntMemoVal(min || 0);
|
|
223
|
+
}, [intMemoVal]);
|
|
224
|
+
|
|
225
|
+
// On Focuse Change
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
let formatedValue = inputValue;
|
|
228
|
+
if (isPriceInput) {
|
|
229
|
+
formatedValue = isFocused
|
|
230
|
+
? removeCommas(inputValue)
|
|
231
|
+
: addCommas(inputValue);
|
|
232
|
+
}
|
|
233
|
+
setInputValueFormated(formatedValue);
|
|
234
|
+
|
|
235
|
+
if (isFocused) {
|
|
236
|
+
if (typeof onFocus === 'function') onFocus({ target: inputRef?.current });
|
|
237
|
+
inputRef?.current?.focus();
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
if (typeof onBlur === 'function') onBlur({ target: inputRef?.current });
|
|
241
|
+
inputRef?.current?.blur();
|
|
242
|
+
}
|
|
243
|
+
}, [isFocused]);
|
|
244
|
+
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
if (inputRef?.current && typeof isFocusDefault === 'boolean')
|
|
247
|
+
setIsFocused(isFocusDefault);
|
|
248
|
+
}, [inputRef, isFocusDefault]);
|
|
249
|
+
|
|
250
|
+
function renderInput() {
|
|
251
|
+
const uniProps = {
|
|
252
|
+
name: name || fieldKey || id || testId || '',
|
|
253
|
+
className: `input ${className || ''}`,
|
|
254
|
+
placeholder,
|
|
255
|
+
value: inputValueFormated,
|
|
256
|
+
disabled,
|
|
257
|
+
onChange: handle.change,
|
|
258
|
+
onFocus: handle.focus,
|
|
259
|
+
onBlur: handle.blur,
|
|
260
|
+
onKeyDown: handle.keyDown,
|
|
261
|
+
onKeyUp: handle.keyUp,
|
|
262
|
+
min,
|
|
263
|
+
max,
|
|
264
|
+
...(maskChar ? { maskChar } : {}),
|
|
265
|
+
...(formatChars ? { formatChars } : {}),
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
<>
|
|
270
|
+
<input
|
|
271
|
+
{...uniProps}
|
|
272
|
+
data-testid={`${testId}-input`}
|
|
273
|
+
value={value?.length > 0 ? addCommas(removeCommas(value)) : value}
|
|
274
|
+
ref={inputRef}
|
|
275
|
+
type="text"
|
|
276
|
+
onFocus={(...params) => {
|
|
277
|
+
if (isUseAutoSelect) inputRef.current.select();
|
|
278
|
+
if (uniProps.onFocus) uniProps.onFocus(...params);
|
|
279
|
+
}}
|
|
280
|
+
{...attributesOfNativeInput}
|
|
281
|
+
/>
|
|
282
|
+
|
|
283
|
+
{!isNotRenderButtons
|
|
284
|
+
? (
|
|
285
|
+
<div className="input__nums">
|
|
286
|
+
<button
|
|
287
|
+
data-testid={`${testId}-minus-btn`}
|
|
288
|
+
ref={decRef}
|
|
289
|
+
className={cn('input__num-btn', {
|
|
290
|
+
'events-none': Number(value) <= min,
|
|
291
|
+
})}
|
|
292
|
+
onMouseDown={e => handle.decrement(e)}
|
|
293
|
+
>
|
|
294
|
+
<Minus className={cn({ disabled: Number(value) <= min })} />
|
|
295
|
+
</button>
|
|
296
|
+
<button
|
|
297
|
+
data-testid={`-${testId}-plus-btn`}
|
|
298
|
+
ref={incRef}
|
|
299
|
+
className={cn('input__num-btn', {
|
|
300
|
+
'events-none': Number(value) >= max,
|
|
301
|
+
})}
|
|
302
|
+
onMouseDown={e => handle.increment(e)}
|
|
303
|
+
>
|
|
304
|
+
<Plus className={cn({ disabled: Number(value) >= max })} />
|
|
305
|
+
</button>
|
|
306
|
+
</div>
|
|
307
|
+
)
|
|
308
|
+
: null}
|
|
309
|
+
</>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return (
|
|
314
|
+
<div
|
|
315
|
+
data-testid={testId}
|
|
316
|
+
ref={wrapRef}
|
|
317
|
+
className={cn(
|
|
318
|
+
`input__wrap`,
|
|
319
|
+
{ [`input__wrap_focus`]: isFocused },
|
|
320
|
+
{ [`input__wrap_error`]: error || isToHighlightError },
|
|
321
|
+
{ [`input__wrap--disabled`]: disabled || isLoading },
|
|
322
|
+
)}
|
|
323
|
+
>
|
|
324
|
+
{renderInput()}
|
|
325
|
+
{icon}
|
|
326
|
+
{withDelete && (
|
|
327
|
+
<span
|
|
328
|
+
className={cn(`input__close`, { hidden: !inputValue })}
|
|
329
|
+
onClick={() => handle.clear()}
|
|
330
|
+
/>
|
|
331
|
+
)}
|
|
332
|
+
{isLoading && <Spinner size="small" />}
|
|
333
|
+
</div>
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export default NumericInput;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import RadioInput from '../RadioInput/RadioInput';
|
|
6
|
+
|
|
7
|
+
import './RadioGroup.scss';
|
|
8
|
+
|
|
9
|
+
function RadioGroup({
|
|
10
|
+
className,
|
|
11
|
+
disabled,
|
|
12
|
+
value,
|
|
13
|
+
onChange = () => {},
|
|
14
|
+
direction = 'row',
|
|
15
|
+
options = [],
|
|
16
|
+
}) {
|
|
17
|
+
const [values, setValues] = useState(options);
|
|
18
|
+
|
|
19
|
+
useLayoutEffect(
|
|
20
|
+
() =>
|
|
21
|
+
setValues(
|
|
22
|
+
options.map(item =>
|
|
23
|
+
item.value === value ? { ...item, checked: value } : item,
|
|
24
|
+
),
|
|
25
|
+
),
|
|
26
|
+
[options, value],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const handle = {
|
|
30
|
+
change: (value) => {
|
|
31
|
+
const newValues = values.map((item) => {
|
|
32
|
+
if (item.value === value) {
|
|
33
|
+
return {
|
|
34
|
+
...item,
|
|
35
|
+
checked: value,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
id: item.id,
|
|
40
|
+
label: item.label,
|
|
41
|
+
value: item.value,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
setValues(newValues);
|
|
45
|
+
onChange(value);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className={cn('radio-group', className, `radio-group--${direction}`, {
|
|
51
|
+
'radio-group--disabled': disabled,
|
|
52
|
+
})}
|
|
53
|
+
>
|
|
54
|
+
{values.map(item => (
|
|
55
|
+
<RadioInput
|
|
56
|
+
key={item.id}
|
|
57
|
+
{...item}
|
|
58
|
+
onChange={handle.change}
|
|
59
|
+
checked={item.checked}
|
|
60
|
+
/>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import FormElement from '../../../Molecular/FormElement/FormElement';
|
|
4
|
+
import Alert from '../../UI/Alert/Alert';
|
|
5
|
+
|
|
6
|
+
import Input from './../Input/Input';
|
|
7
|
+
import RadioInput from './../RadioInput/RadioInput';
|
|
8
|
+
|
|
9
|
+
import './RadioGroupWithInput.scss';
|
|
10
|
+
|
|
11
|
+
function RadioGroupWithInput({
|
|
12
|
+
alert,
|
|
13
|
+
className,
|
|
14
|
+
disabled,
|
|
15
|
+
onChange = () => {},
|
|
16
|
+
direction = 'row',
|
|
17
|
+
options = [],
|
|
18
|
+
}) {
|
|
19
|
+
const handle = {
|
|
20
|
+
changeRadio: (value, el) => {
|
|
21
|
+
const newOptions = options.map((item) => {
|
|
22
|
+
return {
|
|
23
|
+
...item,
|
|
24
|
+
checked: el.value === item.value ? item.value : false,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
onChange(newOptions);
|
|
28
|
+
},
|
|
29
|
+
changeInput: (value, el) => {
|
|
30
|
+
el.input.value = value;
|
|
31
|
+
onChange(options);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div className="radio-group-input-box">
|
|
37
|
+
{alert && <Alert className="mb10" {...alert} />}
|
|
38
|
+
<div
|
|
39
|
+
className={cn(
|
|
40
|
+
'radio-group-input',
|
|
41
|
+
className,
|
|
42
|
+
`radio-group-input--${direction}`,
|
|
43
|
+
{
|
|
44
|
+
'radio-group-input--disabled': disabled,
|
|
45
|
+
},
|
|
46
|
+
)}
|
|
47
|
+
>
|
|
48
|
+
{options?.map((item) => {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
key={item.id}
|
|
52
|
+
className={cn(
|
|
53
|
+
'radio-group-input-item',
|
|
54
|
+
`radio-group-input-item-${item.id}`,
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
<RadioInput
|
|
58
|
+
{...item}
|
|
59
|
+
onChange={value => handle.changeRadio(value, item)}
|
|
60
|
+
checked={item.checked}
|
|
61
|
+
/>
|
|
62
|
+
{item.input && item.checked && (
|
|
63
|
+
<FormElement {...item.input}>
|
|
64
|
+
<Input
|
|
65
|
+
onChange={value => handle.changeInput(value, item)}
|
|
66
|
+
{...item.input}
|
|
67
|
+
/>
|
|
68
|
+
</FormElement>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
})}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default RadioGroupWithInput;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import "./RadioRowSwitcher.scss";
|
|
4
|
+
|
|
5
|
+
const classNames = require("classnames");
|
|
6
|
+
|
|
7
|
+
function RadioRowSwitcher({ onChange, radios, label = '', value = '' }) {
|
|
8
|
+
const handle = {
|
|
9
|
+
change: (newValue) => {
|
|
10
|
+
if (newValue === value) onChange('');
|
|
11
|
+
else onChange(newValue);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const itemClass = key =>
|
|
16
|
+
classNames('radio-row-switcher__item', {
|
|
17
|
+
[`radio-row-switcher__item--active`]: key === value,
|
|
18
|
+
});
|
|
19
|
+
const sliderClass = key =>
|
|
20
|
+
classNames(
|
|
21
|
+
'radio-row-switcher__slider',
|
|
22
|
+
`radio-row-switcher__slider--${key}`,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="radio-row-switcher">
|
|
27
|
+
{label && <div className="radio-row-switcher__label">{label}</div>}
|
|
28
|
+
|
|
29
|
+
<div className="radio-row-switcher__items-box">
|
|
30
|
+
{radios.map((item) => {
|
|
31
|
+
return (
|
|
32
|
+
<React.Fragment key={item.key}>
|
|
33
|
+
<div
|
|
34
|
+
onClick={() => handle.change(item.key)}
|
|
35
|
+
className={itemClass(item.key)}
|
|
36
|
+
>
|
|
37
|
+
{item.label}
|
|
38
|
+
</div>
|
|
39
|
+
</React.Fragment>
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
|
+
|
|
43
|
+
{value && (
|
|
44
|
+
<div
|
|
45
|
+
onClick={() => handle.change('')}
|
|
46
|
+
className={sliderClass(value)}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default RadioRowSwitcher;
|