intelicoreact 1.3.21 → 1.3.22
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 +15 -23
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +15 -23
- package/dist/Atomic/FormElements/Calendar/Calendar.js +69 -124
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +246 -414
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +93 -165
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +54 -75
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +67 -110
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
- package/dist/Atomic/FormElements/Input/Input.js +161 -253
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
- package/dist/Atomic/FormElements/InputColor/InputColor.js +27 -40
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +28 -58
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +108 -176
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +76 -193
- package/dist/Atomic/FormElements/InputLink/InputLink.js +34 -58
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
- package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +300 -460
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +53 -113
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
- package/dist/Atomic/FormElements/Label/Label.js +13 -23
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
- package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +135 -300
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +381 -571
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
- package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +25 -47
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +260 -413
- package/dist/Atomic/FormElements/Text/Text.js +47 -53
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
- package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -27
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -124
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +21 -48
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +36 -79
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
- package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
- package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +49 -106
- package/dist/Atomic/UI/AccordionText/AccordionText.js +13 -37
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +48 -94
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
- package/dist/Atomic/UI/Alert/Alert.js +20 -44
- package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
- package/dist/Atomic/UI/Box/Box.js +14 -21
- package/dist/Atomic/UI/Button/Button.js +26 -35
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
- package/dist/Atomic/UI/Chart/Chart.js +45 -86
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
- package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +12 -36
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
- package/dist/Atomic/UI/DoubleString/DoubleString.js +27 -50
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
- package/dist/Atomic/UI/Hint/Hint.js +49 -94
- package/dist/Atomic/UI/Modal/Modal.js +149 -179
- package/dist/Atomic/UI/Modal/ModalHOC.js +12 -21
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +98 -160
- package/dist/Atomic/UI/ModalBackup/Modal.js +65 -90
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +12 -21
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +6 -11
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +15 -19
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
- package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
- package/dist/Atomic/UI/Price/Price.js +10 -13
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +27 -56
- package/dist/Atomic/UI/Status/Status.js +19 -30
- package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
- package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
- package/dist/Atomic/UI/Table/Table.js +27 -47
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -8
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +25 -47
- package/dist/Atomic/UI/Tag/Tag.js +20 -48
- package/dist/Atomic/UI/TagList/TagList.js +80 -150
- package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
- package/dist/Classes/AbortableFetch.js +283 -422
- package/dist/Classes/AnimatedHandler.js +44 -56
- package/dist/Classes/RESTAPI/index.js +154 -433
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
- package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +57 -275
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +146 -377
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +155 -403
- package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +101 -395
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +14 -33
- package/dist/Functions/customEventListener.js +5 -20
- package/dist/Functions/fieldValueFormatters.js +148 -211
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
- package/dist/Functions/locale/createTranslator.js +13 -27
- package/dist/Functions/operations.js +35 -49
- package/dist/Functions/presets/inputMaskPresets.js +25 -27
- package/dist/Functions/presets/inputPresets.js +19 -22
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -15
- package/dist/Functions/useClickOutside.js +3 -7
- package/dist/Functions/useDebounce.js +11 -25
- package/dist/Functions/useFieldFocus.js +42 -67
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
- package/dist/Functions/useFormTools/functions/General.js +80 -99
- package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
- package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
- package/dist/Functions/useFormTools/index.js +382 -598
- package/dist/Functions/useInputHighlightError.js +27 -52
- package/dist/Functions/useIsMobile.js +13 -36
- package/dist/Functions/useLocalStorage.js +7 -22
- package/dist/Functions/useLocationParams.js +16 -27
- package/dist/Functions/useMetaInfo.js +19 -50
- package/dist/Functions/useMouseUpOutside.js +2 -5
- package/dist/Functions/useOnlineStatus.js +7 -26
- package/dist/Functions/usePasswordChecker.js +42 -77
- package/dist/Functions/usePrevious.js +3 -7
- package/dist/Functions/useResize.js +12 -32
- package/dist/Functions/useScrollTo.js +6 -20
- package/dist/Functions/useToggle.js +10 -30
- package/dist/Functions/utils.js +186 -366
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
- package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
- package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
- package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
- package/dist/Molecular/CustomIcons/components/Button.js +11 -22
- package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
- package/dist/Molecular/CustomIcons/components/Close.js +13 -24
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
- package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
- package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
- package/dist/Molecular/CustomIcons/components/Email.js +29 -40
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
- package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
- package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
- package/dist/Molecular/CustomIcons/components/Key.js +19 -30
- package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
- package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
- package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
- package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
- package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
- package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
- package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
- package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
- package/dist/Molecular/CustomIcons/components/Play.js +24 -35
- package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
- package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
- package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
- package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
- package/dist/Molecular/CustomIcons/components/Star.js +10 -21
- package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
- package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
- package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
- package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
- package/dist/Molecular/CustomIcons/components/User.js +16 -27
- package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
- package/dist/Molecular/CustomIcons/components/X.js +11 -22
- package/dist/Molecular/CustomIcons/index.js +61 -183
- package/dist/Molecular/FormElement/FormElement.js +18 -27
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +95 -112
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -34
- package/dist/Molecular/InputAddress/InputAddress.js +176 -312
- package/dist/Molecular/InputPassword/InputPassword.js +15 -39
- package/dist/index.js +1 -3
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
|
@@ -1,137 +1,91 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
9
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
17
|
-
|
|
18
10
|
var _reactInputMask = _interopRequireDefault(require("react-input-mask"));
|
|
19
|
-
|
|
20
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
12
|
var _Calendar = _interopRequireDefault(require("../Calendar/Calendar"));
|
|
23
|
-
|
|
24
13
|
var _useClickOutside = require("../../../Functions/useClickOutside");
|
|
25
|
-
|
|
26
14
|
require("./InputCalendar.scss");
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var _useState = (0, _react.useState)(null),
|
|
59
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
60
|
-
isOpened = _useState2[0],
|
|
61
|
-
setIsOpened = _useState2[1];
|
|
62
|
-
|
|
63
|
-
var _useState3 = (0, _react.useState)(false),
|
|
64
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
65
|
-
isOpenedByEnter = _useState4[0],
|
|
66
|
-
setOpenedByEnter = _useState4[1];
|
|
67
|
-
|
|
68
|
-
var calendarRef = (0, _react.useRef)(null);
|
|
69
|
-
var inputRef = (0, _react.useRef)(null);
|
|
70
|
-
var formattedMinDate = (0, _momentTimezone.default)(minDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(minDate, format).format(format) : null;
|
|
71
|
-
var formattedMaxDate = (0, _momentTimezone.default)(maxDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(maxDate, format).format(format) : null;
|
|
72
|
-
var momentMinDate = (0, _momentTimezone.default)(formattedMinDate, format).startOf('day');
|
|
73
|
-
var momentMaxDate = (0, _momentTimezone.default)(formattedMaxDate, format).startOf('day');
|
|
74
|
-
(0, _useClickOutside.useClickOutside)(calendarRef, function () {
|
|
75
|
-
return setIsOpened(false);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
var changeInputValue = function changeInputValue(val) {
|
|
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
|
+
const InputCalendar = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
value,
|
|
20
|
+
minDate,
|
|
21
|
+
maxDate,
|
|
22
|
+
format = 'MM/DD/YYYY',
|
|
23
|
+
isDontLimitFuture,
|
|
24
|
+
onChange,
|
|
25
|
+
className = '',
|
|
26
|
+
placeholder = 'mm/dd/yyyy',
|
|
27
|
+
mask = '99/99/9999',
|
|
28
|
+
isListTop,
|
|
29
|
+
disabled,
|
|
30
|
+
disabledFormattedMaxDate = false,
|
|
31
|
+
testId,
|
|
32
|
+
onKeyDown: onKeyDownProp = e => {},
|
|
33
|
+
onKeyUp: onKeyUpProp = e => {},
|
|
34
|
+
onBlur: onBlurProp = e => {}
|
|
35
|
+
} = _ref;
|
|
36
|
+
const [isOpened, setIsOpened] = (0, _react.useState)(null);
|
|
37
|
+
const [isOpenedByEnter, setOpenedByEnter] = (0, _react.useState)(false);
|
|
38
|
+
const calendarRef = (0, _react.useRef)(null);
|
|
39
|
+
const inputRef = (0, _react.useRef)(null);
|
|
40
|
+
const formattedMinDate = (0, _momentTimezone.default)(minDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(minDate, format).format(format) : null;
|
|
41
|
+
const formattedMaxDate = (0, _momentTimezone.default)(maxDate, format).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(maxDate, format).format(format) : null;
|
|
42
|
+
const momentMinDate = (0, _momentTimezone.default)(formattedMinDate, format).startOf('day');
|
|
43
|
+
const momentMaxDate = (0, _momentTimezone.default)(formattedMaxDate, format).startOf('day');
|
|
44
|
+
(0, _useClickOutside.useClickOutside)(calendarRef, () => setIsOpened(false));
|
|
45
|
+
const changeInputValue = val => {
|
|
79
46
|
if (onChange) onChange(val);
|
|
80
47
|
};
|
|
81
|
-
|
|
82
|
-
var changeCalendarDay = function changeCalendarDay(val) {
|
|
48
|
+
const changeCalendarDay = val => {
|
|
83
49
|
if (onChange) onChange(val);
|
|
84
50
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var date = (0, _momentTimezone.default)(value).format('L');
|
|
51
|
+
const getCalendarValue = value => {
|
|
52
|
+
const date = (0, _momentTimezone.default)(value).format('L');
|
|
88
53
|
if (date !== 'Invalid date') return date;
|
|
89
54
|
return (0, _momentTimezone.default)(new Date()).format('L');
|
|
90
55
|
};
|
|
91
|
-
|
|
92
|
-
(0, _react.useEffect)(function () {
|
|
56
|
+
(0, _react.useEffect)(() => {
|
|
93
57
|
if (typeof isOpened === 'boolean' && !isOpened) {
|
|
94
58
|
handleBlur();
|
|
95
59
|
}
|
|
96
60
|
}, [isOpened]);
|
|
97
|
-
|
|
98
|
-
var handleBlur = function handleBlur(e) {
|
|
61
|
+
const handleBlur = e => {
|
|
99
62
|
var _inputRef$current;
|
|
100
|
-
|
|
101
|
-
var 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;
|
|
102
64
|
if ((0, _momentTimezone.default)(value, format).format(format) === 'Invalid date' || value.indexOf('_') > -1) value = '';
|
|
103
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));
|
|
104
66
|
};
|
|
105
|
-
|
|
106
|
-
var onKeyDown = function onKeyDown(e) {
|
|
67
|
+
const onKeyDown = e => {
|
|
107
68
|
if (isOpened && [9, 13].includes(e.keyCode)) {
|
|
108
69
|
setIsOpened(false);
|
|
109
70
|
setOpenedByEnter(true);
|
|
110
71
|
}
|
|
111
|
-
|
|
112
72
|
onKeyDownProp(e);
|
|
113
73
|
};
|
|
114
|
-
|
|
115
|
-
var onKeyUp = function onKeyUp(e) {
|
|
74
|
+
const onKeyUp = e => {
|
|
116
75
|
var _e$target$value;
|
|
117
|
-
|
|
118
|
-
var isValidLenght = ((_e$target$value = e.target.value) === null || _e$target$value === void 0 ? void 0 : _e$target$value.replace(/[^0-9]/g, '').length) === 8;
|
|
119
|
-
|
|
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;
|
|
120
77
|
if ([9, 13].includes(e.keyCode)) {
|
|
121
78
|
setIsOpened(true);
|
|
122
79
|
setOpenedByEnter(true);
|
|
123
80
|
}
|
|
124
|
-
|
|
125
81
|
if (isValidLenght) {
|
|
126
82
|
setIsOpened(false);
|
|
127
83
|
handleBlur();
|
|
128
84
|
} else {
|
|
129
85
|
setIsOpened(true);
|
|
130
86
|
}
|
|
131
|
-
|
|
132
87
|
onKeyUpProp(e);
|
|
133
88
|
};
|
|
134
|
-
|
|
135
89
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
136
90
|
"data-testid": "inputCalendar--key-".concat(testId, "--container"),
|
|
137
91
|
className: (0, _classnames.default)('input__wrap calendar-container', className, {
|
|
@@ -142,13 +96,9 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
142
96
|
mask: mask,
|
|
143
97
|
placeholder: placeholder,
|
|
144
98
|
value: value,
|
|
145
|
-
onChange:
|
|
146
|
-
return changeInputValue(e.target.value);
|
|
147
|
-
},
|
|
99
|
+
onChange: e => changeInputValue(e.target.value),
|
|
148
100
|
className: "calendar-dropdown",
|
|
149
|
-
onClick:
|
|
150
|
-
return setIsOpened(true);
|
|
151
|
-
},
|
|
101
|
+
onClick: () => setIsOpened(true),
|
|
152
102
|
onKeyUp: onKeyUp,
|
|
153
103
|
onKeyDown: onKeyDown,
|
|
154
104
|
onBlur: onBlurProp,
|
|
@@ -156,21 +106,17 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
156
106
|
}), isOpened ? /*#__PURE__*/_react.default.createElement(_Calendar.default, {
|
|
157
107
|
testId: testId,
|
|
158
108
|
date: getCalendarValue(value),
|
|
159
|
-
setDate:
|
|
160
|
-
return changeCalendarDay(newDate);
|
|
161
|
-
},
|
|
109
|
+
setDate: newDate => changeCalendarDay(newDate),
|
|
162
110
|
params: {
|
|
163
|
-
format
|
|
111
|
+
format,
|
|
164
112
|
minDate: formattedMinDate,
|
|
165
113
|
maxDate: formattedMaxDate,
|
|
166
|
-
momentMinDate
|
|
167
|
-
momentMaxDate
|
|
168
|
-
isDontLimitFuture
|
|
114
|
+
momentMinDate,
|
|
115
|
+
momentMaxDate,
|
|
116
|
+
isDontLimitFuture
|
|
169
117
|
},
|
|
170
118
|
isListTop: isListTop,
|
|
171
119
|
setIsOpened: setIsOpened
|
|
172
120
|
}) : null);
|
|
173
121
|
};
|
|
174
|
-
|
|
175
|
-
var _default = InputCalendar;
|
|
176
|
-
exports.default = _default;
|
|
122
|
+
var _default = exports.default = InputCalendar;
|
|
@@ -1,59 +1,48 @@
|
|
|
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
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
9
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
|
|
18
11
|
var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
19
|
-
|
|
20
12
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
21
|
-
|
|
22
13
|
require("./InputColor.scss");
|
|
14
|
+
/* eslint-disable react/display-name */
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var handle = {
|
|
48
|
-
change: function change(e) {
|
|
49
|
-
var inputValue = e !== null && e !== void 0 && e.target ? e.target.value : e;
|
|
16
|
+
const InputColor = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
value,
|
|
19
|
+
className,
|
|
20
|
+
symbolsLimit = 7,
|
|
21
|
+
onChange,
|
|
22
|
+
withHexFormat = {
|
|
23
|
+
withSharp: false,
|
|
24
|
+
isTurnOn: true
|
|
25
|
+
},
|
|
26
|
+
initialHexOfColorBlock = '#9AA0B9',
|
|
27
|
+
testId = '',
|
|
28
|
+
withDelete = true,
|
|
29
|
+
...args
|
|
30
|
+
} = _ref;
|
|
31
|
+
const {
|
|
32
|
+
withSharp,
|
|
33
|
+
isTurnOn: isHex
|
|
34
|
+
} = withHexFormat;
|
|
35
|
+
// HANDLES
|
|
36
|
+
const handle = {
|
|
37
|
+
change: e => {
|
|
38
|
+
let inputValue = e !== null && e !== void 0 && e.target ? e.target.value : e;
|
|
50
39
|
inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
51
40
|
if (isHex) inputValue = (0, _fieldValueFormatters.formatToHex)({
|
|
52
|
-
inputValue
|
|
41
|
+
inputValue,
|
|
53
42
|
withSharp: withSharp
|
|
54
43
|
});
|
|
55
44
|
if (symbolsLimit && inputValue.length > +symbolsLimit) inputValue = inputValue.substring(0, +symbolsLimit);
|
|
56
|
-
onChange === null || onChange === void 0
|
|
45
|
+
onChange === null || onChange === void 0 || onChange(inputValue);
|
|
57
46
|
}
|
|
58
47
|
};
|
|
59
48
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -73,6 +62,4 @@ var InputColor = function InputColor(_ref) {
|
|
|
73
62
|
type: "text"
|
|
74
63
|
})));
|
|
75
64
|
};
|
|
76
|
-
|
|
77
|
-
var _default = InputColor;
|
|
78
|
-
exports.default = _default;
|
|
65
|
+
var _default = exports.default = InputColor;
|
|
@@ -1,104 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
|
-
|
|
12
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
|
|
20
11
|
require("./InputCurrency.scss");
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _useState = (0, _react.useState)(currencySymbol || '$'),
|
|
40
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
41
|
-
inputValue = _useState2[0],
|
|
42
|
-
setInputValue = _useState2[1];
|
|
43
|
-
|
|
44
|
-
var inputRef = (0, _react.useRef)(null);
|
|
45
|
-
|
|
46
|
-
var formatNumberWithCommas = function formatNumberWithCommas(number) {
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const InputCurrency = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
currencySymbol,
|
|
17
|
+
onChange,
|
|
18
|
+
className,
|
|
19
|
+
value,
|
|
20
|
+
disabled,
|
|
21
|
+
attributesOfNativeInput = {},
|
|
22
|
+
min = 0,
|
|
23
|
+
max,
|
|
24
|
+
error
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [inputValue, setInputValue] = (0, _react.useState)(currencySymbol || '$');
|
|
27
|
+
const inputRef = (0, _react.useRef)(null);
|
|
28
|
+
const formatNumberWithCommas = number => {
|
|
47
29
|
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
48
30
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var newValue = event.target.value;
|
|
31
|
+
const formatCurrencyInput = event => {
|
|
32
|
+
let newValue = event.target.value;
|
|
52
33
|
newValue = newValue.replace(/[^0-9]/g, '');
|
|
53
34
|
newValue = formatNumberWithCommas(newValue);
|
|
54
35
|
newValue = "".concat(currencySymbol || '$').concat(newValue);
|
|
55
36
|
setInputValue(newValue);
|
|
56
37
|
onChange(newValue.replace(/[^0-9]/g, ''));
|
|
57
38
|
};
|
|
58
|
-
|
|
59
|
-
var onInputClick = function onInputClick() {
|
|
39
|
+
const onInputClick = () => {
|
|
60
40
|
if (!inputValue) {
|
|
61
41
|
inputRef.current.selectionStart = inputRef.current.selectionEnd = currencySymbol ? currencySymbol.length : 1;
|
|
62
42
|
}
|
|
63
43
|
};
|
|
64
|
-
|
|
65
|
-
var onKeyDown = function onKeyDown(event) {
|
|
44
|
+
const onKeyDown = event => {
|
|
66
45
|
if (event.key.match(/^[a-zA-Z0-9]$/)) {
|
|
67
46
|
setInputValue(inputValue.slice(0, inputRef.current.selectionStart));
|
|
68
47
|
}
|
|
69
48
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var clearValue = value !== null && value !== void 0 ? value : event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : (_event$target$value = _event$target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.replace(/[^0-9]/g, '');
|
|
49
|
+
const checkMinMax = (event, value) => {
|
|
50
|
+
var _event$target;
|
|
51
|
+
const clearValue = value !== null && value !== void 0 ? value : event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.value) === null || _event$target === void 0 ? void 0 : _event$target.replace(/[^0-9]/g, '');
|
|
75
52
|
if (!clearValue) return false;
|
|
76
|
-
|
|
77
53
|
if (clearValue < min) {
|
|
78
54
|
setInputValue("".concat(currencySymbol || '$').concat(formatNumberWithCommas(min)));
|
|
79
55
|
onChange(min);
|
|
80
56
|
return false;
|
|
81
57
|
}
|
|
82
|
-
|
|
83
58
|
if (max && clearValue > max) {
|
|
84
59
|
setInputValue("".concat(currencySymbol || '$').concat(formatNumberWithCommas(max)));
|
|
85
60
|
onChange(max);
|
|
86
61
|
return false;
|
|
87
62
|
}
|
|
88
|
-
|
|
89
63
|
return true;
|
|
90
64
|
};
|
|
91
|
-
|
|
92
|
-
(0, _react.useEffect)(function () {
|
|
65
|
+
(0, _react.useEffect)(() => {
|
|
93
66
|
var _inputValue$toString;
|
|
94
|
-
|
|
95
|
-
if (value && value.toString() !== (inputValue === null || inputValue === void 0 ? void 0 : (_inputValue$toString = inputValue.toString()) === null || _inputValue$toString === void 0 ? void 0 : _inputValue$toString.replace(/[^0-9]/g, ''))) {
|
|
67
|
+
if (value && value.toString() !== (inputValue === null || inputValue === void 0 || (_inputValue$toString = inputValue.toString()) === null || _inputValue$toString === void 0 ? void 0 : _inputValue$toString.replace(/[^0-9]/g, ''))) {
|
|
96
68
|
if (checkMinMax(null, value)) setInputValue("".concat(currencySymbol || '$').concat(formatNumberWithCommas(value)));
|
|
97
69
|
}
|
|
98
70
|
}, [value]);
|
|
99
71
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
72
|
className: (0, _classnames.default)('input-currency-box', className, {
|
|
101
|
-
disabled
|
|
73
|
+
disabled,
|
|
102
74
|
'input-currency__error': error
|
|
103
75
|
})
|
|
104
76
|
}, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
@@ -112,6 +84,4 @@ var InputCurrency = function InputCurrency(_ref) {
|
|
|
112
84
|
onBlur: checkMinMax
|
|
113
85
|
}, attributesOfNativeInput)));
|
|
114
86
|
};
|
|
115
|
-
|
|
116
|
-
var _default = InputCurrency;
|
|
117
|
-
exports.default = _default;
|
|
87
|
+
var _default = exports.default = InputCurrency;
|