intelicoreact 1.6.24 → 1.6.26
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 -98
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -48
- package/dist/Atomic/FormElements/Calendar/Calendar.js +1 -249
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +1 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -65
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -52
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +1 -424
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +1 -4
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +1 -173
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +1 -4
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +1 -735
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -20
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +1 -529
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +1 -94
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +1 -105
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +1 -67
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +1 -247
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +1 -160
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +1 -193
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +1 -135
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -116
- package/dist/Atomic/FormElements/Input/Input.js +1 -467
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +1 -161
- package/dist/Atomic/FormElements/InputColor/InputColor.js +1 -64
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +1 -200
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +1 -354
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +1 -71
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.d.ts +2 -0
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +1 -693
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js.map +1 -0
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +1 -254
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -32
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +1 -200
- package/dist/Atomic/FormElements/InputLink/InputLink.js +1 -99
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +1 -37
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1 -1214
- package/dist/Atomic/FormElements/InputMask/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +1 -674
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask2/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +1 -766
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask3/functions.js +1 -58
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +1 -114
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +1 -140
- package/dist/Atomic/FormElements/Label/Label.js +1 -87
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -506
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -45
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -331
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -80
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -57
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -183
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -222
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -175
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -43
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -443
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -858
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -39
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -59
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -50
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -44
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +1 -100
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +1 -52
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -64
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -170
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +1 -202
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -67
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -115
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1110
- package/dist/Atomic/FormElements/Text/Text.js +1 -125
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -49
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -80
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -176
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -62
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +1 -119
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +1 -188
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -82
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -101
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -29
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -113
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -30
- package/dist/Atomic/Layout/Header/Header.js +1 -85
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -44
- package/dist/Atomic/UI/Accordion/Accordion.js +1 -108
- package/dist/Atomic/UI/Accordion/AccordionItem.js +1 -176
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -238
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -69
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +1 -207
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +1 -56
- package/dist/Atomic/UI/Alert/Alert.js +1 -72
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -132
- package/dist/Atomic/UI/Box/Box.js +1 -52
- package/dist/Atomic/UI/Button/Button.js +1 -47
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -72
- package/dist/Atomic/UI/Chart/Chart.js +1 -172
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +1 -95
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -80
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +1 -188
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -335
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +1 -43
- package/dist/Atomic/UI/Chart/partial/utils.js +1 -60
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -109
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -15
- package/dist/Atomic/UI/DoubleString/DoubleString.d.ts +19 -0
- package/dist/Atomic/UI/DoubleString/DoubleString.js +1 -102
- package/dist/Atomic/UI/DoubleString/DoubleString.js.map +1 -0
- package/dist/Atomic/UI/DoubleString/DoubleString.scss +8 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -70
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -221
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -106
- package/dist/Atomic/UI/Hint/Hint.js +1 -256
- package/dist/Atomic/UI/Hint/partials/_utils.js +1 -64
- package/dist/Atomic/UI/Modal/Modal.js +1 -179
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -97
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -71
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -110
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +1 -192
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -80
- package/dist/Atomic/UI/NavLine/NavLine.js +1 -317
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -77
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -42
- package/dist/Atomic/UI/Price/Price.js +1 -31
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -44
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -98
- package/dist/Atomic/UI/Status/Status.js +1 -67
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -38
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -99
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -52
- package/dist/Atomic/UI/Table/Table.js +1 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -28
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -53
- package/dist/Atomic/UI/Tag/Tag.js +1 -167
- package/dist/Atomic/UI/TagList/TagList.js +1 -251
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -86
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -84
- package/dist/Atomic/UI/WizardStepper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +1 -37
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +1 -61
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +1 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -3
- package/dist/Classes/AbortableFetch.js +1 -454
- package/dist/Classes/AnimatedHandler.js +1 -47
- package/dist/Classes/RESTAPI/index.js +1 -228
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +1 -457
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -48
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +1 -112
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +1 -189
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -252
- package/dist/Classes/RESTAPI/partials/Utils.js +1 -92
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +1 -3
- package/dist/Classes/RESTAPI/partials/_utils.js +1 -197
- package/dist/Constants/index.constants.js +1 -78
- package/dist/Functions/Portal.js +1 -22
- package/dist/Functions/customEventListener.js +1 -96
- package/dist/Functions/dateTime.js +1 -149
- package/dist/Functions/fieldValueFormatters.js +1 -405
- package/dist/Functions/guards/assertions.js +1 -294
- package/dist/Functions/guards/safeValue.js +1 -75
- package/dist/Functions/guards/typeGuards.js +1 -373
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +1 -95
- package/dist/Functions/locale/createTranslator.js +1 -32
- package/dist/Functions/operations.js +1 -130
- package/dist/Functions/presets/inputMaskPresets.js +1 -170
- package/dist/Functions/presets/inputPresets.js +1 -60
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +1 -45
- package/dist/Functions/schemas.js +1 -31
- package/dist/Functions/useBodyScrollLock.js +1 -17
- package/dist/Functions/useClickOutside.js +1 -15
- package/dist/Functions/useDebounce.js +1 -17
- package/dist/Functions/useFieldFocus.js +1 -84
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -39
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +1 -159
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -78
- package/dist/Functions/useFormTools/functions/General.js +1 -134
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -111
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -12
- package/dist/Functions/useFormTools/index.js +1 -778
- package/dist/Functions/useInputHighlightError.js +1 -67
- package/dist/Functions/useIsMobile/useIsMobile.js +1 -33
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -52
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -52
- package/dist/Functions/useLocalStorage.js +1 -34
- package/dist/Functions/useLocationParams.js +1 -27
- package/dist/Functions/useMediaQuery.js +1 -17
- package/dist/Functions/useMetaInfo.js +1 -43
- package/dist/Functions/useMouseUpOutside.js +1 -16
- package/dist/Functions/useOnlineStatus.js +1 -29
- package/dist/Functions/usePasswordChecker.js +1 -110
- package/dist/Functions/usePrevious.js +1 -12
- package/dist/Functions/useResize.js +1 -31
- package/dist/Functions/useScrollTo.js +1 -17
- package/dist/Functions/useToggle.js +1 -17
- package/dist/Functions/utils.js +1 -522
- package/dist/Langs.js +1 -168
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -29
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -32
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -17
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -17
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -15
- package/dist/Molecular/CustomIcons/components/Button.js +1 -12
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -16
- package/dist/Molecular/CustomIcons/components/Check.js +1 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -27
- package/dist/Molecular/CustomIcons/components/Close.js +1 -14
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -17
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -16
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -15
- package/dist/Molecular/CustomIcons/components/Email.js +1 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -18
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -35
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -15
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -25
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -29
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -29
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -19
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -20
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -19
- package/dist/Molecular/CustomIcons/components/Home.js +1 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -22
- package/dist/Molecular/CustomIcons/components/Key.js +1 -23
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -20
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -15
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -26
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -73
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -16
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -28
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -41
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -28
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -30
- package/dist/Molecular/CustomIcons/components/Play.js +1 -25
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -29
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -12
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -13
- package/dist/Molecular/CustomIcons/components/Star.js +1 -14
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -16
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -15
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -15
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -15
- package/dist/Molecular/CustomIcons/components/User.js +1 -25
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -31
- package/dist/Molecular/CustomIcons/components/X.js +1 -12
- package/dist/Molecular/CustomIcons/index.js +1 -61
- package/dist/Molecular/FormElement/FormElement.js +1 -54
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -184
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +1 -53
- package/dist/Molecular/InputAddress/InputAddress.js +1 -626
- package/dist/Molecular/InputPassword/InputPassword.js +1 -48
- package/dist/index.js +1 -104
- package/package.json +1 -1
|
@@ -1,424 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
-
const _moment = /*#__PURE__*/ _interop_require_default(require("moment"));
|
|
14
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
15
|
-
const _Langs = /*#__PURE__*/ _interop_require_default(require("../../../Langs"));
|
|
16
|
-
const _Button = /*#__PURE__*/ _interop_require_default(require("../../UI/Button/Button"));
|
|
17
|
-
const _Dropdown = /*#__PURE__*/ _interop_require_default(require("../Dropdown/Dropdown"));
|
|
18
|
-
const _Input = /*#__PURE__*/ _interop_require_default(require("../Input/Input"));
|
|
19
|
-
const _Switcher = /*#__PURE__*/ _interop_require_default(require("../Switcher/Switcher"));
|
|
20
|
-
const _DatepickerCalendar = /*#__PURE__*/ _interop_require_default(require("./components/DatepickerCalendar"));
|
|
21
|
-
require("./Datepicker.scss");
|
|
22
|
-
function _interop_require_default(obj) {
|
|
23
|
-
return obj && obj.__esModule ? obj : {
|
|
24
|
-
default: obj
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
28
|
-
if (typeof WeakMap !== "function") return null;
|
|
29
|
-
var cacheBabelInterop = new WeakMap();
|
|
30
|
-
var cacheNodeInterop = new WeakMap();
|
|
31
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
32
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
33
|
-
})(nodeInterop);
|
|
34
|
-
}
|
|
35
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
36
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
39
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
40
|
-
return {
|
|
41
|
-
default: obj
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
45
|
-
if (cache && cache.has(obj)) {
|
|
46
|
-
return cache.get(obj);
|
|
47
|
-
}
|
|
48
|
-
var newObj = {
|
|
49
|
-
__proto__: null
|
|
50
|
-
};
|
|
51
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
52
|
-
for(var key in obj){
|
|
53
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
54
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
55
|
-
if (desc && (desc.get || desc.set)) {
|
|
56
|
-
Object.defineProperty(newObj, key, desc);
|
|
57
|
-
} else {
|
|
58
|
-
newObj[key] = obj[key];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
newObj.default = obj;
|
|
63
|
-
if (cache) {
|
|
64
|
-
cache.set(obj, newObj);
|
|
65
|
-
}
|
|
66
|
-
return newObj;
|
|
67
|
-
}
|
|
68
|
-
function padTime(time) {
|
|
69
|
-
return `${time.toString().padStart(2, '0')}:00`;
|
|
70
|
-
}
|
|
71
|
-
const Datepicker = ({ isCompareHidden, limitRange, onChange = ()=>{}, values = {}, onChangeCompare = ()=>{}, onCancel = ()=>{}, getSelectedMode = ()=>'', onChangeInterval = ()=>{} })=>{
|
|
72
|
-
const { start = null, end = null, compare = false } = values;
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
const txt = _Langs.default[globalThis.lng];
|
|
75
|
-
const startDateInputRef = (0, _react.useRef)(null);
|
|
76
|
-
const endDateInputRef = (0, _react.useRef)(null);
|
|
77
|
-
const [startDate, setStartDate] = (0, _react.useState)(start);
|
|
78
|
-
const [endDate, setEndDate] = (0, _react.useState)(end);
|
|
79
|
-
const [startDateInput, setStartDateInput] = (0, _react.useState)(start);
|
|
80
|
-
const [endDateInput, setEndDateInput] = (0, _react.useState)(end);
|
|
81
|
-
const [startHour, setStartHour] = (0, _react.useState)(start ? (0, _moment.default)(start).hour() : 0);
|
|
82
|
-
const [endHour, setEndHour] = (0, _react.useState)(end ? (0, _moment.default)(end).hour() : 0);
|
|
83
|
-
const [isCompare, setIsCompare] = (0, _react.useState)(compare);
|
|
84
|
-
const [date1, setDate1] = (0, _react.useState)(start ? (0, _moment.default)(start).toDate() : (0, _moment.default)().subtract(1, 'month').toDate());
|
|
85
|
-
const [date2, setDate2] = (0, _react.useState)(end ? (0, _moment.default)(end).toDate() : (0, _moment.default)().toDate());
|
|
86
|
-
const [isStartFocused, setIsStartFocused] = (0, _react.useState)(false);
|
|
87
|
-
const [isEndFocused, setIsEndFocused] = (0, _react.useState)(false);
|
|
88
|
-
const [hoverStatus, setHoverStatus] = (0, _react.useState)(null);
|
|
89
|
-
const dateInterval = getSelectedMode({
|
|
90
|
-
start: startDate,
|
|
91
|
-
end: endDate
|
|
92
|
-
});
|
|
93
|
-
const isNearby = (0, _react.useMemo)(()=>(0, _moment.default)(date2).subtract(1, 'month').isSame((0, _moment.default)(date1), 'month'), [
|
|
94
|
-
date1,
|
|
95
|
-
date2
|
|
96
|
-
]);
|
|
97
|
-
const isPreviousPeriodShowed = (0, _react.useMemo)(()=>isCompare && !isCompareHidden && startDate && endDate, [
|
|
98
|
-
startDate,
|
|
99
|
-
endDate,
|
|
100
|
-
isCompare
|
|
101
|
-
]);
|
|
102
|
-
const prevEndHour = (0, _react.useRef)(endHour);
|
|
103
|
-
const getStartHourItems = ()=>Array.from({
|
|
104
|
-
length: 24
|
|
105
|
-
}, (_, hour)=>({
|
|
106
|
-
label: padTime(hour),
|
|
107
|
-
value: hour,
|
|
108
|
-
disabled: !!(startDate && endDate && (0, _moment.default)(startDate).isSame(endDate, 'day') && endHour <= hour)
|
|
109
|
-
}));
|
|
110
|
-
const getEndHourItems = ()=>Array.from({
|
|
111
|
-
length: 24
|
|
112
|
-
}, (_, hour)=>({
|
|
113
|
-
label: padTime(hour + 1),
|
|
114
|
-
value: hour === 23 ? 0 : hour + 1,
|
|
115
|
-
disabled: !!(startDate && endDate && ((0, _moment.default)(startDate).isSame(endDate, 'day') || (0, _moment.default)(startDate).isSame((0, _moment.default)(endDate).subtract(1, 'days'), 'day') && endHour === 0) && hour < startHour)
|
|
116
|
-
}));
|
|
117
|
-
const startPrevDate = (0, _react.useMemo)(()=>{
|
|
118
|
-
if (isPreviousPeriodShowed && startDate && endDate) {
|
|
119
|
-
const intervalHours = (0, _moment.default)(endDate).diff(startDate, 'hours');
|
|
120
|
-
return (0, _moment.default)(startDate).subtract(intervalHours, 'hours').toDate();
|
|
121
|
-
}
|
|
122
|
-
return null;
|
|
123
|
-
}, [
|
|
124
|
-
startDate,
|
|
125
|
-
endDate,
|
|
126
|
-
isCompare
|
|
127
|
-
]);
|
|
128
|
-
const endPrevDate = (0, _react.useMemo)(()=>{
|
|
129
|
-
return isPreviousPeriodShowed && startDate ? startDate : null;
|
|
130
|
-
}, [
|
|
131
|
-
startDate,
|
|
132
|
-
isCompare
|
|
133
|
-
]);
|
|
134
|
-
const title = (0, _react.useMemo)(()=>{
|
|
135
|
-
if (isCompare && !isCompareHidden && startPrevDate && endPrevDate) {
|
|
136
|
-
return `${(0, _moment.default)(startPrevDate).format('ll')} (${(0, _moment.default)(startPrevDate).format('HH:mm')}) - ${(0, _moment.default)(endPrevDate).format('ll')} (${(0, _moment.default)(endPrevDate).format('HH:mm')})`;
|
|
137
|
-
}
|
|
138
|
-
return '';
|
|
139
|
-
}, [
|
|
140
|
-
startPrevDate,
|
|
141
|
-
endPrevDate,
|
|
142
|
-
isCompare
|
|
143
|
-
]);
|
|
144
|
-
const subtractDay = (date)=>endHour === 0 ? (0, _moment.default)(date).subtract(1, 'days') : (0, _moment.default)(date);
|
|
145
|
-
const addDay = (date)=>endHour === 0 ? (0, _moment.default)(date).add(1, 'days') : (0, _moment.default)(date);
|
|
146
|
-
(0, _react.useEffect)(()=>{
|
|
147
|
-
if (startDate && endDate && (0, _moment.default)(startDate).isSameOrAfter(endDate)) {
|
|
148
|
-
const newStart = (0, _moment.default)(endDate).subtract(1, 'd').toDate();
|
|
149
|
-
setStartDate(newStart);
|
|
150
|
-
setDate1(newStart);
|
|
151
|
-
}
|
|
152
|
-
}, [
|
|
153
|
-
startDate
|
|
154
|
-
]);
|
|
155
|
-
(0, _react.useEffect)(()=>{
|
|
156
|
-
if (startDate && endDate && (0, _moment.default)(endDate).isSameOrBefore(startDate)) {
|
|
157
|
-
const newEnd = (0, _moment.default)(startDate).add(1, 'd').toDate();
|
|
158
|
-
setEndDate(newEnd);
|
|
159
|
-
setDate2(newEnd);
|
|
160
|
-
}
|
|
161
|
-
}, [
|
|
162
|
-
endDate
|
|
163
|
-
]);
|
|
164
|
-
(0, _react.useEffect)(()=>{
|
|
165
|
-
setStartDateInput(startDate);
|
|
166
|
-
setEndDateInput(endDate);
|
|
167
|
-
if (startDate && endDate && (0, _moment.default)(startDate).isBefore((0, _moment.default)(endDate), 'month')) {
|
|
168
|
-
setDate1(startDate);
|
|
169
|
-
setDate2(endDate);
|
|
170
|
-
}
|
|
171
|
-
}, [
|
|
172
|
-
startDate,
|
|
173
|
-
endDate
|
|
174
|
-
]);
|
|
175
|
-
(0, _react.useEffect)(()=>{
|
|
176
|
-
if ((0, _moment.default)(date1).isSameOrAfter((0, _moment.default)(date2), 'month')) {
|
|
177
|
-
setDate1((0, _moment.default)(date2).subtract(1, 'month').toDate());
|
|
178
|
-
}
|
|
179
|
-
}, [
|
|
180
|
-
date1,
|
|
181
|
-
date2
|
|
182
|
-
]);
|
|
183
|
-
(0, _react.useEffect)(()=>{
|
|
184
|
-
onChangeInterval(dateInterval);
|
|
185
|
-
}, [
|
|
186
|
-
dateInterval
|
|
187
|
-
]);
|
|
188
|
-
const handleClick = (date)=>{
|
|
189
|
-
prevEndHour.current = 0;
|
|
190
|
-
if (!startDate || startDate && endDate && !((0, _moment.default)(startDate).add(1, 'd').isSame(endDate, 'day') && endHour === 0)) {
|
|
191
|
-
setStartDate((0, _moment.default)(date).startOf('day').toDate());
|
|
192
|
-
setEndDate((0, _moment.default)(date).add(1, 'd').startOf('day').toDate());
|
|
193
|
-
setStartHour(0);
|
|
194
|
-
setEndHour(0);
|
|
195
|
-
} else if ((0, _moment.default)(date).isBefore((0, _moment.default)(startDate), 'day')) {
|
|
196
|
-
setEndDate((0, _moment.default)(startDate).add(1, 'd').startOf('day').toDate());
|
|
197
|
-
setStartDate((0, _moment.default)(date).set('hour', startHour).toDate());
|
|
198
|
-
} else if ((0, _moment.default)(date).isAfter((0, _moment.default)(startDate), 'day')) {
|
|
199
|
-
setEndDate((0, _moment.default)(date).add(1, 'd').startOf('day').toDate());
|
|
200
|
-
}
|
|
201
|
-
setHoverStatus(null);
|
|
202
|
-
};
|
|
203
|
-
let timerId;
|
|
204
|
-
const handleHover = (date)=>{
|
|
205
|
-
if (!date) {
|
|
206
|
-
timerId = setTimeout(()=>setHoverStatus(null), 400);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (timerId) clearTimeout(timerId);
|
|
210
|
-
if (startDate && endDate && (0, _moment.default)(startDate).add(1, 'd').isSame(endDate, 'day') && endHour === 0) {
|
|
211
|
-
if ((0, _moment.default)(date).isAfter((0, _moment.default)(startDate), 'day')) setHoverStatus('end');
|
|
212
|
-
else if ((0, _moment.default)(date).isBefore((0, _moment.default)(startDate), 'day')) setHoverStatus('start');
|
|
213
|
-
else setHoverStatus(null);
|
|
214
|
-
} else {
|
|
215
|
-
setHoverStatus('start');
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
const handleChangeStartHour = (value)=>{
|
|
219
|
-
const val = Number(value);
|
|
220
|
-
setStartHour(val);
|
|
221
|
-
if (startDate) setStartDate((0, _moment.default)(startDate).set('hour', val).toDate());
|
|
222
|
-
};
|
|
223
|
-
const handleChangeEndHour = (value)=>{
|
|
224
|
-
const newHour = Number(value);
|
|
225
|
-
setEndHour(newHour);
|
|
226
|
-
if (!endDate) return;
|
|
227
|
-
let newEndDate;
|
|
228
|
-
if (prevEndHour.current === 0 && newHour !== 0) {
|
|
229
|
-
newEndDate = (0, _moment.default)(endDate).subtract(1, 'days');
|
|
230
|
-
} else if (prevEndHour.current !== 0 && newHour === 0) {
|
|
231
|
-
newEndDate = (0, _moment.default)(endDate).add(1, 'days');
|
|
232
|
-
} else {
|
|
233
|
-
newEndDate = (0, _moment.default)(endDate);
|
|
234
|
-
}
|
|
235
|
-
prevEndHour.current = newHour;
|
|
236
|
-
setEndDate((0, _moment.default)(newEndDate).set('hour', newHour).toDate());
|
|
237
|
-
};
|
|
238
|
-
const handleStartDateFocus = ()=>{
|
|
239
|
-
setIsStartFocused(true);
|
|
240
|
-
if (startDate) setStartDateInput((0, _moment.default)(startDate).format('L'));
|
|
241
|
-
};
|
|
242
|
-
const handleEndDateFocus = ()=>{
|
|
243
|
-
setIsEndFocused(true);
|
|
244
|
-
if (endDate) setEndDateInput((0, _moment.default)(subtractDay(endDate)).format('L'));
|
|
245
|
-
};
|
|
246
|
-
const handleStartDateBlur = ()=>{
|
|
247
|
-
var _startDateInputRef_current;
|
|
248
|
-
if (typeof startDateInput === 'string' && (0, _moment.default)(startDateInput).isValid()) {
|
|
249
|
-
const newDate = (0, _moment.default)(startDateInput).set('hour', startHour).toDate();
|
|
250
|
-
setStartDate(newDate);
|
|
251
|
-
setDate1((0, _moment.default)(newDate).isSameOrAfter((0, _moment.default)(date2), 'month') ? (0, _moment.default)(date2).subtract(1, 'month').toDate() : newDate);
|
|
252
|
-
} else {
|
|
253
|
-
setStartDateInput(startDate);
|
|
254
|
-
}
|
|
255
|
-
setIsStartFocused(false);
|
|
256
|
-
(_startDateInputRef_current = startDateInputRef.current) === null || _startDateInputRef_current === void 0 ? void 0 : _startDateInputRef_current.blur();
|
|
257
|
-
};
|
|
258
|
-
const handleEndDateBlur = ()=>{
|
|
259
|
-
var _endDateInputRef_current;
|
|
260
|
-
if (typeof endDateInput === 'string' && (0, _moment.default)(endDateInput).isValid()) {
|
|
261
|
-
const newDate = (0, _moment.default)(endDateInput).set('hour', endHour).toDate();
|
|
262
|
-
const finalDate = addDay(newDate).toDate();
|
|
263
|
-
setEndDate(finalDate);
|
|
264
|
-
setDate2(finalDate);
|
|
265
|
-
} else {
|
|
266
|
-
setEndDateInput(endDate);
|
|
267
|
-
}
|
|
268
|
-
setIsEndFocused(false);
|
|
269
|
-
(_endDateInputRef_current = endDateInputRef.current) === null || _endDateInputRef_current === void 0 ? void 0 : _endDateInputRef_current.blur();
|
|
270
|
-
};
|
|
271
|
-
const handleKeyPressed = (e, callback)=>{
|
|
272
|
-
if (e.key === 'Enter') callback();
|
|
273
|
-
};
|
|
274
|
-
const renderButtons = ()=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
275
|
-
children: [
|
|
276
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
277
|
-
className: "plr15 mr5",
|
|
278
|
-
onClick: onCancel,
|
|
279
|
-
children: txt.buttons.cancel
|
|
280
|
-
}),
|
|
281
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
282
|
-
className: "plr20",
|
|
283
|
-
// variant="filled"
|
|
284
|
-
disabled: !startDate || !endDate,
|
|
285
|
-
onClick: ()=>{
|
|
286
|
-
if (!startDate || !endDate) return;
|
|
287
|
-
onChange({
|
|
288
|
-
start: startDate,
|
|
289
|
-
end: endDate,
|
|
290
|
-
startPrevDate,
|
|
291
|
-
endPrevDate,
|
|
292
|
-
compare: isCompare
|
|
293
|
-
});
|
|
294
|
-
},
|
|
295
|
-
children: txt.buttons.apply
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
});
|
|
299
|
-
const renderPreviousPeriod = ()=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
300
|
-
children: [
|
|
301
|
-
txt.labels.previousPeriod,
|
|
302
|
-
":",
|
|
303
|
-
' ',
|
|
304
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
305
|
-
className: "date-picker__previous-period-interval",
|
|
306
|
-
children: title
|
|
307
|
-
})
|
|
308
|
-
]
|
|
309
|
-
});
|
|
310
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
311
|
-
className: "date-picker",
|
|
312
|
-
children: [
|
|
313
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
314
|
-
className: "date-picker__header",
|
|
315
|
-
children: [
|
|
316
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Input.default, {
|
|
317
|
-
// @ts-ignore
|
|
318
|
-
testId: "datepicker_start-date-input",
|
|
319
|
-
className: (0, _classnames.default)('mr5', {
|
|
320
|
-
'date-picker-text-input--active': hoverStatus === 'start'
|
|
321
|
-
}),
|
|
322
|
-
value: isStartFocused ? startDateInput : (0, _moment.default)(startDate).format('ll'),
|
|
323
|
-
disabled: !startDate,
|
|
324
|
-
onChange: (e)=>setStartDateInput(e.target.value),
|
|
325
|
-
onFocus: handleStartDateFocus,
|
|
326
|
-
onBlur: handleStartDateBlur,
|
|
327
|
-
onKeyPress: (e)=>handleKeyPressed(e, handleStartDateBlur),
|
|
328
|
-
ref: startDateInputRef
|
|
329
|
-
}),
|
|
330
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Dropdown.default, {
|
|
331
|
-
// @ts-ignore
|
|
332
|
-
testId: "datepicker_start-hour-select-input",
|
|
333
|
-
onChange: handleChangeStartHour,
|
|
334
|
-
value: startHour,
|
|
335
|
-
options: getStartHourItems(),
|
|
336
|
-
disabled: !startDate
|
|
337
|
-
}),
|
|
338
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
339
|
-
className: "pl5 pr5 date-picker__header--gray",
|
|
340
|
-
children: "—"
|
|
341
|
-
}),
|
|
342
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Input.default, {
|
|
343
|
-
// @ts-ignore
|
|
344
|
-
testId: "datepicker_end-date-input",
|
|
345
|
-
className: (0, _classnames.default)('mr5', {
|
|
346
|
-
'date-picker-text-input--active': hoverStatus === 'end'
|
|
347
|
-
}),
|
|
348
|
-
value: isEndFocused ? endDateInput : endDate ? (0, _moment.default)(subtractDay(endDate)).format('ll') : '',
|
|
349
|
-
disabled: !endDate,
|
|
350
|
-
onChange: (e)=>setEndDateInput(e.target.value),
|
|
351
|
-
onFocus: handleEndDateFocus,
|
|
352
|
-
onBlur: handleEndDateBlur,
|
|
353
|
-
onKeyPress: (e)=>handleKeyPressed(e, handleEndDateBlur),
|
|
354
|
-
ref: endDateInputRef
|
|
355
|
-
}),
|
|
356
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Dropdown.default, {
|
|
357
|
-
testId: "datepicker_end-hour-select-input",
|
|
358
|
-
onChange: handleChangeEndHour,
|
|
359
|
-
value: endHour,
|
|
360
|
-
options: getEndHourItems(),
|
|
361
|
-
disabled: !endDate
|
|
362
|
-
})
|
|
363
|
-
]
|
|
364
|
-
}),
|
|
365
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
366
|
-
className: "date-picker__previous-period",
|
|
367
|
-
children: isCompare && !isCompareHidden && startDate && endDate && renderPreviousPeriod()
|
|
368
|
-
}),
|
|
369
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
370
|
-
className: "date-picker__calendars",
|
|
371
|
-
children: [
|
|
372
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DatepickerCalendar.default, {
|
|
373
|
-
date: date1,
|
|
374
|
-
setDate: setDate1,
|
|
375
|
-
allowNext: !isNearby,
|
|
376
|
-
startDate: startDate,
|
|
377
|
-
endDate: endDate,
|
|
378
|
-
startPrevDate: startPrevDate,
|
|
379
|
-
endPrevDate: endPrevDate,
|
|
380
|
-
onClick: handleClick,
|
|
381
|
-
onHover: handleHover,
|
|
382
|
-
limitRange: limitRange
|
|
383
|
-
}),
|
|
384
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DatepickerCalendar.default, {
|
|
385
|
-
date: date2,
|
|
386
|
-
setDate: setDate2,
|
|
387
|
-
allowPrev: !isNearby,
|
|
388
|
-
startDate: startDate,
|
|
389
|
-
endDate: endDate,
|
|
390
|
-
startPrevDate: startPrevDate,
|
|
391
|
-
endPrevDate: endPrevDate,
|
|
392
|
-
onClick: handleClick,
|
|
393
|
-
onHover: handleHover
|
|
394
|
-
})
|
|
395
|
-
]
|
|
396
|
-
}),
|
|
397
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
398
|
-
className: "date-picker__footer j46",
|
|
399
|
-
children: [
|
|
400
|
-
!isCompareHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
401
|
-
className: "j4",
|
|
402
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
403
|
-
className: "mr5",
|
|
404
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Switcher.default, {
|
|
405
|
-
testId: "datepicker_compare",
|
|
406
|
-
// @ts-ignore
|
|
407
|
-
label: txt.labels.compare,
|
|
408
|
-
isActive: isCompare,
|
|
409
|
-
onChange: ()=>{
|
|
410
|
-
onChangeCompare(!isCompare);
|
|
411
|
-
setIsCompare((state)=>!state);
|
|
412
|
-
}
|
|
413
|
-
})
|
|
414
|
-
})
|
|
415
|
-
}),
|
|
416
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
417
|
-
children: renderButtons()
|
|
418
|
-
})
|
|
419
|
-
]
|
|
420
|
-
})
|
|
421
|
-
]
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
const _default = Datepicker;
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}function t(t,a){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var a,r,n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var u=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done)&&(u.push(a.value),!t||u.length!==t);l=!0);}catch(e){o=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw r}}return u}}(t,a)||function(t,a){if(t){if("string"==typeof t)return e(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,a)}}(t,a)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return v}});var a=require("react/jsx-runtime"),r=c(require("classnames")),n=c(require("moment")),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var a=m(t);if(a&&a.has(e))return a.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=n?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(r,u,l):r[u]=e[u]}return r.default=e,a&&a.set(e,r),r}(require("react")),l=c(require("../../../Langs")),o=c(require("../../UI/Button/Button")),d=c(require("../Dropdown/Dropdown")),i=c(require("../Input/Input")),f=c(require("../Switcher/Switcher")),s=c(require("./components/DatepickerCalendar"));function c(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(m=function(e){return e?a:t})(e)}function p(e){return"".concat(e.toString().padStart(2,"0"),":00")}require("./Datepicker.scss");var v=function(e){var c,m=e.isCompareHidden,v=e.limitRange,h=e.onChange,y=void 0===h?function(){}:h,b=e.values,D=void 0===b?{}:b,g=e.onChangeCompare,j=void 0===g?function(){}:g,S=e.onCancel,x=e.getSelectedMode,_=e.onChangeInterval,k=void 0===_?function(){}:_,O=D.start,C=void 0===O?null:O,P=D.end,N=void 0===P?null:P,A=D.compare,w=l.default[globalThis.lng],M=(0,u.useRef)(null),I=(0,u.useRef)(null),q=t((0,u.useState)(C),2),B=q[0],E=q[1],H=t((0,u.useState)(N),2),R=H[0],F=H[1],T=t((0,u.useState)(C),2),L=T[0],W=T[1],K=t((0,u.useState)(N),2),U=K[0],V=K[1],$=t((0,u.useState)(C?(0,n.default)(C).hour():0),2),z=$[0],G=$[1],J=t((0,u.useState)(N?(0,n.default)(N).hour():0),2),Q=J[0],X=J[1],Y=t((0,u.useState)(void 0!==A&&A),2),Z=Y[0],ee=Y[1],et=t((0,u.useState)(C?(0,n.default)(C).toDate():(0,n.default)().subtract(1,"month").toDate()),2),ea=et[0],er=et[1],en=t((0,u.useState)(N?(0,n.default)(N).toDate():(0,n.default)().toDate()),2),eu=en[0],el=en[1],eo=t((0,u.useState)(!1),2),ed=eo[0],ei=eo[1],ef=t((0,u.useState)(!1),2),es=ef[0],ec=ef[1],em=t((0,u.useState)(null),2),ep=em[0],ev=em[1],eh=(void 0===x?function(){return""}:x)({start:B,end:R}),ey=(0,u.useMemo)(function(){return(0,n.default)(eu).subtract(1,"month").isSame((0,n.default)(ea),"month")},[ea,eu]),eb=(0,u.useMemo)(function(){return Z&&!m&&B&&R},[B,R,Z]),eD=(0,u.useRef)(Q),eg=(0,u.useMemo)(function(){if(eb&&B&&R){var e=(0,n.default)(R).diff(B,"hours");return(0,n.default)(B).subtract(e,"hours").toDate()}return null},[B,R,Z]),ej=(0,u.useMemo)(function(){return eb&&B?B:null},[B,Z]),eS=(0,u.useMemo)(function(){return Z&&!m&&eg&&ej?"".concat((0,n.default)(eg).format("ll")," (").concat((0,n.default)(eg).format("HH:mm"),") - ").concat((0,n.default)(ej).format("ll")," (").concat((0,n.default)(ej).format("HH:mm"),")"):""},[eg,ej,Z]),ex=function(e){return 0===Q?(0,n.default)(e).subtract(1,"days"):(0,n.default)(e)};(0,u.useEffect)(function(){if(B&&R&&(0,n.default)(B).isSameOrAfter(R)){var e=(0,n.default)(R).subtract(1,"d").toDate();E(e),er(e)}},[B]),(0,u.useEffect)(function(){if(B&&R&&(0,n.default)(R).isSameOrBefore(B)){var e=(0,n.default)(B).add(1,"d").toDate();F(e),el(e)}},[R]),(0,u.useEffect)(function(){W(B),V(R),B&&R&&(0,n.default)(B).isBefore((0,n.default)(R),"month")&&(er(B),el(R))},[B,R]),(0,u.useEffect)(function(){(0,n.default)(ea).isSameOrAfter((0,n.default)(eu),"month")&&er((0,n.default)(eu).subtract(1,"month").toDate())},[ea,eu]),(0,u.useEffect)(function(){k(eh)},[eh]);var e_=function(e){eD.current=0,!B||B&&R&&!((0,n.default)(B).add(1,"d").isSame(R,"day")&&0===Q)?(E((0,n.default)(e).startOf("day").toDate()),F((0,n.default)(e).add(1,"d").startOf("day").toDate()),G(0),X(0)):(0,n.default)(e).isBefore((0,n.default)(B),"day")?(F((0,n.default)(B).add(1,"d").startOf("day").toDate()),E((0,n.default)(e).set("hour",z).toDate())):(0,n.default)(e).isAfter((0,n.default)(B),"day")&&F((0,n.default)(e).add(1,"d").startOf("day").toDate()),ev(null)},ek=function(e){if(!e){c=setTimeout(function(){return ev(null)},400);return}c&&clearTimeout(c),B&&R&&(0,n.default)(B).add(1,"d").isSame(R,"day")&&0===Q?(0,n.default)(e).isAfter((0,n.default)(B),"day")?ev("end"):(0,n.default)(e).isBefore((0,n.default)(B),"day")?ev("start"):ev(null):ev("start")},eO=function(){var e;if("string"==typeof L&&(0,n.default)(L).isValid()){var t=(0,n.default)(L).set("hour",z).toDate();E(t),er((0,n.default)(t).isSameOrAfter((0,n.default)(eu),"month")?(0,n.default)(eu).subtract(1,"month").toDate():t)}else W(B);ei(!1),null==(e=M.current)||e.blur()},eC=function(){var e;if("string"==typeof U&&(0,n.default)(U).isValid()){var t,a=(t=(0,n.default)(U).set("hour",Q).toDate(),0===Q?(0,n.default)(t).add(1,"days"):(0,n.default)(t)).toDate();F(a),el(a)}else V(R);ec(!1),null==(e=I.current)||e.blur()},eP=function(e,t){"Enter"===e.key&&t()};return(0,a.jsxs)("div",{className:"date-picker",children:[(0,a.jsxs)("div",{className:"date-picker__header",children:[(0,a.jsx)(i.default,{testId:"datepicker_start-date-input",className:(0,r.default)("mr5",{"date-picker-text-input--active":"start"===ep}),value:ed?L:(0,n.default)(B).format("ll"),disabled:!B,onChange:function(e){return W(e.target.value)},onFocus:function(){ei(!0),B&&W((0,n.default)(B).format("L"))},onBlur:eO,onKeyPress:function(e){return eP(e,eO)},ref:M}),(0,a.jsx)(d.default,{testId:"datepicker_start-hour-select-input",onChange:function(e){var t=Number(e);G(t),B&&E((0,n.default)(B).set("hour",t).toDate())},value:z,options:Array.from({length:24},function(e,t){return{label:p(t),value:t,disabled:!!(B&&R&&(0,n.default)(B).isSame(R,"day")&&Q<=t)}}),disabled:!B}),(0,a.jsx)("div",{className:"pl5 pr5 date-picker__header--gray",children:"—"}),(0,a.jsx)(i.default,{testId:"datepicker_end-date-input",className:(0,r.default)("mr5",{"date-picker-text-input--active":"end"===ep}),value:es?U:R?(0,n.default)(ex(R)).format("ll"):"",disabled:!R,onChange:function(e){return V(e.target.value)},onFocus:function(){ec(!0),R&&V((0,n.default)(ex(R)).format("L"))},onBlur:eC,onKeyPress:function(e){return eP(e,eC)},ref:I}),(0,a.jsx)(d.default,{testId:"datepicker_end-hour-select-input",onChange:function(e){var t,a=Number(e);X(a),R&&(t=0===eD.current&&0!==a?(0,n.default)(R).subtract(1,"days"):0!==eD.current&&0===a?(0,n.default)(R).add(1,"days"):(0,n.default)(R),eD.current=a,F((0,n.default)(t).set("hour",a).toDate()))},value:Q,options:Array.from({length:24},function(e,t){return{label:p(t+1),value:23===t?0:t+1,disabled:!!(B&&R&&((0,n.default)(B).isSame(R,"day")||(0,n.default)(B).isSame((0,n.default)(R).subtract(1,"days"),"day")&&0===Q)&&t<z)}}),disabled:!R})]}),(0,a.jsx)("div",{className:"date-picker__previous-period",children:Z&&!m&&B&&R&&(0,a.jsxs)(a.Fragment,{children:[w.labels.previousPeriod,":"," ",(0,a.jsx)("span",{className:"date-picker__previous-period-interval",children:eS})]})}),(0,a.jsxs)("div",{className:"date-picker__calendars",children:[(0,a.jsx)(s.default,{date:ea,setDate:er,allowNext:!ey,startDate:B,endDate:R,startPrevDate:eg,endPrevDate:ej,onClick:e_,onHover:ek,limitRange:v}),(0,a.jsx)(s.default,{date:eu,setDate:el,allowPrev:!ey,startDate:B,endDate:R,startPrevDate:eg,endPrevDate:ej,onClick:e_,onHover:ek})]}),(0,a.jsxs)("div",{className:"date-picker__footer j46",children:[!m&&(0,a.jsx)("div",{className:"j4",children:(0,a.jsx)("div",{className:"mr5",children:(0,a.jsx)(f.default,{testId:"datepicker_compare",label:w.labels.compare,isActive:Z,onChange:function(){j(!Z),ee(function(e){return!e})}})})}),(0,a.jsx)("div",{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.default,{className:"plr15 mr5",onClick:void 0===S?function(){}:S,children:w.buttons.cancel}),(0,a.jsx)(o.default,{className:"plr20",disabled:!B||!R,onClick:function(){B&&R&&y({start:B,end:R,startPrevDate:eg,endPrevDate:ej,compare:Z})},children:w.buttons.apply})]})})]})]})};
|
|
@@ -1,173 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
-
const _moment = /*#__PURE__*/ _interop_require_default(require("moment"));
|
|
14
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
15
|
-
const _reactfeather = /*#__PURE__*/ _interop_require_wildcard(require("react-feather"));
|
|
16
|
-
function _interop_require_default(obj) {
|
|
17
|
-
return obj && obj.__esModule ? obj : {
|
|
18
|
-
default: obj
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
22
|
-
if (typeof WeakMap !== "function") return null;
|
|
23
|
-
var cacheBabelInterop = new WeakMap();
|
|
24
|
-
var cacheNodeInterop = new WeakMap();
|
|
25
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
26
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
27
|
-
})(nodeInterop);
|
|
28
|
-
}
|
|
29
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
30
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
34
|
-
return {
|
|
35
|
-
default: obj
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
39
|
-
if (cache && cache.has(obj)) {
|
|
40
|
-
return cache.get(obj);
|
|
41
|
-
}
|
|
42
|
-
var newObj = {
|
|
43
|
-
__proto__: null
|
|
44
|
-
};
|
|
45
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
46
|
-
for(var key in obj){
|
|
47
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
48
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
49
|
-
if (desc && (desc.get || desc.set)) {
|
|
50
|
-
Object.defineProperty(newObj, key, desc);
|
|
51
|
-
} else {
|
|
52
|
-
newObj[key] = obj[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
newObj.default = obj;
|
|
57
|
-
if (cache) {
|
|
58
|
-
cache.set(obj, newObj);
|
|
59
|
-
}
|
|
60
|
-
return newObj;
|
|
61
|
-
}
|
|
62
|
-
const DatepickerCalendar = ({ date, setDate, startDate, endDate, allowPrev = true, allowNext = true, onClick, onHover, startPrevDate, endPrevDate, limitRange })=>{
|
|
63
|
-
const [days, setDays] = (0, _react.useState)({});
|
|
64
|
-
const title = (0, _react.useMemo)(()=>`${(0, _moment.default)(date).format('MMM')} ${(0, _moment.default)(date).format('YYYY')}`, [
|
|
65
|
-
date
|
|
66
|
-
]);
|
|
67
|
-
(0, _react.useEffect)(()=>{
|
|
68
|
-
const result = {};
|
|
69
|
-
const day = (0, _moment.default)(date).startOf('month');
|
|
70
|
-
const daysInMonth = day.daysInMonth();
|
|
71
|
-
for(let d = 0; d < daysInMonth; d++){
|
|
72
|
-
let week = day.week();
|
|
73
|
-
if (day.month() === 11 && week === 1) week = 53;
|
|
74
|
-
if (day.month() === 0 && week === 53) week = 0;
|
|
75
|
-
if (!result[week]) result[week] = {};
|
|
76
|
-
result[week][day.weekday()] = {
|
|
77
|
-
date: day.toDate()
|
|
78
|
-
};
|
|
79
|
-
day.add(1, 'd');
|
|
80
|
-
}
|
|
81
|
-
setDays(result);
|
|
82
|
-
}, [
|
|
83
|
-
date
|
|
84
|
-
]);
|
|
85
|
-
const renderDay = (week, dayOfWeek)=>{
|
|
86
|
-
var _days_;
|
|
87
|
-
const day = (_days_ = days[+week]) === null || _days_ === void 0 ? void 0 : _days_[dayOfWeek];
|
|
88
|
-
const isFutureDay = day && (0, _moment.default)(day.date).isAfter((0, _moment.default)(), 'day');
|
|
89
|
-
const isPastDay = limitRange ? day && (0, _moment.default)(day.date).isBefore((0, _moment.default)().subtract(limitRange, 'days'), 'day') : null;
|
|
90
|
-
const isRangeEnd = day && ((0, _moment.default)(day.date).isSame(startDate, 'day') || (0, _moment.default)(day.date).isSame((0, _moment.default)(endDate).subtract(1, 'hour'), 'day'));
|
|
91
|
-
const isRangeInside = day && startDate && endDate && (0, _moment.default)(day.date).isAfter(startDate, 'day') && (0, _moment.default)(day.date).isBefore((0, _moment.default)(endDate).subtract(1, 'hour'), 'day');
|
|
92
|
-
const isPrevRangeEnd = day && ((0, _moment.default)(day.date).isSame(startPrevDate, 'day') || (0, _moment.default)(day.date).isSame((0, _moment.default)(endPrevDate).subtract(1, 'day'), 'day'));
|
|
93
|
-
const isPrevRangeInside = day && startPrevDate && endPrevDate && (0, _moment.default)(day.date).isAfter(startPrevDate, 'day') && (0, _moment.default)(day.date).isBefore((0, _moment.default)(endPrevDate).subtract(1, 'day'), 'day');
|
|
94
|
-
const classNames = (0, _classnames.default)('calendar__day', {
|
|
95
|
-
'calendar__day--clickable': day
|
|
96
|
-
}, {
|
|
97
|
-
'calendar__day--disabled': isFutureDay || isPastDay
|
|
98
|
-
}, {
|
|
99
|
-
'calendar__day--range-end': isRangeEnd
|
|
100
|
-
}, {
|
|
101
|
-
'calendar__day--range-inside': isRangeInside
|
|
102
|
-
}, {
|
|
103
|
-
'calendar__day--prev-range-end': isPrevRangeEnd
|
|
104
|
-
}, {
|
|
105
|
-
'calendar__day--prev-range-inside': isPrevRangeInside
|
|
106
|
-
});
|
|
107
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
108
|
-
className: classNames,
|
|
109
|
-
onClick: day && !isFutureDay ? ()=>onClick(day.date) : undefined,
|
|
110
|
-
onMouseOver: day && !isFutureDay ? ()=>onHover(day.date) : undefined,
|
|
111
|
-
onMouseLeave: ()=>onHover(null),
|
|
112
|
-
children: day && day.date.getDate()
|
|
113
|
-
}, `${week}_${dayOfWeek}`);
|
|
114
|
-
};
|
|
115
|
-
const handlePrev = ()=>{
|
|
116
|
-
setDate((0, _moment.default)(date).subtract(1, 'month').toDate());
|
|
117
|
-
};
|
|
118
|
-
const handleNext = ()=>{
|
|
119
|
-
setDate((0, _moment.default)(date).add(1, 'month').toDate());
|
|
120
|
-
};
|
|
121
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
122
|
-
className: "calendar",
|
|
123
|
-
children: [
|
|
124
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
125
|
-
className: "calendar-header",
|
|
126
|
-
children: [
|
|
127
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
128
|
-
className: "calendar-header__prev",
|
|
129
|
-
children: allowPrev && /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
|
|
130
|
-
"data-testid": "datepicker-calendar-prev",
|
|
131
|
-
onClick: handlePrev,
|
|
132
|
-
"aria-label": "Previous month",
|
|
133
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronLeft, {
|
|
134
|
-
size: 16
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
}),
|
|
138
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
139
|
-
className: "calendar-header__title",
|
|
140
|
-
children: title
|
|
141
|
-
}),
|
|
142
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
143
|
-
className: "calendar-header__next",
|
|
144
|
-
children: allowNext && /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
|
|
145
|
-
"data-testid": "datepicker-calendar-next",
|
|
146
|
-
onClick: handleNext,
|
|
147
|
-
"aria-label": "Next month",
|
|
148
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronRight, {
|
|
149
|
-
size: 16
|
|
150
|
-
})
|
|
151
|
-
})
|
|
152
|
-
})
|
|
153
|
-
]
|
|
154
|
-
}),
|
|
155
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
156
|
-
className: "calendar__week",
|
|
157
|
-
children: Array.from({
|
|
158
|
-
length: 7
|
|
159
|
-
}, (_, dayOfWeek)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
160
|
-
className: "calendar__day calendar__day--title",
|
|
161
|
-
children: (0, _moment.default)().weekday(dayOfWeek).format('dd').charAt(0)
|
|
162
|
-
}, `day-of-week_${dayOfWeek}`))
|
|
163
|
-
}),
|
|
164
|
-
Object.keys(days).map((week, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
165
|
-
className: "calendar__week",
|
|
166
|
-
children: Array.from({
|
|
167
|
-
length: 7
|
|
168
|
-
}, (_, dayOfWeek)=>renderDay(week, dayOfWeek))
|
|
169
|
-
}, `week_${index}`))
|
|
170
|
-
]
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
const _default = DatepickerCalendar;
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return i}});var t=require("react/jsx-runtime"),a=l(require("classnames")),r=l(require("moment")),n=u(require("react")),d=u(require("react-feather"));function l(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in e)if("default"!==d&&Object.prototype.hasOwnProperty.call(e,d)){var l=n?Object.getOwnPropertyDescriptor(e,d):null;l&&(l.get||l.set)?Object.defineProperty(r,d,l):r[d]=e[d]}return r.default=e,a&&a.set(e,r),r}var i=function(l){var o,u=l.date,i=l.setDate,c=l.startDate,f=l.endDate,s=l.allowPrev,y=l.allowNext,v=l.onClick,m=l.onHover,h=l.startPrevDate,_=l.endPrevDate,p=l.limitRange,b=(o=(0,n.useState)({}),function(e){if(Array.isArray(e))return e}(o)||function(e,t){var a,r,n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var d=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done)&&(d.push(a.value),d.length!==t);l=!0);}catch(e){o=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw r}}return d}}(o,2)||function(t,a){if(t){if("string"==typeof t)return e(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,a)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),j=b[0],x=b[1],g=(0,n.useMemo)(function(){return"".concat((0,r.default)(u).format("MMM")," ").concat((0,r.default)(u).format("YYYY"))},[u]);(0,n.useEffect)(function(){for(var e={},t=(0,r.default)(u).startOf("month"),a=t.daysInMonth(),n=0;n<a;n++){var d=t.week();11===t.month()&&1===d&&(d=53),0===t.month()&&53===d&&(d=0),e[d]||(e[d]={}),e[d][t.weekday()]={date:t.toDate()},t.add(1,"d")}x(e)},[u]);var k=function(e,n){var d,l=null==(d=j[+e])?void 0:d[n],o=l&&(0,r.default)(l.date).isAfter((0,r.default)(),"day"),u=p?l&&(0,r.default)(l.date).isBefore((0,r.default)().subtract(p,"days"),"day"):null,i=l&&((0,r.default)(l.date).isSame(c,"day")||(0,r.default)(l.date).isSame((0,r.default)(f).subtract(1,"hour"),"day")),s=l&&c&&f&&(0,r.default)(l.date).isAfter(c,"day")&&(0,r.default)(l.date).isBefore((0,r.default)(f).subtract(1,"hour"),"day"),y=l&&((0,r.default)(l.date).isSame(h,"day")||(0,r.default)(l.date).isSame((0,r.default)(_).subtract(1,"day"),"day")),b=l&&h&&_&&(0,r.default)(l.date).isAfter(h,"day")&&(0,r.default)(l.date).isBefore((0,r.default)(_).subtract(1,"day"),"day"),x=(0,a.default)("calendar__day",{"calendar__day--clickable":l},{"calendar__day--disabled":o||u},{"calendar__day--range-end":i},{"calendar__day--range-inside":s},{"calendar__day--prev-range-end":y},{"calendar__day--prev-range-inside":b});return(0,t.jsx)("div",{className:x,onClick:l&&!o?function(){return v(l.date)}:void 0,onMouseOver:l&&!o?function(){return m(l.date)}:void 0,onMouseLeave:function(){return m(null)},children:l&&l.date.getDate()},"".concat(e,"_").concat(n))};return(0,t.jsxs)("div",{className:"calendar",children:[(0,t.jsxs)("div",{className:"calendar-header",children:[(0,t.jsx)("div",{className:"calendar-header__prev",children:(void 0===s||s)&&(0,t.jsx)("button",{"data-testid":"datepicker-calendar-prev",onClick:function(){i((0,r.default)(u).subtract(1,"month").toDate())},"aria-label":"Previous month",children:(0,t.jsx)(d.ChevronLeft,{size:16})})}),(0,t.jsx)("div",{className:"calendar-header__title",children:g}),(0,t.jsx)("div",{className:"calendar-header__next",children:(void 0===y||y)&&(0,t.jsx)("button",{"data-testid":"datepicker-calendar-next",onClick:function(){i((0,r.default)(u).add(1,"month").toDate())},"aria-label":"Next month",children:(0,t.jsx)(d.ChevronRight,{size:16})})})]}),(0,t.jsx)("div",{className:"calendar__week",children:Array.from({length:7},function(e,a){return(0,t.jsx)("div",{className:"calendar__day calendar__day--title",children:(0,r.default)().weekday(a).format("dd").charAt(0)},"day-of-week_".concat(a))})}),Object.keys(j).map(function(e,a){return(0,t.jsx)("div",{className:"calendar__week",children:Array.from({length:7},function(t,a){return k(e,a)})},"week_".concat(a))})]})};
|