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