intelicoreact 1.6.22 → 1.6.24
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 +98 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +87 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +47 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +256 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
- package/dist/Atomic/UI/Modal/Modal.js +179 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +31 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
- package/dist/Atomic/UI/Status/Status.js +67 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +167 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +294 -1
- package/dist/Functions/guards/safeValue.js +75 -1
- package/dist/Functions/guards/typeGuards.js +373 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +626 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +104 -1
- package/package.json +1 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
- package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
|
@@ -1 +1,331 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
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 { getCorrectTestId } from "../../../Functions/utils";
|
|
13
|
+
import Spinner from "../../Layout/Spinner/Spinner";
|
|
14
|
+
|
|
15
|
+
import "./NumericInput.scss";
|
|
16
|
+
|
|
17
|
+
const NumericInput = ({
|
|
18
|
+
disabled,
|
|
19
|
+
withDelete,
|
|
20
|
+
numStep = 1,
|
|
21
|
+
min = 0,
|
|
22
|
+
max,
|
|
23
|
+
value,
|
|
24
|
+
placeholder,
|
|
25
|
+
className,
|
|
26
|
+
testId = "numeric-input",
|
|
27
|
+
name,
|
|
28
|
+
fieldKey,
|
|
29
|
+
id,
|
|
30
|
+
|
|
31
|
+
onChange = () => {},
|
|
32
|
+
onBlur = () => {},
|
|
33
|
+
onFocus = () => {},
|
|
34
|
+
onKeyUp = () => {},
|
|
35
|
+
onKeyDown = () => {},
|
|
36
|
+
|
|
37
|
+
maskChar,
|
|
38
|
+
formatChars,
|
|
39
|
+
error,
|
|
40
|
+
icon,
|
|
41
|
+
isNotBlinkErrors,
|
|
42
|
+
blinkTime,
|
|
43
|
+
isPriceInput,
|
|
44
|
+
isFocusDefault = false,
|
|
45
|
+
isNotRenderButtons = false,
|
|
46
|
+
isUseAutoSelect = true,
|
|
47
|
+
isLoading = false,
|
|
48
|
+
isAllowNullValue = false,
|
|
49
|
+
onlyNumbers = {
|
|
50
|
+
type: "int",
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
attributesOfNativeInput = {},
|
|
54
|
+
}) => {
|
|
55
|
+
const DEFAULT_BLINK_TIME = 200;
|
|
56
|
+
|
|
57
|
+
//REFS
|
|
58
|
+
const inputRef = useRef(null);
|
|
59
|
+
const decRef = useRef(null);
|
|
60
|
+
const incRef = useRef(null);
|
|
61
|
+
const wrapRef = useRef(null);
|
|
62
|
+
|
|
63
|
+
// STATES
|
|
64
|
+
const initialMin = isAllowNullValue ? "" : min;
|
|
65
|
+
const [inputValue, setInputValue] = useState(value || initialMin);
|
|
66
|
+
const [inputValueFormated, setInputValueFormated] = useState(inputValue);
|
|
67
|
+
const [intMemoVal, setIntMemoVal] = useState(0);
|
|
68
|
+
|
|
69
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
70
|
+
|
|
71
|
+
const [isAttemptToChange, setIsAttemptToChange] = useState(false);
|
|
72
|
+
const [isToHighlightError, setIsToHighlightError] = useState(false);
|
|
73
|
+
|
|
74
|
+
const [prevValue, setPreviousValue] = useState(value || initialMin);
|
|
75
|
+
|
|
76
|
+
const setCursorToEnd = () => {
|
|
77
|
+
const input = inputRef.current;
|
|
78
|
+
const cursor = input?.value?.length;
|
|
79
|
+
if (input) setTimeout(() => input.setSelectionRange(cursor, cursor), 10);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// HANDLES
|
|
83
|
+
const handle = {
|
|
84
|
+
change: (e) => {
|
|
85
|
+
const inputValue = e.target
|
|
86
|
+
? filterNumeric(e.target.value, onlyNumbers)
|
|
87
|
+
: filterNumeric(e, onlyNumbers);
|
|
88
|
+
setInputValue(inputValue.toString());
|
|
89
|
+
},
|
|
90
|
+
clear: () => {
|
|
91
|
+
handle.change(initialMin || "");
|
|
92
|
+
},
|
|
93
|
+
focus: (e) => {
|
|
94
|
+
setIsFocused(true);
|
|
95
|
+
if (onFocus) onFocus(e);
|
|
96
|
+
},
|
|
97
|
+
blur: (e) => {
|
|
98
|
+
setIsFocused(false);
|
|
99
|
+
|
|
100
|
+
if (Number.isNaN(inputValue) || inputValue < min)
|
|
101
|
+
setInputValue(initialMin);
|
|
102
|
+
if (max && Number(max) < inputValue) setInputValue(max);
|
|
103
|
+
|
|
104
|
+
if (onBlur) onBlur(e);
|
|
105
|
+
},
|
|
106
|
+
keyDown: (e) => {
|
|
107
|
+
setPreviousValue(e?.target?.value);
|
|
108
|
+
onKeyDown(e.keyCode, e);
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
keyUp: (e) => {
|
|
112
|
+
if (!isNotBlinkErrors) {
|
|
113
|
+
const changedValue = String(value ?? "");
|
|
114
|
+
const previousValue = String(prevValue);
|
|
115
|
+
|
|
116
|
+
const short =
|
|
117
|
+
previousValue.length <= changedValue.length
|
|
118
|
+
? previousValue
|
|
119
|
+
: changedValue;
|
|
120
|
+
const long =
|
|
121
|
+
previousValue.length > changedValue.length
|
|
122
|
+
? previousValue
|
|
123
|
+
: changedValue;
|
|
124
|
+
|
|
125
|
+
const infoAboutDifferencesSameness = short.split("").reduce(
|
|
126
|
+
(acc, symbol, idx) => {
|
|
127
|
+
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);
|
|
128
|
+
else {
|
|
129
|
+
acc.countOn = false;
|
|
130
|
+
acc.differences.push([idx, symbol]);
|
|
131
|
+
}
|
|
132
|
+
return acc;
|
|
133
|
+
},
|
|
134
|
+
{ same: [], countOn: true, differences: [] },
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
const samePart = infoAboutDifferencesSameness.same.join("");
|
|
138
|
+
const differencesLength =
|
|
139
|
+
infoAboutDifferencesSameness.differences.length;
|
|
140
|
+
const currentSet = changedValue?.replace(samePart, "");
|
|
141
|
+
|
|
142
|
+
if (
|
|
143
|
+
!KEYBOARD_SERVICE_KEYS.includes(e.key) &&
|
|
144
|
+
changedValue === previousValue
|
|
145
|
+
)
|
|
146
|
+
setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (onKeyUp) onKeyUp(e.keyCode, e.target.value);
|
|
150
|
+
},
|
|
151
|
+
decrement: (e) => {
|
|
152
|
+
let newValue = Number(intMemoVal) - Number(numStep);
|
|
153
|
+
if (newValue < min) newValue = min;
|
|
154
|
+
else if (newValue > max) newValue = max;
|
|
155
|
+
|
|
156
|
+
handle.change(newValue);
|
|
157
|
+
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
inputRef?.current?.focus();
|
|
160
|
+
setCursorToEnd();
|
|
161
|
+
}, 100);
|
|
162
|
+
},
|
|
163
|
+
increment: (e) => {
|
|
164
|
+
let newValue = Number(intMemoVal) + Number(numStep);
|
|
165
|
+
if (newValue < min) newValue = min;
|
|
166
|
+
else if (newValue > max) newValue = max;
|
|
167
|
+
|
|
168
|
+
handle.change(newValue);
|
|
169
|
+
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
inputRef?.current?.focus();
|
|
172
|
+
setCursorToEnd();
|
|
173
|
+
}, 100);
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
//Check Outside Click
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
const handleClickOutside = (event) => {
|
|
180
|
+
if (!wrapRef.current.contains(event.target)) setIsFocused(false);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
document.addEventListener("mousedown", handleClickOutside, true);
|
|
184
|
+
return () =>
|
|
185
|
+
document.removeEventListener("mousedown", handleClickOutside, true);
|
|
186
|
+
}, []);
|
|
187
|
+
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
if (!isNotBlinkErrors && isAttemptToChange) {
|
|
190
|
+
setIsAttemptToChange(false);
|
|
191
|
+
setIsToHighlightError(true);
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
setIsToHighlightError(false);
|
|
194
|
+
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
195
|
+
}
|
|
196
|
+
}, [isAttemptToChange]);
|
|
197
|
+
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
if (value && value !== inputValue) setInputValue(value);
|
|
200
|
+
}, [value]);
|
|
201
|
+
|
|
202
|
+
//On Input Value Change
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
if (inputValue !== value) setIsFocused(true);
|
|
205
|
+
|
|
206
|
+
setInputValueFormated(
|
|
207
|
+
isPriceInput && inputValue?.length > 0
|
|
208
|
+
? isFocused
|
|
209
|
+
? removeCommas(inputValue)
|
|
210
|
+
: addCommas(inputValue)
|
|
211
|
+
: inputValue,
|
|
212
|
+
);
|
|
213
|
+
setIntMemoVal(removeCommas(inputValue));
|
|
214
|
+
|
|
215
|
+
if (typeof onChange === "function" && value !== undefined && +inputValue !== +value) onChange(inputValue?.toString());
|
|
216
|
+
}, [inputValue]);
|
|
217
|
+
|
|
218
|
+
//On Integer Value Change
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
if (isNaN(intMemoVal)) setIntMemoVal(min || 0);
|
|
221
|
+
}, [intMemoVal]);
|
|
222
|
+
|
|
223
|
+
//On Focuse Change
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
let formatedValue = inputValue;
|
|
226
|
+
if (isPriceInput)
|
|
227
|
+
formatedValue = isFocused
|
|
228
|
+
? removeCommas(inputValue)
|
|
229
|
+
: addCommas(inputValue);
|
|
230
|
+
setInputValueFormated(formatedValue);
|
|
231
|
+
|
|
232
|
+
if (isFocused) {
|
|
233
|
+
if (typeof onFocus === "function") onFocus({ target: inputRef?.current });
|
|
234
|
+
inputRef?.current?.focus();
|
|
235
|
+
} else {
|
|
236
|
+
if (typeof onBlur === "function") onBlur({ target: inputRef?.current });
|
|
237
|
+
inputRef?.current?.blur();
|
|
238
|
+
}
|
|
239
|
+
}, [isFocused]);
|
|
240
|
+
|
|
241
|
+
useEffect(() => {
|
|
242
|
+
if (inputRef?.current && typeof isFocusDefault === "boolean")
|
|
243
|
+
setIsFocused(isFocusDefault);
|
|
244
|
+
}, [inputRef, isFocusDefault]);
|
|
245
|
+
|
|
246
|
+
function renderInput() {
|
|
247
|
+
const uniProps = {
|
|
248
|
+
name: name || fieldKey || id || testId || "",
|
|
249
|
+
className: `input ${className || ""}`,
|
|
250
|
+
placeholder,
|
|
251
|
+
value: inputValueFormated,
|
|
252
|
+
disabled,
|
|
253
|
+
onChange: handle.change,
|
|
254
|
+
onFocus: handle.focus,
|
|
255
|
+
onBlur: handle.blur,
|
|
256
|
+
onKeyDown: handle.keyDown,
|
|
257
|
+
onKeyUp: handle.keyUp,
|
|
258
|
+
min,
|
|
259
|
+
max,
|
|
260
|
+
...(maskChar ? { maskChar } : {}),
|
|
261
|
+
...(formatChars ? { formatChars } : {}),
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
<>
|
|
266
|
+
<input
|
|
267
|
+
{...uniProps}
|
|
268
|
+
data-testid={`${testId}-input`}
|
|
269
|
+
value={value?.length > 0 ? addCommas(removeCommas(value)) : value}
|
|
270
|
+
ref={inputRef}
|
|
271
|
+
type="text"
|
|
272
|
+
onFocus={(...params) => {
|
|
273
|
+
if (isUseAutoSelect) inputRef.current.select();
|
|
274
|
+
if (uniProps.onFocus) uniProps.onFocus(...params);
|
|
275
|
+
}}
|
|
276
|
+
{...attributesOfNativeInput}
|
|
277
|
+
/>
|
|
278
|
+
|
|
279
|
+
{!isNotRenderButtons ? (
|
|
280
|
+
<div className="input__nums">
|
|
281
|
+
<button
|
|
282
|
+
data-testid={`${testId}-minus-btn`}
|
|
283
|
+
ref={decRef}
|
|
284
|
+
className={cn("input__num-btn", {
|
|
285
|
+
"events-none": Number(value) <= min,
|
|
286
|
+
})}
|
|
287
|
+
onMouseDown={(e) => handle.decrement(e)}
|
|
288
|
+
>
|
|
289
|
+
<Minus className={cn({ disabled: Number(value) <= min })} />
|
|
290
|
+
</button>
|
|
291
|
+
<button
|
|
292
|
+
data-testid={`-${testId}-plus-btn`}
|
|
293
|
+
ref={incRef}
|
|
294
|
+
className={cn("input__num-btn", {
|
|
295
|
+
"events-none": Number(value) >= max,
|
|
296
|
+
})}
|
|
297
|
+
onMouseDown={(e) => handle.increment(e)}
|
|
298
|
+
>
|
|
299
|
+
<Plus className={cn({ disabled: Number(value) >= max })} />
|
|
300
|
+
</button>
|
|
301
|
+
</div>
|
|
302
|
+
) : null}
|
|
303
|
+
</>
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<div
|
|
309
|
+
data-testid={testId}
|
|
310
|
+
ref={wrapRef}
|
|
311
|
+
className={cn(
|
|
312
|
+
`input__wrap`,
|
|
313
|
+
{ [`input__wrap_focus`]: isFocused },
|
|
314
|
+
{ [`input__wrap_error`]: error || isToHighlightError },
|
|
315
|
+
{ [`input__wrap--disabled`]: disabled || isLoading },
|
|
316
|
+
)}
|
|
317
|
+
>
|
|
318
|
+
{renderInput()}
|
|
319
|
+
{icon}
|
|
320
|
+
{withDelete && (
|
|
321
|
+
<span
|
|
322
|
+
className={cn(`input__close`, { hidden: !inputValue })}
|
|
323
|
+
onClick={() => handle.clear()}
|
|
324
|
+
/>
|
|
325
|
+
)}
|
|
326
|
+
{isLoading && <Spinner size="small" />}
|
|
327
|
+
</div>
|
|
328
|
+
);
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export default NumericInput;
|
|
@@ -1 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useLayoutEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import RadioInput from "../RadioInput/RadioInput";
|
|
6
|
+
|
|
7
|
+
import "./RadioGroup.scss";
|
|
8
|
+
|
|
9
|
+
const 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;
|
|
@@ -1 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import FormElement from "../../../Molecular/FormElement/FormElement";
|
|
6
|
+
import Alert from "../../UI/Alert/Alert";
|
|
7
|
+
|
|
8
|
+
import Input from "./../Input/Input";
|
|
9
|
+
import RadioInput from "./../RadioInput/RadioInput";
|
|
10
|
+
|
|
11
|
+
import "./RadioGroupWithInput.scss";
|
|
12
|
+
|
|
13
|
+
const RadioGroupWithInput = ({
|
|
14
|
+
alert,
|
|
15
|
+
className,
|
|
16
|
+
disabled,
|
|
17
|
+
onChange = () => {},
|
|
18
|
+
direction = "row",
|
|
19
|
+
options = [],
|
|
20
|
+
}) => {
|
|
21
|
+
const handle = {
|
|
22
|
+
changeRadio: (value, el) => {
|
|
23
|
+
const newOptions = options.map((item) => {
|
|
24
|
+
return {
|
|
25
|
+
...item,
|
|
26
|
+
checked: el.value === item.value ? item.value : false,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
onChange(newOptions);
|
|
30
|
+
},
|
|
31
|
+
changeInput: (value, el) => {
|
|
32
|
+
el.input.value = value;
|
|
33
|
+
onChange(options);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="radio-group-input-box">
|
|
39
|
+
{alert && <Alert className="mb10" {...alert} />}
|
|
40
|
+
<div
|
|
41
|
+
className={cn(
|
|
42
|
+
"radio-group-input",
|
|
43
|
+
className,
|
|
44
|
+
`radio-group-input--${direction}`,
|
|
45
|
+
{
|
|
46
|
+
"radio-group-input--disabled": disabled,
|
|
47
|
+
},
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
{options?.map((item) => {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
key={item.id}
|
|
54
|
+
className={cn(
|
|
55
|
+
"radio-group-input-item",
|
|
56
|
+
`radio-group-input-item-${item.id}`,
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
<RadioInput
|
|
60
|
+
{...item}
|
|
61
|
+
onChange={(value) => handle.changeRadio(value, item)}
|
|
62
|
+
checked={item.checked}
|
|
63
|
+
/>
|
|
64
|
+
{item.input && item.checked && (
|
|
65
|
+
<FormElement {...item.input}>
|
|
66
|
+
<Input
|
|
67
|
+
onChange={(value) => handle.changeInput(value, item)}
|
|
68
|
+
{...item.input}
|
|
69
|
+
/>
|
|
70
|
+
</FormElement>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default RadioGroupWithInput;
|
|
@@ -1 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
14
|
+
require("./RadioInput.scss");
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const RC = 'radio-input';
|
|
21
|
+
const RadioInput = ({ label, id, checked, name, disabled, className, value, testId = 'radio-input', onChange = ()=>{}, attributesOfNativeInput = {} })=>{
|
|
22
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("label", {
|
|
23
|
+
"data-testid": testId,
|
|
24
|
+
className: (0, _classnames.default)(RC, className, {
|
|
25
|
+
[`${RC}_disabled`]: disabled
|
|
26
|
+
}),
|
|
27
|
+
htmlFor: id,
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
30
|
+
className: (0, _classnames.default)(`${RC}__input`, {
|
|
31
|
+
[`${RC}__input--checked`]: checked === value
|
|
32
|
+
}),
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
35
|
+
id: id,
|
|
36
|
+
"data-testid": `${testId}-input`,
|
|
37
|
+
type: "radio",
|
|
38
|
+
checked: checked === value,
|
|
39
|
+
className: `${RC}__radio`,
|
|
40
|
+
onChange: ()=>onChange(value),
|
|
41
|
+
name: name,
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
...attributesOfNativeInput
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
46
|
+
className: `${RC}__mark`
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}),
|
|
50
|
+
label && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
51
|
+
className: `${RC}__label`,
|
|
52
|
+
children: label
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const _default = RadioInput;
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import "./RadioRowSwitcher.scss";
|
|
4
|
+
|
|
5
|
+
const classNames = require("classnames");
|
|
6
|
+
|
|
7
|
+
const 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;
|