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