intelicoreact 1.3.19 → 1.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +23 -15
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +23 -15
- package/dist/Atomic/FormElements/Calendar/Calendar.js +124 -69
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +36 -27
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +39 -23
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +246 -110
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +85 -44
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +414 -246
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +9 -5
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +165 -93
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +64 -39
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +132 -51
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +73 -34
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +75 -54
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +110 -67
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +83 -33
- package/dist/Atomic/FormElements/Input/Input.js +253 -161
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +102 -48
- package/dist/Atomic/FormElements/InputColor/InputColor.js +40 -27
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +58 -28
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +176 -108
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +57 -32
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +302 -184
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +157 -85
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +16 -11
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +193 -76
- package/dist/Atomic/FormElements/InputLink/InputLink.js +58 -34
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +12 -8
- package/dist/Atomic/FormElements/InputMask/InputMask.js +964 -554
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +43 -17
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +404 -268
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +43 -17
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +459 -299
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +43 -17
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +113 -53
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +118 -64
- package/dist/Atomic/FormElements/Label/Label.js +23 -13
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +349 -217
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +47 -25
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +207 -133
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +61 -29
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +42 -20
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +33 -22
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +43 -20
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +101 -54
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +102 -59
- package/dist/Atomic/FormElements/RangeList/RangeList.js +150 -89
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +29 -23
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +300 -135
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +571 -381
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +24 -14
- package/dist/Atomic/FormElements/Switcher/Switcher.js +29 -24
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +47 -25
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +32 -20
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +55 -32
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +42 -22
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +33 -23
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +120 -51
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +46 -23
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +417 -253
- package/dist/Atomic/FormElements/Text/Text.js +53 -47
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +31 -21
- package/dist/Atomic/FormElements/Textarea/Textarea.js +27 -16
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +128 -68
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +36 -25
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +70 -33
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +124 -58
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +80 -48
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +42 -32
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +60 -40
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +3 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +69 -50
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +48 -21
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +79 -36
- package/dist/Atomic/Layout/Spinner/Spinner.js +14 -8
- package/dist/Atomic/UI/Accordion/Accordion.js +48 -18
- package/dist/Atomic/UI/Accordion/AccordionItem.js +60 -35
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +106 -49
- package/dist/Atomic/UI/AccordionText/AccordionText.js +37 -13
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +94 -48
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +50 -22
- package/dist/Atomic/UI/Alert/Alert.js +44 -20
- package/dist/Atomic/UI/Arrow/Arrow.js +35 -15
- package/dist/Atomic/UI/Box/Box.js +21 -14
- package/dist/Atomic/UI/Button/Button.js +35 -26
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +31 -22
- package/dist/Atomic/UI/Chart/Chart.js +86 -45
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +24 -14
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +22 -13
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +113 -68
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +140 -158
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +42 -26
- package/dist/Atomic/UI/Chart/partial/utils.js +48 -20
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +42 -22
- package/dist/Atomic/UI/DateTime/DateTime.js +38 -23
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +36 -12
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +21 -5
- package/dist/Atomic/UI/DoubleString/DoubleString.js +50 -27
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +63 -15
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +157 -62
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +110 -47
- package/dist/Atomic/UI/Hint/Hint.js +94 -49
- package/dist/Atomic/UI/Modal/Modal.js +179 -149
- package/dist/Atomic/UI/Modal/ModalHOC.js +21 -12
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +12 -7
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +21 -17
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +167 -94
- package/dist/Atomic/UI/ModalBackup/Modal.js +90 -65
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +62 -32
- package/dist/Atomic/UI/NavLine/NavLine.js +211 -120
- package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
- package/dist/Atomic/UI/PageTitle/PageTitle.js +17 -13
- package/dist/Atomic/UI/PieChart/PieChart.js +21 -11
- package/dist/Atomic/UI/Price/Price.js +13 -10
- package/dist/Atomic/UI/PriceRange/PriceRange.js +11 -7
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +56 -27
- package/dist/Atomic/UI/Status/Status.js +30 -19
- package/dist/Atomic/UI/Table/Partials/TdCell.js +71 -28
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +16 -7
- package/dist/Atomic/UI/Table/Partials/TdRow.js +65 -29
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +40 -16
- package/dist/Atomic/UI/Table/Table.js +47 -27
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +48 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +19 -9
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +8 -5
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +47 -25
- package/dist/Atomic/UI/Tag/Tag.js +48 -20
- package/dist/Atomic/UI/TagList/TagList.js +150 -80
- package/dist/Atomic/UI/UserBox/UserBox.js +26 -14
- package/dist/Classes/AbortableFetch.js +422 -283
- package/dist/Classes/AnimatedHandler.js +56 -44
- package/dist/Classes/RESTAPI/index.js +433 -154
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +428 -290
- package/dist/Classes/RESTAPI/partials/ApiBase.js +67 -24
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +275 -57
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +377 -146
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +403 -155
- package/dist/Classes/RESTAPI/partials/Utils.js +135 -81
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
- package/dist/Classes/RESTAPI/partials/_utils.js +395 -101
- package/dist/Constants/index.constants.js +15 -8
- package/dist/Functions/Portal.js +33 -14
- package/dist/Functions/customEventListener.js +20 -5
- package/dist/Functions/fieldValueFormatters.js +211 -148
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +137 -75
- package/dist/Functions/locale/createTranslator.js +27 -13
- package/dist/Functions/operations.js +49 -35
- package/dist/Functions/presets/inputMaskPresets.js +27 -25
- package/dist/Functions/presets/inputPresets.js +22 -19
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
- package/dist/Functions/schemas.js +15 -6
- package/dist/Functions/useClickOutside.js +7 -3
- package/dist/Functions/useDebounce.js +25 -11
- package/dist/Functions/useFieldFocus.js +67 -42
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +54 -35
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +95 -74
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +91 -55
- package/dist/Functions/useFormTools/functions/General.js +99 -80
- package/dist/Functions/useFormTools/functions/RenderFields.js +72 -45
- package/dist/Functions/useFormTools/functions/usePrevious.js +7 -3
- package/dist/Functions/useFormTools/index.js +598 -382
- package/dist/Functions/useInputHighlightError.js +52 -27
- package/dist/Functions/useIsMobile.js +36 -13
- package/dist/Functions/useLocalStorage.js +22 -7
- package/dist/Functions/useLocationParams.js +27 -16
- package/dist/Functions/useMetaInfo.js +50 -19
- package/dist/Functions/useMouseUpOutside.js +5 -2
- package/dist/Functions/useOnlineStatus.js +26 -7
- package/dist/Functions/usePasswordChecker.js +77 -42
- package/dist/Functions/usePrevious.js +7 -3
- package/dist/Functions/useResize.js +32 -12
- package/dist/Functions/useScrollTo.js +20 -6
- package/dist/Functions/useToggle.js +30 -10
- package/dist/Functions/utils.js +366 -186
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +32 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +32 -21
- package/dist/Molecular/CustomIcons/components/AppStore.js +36 -25
- package/dist/Molecular/CustomIcons/components/Arrow.js +42 -31
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +24 -13
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +27 -16
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +27 -16
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +24 -13
- package/dist/Molecular/CustomIcons/components/Bell.js +22 -11
- package/dist/Molecular/CustomIcons/components/Button.js +22 -11
- package/dist/Molecular/CustomIcons/components/Campaigns.js +23 -12
- package/dist/Molecular/CustomIcons/components/Check.js +23 -12
- package/dist/Molecular/CustomIcons/components/Check2.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +22 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +37 -26
- package/dist/Molecular/CustomIcons/components/Close.js +24 -13
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +49 -38
- package/dist/Molecular/CustomIcons/components/Delete.js +23 -12
- package/dist/Molecular/CustomIcons/components/Edit.js +22 -11
- package/dist/Molecular/CustomIcons/components/Email.js +40 -29
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +30 -19
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +38 -27
- package/dist/Molecular/CustomIcons/components/Flows.js +22 -11
- package/dist/Molecular/CustomIcons/components/Gift.js +27 -16
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +36 -25
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +36 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +25 -14
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +26 -15
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +25 -14
- package/dist/Molecular/CustomIcons/components/Home.js +25 -14
- package/dist/Molecular/CustomIcons/components/Home2.js +28 -17
- package/dist/Molecular/CustomIcons/components/Key.js +30 -19
- package/dist/Molecular/CustomIcons/components/Landers.js +26 -15
- package/dist/Molecular/CustomIcons/components/Lock.js +22 -11
- package/dist/Molecular/CustomIcons/components/Mail.js +30 -19
- package/dist/Molecular/CustomIcons/components/Mastercard.js +72 -61
- package/dist/Molecular/CustomIcons/components/Minus.js +35 -24
- package/dist/Molecular/CustomIcons/components/Offers.js +23 -12
- package/dist/Molecular/CustomIcons/components/Pause.js +35 -24
- package/dist/Molecular/CustomIcons/components/PayPal.js +49 -38
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +36 -25
- package/dist/Molecular/CustomIcons/components/Phone.js +37 -26
- package/dist/Molecular/CustomIcons/components/Play.js +35 -24
- package/dist/Molecular/CustomIcons/components/Plus.js +35 -24
- package/dist/Molecular/CustomIcons/components/Profile.js +27 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +37 -26
- package/dist/Molecular/CustomIcons/components/Rectangle.js +22 -11
- package/dist/Molecular/CustomIcons/components/Revert.js +25 -14
- package/dist/Molecular/CustomIcons/components/Star.js +21 -10
- package/dist/Molecular/CustomIcons/components/Star2.js +23 -12
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +25 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +22 -11
- package/dist/Molecular/CustomIcons/components/TrashRed.js +22 -11
- package/dist/Molecular/CustomIcons/components/Triggers.js +22 -11
- package/dist/Molecular/CustomIcons/components/User.js +27 -16
- package/dist/Molecular/CustomIcons/components/Visa.js +38 -27
- package/dist/Molecular/CustomIcons/components/X.js +22 -11
- package/dist/Molecular/CustomIcons/index.js +183 -61
- package/dist/Molecular/FormElement/FormElement.js +27 -18
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +108 -86
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +34 -29
- package/dist/Molecular/InputAddress/InputAddress.js +312 -176
- package/dist/Molecular/InputPassword/InputPassword.js +39 -15
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,57 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
4
7
|
Object.defineProperty(exports, "__esModule", {
|
|
5
8
|
value: true
|
|
6
9
|
});
|
|
7
10
|
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
8
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
9
18
|
var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
19
|
+
|
|
10
20
|
var _CheckboxInput = _interopRequireDefault(require("../CheckboxInput/CheckboxInput"));
|
|
21
|
+
|
|
11
22
|
require("./MultiSelect.scss");
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
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
|
+
|
|
28
|
+
var MultiSelect = function MultiSelect(_ref) {
|
|
29
|
+
var options = _ref.options,
|
|
30
|
+
chosenOptions = _ref.chosenOptions,
|
|
31
|
+
onChange = _ref.onChange;
|
|
32
|
+
|
|
33
|
+
var _useState = (0, _react.useState)(''),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
searchValue = _useState2[0],
|
|
36
|
+
setSearchValue = _useState2[1];
|
|
37
|
+
|
|
38
|
+
var checkHandler = function checkHandler(state, value) {
|
|
22
39
|
if (state) {
|
|
23
|
-
onChange([
|
|
40
|
+
onChange([].concat((0, _toConsumableArray2.default)(chosenOptions), [value]));
|
|
24
41
|
} else {
|
|
25
|
-
onChange(chosenOptions.filter(
|
|
42
|
+
onChange(chosenOptions.filter(function (item) {
|
|
43
|
+
return item !== value;
|
|
44
|
+
}));
|
|
26
45
|
}
|
|
27
46
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref2;
|
|
47
|
+
|
|
48
|
+
var filteredOptions = options.filter(function (_ref2) {
|
|
49
|
+
var label = _ref2.label;
|
|
32
50
|
return label.toLowerCase().includes(searchValue.toLowerCase());
|
|
33
51
|
});
|
|
34
52
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
53
|
className: "multiselect"
|
|
36
54
|
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
37
55
|
value: searchValue,
|
|
38
|
-
onChange:
|
|
56
|
+
onChange: function onChange(value) {
|
|
57
|
+
return setSearchValue(value);
|
|
58
|
+
},
|
|
39
59
|
placeholder: "Search"
|
|
40
60
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
41
61
|
className: "multiselect__list"
|
|
42
|
-
}, filteredOptions.map(_ref3
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id
|
|
47
|
-
} = _ref3;
|
|
62
|
+
}, filteredOptions.map(function (_ref3) {
|
|
63
|
+
var label = _ref3.label,
|
|
64
|
+
value = _ref3.value,
|
|
65
|
+
id = _ref3.id;
|
|
48
66
|
return /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
49
67
|
key: id,
|
|
50
68
|
value: chosenOptions.includes(value),
|
|
51
69
|
label: label,
|
|
52
|
-
onChange:
|
|
70
|
+
onChange: function onChange(state) {
|
|
71
|
+
return checkHandler(state, value);
|
|
72
|
+
},
|
|
53
73
|
className: "multiselect__item"
|
|
54
74
|
});
|
|
55
75
|
})));
|
|
56
76
|
};
|
|
57
|
-
|
|
77
|
+
|
|
78
|
+
var _default = MultiSelect;
|
|
79
|
+
exports.default = _default;
|
|
@@ -1,112 +1,178 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
4
7
|
Object.defineProperty(exports, "__esModule", {
|
|
5
8
|
value: true
|
|
6
9
|
});
|
|
7
10
|
exports.default = void 0;
|
|
11
|
+
|
|
8
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
9
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
10
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
11
22
|
var _reactFeather = require("react-feather");
|
|
23
|
+
|
|
12
24
|
var _index = require("../../../Constants/index.constants");
|
|
25
|
+
|
|
13
26
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
27
|
+
|
|
14
28
|
var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
29
|
+
|
|
15
30
|
require("./NumericInput.scss");
|
|
31
|
+
|
|
16
32
|
var _utils = require("../../../Functions/utils");
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
+
|
|
42
|
+
var NumericInput = function NumericInput(_ref) {
|
|
43
|
+
var disabled = _ref.disabled,
|
|
44
|
+
withDelete = _ref.withDelete,
|
|
45
|
+
_ref$numStep = _ref.numStep,
|
|
46
|
+
numStep = _ref$numStep === void 0 ? 1 : _ref$numStep,
|
|
47
|
+
_ref$min = _ref.min,
|
|
48
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
49
|
+
max = _ref.max,
|
|
50
|
+
value = _ref.value,
|
|
51
|
+
placeholder = _ref.placeholder,
|
|
52
|
+
className = _ref.className,
|
|
53
|
+
testId = _ref.testId,
|
|
54
|
+
name = _ref.name,
|
|
55
|
+
fieldKey = _ref.fieldKey,
|
|
56
|
+
id = _ref.id,
|
|
57
|
+
_ref$onChange = _ref.onChange,
|
|
58
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
59
|
+
_ref$onBlur = _ref.onBlur,
|
|
60
|
+
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
61
|
+
_ref$onFocus = _ref.onFocus,
|
|
62
|
+
onFocus = _ref$onFocus === void 0 ? function () {} : _ref$onFocus,
|
|
63
|
+
_ref$onKeyUp = _ref.onKeyUp,
|
|
64
|
+
onKeyUp = _ref$onKeyUp === void 0 ? function () {} : _ref$onKeyUp,
|
|
65
|
+
_ref$onKeyDown = _ref.onKeyDown,
|
|
66
|
+
onKeyDown = _ref$onKeyDown === void 0 ? function () {} : _ref$onKeyDown,
|
|
67
|
+
maskChar = _ref.maskChar,
|
|
68
|
+
formatChars = _ref.formatChars,
|
|
69
|
+
error = _ref.error,
|
|
70
|
+
icon = _ref.icon,
|
|
71
|
+
isNotBlinkErrors = _ref.isNotBlinkErrors,
|
|
72
|
+
blinkTime = _ref.blinkTime,
|
|
73
|
+
isPriceInput = _ref.isPriceInput,
|
|
74
|
+
_ref$isFocusDefault = _ref.isFocusDefault,
|
|
75
|
+
isFocusDefault = _ref$isFocusDefault === void 0 ? false : _ref$isFocusDefault,
|
|
76
|
+
_ref$isNotRenderButto = _ref.isNotRenderButtons,
|
|
77
|
+
isNotRenderButtons = _ref$isNotRenderButto === void 0 ? false : _ref$isNotRenderButto,
|
|
78
|
+
_ref$isUseAutoSelect = _ref.isUseAutoSelect,
|
|
79
|
+
isUseAutoSelect = _ref$isUseAutoSelect === void 0 ? true : _ref$isUseAutoSelect,
|
|
80
|
+
_ref$isLoading = _ref.isLoading,
|
|
81
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
82
|
+
_ref$isAllowNullValue = _ref.isAllowNullValue,
|
|
83
|
+
isAllowNullValue = _ref$isAllowNullValue === void 0 ? false : _ref$isAllowNullValue,
|
|
84
|
+
_ref$onlyNumbers = _ref.onlyNumbers,
|
|
85
|
+
onlyNumbers = _ref$onlyNumbers === void 0 ? {
|
|
86
|
+
type: 'int'
|
|
87
|
+
} : _ref$onlyNumbers,
|
|
88
|
+
_ref$attributesOfNati = _ref.attributesOfNativeInput,
|
|
89
|
+
attributesOfNativeInput = _ref$attributesOfNati === void 0 ? {} : _ref$attributesOfNati;
|
|
90
|
+
var DEFAULT_BLINK_TIME = 200; //REFS
|
|
91
|
+
|
|
92
|
+
var inputRef = (0, _react.useRef)(null);
|
|
93
|
+
var decRef = (0, _react.useRef)(null);
|
|
94
|
+
var incRef = (0, _react.useRef)(null);
|
|
95
|
+
var wrapRef = (0, _react.useRef)(null); // STATES
|
|
96
|
+
|
|
97
|
+
var initialMin = isAllowNullValue ? '' : min;
|
|
98
|
+
|
|
99
|
+
var _useState = (0, _react.useState)(value || initialMin),
|
|
100
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
101
|
+
inputValue = _useState2[0],
|
|
102
|
+
setInputValue = _useState2[1];
|
|
103
|
+
|
|
104
|
+
var _useState3 = (0, _react.useState)(inputValue),
|
|
105
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
106
|
+
inputValueFormated = _useState4[0],
|
|
107
|
+
setInputValueFormated = _useState4[1];
|
|
108
|
+
|
|
109
|
+
var _useState5 = (0, _react.useState)(0),
|
|
110
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
111
|
+
intMemoVal = _useState6[0],
|
|
112
|
+
setIntMemoVal = _useState6[1];
|
|
113
|
+
|
|
114
|
+
var _useState7 = (0, _react.useState)(false),
|
|
115
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
116
|
+
isFocused = _useState8[0],
|
|
117
|
+
setIsFocused = _useState8[1];
|
|
118
|
+
|
|
119
|
+
var _useState9 = (0, _react.useState)(false),
|
|
120
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
121
|
+
isAttemptToChange = _useState10[0],
|
|
122
|
+
setIsAttemptToChange = _useState10[1];
|
|
123
|
+
|
|
124
|
+
var _useState11 = (0, _react.useState)(false),
|
|
125
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
126
|
+
isToHighlightError = _useState12[0],
|
|
127
|
+
setIsToHighlightError = _useState12[1];
|
|
128
|
+
|
|
129
|
+
var _useState13 = (0, _react.useState)(value || initialMin),
|
|
130
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
131
|
+
prevValue = _useState14[0],
|
|
132
|
+
setPreviousValue = _useState14[1];
|
|
133
|
+
|
|
134
|
+
var setCursorToEnd = function setCursorToEnd() {
|
|
73
135
|
var _input$value;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
136
|
+
|
|
137
|
+
var input = inputRef.current;
|
|
138
|
+
var cursor = input === null || input === void 0 ? void 0 : (_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length;
|
|
139
|
+
if (input) setTimeout(function () {
|
|
140
|
+
return input.setSelectionRange(cursor, cursor);
|
|
141
|
+
}, 10);
|
|
142
|
+
}; // HANDLES
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
var handle = {
|
|
146
|
+
change: function change(e) {
|
|
147
|
+
var inputValue = e.target ? (0, _fieldValueFormatters.filterNumeric)(e.target.value, onlyNumbers) : (0, _fieldValueFormatters.filterNumeric)(e, onlyNumbers);
|
|
83
148
|
setInputValue(inputValue.toString());
|
|
84
149
|
},
|
|
85
|
-
clear: ()
|
|
150
|
+
clear: function clear() {
|
|
86
151
|
handle.change(initialMin || '');
|
|
87
152
|
},
|
|
88
|
-
focus: e
|
|
153
|
+
focus: function focus(e) {
|
|
89
154
|
setIsFocused(true);
|
|
90
155
|
if (onFocus) onFocus(e);
|
|
91
156
|
},
|
|
92
|
-
blur: e
|
|
157
|
+
blur: function blur(e) {
|
|
93
158
|
setIsFocused(false);
|
|
94
159
|
if (Number.isNaN(inputValue) || inputValue < min) setInputValue(initialMin);
|
|
95
160
|
if (max && +max < inputValue) setInputValue(max);
|
|
96
161
|
if (onBlur) onBlur(e);
|
|
97
162
|
},
|
|
98
|
-
keyDown: e
|
|
163
|
+
keyDown: function keyDown(e) {
|
|
99
164
|
var _e$target;
|
|
100
|
-
|
|
165
|
+
|
|
166
|
+
setPreviousValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
101
167
|
onKeyDown(e.keyCode, e);
|
|
102
168
|
},
|
|
103
|
-
keyUp: e
|
|
169
|
+
keyUp: function keyUp(e) {
|
|
104
170
|
if (!isNotBlinkErrors) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
171
|
+
var changedValue = '' + (value !== null && value !== void 0 ? value : '');
|
|
172
|
+
var previousValue = '' + prevValue;
|
|
173
|
+
var short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
174
|
+
var long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
175
|
+
var infoAboutDifferencesSameness = short.split('').reduce(function (acc, symbol, idx) {
|
|
110
176
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
111
177
|
acc.countOn = false;
|
|
112
178
|
acc.differences.push([idx, symbol]);
|
|
@@ -117,112 +183,117 @@ const NumericInput = _ref => {
|
|
|
117
183
|
countOn: true,
|
|
118
184
|
differences: []
|
|
119
185
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
186
|
+
var samePart = infoAboutDifferencesSameness.same.join('');
|
|
187
|
+
var differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
188
|
+
var currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, '');
|
|
123
189
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
124
190
|
}
|
|
191
|
+
|
|
125
192
|
if (onKeyUp) onKeyUp(e.keyCode, e.target.value);
|
|
126
193
|
},
|
|
127
|
-
decrement: e
|
|
128
|
-
|
|
194
|
+
decrement: function decrement(e) {
|
|
195
|
+
var newValue = +intMemoVal - +numStep;
|
|
129
196
|
if (newValue < min) newValue = min;else if (newValue > max) newValue = max;
|
|
130
197
|
handle.change(newValue);
|
|
131
|
-
setTimeout(()
|
|
198
|
+
setTimeout(function () {
|
|
132
199
|
var _inputRef$current;
|
|
133
|
-
|
|
200
|
+
|
|
201
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
134
202
|
setCursorToEnd();
|
|
135
203
|
}, 100);
|
|
136
204
|
},
|
|
137
|
-
increment: e
|
|
138
|
-
|
|
205
|
+
increment: function increment(e) {
|
|
206
|
+
var newValue = +intMemoVal + +numStep;
|
|
139
207
|
if (newValue < min) newValue = min;else if (newValue > max) newValue = max;
|
|
140
208
|
handle.change(newValue);
|
|
141
|
-
setTimeout(()
|
|
209
|
+
setTimeout(function () {
|
|
142
210
|
var _inputRef$current2;
|
|
143
|
-
|
|
211
|
+
|
|
212
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
144
213
|
setCursorToEnd();
|
|
145
214
|
}, 100);
|
|
146
215
|
}
|
|
147
|
-
};
|
|
216
|
+
}; //Check Outside Click
|
|
148
217
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const handleClickOutside = event => {
|
|
218
|
+
(0, _react.useEffect)(function () {
|
|
219
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
152
220
|
if (!wrapRef.current.contains(event.target)) setIsFocused(false);
|
|
153
221
|
};
|
|
222
|
+
|
|
154
223
|
document.addEventListener('mousedown', handleClickOutside, true);
|
|
155
|
-
return ()
|
|
224
|
+
return function () {
|
|
225
|
+
return document.removeEventListener('mousedown', handleClickOutside, true);
|
|
226
|
+
};
|
|
156
227
|
}, []);
|
|
157
|
-
(0, _react.useEffect)(()
|
|
228
|
+
(0, _react.useEffect)(function () {
|
|
158
229
|
if (!isNotBlinkErrors && isAttemptToChange) {
|
|
159
230
|
setIsAttemptToChange(false);
|
|
160
231
|
setIsToHighlightError(true);
|
|
161
|
-
setTimeout(()
|
|
232
|
+
setTimeout(function () {
|
|
162
233
|
setIsToHighlightError(false);
|
|
163
234
|
}, blinkTime || DEFAULT_BLINK_TIME);
|
|
164
235
|
}
|
|
165
236
|
}, [isAttemptToChange]);
|
|
166
|
-
(0, _react.useEffect)(()
|
|
237
|
+
(0, _react.useEffect)(function () {
|
|
167
238
|
if (value && value !== inputValue) setInputValue(value);
|
|
168
|
-
}, [value]);
|
|
239
|
+
}, [value]); //On Input Value Change
|
|
169
240
|
|
|
170
|
-
|
|
171
|
-
(0, _react.useEffect)(() => {
|
|
241
|
+
(0, _react.useEffect)(function () {
|
|
172
242
|
if (inputValue !== value) setIsFocused(true);
|
|
173
243
|
setInputValueFormated(isPriceInput && (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? isFocused ? (0, _fieldValueFormatters.formatToRemoveComa)(inputValue) : (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue) : inputValue);
|
|
174
244
|
setIntMemoVal((0, _fieldValueFormatters.formatToRemoveComa)(inputValue));
|
|
175
245
|
if (typeof onChange === 'function') onChange(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toString());
|
|
176
|
-
}, [inputValue]);
|
|
246
|
+
}, [inputValue]); //On Integer Value Change
|
|
177
247
|
|
|
178
|
-
|
|
179
|
-
(0, _react.useEffect)(() => {
|
|
248
|
+
(0, _react.useEffect)(function () {
|
|
180
249
|
if (isNaN(intMemoVal)) setIntMemoVal(min || 0);
|
|
181
|
-
}, [intMemoVal]);
|
|
250
|
+
}, [intMemoVal]); //On Focuse Change
|
|
182
251
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
let formatedValue = inputValue;
|
|
252
|
+
(0, _react.useEffect)(function () {
|
|
253
|
+
var formatedValue = inputValue;
|
|
186
254
|
if (isPriceInput) formatedValue = isFocused ? (0, _fieldValueFormatters.formatToRemoveComa)(inputValue) : (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue);
|
|
187
255
|
setInputValueFormated(formatedValue);
|
|
256
|
+
|
|
188
257
|
if (isFocused) {
|
|
189
258
|
var _inputRef$current3;
|
|
259
|
+
|
|
190
260
|
if (typeof onFocus === 'function') onFocus({
|
|
191
261
|
target: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current
|
|
192
262
|
});
|
|
193
|
-
inputRef === null || inputRef === void 0
|
|
263
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.focus();
|
|
194
264
|
} else {
|
|
195
265
|
var _inputRef$current4;
|
|
266
|
+
|
|
196
267
|
if (typeof onBlur === 'function') onBlur({
|
|
197
268
|
target: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current
|
|
198
269
|
});
|
|
199
|
-
inputRef === null || inputRef === void 0
|
|
270
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.blur();
|
|
200
271
|
}
|
|
201
272
|
}, [isFocused]);
|
|
202
|
-
(0, _react.useEffect)(()
|
|
273
|
+
(0, _react.useEffect)(function () {
|
|
203
274
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === 'boolean') setIsFocused(isFocusDefault);
|
|
204
275
|
}, [inputRef, isFocusDefault]);
|
|
276
|
+
|
|
205
277
|
function renderInput() {
|
|
206
|
-
|
|
278
|
+
var uniProps = _objectSpread(_objectSpread({
|
|
207
279
|
name: name || fieldKey || id || testId || '',
|
|
208
280
|
className: "input ".concat(className || ''),
|
|
209
|
-
placeholder,
|
|
281
|
+
placeholder: placeholder,
|
|
210
282
|
value: inputValueFormated,
|
|
211
|
-
disabled,
|
|
283
|
+
disabled: disabled,
|
|
212
284
|
onChange: handle.change,
|
|
213
285
|
onFocus: handle.focus,
|
|
214
286
|
onBlur: handle.blur,
|
|
215
287
|
onKeyDown: handle.keyDown,
|
|
216
288
|
onKeyUp: handle.keyUp,
|
|
217
|
-
min,
|
|
218
|
-
max
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
};
|
|
289
|
+
min: min,
|
|
290
|
+
max: max
|
|
291
|
+
}, maskChar ? {
|
|
292
|
+
maskChar: maskChar
|
|
293
|
+
} : {}), formatChars ? {
|
|
294
|
+
formatChars: formatChars
|
|
295
|
+
} : {});
|
|
296
|
+
|
|
226
297
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, uniProps, {
|
|
227
298
|
"data-testid": "input-".concat((0, _utils.getCorrectTestId)({
|
|
228
299
|
testId: testId || name || fieldKey || id
|
|
@@ -230,9 +301,9 @@ const NumericInput = _ref => {
|
|
|
230
301
|
value: (value === null || value === void 0 ? void 0 : value.length) > 0 ? (0, _fieldValueFormatters.formatToAddBitDepthPoints)((0, _fieldValueFormatters.formatToRemoveComa)(value)) : value,
|
|
231
302
|
ref: inputRef,
|
|
232
303
|
type: "text",
|
|
233
|
-
onFocus: function () {
|
|
304
|
+
onFocus: function onFocus() {
|
|
234
305
|
if (isUseAutoSelect) inputRef.current.select();
|
|
235
|
-
if (uniProps.onFocus) uniProps.onFocus(
|
|
306
|
+
if (uniProps.onFocus) uniProps.onFocus.apply(uniProps, arguments);
|
|
236
307
|
}
|
|
237
308
|
}, attributesOfNativeInput)), !isNotRenderButtons ? /*#__PURE__*/_react.default.createElement("div", {
|
|
238
309
|
className: "input__nums"
|
|
@@ -242,7 +313,9 @@ const NumericInput = _ref => {
|
|
|
242
313
|
className: (0, _classnames.default)('input__num-btn', {
|
|
243
314
|
'events-none': +value <= min
|
|
244
315
|
}),
|
|
245
|
-
onMouseDown:
|
|
316
|
+
onMouseDown: function onMouseDown(e) {
|
|
317
|
+
return handle.decrement(e);
|
|
318
|
+
}
|
|
246
319
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.Minus, {
|
|
247
320
|
className: (0, _classnames.default)({
|
|
248
321
|
disabled: +value <= min
|
|
@@ -253,29 +326,30 @@ const NumericInput = _ref => {
|
|
|
253
326
|
className: (0, _classnames.default)('input__num-btn', {
|
|
254
327
|
'events-none': +value >= max
|
|
255
328
|
}),
|
|
256
|
-
onMouseDown:
|
|
329
|
+
onMouseDown: function onMouseDown(e) {
|
|
330
|
+
return handle.increment(e);
|
|
331
|
+
}
|
|
257
332
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.Plus, {
|
|
258
333
|
className: (0, _classnames.default)({
|
|
259
334
|
disabled: +value >= max
|
|
260
335
|
})
|
|
261
336
|
}))) : null);
|
|
262
337
|
}
|
|
338
|
+
|
|
263
339
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
264
340
|
ref: wrapRef,
|
|
265
|
-
className: (0, _classnames.default)("input__wrap", {
|
|
266
|
-
["input__wrap_focus"]: isFocused
|
|
267
|
-
}, {
|
|
268
|
-
["input__wrap_error"]: error || isToHighlightError
|
|
269
|
-
}, {
|
|
270
|
-
["input__wrap--disabled"]: disabled || isLoading
|
|
271
|
-
})
|
|
341
|
+
className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap--disabled", disabled || isLoading))
|
|
272
342
|
}, renderInput(), icon, withDelete && /*#__PURE__*/_react.default.createElement("span", {
|
|
273
343
|
className: (0, _classnames.default)("input__close", {
|
|
274
344
|
hidden: !inputValue
|
|
275
345
|
}),
|
|
276
|
-
onClick: ()
|
|
346
|
+
onClick: function onClick() {
|
|
347
|
+
return handle.clear();
|
|
348
|
+
}
|
|
277
349
|
}), isLoading && /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
278
350
|
size: "small"
|
|
279
351
|
}));
|
|
280
352
|
};
|
|
281
|
-
|
|
353
|
+
|
|
354
|
+
var _default = NumericInput;
|
|
355
|
+
exports.default = _default;
|