intelicoreact 1.4.21 → 1.4.23
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 +25 -91
- 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 +25 -60
- 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 -29
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
- 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 +16 -46
- 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 -85
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
- 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/TagListToDropdown/TagListToDropdown.js +9 -31
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +125 -213
- 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 +4 -20
- 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 -19
- 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 -31
- 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 +7 -19
- package/dist/Atomic/UI/TagList/TagList.js +20 -38
- 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 -42
- 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 +24 -32
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
- 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/useMediaQuery.js +3 -9
- 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 +56 -131
- 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,34 +1,23 @@
|
|
|
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 _reactFeather = require("react-feather");
|
|
15
|
-
|
|
16
11
|
var _utils = require("../../../Functions/utils");
|
|
17
|
-
|
|
18
12
|
var _Alert = _interopRequireDefault(require("../../UI/Alert/Alert"));
|
|
19
|
-
|
|
20
13
|
var _FileLoaderLocal = _interopRequireDefault(require("../FileLoaderLocal/FileLoaderLocal"));
|
|
21
|
-
|
|
22
14
|
require("./FileLoaderLocalGroup.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
|
/* eslint-disable no-console */
|
|
18
|
+
|
|
29
19
|
const DEFAULT_LABEL_PREFIX = "Please attach";
|
|
30
20
|
const MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
31
|
-
|
|
32
21
|
const FileLoaderLocalGroup = _ref => {
|
|
33
22
|
let {
|
|
34
23
|
className,
|
|
@@ -40,10 +29,8 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
40
29
|
alertText
|
|
41
30
|
} = _ref;
|
|
42
31
|
const [groups, setGroups] = (0, _react.useState)((0, _utils.clone)(groupsArray));
|
|
43
|
-
|
|
44
32
|
const getNewFile = group => {
|
|
45
33
|
var _group$files, _group$files2, _group$maxItemSizeByt;
|
|
46
|
-
|
|
47
34
|
return {
|
|
48
35
|
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,
|
|
49
36
|
value: "",
|
|
@@ -54,10 +41,10 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
54
41
|
isRequired: (group === null || group === void 0 ? void 0 : group.isRequired) || false
|
|
55
42
|
};
|
|
56
43
|
};
|
|
57
|
-
|
|
58
44
|
(0, _react.useEffect)(() => {
|
|
59
45
|
const mergedGroups = groupsArray === null || groupsArray === void 0 ? void 0 : groupsArray.map(group => {
|
|
60
|
-
return {
|
|
46
|
+
return {
|
|
47
|
+
...group,
|
|
61
48
|
files: [getNewFile(group)]
|
|
62
49
|
};
|
|
63
50
|
});
|
|
@@ -77,7 +64,6 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
77
64
|
const currentGroup = groups === null || groups === void 0 ? void 0 : groups.find(group => group.groupId === groupId.toString());
|
|
78
65
|
const files = currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.files;
|
|
79
66
|
const changedField = files.find(item => Number(item.id) === Number(id));
|
|
80
|
-
|
|
81
67
|
if (error) {
|
|
82
68
|
changedField.value = name;
|
|
83
69
|
changedField.error = error;
|
|
@@ -90,17 +76,19 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
90
76
|
changedField.error = "";
|
|
91
77
|
const oldDataWithNewFile = groups === null || groups === void 0 ? void 0 : groups.map(group => {
|
|
92
78
|
if ((group === null || group === void 0 ? void 0 : group.groupId) === groupId.toString() && isSingleGroup) {
|
|
93
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
...group,
|
|
94
81
|
files: [...group.files]
|
|
95
82
|
};
|
|
96
83
|
} else if ((group === null || group === void 0 ? void 0 : group.groupId) === groupId.toString() && group.files.length < 10 && !isSingleGroup) {
|
|
97
|
-
return {
|
|
98
|
-
|
|
84
|
+
return {
|
|
85
|
+
...group,
|
|
86
|
+
files: [...group.files, {
|
|
87
|
+
...getNewFile(group),
|
|
99
88
|
isRequired: group.files.length > 1
|
|
100
89
|
}]
|
|
101
90
|
};
|
|
102
91
|
}
|
|
103
|
-
|
|
104
92
|
return group;
|
|
105
93
|
});
|
|
106
94
|
setGroups([...oldDataWithNewFile]);
|
|
@@ -109,18 +97,20 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
109
97
|
} else {
|
|
110
98
|
const oldDataWithRemovedFile = groups === null || groups === void 0 ? void 0 : groups.map(group => {
|
|
111
99
|
if (isSingleGroup && (group === null || group === void 0 ? void 0 : group.groupId) === groupId.toString()) {
|
|
112
|
-
return {
|
|
113
|
-
|
|
100
|
+
return {
|
|
101
|
+
...group,
|
|
102
|
+
files: [{
|
|
103
|
+
...getNewFile(group),
|
|
114
104
|
value: "",
|
|
115
105
|
base64: ""
|
|
116
106
|
}]
|
|
117
107
|
};
|
|
118
108
|
} else if ((group === null || group === void 0 ? void 0 : group.groupId) === groupId.toString() && !isSingleGroup) {
|
|
119
|
-
return {
|
|
109
|
+
return {
|
|
110
|
+
...group,
|
|
120
111
|
files: group.files.filter(item => item.id !== id)
|
|
121
112
|
};
|
|
122
113
|
}
|
|
123
|
-
|
|
124
114
|
return group;
|
|
125
115
|
});
|
|
126
116
|
setGroups([...oldDataWithRemovedFile]);
|
|
@@ -128,12 +118,9 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
128
118
|
}
|
|
129
119
|
}
|
|
130
120
|
};
|
|
131
|
-
|
|
132
121
|
const getUniqueExts = acceptExts => (0, _utils.getUniqueFileExtensions)(acceptExts === null || acceptExts === void 0 ? void 0 : acceptExts.replace(/\./g, ""));
|
|
133
|
-
|
|
134
122
|
return groups === null || groups === void 0 ? void 0 : groups.map(group => {
|
|
135
123
|
var _group$files3;
|
|
136
|
-
|
|
137
124
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
125
|
key: group.groupId,
|
|
139
126
|
className: (0, _classnames.default)("file-loader-local-groups", className)
|
|
@@ -151,9 +138,8 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
151
138
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
152
139
|
"data-testid": "input--group-file-loader--key-".concat(testId || (group === null || group === void 0 ? void 0 : group.groupId)),
|
|
153
140
|
className: "file-loader-local-groups__item"
|
|
154
|
-
}, group === null || group === void 0
|
|
141
|
+
}, group === null || group === void 0 || (_group$files3 = group.files) === null || _group$files3 === void 0 ? void 0 : _group$files3.map((file, index) => {
|
|
155
142
|
var _group$files4, _group$files5;
|
|
156
|
-
|
|
157
143
|
return /*#__PURE__*/_react.default.createElement(_FileLoaderLocal.default, {
|
|
158
144
|
groupId: group === null || group === void 0 ? void 0 : group.groupId,
|
|
159
145
|
key: (file === null || file === void 0 ? void 0 : file.id) || index,
|
|
@@ -171,6 +157,4 @@ const FileLoaderLocalGroup = _ref => {
|
|
|
171
157
|
})));
|
|
172
158
|
});
|
|
173
159
|
};
|
|
174
|
-
|
|
175
|
-
var _default = FileLoaderLocalGroup;
|
|
176
|
-
exports.default = _default;
|
|
160
|
+
var _default = exports.default = FileLoaderLocalGroup;
|
|
@@ -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,
|
|
@@ -117,13 +105,13 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
117
105
|
const DynamicIconComponent = iconDynamicKey && !icon ? /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, (0, _extends2.default)({
|
|
118
106
|
iconKey: iconDynamicKey
|
|
119
107
|
}, iconDynamicProps)) : null;
|
|
120
|
-
const DEFAULT_BLINK_TIME = 100;
|
|
121
|
-
|
|
108
|
+
const DEFAULT_BLINK_TIME = 100;
|
|
109
|
+
// STATES
|
|
122
110
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
123
111
|
const [isEditing, setEditing] = (0, _react.useState)(false);
|
|
124
112
|
const inputInnerRef = (0, _react.useRef)(null);
|
|
125
|
-
const inputRef = (0, _react.useMemo)(() => ref || inputInnerRef, [ref]);
|
|
126
|
-
|
|
113
|
+
const inputRef = (0, _react.useMemo)(() => ref || inputInnerRef, [ref]);
|
|
114
|
+
// const previousValueRef = useRef(value);
|
|
127
115
|
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
128
116
|
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
129
117
|
const [onInputHover, setOnInputHover] = (0, _react.useState)(false);
|
|
@@ -136,8 +124,9 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
136
124
|
const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
|
|
137
125
|
const isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
138
126
|
const inputName = name || fieldKey || id;
|
|
139
|
-
const isPseudoPasswordMode = type === "pseudoPassword";
|
|
127
|
+
const isPseudoPasswordMode = type === "pseudoPassword";
|
|
140
128
|
|
|
129
|
+
// HANDLES
|
|
141
130
|
const handle = {
|
|
142
131
|
correctMinMax: (value, correctionType) => {
|
|
143
132
|
if (!onlyNumbers) return value;
|
|
@@ -151,66 +140,57 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
151
140
|
const maximum = !Number.isNaN(Number(max)) && max !== null && (max >= 0 || !isOnlyPositive) ? max : undefined;
|
|
152
141
|
let minusSymbol;
|
|
153
142
|
let inputValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
154
|
-
|
|
155
143
|
const checkMin = () => {
|
|
156
144
|
var _minusSymbol;
|
|
157
|
-
|
|
158
145
|
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;
|
|
159
146
|
};
|
|
160
|
-
|
|
161
147
|
const checkMax = () => {
|
|
162
148
|
var _minusSymbol2;
|
|
163
|
-
|
|
164
149
|
if (!Number.isNaN(Number(maximum)) && Number(maximum) < Number(((_minusSymbol2 = minusSymbol) !== null && _minusSymbol2 !== void 0 ? _minusSymbol2 : "") + inputValue)) {
|
|
165
150
|
inputValue = maximum;
|
|
166
151
|
minusSymbol = null;
|
|
167
152
|
}
|
|
168
153
|
};
|
|
169
|
-
|
|
170
154
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
171
|
-
|
|
172
155
|
if (!isOnlyPositive && inputValue[0] === "-") {
|
|
173
156
|
minusSymbol = "-";
|
|
174
157
|
inputValue = inputValue.slice(1);
|
|
175
158
|
}
|
|
176
|
-
|
|
177
159
|
inputValue = (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
|
|
178
|
-
|
|
179
160
|
switch (correctionType) {
|
|
180
161
|
case "min":
|
|
181
162
|
checkMin();
|
|
182
163
|
break;
|
|
183
|
-
|
|
184
164
|
case "max":
|
|
185
165
|
checkMax();
|
|
186
166
|
break;
|
|
187
|
-
|
|
188
167
|
default:
|
|
189
168
|
checkMin();
|
|
190
169
|
checkMax();
|
|
191
170
|
break;
|
|
192
171
|
}
|
|
193
|
-
|
|
194
172
|
return inputValue;
|
|
195
173
|
},
|
|
196
174
|
processPseudoValue: (newValue, oldValue) => {
|
|
197
|
-
const insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, "g"), "");
|
|
198
|
-
//? По договоренности любой копипаст заменяет текущее велью
|
|
175
|
+
const insertedPart = newValue.replace(new RegExp(HIDE_SYMBOL, "g"), "");
|
|
199
176
|
|
|
177
|
+
//? Если insertedPart.length > 1, то это точно копи-паст
|
|
178
|
+
//? По договоренности любой копипаст заменяет текущее велью
|
|
200
179
|
if (insertedPart.length > 1) return insertedPart;
|
|
201
180
|
const isOldValueHasBeenReduced = newValue.replace(new RegExp(/^HIDE_SYMBOL/g), "").length < oldValue.length;
|
|
202
181
|
const oldValueArr = oldValue.split("");
|
|
203
|
-
|
|
204
182
|
const getIsInclude = idx => {
|
|
205
|
-
const BACKSPACE_CODE = 8;
|
|
183
|
+
const BACKSPACE_CODE = 8;
|
|
206
184
|
|
|
207
|
-
|
|
185
|
+
//? Если позиции не равны, значит была выделена область, значит будем воспринимать как копи-паст
|
|
186
|
+
if (keyDownData.start !== keyDownData.end) return false;
|
|
208
187
|
|
|
209
|
-
|
|
188
|
+
//? Если позиции равны и есть вставляемое значение - обрезаем "хвост"
|
|
189
|
+
if (insertedPart) return idx < keyDownData.start;
|
|
210
190
|
|
|
191
|
+
//? Если позиции равны и нет вставляемого значения - значит симвовол удалили
|
|
211
192
|
return keyDownData.keyCode === BACKSPACE_CODE ? idx < keyDownData.start - 1 || idx > keyDownData.end - 1 : idx < keyDownData.start || idx > keyDownData.end;
|
|
212
193
|
};
|
|
213
|
-
|
|
214
194
|
if (!insertedPart) return oldValueArr.reduce((acc, sym, idx) => getIsInclude(idx) ? "".concat(acc).concat(sym) : acc, "");
|
|
215
195
|
const outputStructure = oldValueArr.reduce((acc, sym, idx) => {
|
|
216
196
|
if (getIsInclude(idx)) acc.result = "".concat(acc.result).concat(sym);else if (!acc.position) acc.position = insertedPart ? idx : idx - 1;
|
|
@@ -224,7 +204,6 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
224
204
|
},
|
|
225
205
|
change: e => {
|
|
226
206
|
var _minusSymbol3;
|
|
227
|
-
|
|
228
207
|
const {
|
|
229
208
|
isOnlyPositive
|
|
230
209
|
} = (0, _utils.getIsOnlyAnObject)(onlyNumbers) ? onlyNumbers : {};
|
|
@@ -233,12 +212,10 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
233
212
|
if (isPseudoPasswordMode) inputValue = inputValue.includes(HIDE_SYMBOL) ? handle.processPseudoValue(inputValue, value, e) : inputValue;
|
|
234
213
|
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToRemoveComa)(inputValue);
|
|
235
214
|
if (onlyNumbers) inputValue = inputValue.replace(/,/g, ".");
|
|
236
|
-
|
|
237
215
|
if (onlyNumbers && !isOnlyPositive && inputValue[0] === "-") {
|
|
238
216
|
minusSymbol = "-";
|
|
239
217
|
inputValue = inputValue.slice(1);
|
|
240
218
|
}
|
|
241
|
-
|
|
242
219
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
243
220
|
if (symbolsLimit && inputValue.length > Number(symbolsLimit)) inputValue = inputValue.substring(0, Number(symbolsLimit));
|
|
244
221
|
if (isCropFirstNool && inputValue[0] == 0) return "";else if (onlyNumbers) inputValue = handle.correctMinMax(inputValue, "max");
|
|
@@ -258,15 +235,14 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
258
235
|
if (trimEnd) inputValue = inputValue.replace(new RegExp("[".concat(characters, "]+$")), "");
|
|
259
236
|
if (value !== inputValue) onChange(inputValue);
|
|
260
237
|
setIsFocused(false);
|
|
261
|
-
setEditing(false);
|
|
238
|
+
setEditing(false);
|
|
239
|
+
// использую setTimeout для того чтоб прошли переназначения велью, если они есть,
|
|
262
240
|
// для того, чтоб верхний onBlur при обращении к e.target.value получал обновленное велью
|
|
263
|
-
|
|
264
241
|
if (onBlur) setTimeout(() => onBlur(e), 0);
|
|
265
242
|
},
|
|
266
243
|
keyDown: e => {
|
|
267
244
|
var _e$target;
|
|
268
|
-
|
|
269
|
-
setPreviousValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
245
|
+
setPreviousValue(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
270
246
|
setKeyDownData({
|
|
271
247
|
start: e.target.selectionStart,
|
|
272
248
|
end: e.target.selectionEnd,
|
|
@@ -296,14 +272,12 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
296
272
|
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
297
273
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
298
274
|
}
|
|
299
|
-
|
|
300
275
|
onKeyUp(e.keyCode, e);
|
|
301
276
|
}
|
|
302
277
|
};
|
|
303
278
|
(0, _react.useEffect)(() => {
|
|
304
279
|
var _inputRef$current, _inputRef$current$foc;
|
|
305
|
-
|
|
306
|
-
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);
|
|
280
|
+
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);
|
|
307
281
|
}, [isEditing, isFocused]);
|
|
308
282
|
(0, _react.useEffect)(() => {
|
|
309
283
|
setEditing(isSelect !== null && isSelect !== void 0 ? isSelect : false);
|
|
@@ -321,23 +295,18 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
321
295
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === "boolean") setIsFocused(isFocusDefault);
|
|
322
296
|
setEditing(isFocusDefault);
|
|
323
297
|
}, [inputRef, isFocusDefault]);
|
|
324
|
-
|
|
325
298
|
const getInputType = () => {
|
|
326
299
|
if (isPriceInput || isPseudoPasswordMode) return "text";
|
|
327
300
|
return type;
|
|
328
301
|
};
|
|
329
|
-
|
|
330
302
|
const formatedValue = (() => {
|
|
331
303
|
let safelyValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
332
|
-
|
|
333
304
|
const hideSymbols = () => safelyValue.split("").map(() => HIDE_SYMBOL).join("");
|
|
334
|
-
|
|
335
305
|
if (isPseudoPasswordMode) return hideSymbols();
|
|
336
306
|
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) safelyValue = handle.correctMinMax(safelyValue, "min");
|
|
337
307
|
if (isUseBitDepthPoints) safelyValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(safelyValue, onlyNumbers);
|
|
338
308
|
return safelyValue;
|
|
339
309
|
})();
|
|
340
|
-
|
|
341
310
|
const uniProps = {
|
|
342
311
|
name: inputName,
|
|
343
312
|
className: (0, _classnames.default)("input", className, {
|
|
@@ -380,12 +349,10 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
380
349
|
}, attributesOfNativeInput, {
|
|
381
350
|
onFocus: function () {
|
|
382
351
|
var _attributesOfNativeIn;
|
|
383
|
-
|
|
384
352
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
385
353
|
params[_key] = arguments[_key];
|
|
386
354
|
}
|
|
387
|
-
|
|
388
|
-
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 ? void 0 : _attributesOfNativeIn.call(attributesOfNativeInput, ...params);
|
|
355
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 || (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 || _attributesOfNativeIn.call(attributesOfNativeInput, ...params);
|
|
389
356
|
if (isUseAutoSelect) inputRef.current.select();
|
|
390
357
|
if (uniProps.onFocus) uniProps.onFocus(...params);
|
|
391
358
|
}
|
|
@@ -399,6 +366,4 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
399
366
|
size: "small"
|
|
400
367
|
}));
|
|
401
368
|
});
|
|
402
|
-
|
|
403
|
-
var _default = Input;
|
|
404
|
-
exports.default = _default;
|
|
369
|
+
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;
|