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,248 +1,184 @@
|
|
|
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 _moment = _interopRequireDefault(require("moment"));
|
|
17
|
-
|
|
18
10
|
require("./MobileCalendar.scss");
|
|
19
|
-
|
|
20
11
|
var _reactFeather = require("react-feather");
|
|
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
|
-
|
|
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; }
|
|
26
14
|
require('../../../Functions/customEventListener');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var _useState3 = (0, _react.useState)((0, _moment.default)(min)),
|
|
80
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
81
|
-
minDate = _useState4[0],
|
|
82
|
-
setMinDate = _useState4[1];
|
|
83
|
-
|
|
84
|
-
var _useState5 = (0, _react.useState)((0, _moment.default)(max)),
|
|
85
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
86
|
-
maxDate = _useState6[0],
|
|
87
|
-
setMaxDate = _useState6[1];
|
|
88
|
-
|
|
89
|
-
var _useState7 = (0, _react.useState)(false),
|
|
90
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
91
|
-
isMouseDown = _useState8[0],
|
|
92
|
-
setIsMouseDown = _useState8[1];
|
|
93
|
-
|
|
94
|
-
var _useState9 = (0, _react.useState)(null),
|
|
95
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
96
|
-
mouseDownOn = _useState10[0],
|
|
97
|
-
setMouseDownOn = _useState10[1];
|
|
98
|
-
|
|
99
|
-
var _useState11 = (0, _react.useState)(null),
|
|
100
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
101
|
-
changeInterval = _useState12[0],
|
|
102
|
-
setChangeInterval = _useState12[1];
|
|
103
|
-
|
|
104
|
-
var _useState13 = (0, _react.useState)(null),
|
|
105
|
-
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
106
|
-
touchY = _useState14[0],
|
|
107
|
-
setTouchY = _useState14[1];
|
|
108
|
-
|
|
109
|
-
var _useState15 = (0, _react.useState)(null),
|
|
110
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
111
|
-
touchType = _useState16[0],
|
|
112
|
-
setTouchType = _useState16[1];
|
|
113
|
-
|
|
114
|
-
var _useState17 = (0, _react.useState)(null),
|
|
115
|
-
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
116
|
-
touchTimestamp = _useState18[0],
|
|
117
|
-
setTouchTimestamp = _useState18[1];
|
|
118
|
-
|
|
119
|
-
var _useState19 = (0, _react.useState)(0),
|
|
120
|
-
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
121
|
-
scrollDirection = _useState20[0],
|
|
122
|
-
setScrollDirection = _useState20[1];
|
|
123
|
-
|
|
124
|
-
var monthsListRef = (0, _react.useRef)(null);
|
|
125
|
-
var daysListRef = (0, _react.useRef)(null);
|
|
126
|
-
var yearsListRef = (0, _react.useRef)(null);
|
|
127
|
-
var dateRef = (0, _react.useRef)(null);
|
|
128
|
-
var intervalRef = (0, _react.useRef)(null); //--HANDLERS--//
|
|
129
|
-
|
|
130
|
-
var changeItem = function changeItem(type, value) {
|
|
15
|
+
const MobileCalendar = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
min = (0, _moment.default)().subtract('10', 'years'),
|
|
18
|
+
max = (0, _moment.default)().add('10', 'years'),
|
|
19
|
+
value = (0, _moment.default)(),
|
|
20
|
+
rows = 5,
|
|
21
|
+
label = '',
|
|
22
|
+
timeout = 75,
|
|
23
|
+
isMobile = true,
|
|
24
|
+
showSelectedDate = false,
|
|
25
|
+
listItemHeight = 32,
|
|
26
|
+
classes = {
|
|
27
|
+
wrapper: '',
|
|
28
|
+
label: '',
|
|
29
|
+
body: '',
|
|
30
|
+
yearsBlock: '',
|
|
31
|
+
yearsList: '',
|
|
32
|
+
yearsListItem: '',
|
|
33
|
+
monthsBlock: '',
|
|
34
|
+
monthsList: '',
|
|
35
|
+
monthsListItem: '',
|
|
36
|
+
daysBlock: '',
|
|
37
|
+
daysList: '',
|
|
38
|
+
daysListItem: '',
|
|
39
|
+
prevItem: '',
|
|
40
|
+
nextItem: '',
|
|
41
|
+
activeItem: ''
|
|
42
|
+
},
|
|
43
|
+
onChange = () => {},
|
|
44
|
+
onMinDateReached = () => {},
|
|
45
|
+
onMaxDateReached = () => {}
|
|
46
|
+
} = _ref;
|
|
47
|
+
const Body = document.querySelector('body');
|
|
48
|
+
const listItem = document.querySelector('.mobile-calendar_wrapper_body_months-list--item');
|
|
49
|
+
const [date, setDate] = (0, _react.useState)(value ? (0, _moment.default)(value) : (0, _moment.default)());
|
|
50
|
+
const [minDate, setMinDate] = (0, _react.useState)((0, _moment.default)(min));
|
|
51
|
+
const [maxDate, setMaxDate] = (0, _react.useState)((0, _moment.default)(max));
|
|
52
|
+
const [isMouseDown, setIsMouseDown] = (0, _react.useState)(false);
|
|
53
|
+
const [mouseDownOn, setMouseDownOn] = (0, _react.useState)(null);
|
|
54
|
+
const [changeInterval, setChangeInterval] = (0, _react.useState)(null);
|
|
55
|
+
const [touchY, setTouchY] = (0, _react.useState)(null);
|
|
56
|
+
const [touchType, setTouchType] = (0, _react.useState)(null);
|
|
57
|
+
const [touchTimestamp, setTouchTimestamp] = (0, _react.useState)(null);
|
|
58
|
+
const [scrollDirection, setScrollDirection] = (0, _react.useState)(0);
|
|
59
|
+
const monthsListRef = (0, _react.useRef)(null);
|
|
60
|
+
const daysListRef = (0, _react.useRef)(null);
|
|
61
|
+
const yearsListRef = (0, _react.useRef)(null);
|
|
62
|
+
const dateRef = (0, _react.useRef)(null);
|
|
63
|
+
const intervalRef = (0, _react.useRef)(null);
|
|
64
|
+
|
|
65
|
+
//--HANDLERS--//
|
|
66
|
+
const changeItem = (type, value) => {
|
|
131
67
|
setScrollDirection(value);
|
|
132
|
-
setDate(
|
|
133
|
-
|
|
68
|
+
setDate(date => {
|
|
69
|
+
const newDate = (0, _moment.default)(date).add(value, type);
|
|
134
70
|
if ((0, _moment.default)(newDate).isBefore(minDate)) return minDate;
|
|
135
71
|
if ((0, _moment.default)(newDate).isAfter(maxDate)) return maxDate;
|
|
136
72
|
return newDate;
|
|
137
73
|
});
|
|
138
|
-
setTimeout(
|
|
74
|
+
setTimeout(() => {
|
|
139
75
|
setScrollDirection(0);
|
|
140
76
|
}, 50);
|
|
141
77
|
};
|
|
142
|
-
|
|
143
|
-
var checkAvailability = function checkAvailability(type, value) {
|
|
78
|
+
const checkAvailability = (type, value) => {
|
|
144
79
|
if (!(dateRef !== null && dateRef !== void 0 && dateRef.current)) return false;
|
|
145
|
-
|
|
80
|
+
const newDate = (0, _moment.default)(dateRef === null || dateRef === void 0 ? void 0 : dateRef.current).add(value, type);
|
|
146
81
|
if ((0, _moment.default)(newDate).isBefore(minDate)) return false;
|
|
147
82
|
if ((0, _moment.default)(newDate).isAfter(maxDate)) return false;
|
|
148
83
|
return true;
|
|
149
84
|
};
|
|
150
|
-
|
|
151
|
-
var onArrowMouseDown = function onArrowMouseDown(type, value) {
|
|
85
|
+
const onArrowMouseDown = (type, value) => {
|
|
152
86
|
setIsMouseDown(true);
|
|
153
87
|
setMouseDownOn({
|
|
154
|
-
type
|
|
155
|
-
value
|
|
88
|
+
type,
|
|
89
|
+
value
|
|
156
90
|
});
|
|
157
91
|
};
|
|
158
|
-
|
|
159
|
-
var onArrowMouseUp = function onArrowMouseUp() {
|
|
92
|
+
const onArrowMouseUp = () => {
|
|
160
93
|
setIsMouseDown(false);
|
|
161
94
|
setMouseDownOn(null);
|
|
162
95
|
};
|
|
163
|
-
|
|
164
|
-
var onWheel = function onWheel(e, type) {
|
|
96
|
+
const onWheel = (e, type) => {
|
|
165
97
|
e.preventDefault();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
98
|
+
const {
|
|
99
|
+
deltaY
|
|
100
|
+
} = e;
|
|
101
|
+
const top = window.scrollX;
|
|
102
|
+
const left = window.scrollY;
|
|
169
103
|
window.scrollTo({
|
|
170
|
-
top
|
|
171
|
-
left
|
|
104
|
+
top,
|
|
105
|
+
left
|
|
172
106
|
});
|
|
173
107
|
changeItem(type, deltaY < 0 ? -1 : 1);
|
|
174
108
|
};
|
|
175
|
-
|
|
176
|
-
var onTouchStart = function onTouchStart(e, type) {
|
|
109
|
+
const onTouchStart = (e, type) => {
|
|
177
110
|
e.preventDefault();
|
|
178
|
-
|
|
179
111
|
if (intervalRef !== null && intervalRef !== void 0 && intervalRef.current) {
|
|
180
112
|
clearInterval(intervalRef === null || intervalRef === void 0 ? void 0 : intervalRef.current);
|
|
181
113
|
intervalRef.current = null;
|
|
182
114
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
115
|
+
const {
|
|
116
|
+
timeStamp,
|
|
117
|
+
changedTouches
|
|
118
|
+
} = e;
|
|
119
|
+
const {
|
|
120
|
+
pageY
|
|
121
|
+
} = changedTouches[0];
|
|
187
122
|
setTouchY(pageY);
|
|
188
123
|
setTouchTimestamp(timeStamp);
|
|
189
124
|
setTouchType(type);
|
|
190
|
-
window.addEventListener('touchend',
|
|
191
|
-
return onTouchEnd(e, pageY, timeStamp, type);
|
|
192
|
-
}, {
|
|
125
|
+
window.addEventListener('touchend', e => onTouchEnd(e, pageY, timeStamp, type), {
|
|
193
126
|
once: true
|
|
194
127
|
});
|
|
195
128
|
};
|
|
196
|
-
|
|
197
|
-
var onTouchMove = function onTouchMove(e) {
|
|
129
|
+
const onTouchMove = e => {
|
|
198
130
|
if (!touchY || !touchType) return;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
131
|
+
const {
|
|
132
|
+
timeStamp,
|
|
133
|
+
changedTouches
|
|
134
|
+
} = e;
|
|
135
|
+
const {
|
|
136
|
+
pageY
|
|
137
|
+
} = changedTouches[0];
|
|
138
|
+
const deltaY = touchY - pageY;
|
|
203
139
|
if (Math.abs(deltaY) < listItemHeight) return;
|
|
204
|
-
|
|
140
|
+
const direction = deltaY < 0 ? -1 : 1;
|
|
205
141
|
setScrollDirection(direction);
|
|
206
142
|
changeItem(touchType, direction);
|
|
207
143
|
setTouchY(pageY);
|
|
208
144
|
setTouchTimestamp(timeStamp);
|
|
209
145
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
146
|
+
const onTouchEnd = (e, startY, startTime, touchType) => {
|
|
147
|
+
const {
|
|
148
|
+
timeStamp,
|
|
149
|
+
changedTouches
|
|
150
|
+
} = e;
|
|
151
|
+
const {
|
|
152
|
+
pageY
|
|
153
|
+
} = changedTouches[0];
|
|
154
|
+
const path = Math.abs(startY - pageY); //in px
|
|
155
|
+
const time = timeStamp - startTime; //ms
|
|
156
|
+
const pxPerMs = path / time;
|
|
220
157
|
if (pxPerMs > 0.65) innertionScroll({
|
|
221
|
-
startY
|
|
222
|
-
pageY
|
|
223
|
-
timeStamp
|
|
224
|
-
startTime
|
|
225
|
-
touchType
|
|
158
|
+
startY,
|
|
159
|
+
pageY,
|
|
160
|
+
timeStamp,
|
|
161
|
+
startTime,
|
|
162
|
+
touchType
|
|
226
163
|
});else setTouchType(null);
|
|
227
164
|
setTouchY(null);
|
|
228
165
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
intervalRef.current = setInterval(function () {
|
|
166
|
+
const innertionScroll = _ref2 => {
|
|
167
|
+
let {
|
|
168
|
+
startY,
|
|
169
|
+
pageY,
|
|
170
|
+
timeStamp,
|
|
171
|
+
startTime,
|
|
172
|
+
touchType
|
|
173
|
+
} = _ref2;
|
|
174
|
+
const path = Math.abs(startY - pageY); //in px
|
|
175
|
+
const time = timeStamp - startTime; //ms
|
|
176
|
+
const pxPerMs = Math.ceil(path / time); //speed
|
|
177
|
+
|
|
178
|
+
const S = pxPerMs / 2 * time;
|
|
179
|
+
const blocks = Math.ceil(S / listItemHeight * pxPerMs);
|
|
180
|
+
let i = 1;
|
|
181
|
+
intervalRef.current = setInterval(() => {
|
|
246
182
|
if (checkAvailability(touchType, startY - pageY < 0 ? -1 : 1, date) && i <= blocks) {
|
|
247
183
|
changeItem(touchType, startY - pageY < 0 ? -1 : 1);
|
|
248
184
|
} else {
|
|
@@ -250,9 +186,10 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
250
186
|
clearInterval(intervalRef === null || intervalRef === void 0 ? void 0 : intervalRef.current);
|
|
251
187
|
intervalRef.current = null;
|
|
252
188
|
}
|
|
253
|
-
|
|
254
189
|
++i;
|
|
255
|
-
}, timeout);
|
|
190
|
+
}, timeout);
|
|
191
|
+
|
|
192
|
+
// for(let i = 1; i <= blocks; ++i){
|
|
256
193
|
// // timeout = i*pxPerMs+Math.pow(i,2)*10;
|
|
257
194
|
// timeout += 80;
|
|
258
195
|
// if(checkAvailability(touchType, startY-pageY < 0 ? -1 : 1, date)){
|
|
@@ -261,188 +198,144 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
261
198
|
// changeItem(touchType, startY-pageY < 0 ? -1 : 1);
|
|
262
199
|
// }, timeout)
|
|
263
200
|
// }
|
|
264
|
-
// }
|
|
265
|
-
}; //--FUNCTIONS--//
|
|
266
201
|
|
|
202
|
+
// }
|
|
203
|
+
};
|
|
267
204
|
|
|
268
|
-
|
|
205
|
+
//--FUNCTIONS--//
|
|
206
|
+
const intervalWorker = () => {
|
|
269
207
|
if (!mouseDownOn) return;
|
|
270
|
-
|
|
271
|
-
|
|
208
|
+
const {
|
|
209
|
+
type,
|
|
210
|
+
value
|
|
211
|
+
} = mouseDownOn;
|
|
272
212
|
changeItem(type, value);
|
|
273
213
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
for (var i = (renderRows - 1) / 2; i >= (renderRows - 1) / 2 * -1; --i) {
|
|
214
|
+
const getList = (type, format) => {
|
|
215
|
+
const list = [];
|
|
216
|
+
const renderRows = rows;
|
|
217
|
+
for (let i = (renderRows - 1) / 2; i >= (renderRows - 1) / 2 * -1; --i) {
|
|
280
218
|
list.push((0, _moment.default)(date).subtract(i, type).format(format));
|
|
281
219
|
}
|
|
282
|
-
|
|
283
220
|
return list;
|
|
284
221
|
};
|
|
222
|
+
const getMonthList = () => getList('months', 'MMMM');
|
|
223
|
+
const getDaysList = () => getList('days', 'D');
|
|
224
|
+
const getYearsList = () => getList('years', 'YYYY');
|
|
285
225
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
var getDaysList = function getDaysList() {
|
|
291
|
-
return getList('days', 'D');
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
var getYearsList = function getYearsList() {
|
|
295
|
-
return getList('years', 'YYYY');
|
|
296
|
-
}; //--OBSERVERS--//
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
(0, _react.useEffect)(function () {
|
|
226
|
+
//--OBSERVERS--//
|
|
227
|
+
(0, _react.useEffect)(() => {
|
|
300
228
|
if ((0, _moment.default)(date.format('L')).isBefore(minDate.format('L'))) setDate(minDate);
|
|
301
229
|
if ((0, _moment.default)(date.format('L')).isAfter(maxDate.format('L'))) setDate(maxDate);
|
|
302
|
-
}, []);
|
|
230
|
+
}, []);
|
|
303
231
|
|
|
304
|
-
|
|
232
|
+
//Events Observer
|
|
233
|
+
(0, _react.useEffect)(() => {
|
|
305
234
|
document.addEventListener('mouseup', onArrowMouseUp);
|
|
306
|
-
return
|
|
235
|
+
return () => {
|
|
307
236
|
document.removeEventListener('mouseup', onArrowMouseUp);
|
|
308
237
|
};
|
|
309
238
|
}, []);
|
|
310
|
-
(0, _react.useEffect)(
|
|
239
|
+
(0, _react.useEffect)(() => {
|
|
311
240
|
onChange(date);
|
|
312
241
|
dateRef.current = date;
|
|
313
242
|
if ((0, _moment.default)(date.format('L')).isSame(minDate.format('L'))) onMinDateReached(minDate);
|
|
314
243
|
if ((0, _moment.default)(date.format('L')).isSame(maxDate.format('L'))) onMaxDateReached(maxDate);
|
|
315
|
-
}, [date]);
|
|
244
|
+
}, [date]);
|
|
316
245
|
|
|
317
|
-
|
|
246
|
+
//monthList Events
|
|
247
|
+
(0, _react.useEffect)(() => {
|
|
318
248
|
if (monthsListRef !== null && monthsListRef !== void 0 && monthsListRef.current) {
|
|
319
249
|
var _monthsListRef$curren, _monthsListRef$curren2;
|
|
320
|
-
|
|
321
|
-
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren = monthsListRef.current) === null || _monthsListRef$curren === void 0 ? void 0 : _monthsListRef$curren.addEventListener('mousewheel', function (e) {
|
|
322
|
-
return onWheel(e, 'months');
|
|
323
|
-
}, {
|
|
250
|
+
monthsListRef === null || monthsListRef === void 0 || (_monthsListRef$curren = monthsListRef.current) === null || _monthsListRef$curren === void 0 || _monthsListRef$curren.addEventListener('mousewheel', e => onWheel(e, 'months'), {
|
|
324
251
|
passive: false
|
|
325
252
|
});
|
|
326
|
-
monthsListRef === null || monthsListRef === void 0
|
|
327
|
-
return onTouchStart(e, 'months');
|
|
328
|
-
}, {
|
|
253
|
+
monthsListRef === null || monthsListRef === void 0 || (_monthsListRef$curren2 = monthsListRef.current) === null || _monthsListRef$curren2 === void 0 || _monthsListRef$curren2.addEventListener('touchstart', e => onTouchStart(e, 'months'), {
|
|
329
254
|
passive: false
|
|
330
255
|
});
|
|
331
256
|
}
|
|
332
|
-
|
|
333
|
-
return function () {
|
|
257
|
+
return () => {
|
|
334
258
|
var _monthsListRef$curren3, _monthsListRef$curren4;
|
|
335
|
-
|
|
336
|
-
monthsListRef === null || monthsListRef === void 0
|
|
337
|
-
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren4 = monthsListRef.current) === null || _monthsListRef$curren4 === void 0 ? void 0 : _monthsListRef$curren4.clearEventListeners('touchstart');
|
|
259
|
+
monthsListRef === null || monthsListRef === void 0 || (_monthsListRef$curren3 = monthsListRef.current) === null || _monthsListRef$curren3 === void 0 || _monthsListRef$curren3.clearEventListeners('mousewheel');
|
|
260
|
+
monthsListRef === null || monthsListRef === void 0 || (_monthsListRef$curren4 = monthsListRef.current) === null || _monthsListRef$curren4 === void 0 || _monthsListRef$curren4.clearEventListeners('touchstart');
|
|
338
261
|
};
|
|
339
|
-
}, [monthsListRef]);
|
|
262
|
+
}, [monthsListRef]);
|
|
340
263
|
|
|
341
|
-
|
|
264
|
+
//daysList Events
|
|
265
|
+
(0, _react.useEffect)(() => {
|
|
342
266
|
if (daysListRef !== null && daysListRef !== void 0 && daysListRef.current) {
|
|
343
267
|
var _daysListRef$current, _daysListRef$current2;
|
|
344
|
-
|
|
345
|
-
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current = daysListRef.current) === null || _daysListRef$current === void 0 ? void 0 : _daysListRef$current.addEventListener('mousewheel', function (e) {
|
|
346
|
-
return onWheel(e, 'days');
|
|
347
|
-
}, {
|
|
268
|
+
daysListRef === null || daysListRef === void 0 || (_daysListRef$current = daysListRef.current) === null || _daysListRef$current === void 0 || _daysListRef$current.addEventListener('mousewheel', e => onWheel(e, 'days'), {
|
|
348
269
|
passive: false
|
|
349
270
|
});
|
|
350
|
-
daysListRef === null || daysListRef === void 0
|
|
351
|
-
return onTouchStart(e, 'days');
|
|
352
|
-
}, {
|
|
271
|
+
daysListRef === null || daysListRef === void 0 || (_daysListRef$current2 = daysListRef.current) === null || _daysListRef$current2 === void 0 || _daysListRef$current2.addEventListener('touchstart', e => onTouchStart(e, 'days'), {
|
|
353
272
|
passive: false
|
|
354
273
|
});
|
|
355
274
|
}
|
|
356
|
-
|
|
357
|
-
return function () {
|
|
275
|
+
return () => {
|
|
358
276
|
var _daysListRef$current3, _daysListRef$current4;
|
|
359
|
-
|
|
360
|
-
daysListRef === null || daysListRef === void 0
|
|
361
|
-
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current4 = daysListRef.current) === null || _daysListRef$current4 === void 0 ? void 0 : _daysListRef$current4.clearEventListeners('touchstart');
|
|
277
|
+
daysListRef === null || daysListRef === void 0 || (_daysListRef$current3 = daysListRef.current) === null || _daysListRef$current3 === void 0 || _daysListRef$current3.clearEventListeners('mousewheel');
|
|
278
|
+
daysListRef === null || daysListRef === void 0 || (_daysListRef$current4 = daysListRef.current) === null || _daysListRef$current4 === void 0 || _daysListRef$current4.clearEventListeners('touchstart');
|
|
362
279
|
};
|
|
363
|
-
}, [daysListRef]);
|
|
280
|
+
}, [daysListRef]);
|
|
364
281
|
|
|
365
|
-
|
|
282
|
+
//yearsList Events
|
|
283
|
+
(0, _react.useEffect)(() => {
|
|
366
284
|
if (yearsListRef !== null && yearsListRef !== void 0 && yearsListRef.current) {
|
|
367
285
|
var _yearsListRef$current, _yearsListRef$current2;
|
|
368
|
-
|
|
369
|
-
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current = yearsListRef.current) === null || _yearsListRef$current === void 0 ? void 0 : _yearsListRef$current.addEventListener('mousewheel', function (e) {
|
|
370
|
-
return onWheel(e, 'years');
|
|
371
|
-
}, {
|
|
286
|
+
yearsListRef === null || yearsListRef === void 0 || (_yearsListRef$current = yearsListRef.current) === null || _yearsListRef$current === void 0 || _yearsListRef$current.addEventListener('mousewheel', e => onWheel(e, 'years'), {
|
|
372
287
|
passive: false
|
|
373
288
|
});
|
|
374
|
-
yearsListRef === null || yearsListRef === void 0
|
|
375
|
-
return onTouchStart(e, 'years');
|
|
376
|
-
}, {
|
|
289
|
+
yearsListRef === null || yearsListRef === void 0 || (_yearsListRef$current2 = yearsListRef.current) === null || _yearsListRef$current2 === void 0 || _yearsListRef$current2.addEventListener('touchstart', e => onTouchStart(e, 'years'), {
|
|
377
290
|
passive: false
|
|
378
291
|
});
|
|
379
292
|
}
|
|
380
|
-
|
|
381
|
-
return function () {
|
|
293
|
+
return () => {
|
|
382
294
|
var _yearsListRef$current3, _yearsListRef$current4;
|
|
383
|
-
|
|
384
|
-
yearsListRef === null || yearsListRef === void 0
|
|
385
|
-
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current4 = yearsListRef.current) === null || _yearsListRef$current4 === void 0 ? void 0 : _yearsListRef$current4.clearEventListeners('touchstart');
|
|
295
|
+
yearsListRef === null || yearsListRef === void 0 || (_yearsListRef$current3 = yearsListRef.current) === null || _yearsListRef$current3 === void 0 || _yearsListRef$current3.clearEventListeners('mousewheel');
|
|
296
|
+
yearsListRef === null || yearsListRef === void 0 || (_yearsListRef$current4 = yearsListRef.current) === null || _yearsListRef$current4 === void 0 || _yearsListRef$current4.clearEventListeners('touchstart');
|
|
386
297
|
};
|
|
387
|
-
}, [yearsListRef]);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
"attr-is-scrolling": touchType === 'months' ? 1 : 0
|
|
400
|
-
}, month);
|
|
401
|
-
});
|
|
298
|
+
}, [yearsListRef]);
|
|
299
|
+
|
|
300
|
+
//--RENDER--//
|
|
301
|
+
const renderMonthsList = () => {
|
|
302
|
+
const half = (rows - 1) / 2;
|
|
303
|
+
return getMonthList().map((month, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
304
|
+
className: "mobile-calendar_wrapper_body_months-list--item ".concat(i === half ? 'active' : '', " ").concat(i === 0 || i === rows - 1 ? 'transparent' : '', " ").concat(classes === null || classes === void 0 ? void 0 : classes.monthsListItem, " ").concat(i === half ? classes === null || classes === void 0 ? void 0 : classes.activeItem : ''),
|
|
305
|
+
key: "month-".concat(month),
|
|
306
|
+
onClick: touchY ? null : () => i - half === 0 ? {} : changeItem('months', i - half),
|
|
307
|
+
"attr-scroll-direction": touchType === 'months' ? scrollDirection : 0,
|
|
308
|
+
"attr-is-scrolling": touchType === 'months' ? 1 : 0
|
|
309
|
+
}, month));
|
|
402
310
|
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
"attr-scroll-direction": touchType === 'days' ? scrollDirection : 0,
|
|
414
|
-
"attr-is-scrolling": touchType === 'days' ? 1 : 0
|
|
415
|
-
}, day);
|
|
416
|
-
});
|
|
311
|
+
const renderDaysList = () => {
|
|
312
|
+
const half = (rows - 1) / 2;
|
|
313
|
+
return getDaysList().map((day, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
+
className: "mobile-calendar_wrapper_body_days-list--item ".concat(i === half ? 'active' : '', " ").concat(i === 0 || i === rows - 1 ? 'transparent' : '', " ").concat(classes === null || classes === void 0 ? void 0 : classes.daysListItem, " ").concat(i === half ? classes === null || classes === void 0 ? void 0 : classes.activeItem : ''),
|
|
315
|
+
key: "day-".concat(day),
|
|
316
|
+
onClick: () => i - half === 0 ? {} : changeItem('days', i - half),
|
|
317
|
+
"attr-scroll-direction": touchType === 'days' ? scrollDirection : 0,
|
|
318
|
+
"attr-is-scrolling": touchType === 'days' ? 1 : 0
|
|
319
|
+
}, day));
|
|
417
320
|
};
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
},
|
|
428
|
-
"attr-scroll-direction": touchType === 'years' ? scrollDirection : 0,
|
|
429
|
-
"attr-is-scrolling": touchType === 'years' ? 1 : 0
|
|
430
|
-
}, year);
|
|
431
|
-
});
|
|
321
|
+
const renderYearsList = () => {
|
|
322
|
+
const half = (rows - 1) / 2;
|
|
323
|
+
return getYearsList().map((year, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
324
|
+
className: "mobile-calendar_wrapper_body_years-list--item ".concat(i === half ? 'active' : '', " ").concat(i === 0 || i === rows - 1 ? 'transparent' : '', " ").concat(classes === null || classes === void 0 ? void 0 : classes.yearsListItem, " ").concat(i === half ? classes === null || classes === void 0 ? void 0 : classes.activeItem : ''),
|
|
325
|
+
key: "year-".concat(year),
|
|
326
|
+
onClick: () => i - half === 0 ? {} : changeItem('years', i - half),
|
|
327
|
+
"attr-scroll-direction": touchType === 'years' ? scrollDirection : 0,
|
|
328
|
+
"attr-is-scrolling": touchType === 'years' ? 1 : 0
|
|
329
|
+
}, year));
|
|
432
330
|
};
|
|
433
|
-
|
|
434
|
-
var renderMonthsBlock = function renderMonthsBlock() {
|
|
331
|
+
const renderMonthsBlock = () => {
|
|
435
332
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
436
333
|
className: "mobile-calendar_wrapper_body_months ".concat(classes === null || classes === void 0 ? void 0 : classes.monthsBlock)
|
|
437
334
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
438
335
|
className: "mobile-calendar_wrapper_body_months--prev ".concat(classes === null || classes === void 0 ? void 0 : classes.prevItem)
|
|
439
336
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
|
|
440
|
-
onClick:
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
onMouseDown: function onMouseDown() {
|
|
444
|
-
return onArrowMouseDown('months', -1);
|
|
445
|
-
},
|
|
337
|
+
onClick: () => changeItem('months', -1),
|
|
338
|
+
onMouseDown: () => onArrowMouseDown('months', -1),
|
|
446
339
|
onMouseUp: onArrowMouseUp
|
|
447
340
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
448
341
|
className: "mobile-calendar_wrapper_body_months-list ".concat(classes === null || classes === void 0 ? void 0 : classes.monthsList),
|
|
@@ -452,28 +345,19 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
452
345
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
453
346
|
className: "mobile-calendar_wrapper_body_months--next ".concat(classes === null || classes === void 0 ? void 0 : classes.nextItem)
|
|
454
347
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, {
|
|
455
|
-
onClick:
|
|
456
|
-
|
|
457
|
-
},
|
|
458
|
-
onMouseDown: function onMouseDown() {
|
|
459
|
-
return onArrowMouseDown('months', 1);
|
|
460
|
-
},
|
|
348
|
+
onClick: () => changeItem('months', 1),
|
|
349
|
+
onMouseDown: () => onArrowMouseDown('months', 1),
|
|
461
350
|
onMouseUp: onArrowMouseUp
|
|
462
351
|
})));
|
|
463
352
|
};
|
|
464
|
-
|
|
465
|
-
var renderDaysBlock = function renderDaysBlock() {
|
|
353
|
+
const renderDaysBlock = () => {
|
|
466
354
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
467
355
|
className: "mobile-calendar_wrapper_body_days ".concat(classes === null || classes === void 0 ? void 0 : classes.daysBlock)
|
|
468
356
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
469
357
|
className: "mobile-calendar_wrapper_body_days--prev ".concat(classes === null || classes === void 0 ? void 0 : classes.prevItem)
|
|
470
358
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
|
|
471
|
-
onClick:
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
onMouseDown: function onMouseDown() {
|
|
475
|
-
return onArrowMouseDown('days', -1);
|
|
476
|
-
},
|
|
359
|
+
onClick: () => changeItem('days', -1),
|
|
360
|
+
onMouseDown: () => onArrowMouseDown('days', -1),
|
|
477
361
|
onMouseUp: onArrowMouseUp
|
|
478
362
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
479
363
|
className: "mobile-calendar_wrapper_body_days-list ".concat(classes === null || classes === void 0 ? void 0 : classes.daysList),
|
|
@@ -483,28 +367,19 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
483
367
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
484
368
|
className: "mobile-calendar_wrapper_body_days--next ".concat(classes === null || classes === void 0 ? void 0 : classes.nextItem)
|
|
485
369
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, {
|
|
486
|
-
onClick:
|
|
487
|
-
|
|
488
|
-
},
|
|
489
|
-
onMouseDown: function onMouseDown() {
|
|
490
|
-
return onArrowMouseDown('days', 1);
|
|
491
|
-
},
|
|
370
|
+
onClick: () => changeItem('days', 1),
|
|
371
|
+
onMouseDown: () => onArrowMouseDown('days', 1),
|
|
492
372
|
onMouseUp: onArrowMouseUp
|
|
493
373
|
})));
|
|
494
374
|
};
|
|
495
|
-
|
|
496
|
-
var renderYearsBlock = function renderYearsBlock() {
|
|
375
|
+
const renderYearsBlock = () => {
|
|
497
376
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
498
377
|
className: "mobile-calendar_wrapper_body_years ".concat(classes === null || classes === void 0 ? void 0 : classes.yearsBlock)
|
|
499
378
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
500
379
|
className: "mobile-calendar_wrapper_body_years--prev ".concat(classes === null || classes === void 0 ? void 0 : classes.prevItem)
|
|
501
380
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, {
|
|
502
|
-
onClick:
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
onMouseDown: function onMouseDown() {
|
|
506
|
-
return onArrowMouseDown('years', -1);
|
|
507
|
-
},
|
|
381
|
+
onClick: () => changeItem('years', -1),
|
|
382
|
+
onMouseDown: () => onArrowMouseDown('years', -1),
|
|
508
383
|
onMouseUp: onArrowMouseUp
|
|
509
384
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
510
385
|
className: "mobile-calendar_wrapper_body_years-list ".concat(classes === null || classes === void 0 ? void 0 : classes.yearsList),
|
|
@@ -514,16 +389,11 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
514
389
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
515
390
|
className: "mobile-calendar_wrapper_body_years--next ".concat(classes === null || classes === void 0 ? void 0 : classes.nextItem)
|
|
516
391
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, {
|
|
517
|
-
onClick:
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
onMouseDown: function onMouseDown() {
|
|
521
|
-
return onArrowMouseDown('years', 1);
|
|
522
|
-
},
|
|
392
|
+
onClick: () => changeItem('years', 1),
|
|
393
|
+
onMouseDown: () => onArrowMouseDown('years', 1),
|
|
523
394
|
onMouseUp: onArrowMouseUp
|
|
524
395
|
})));
|
|
525
396
|
};
|
|
526
|
-
|
|
527
397
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
528
398
|
className: "mobile-calendar_wrapper ".concat(classes === null || classes === void 0 ? void 0 : classes.wrapper),
|
|
529
399
|
onTouchMove: onTouchMove
|
|
@@ -535,6 +405,4 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
535
405
|
className: "mobile-calendar_wrapper_body ".concat(classes === null || classes === void 0 ? void 0 : classes.body)
|
|
536
406
|
}, renderMonthsBlock(), renderDaysBlock(), renderYearsBlock()));
|
|
537
407
|
};
|
|
538
|
-
|
|
539
|
-
var _default = MobileCalendar;
|
|
540
|
-
exports.default = _default;
|
|
408
|
+
var _default = exports.default = MobileCalendar;
|