intelicoreact 1.8.10 → 1.8.12
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/Dropdown/components/DropdownLoader.js +1 -0
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -0
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -0
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -0
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -0
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -0
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -0
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -0
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -0
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -0
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -0
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -0
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -0
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -0
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -0
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -0
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +3 -3
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1
- package/dist/Atomic/FormElements/Text/Text.js +1 -0
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -0
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -0
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -0
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -0
- package/dist/Atomic/Layout/Header/Header.js +1 -0
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +1 -0
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -0
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -0
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -0
- package/dist/Atomic/UI/Box/Box.js +1 -0
- package/dist/Atomic/UI/Chart/Chart.js +1 -0
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -0
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -0
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -0
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -0
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -0
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -0
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -0
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -0
- package/dist/Atomic/UI/Table/Table.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -0
- package/dist/Atomic/UI/Tag/Tag.interface.ts +1 -1
- package/dist/Atomic/UI/Tag/Tag.js +1 -1
- package/dist/Atomic/UI/TagList/TagList.js +1 -0
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -0
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -0
- package/dist/Functions/customEventListener.js +1 -0
- package/dist/Functions/operations.js +1 -0
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -0
- package/dist/Functions/useFormTools/index.js +1 -0
- package/dist/Functions/usePasswordChecker.js +1 -0
- package/dist/Functions/utils.js +1 -0
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -0
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -0
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -0
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -0
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -0
- package/dist/Molecular/CustomIcons/components/Button.js +1 -0
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -0
- package/dist/Molecular/CustomIcons/components/Check.js +1 -0
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/Close.js +1 -0
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -0
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -0
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -0
- package/dist/Molecular/CustomIcons/components/Email.js +1 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -0
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -0
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -0
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -0
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -0
- package/dist/Molecular/CustomIcons/components/Home.js +1 -0
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -0
- package/dist/Molecular/CustomIcons/components/Key.js +1 -0
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -0
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -0
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -0
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -0
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -0
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -0
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -0
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -0
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -0
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -0
- package/dist/Molecular/CustomIcons/components/Play.js +1 -0
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -0
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -0
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -0
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -0
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -0
- package/dist/Molecular/CustomIcons/components/Star.js +1 -0
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -0
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -0
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -0
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -0
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -0
- package/dist/Molecular/CustomIcons/components/User.js +1 -0
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -0
- package/dist/Molecular/CustomIcons/components/X.js +1 -0
- package/dist/Molecular/FormElement/FormElement.js +1 -0
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -0
- package/dist/Molecular/InputAddress/InputAddress.js +1 -0
- package/dist/Molecular/InputPassword/InputPassword.js +1 -0
- package/package.json +6 -13
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.jsx +0 -18
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +0 -121
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +0 -507
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +0 -46
- package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +0 -337
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +0 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +0 -78
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +0 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +0 -183
- package/dist/Atomic/FormElements/RangeList/RangeList.jsx +0 -181
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +0 -41
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +0 -449
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +0 -865
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +0 -37
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +0 -48
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +0 -62
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +0 -175
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +0 -65
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +0 -118
- package/dist/Atomic/FormElements/Text/Text.jsx +0 -126
- package/dist/Atomic/FormElements/Textarea/Textarea.jsx +0 -61
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +0 -181
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +0 -60
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +0 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +0 -80
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +0 -103
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +0 -115
- package/dist/Atomic/Layout/Header/Header.jsx +0 -86
- package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +0 -250
- package/dist/Atomic/UI/AccordionText/AccordionText.jsx +0 -68
- package/dist/Atomic/UI/Arrow/Arrow.jsx +0 -134
- package/dist/Atomic/UI/Box/Box.jsx +0 -53
- package/dist/Atomic/UI/Chart/Chart.jsx +0 -178
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +0 -78
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +0 -334
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +0 -111
- package/dist/Atomic/UI/DateTime/DateTime.jsx +0 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +0 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +0 -15
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +0 -223
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +0 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +0 -86
- package/dist/Atomic/UI/PieChart/PieChart.jsx +0 -41
- package/dist/Atomic/UI/Table/Partials/TdCell.jsx +0 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +0 -36
- package/dist/Atomic/UI/Table/Partials/TdRow.jsx +0 -103
- package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +0 -55
- package/dist/Atomic/UI/Table/Table.jsx +0 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +0 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +0 -26
- package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +0 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +0 -56
- package/dist/Atomic/UI/TagList/TagList.jsx +0 -256
- package/dist/Atomic/UI/WizardStepper/constructor.jsx +0 -86
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +0 -254
- package/dist/Functions/customEventListener.jsx +0 -96
- package/dist/Functions/operations.jsx +0 -138
- package/dist/Functions/useFormTools/functions/RenderFields.jsx +0 -108
- package/dist/Functions/useFormTools/index.jsx +0 -777
- package/dist/Functions/usePasswordChecker.jsx +0 -128
- package/dist/Functions/utils.jsx +0 -492
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +0 -22
- package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +0 -24
- package/dist/Molecular/CustomIcons/components/AppStore.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/Arrow.jsx +0 -33
- package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/Bell.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Button.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/Campaigns.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Check.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Check2.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +0 -28
- package/dist/Molecular/CustomIcons/components/Close.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/Delete.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Edit.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Email.jsx +0 -32
- package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +0 -19
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +0 -36
- package/dist/Molecular/CustomIcons/components/Flows.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Gift.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +0 -20
- package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +0 -21
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +0 -20
- package/dist/Molecular/CustomIcons/components/Home.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Home2.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/Key.jsx +0 -24
- package/dist/Molecular/CustomIcons/components/Landers.jsx +0 -21
- package/dist/Molecular/CustomIcons/components/Lock.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Mail.jsx +0 -27
- package/dist/Molecular/CustomIcons/components/Mastercard.jsx +0 -74
- package/dist/Molecular/CustomIcons/components/Minus.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Offers.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Pause.jsx +0 -29
- package/dist/Molecular/CustomIcons/components/PayPal.jsx +0 -42
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +0 -29
- package/dist/Molecular/CustomIcons/components/Phone.jsx +0 -31
- package/dist/Molecular/CustomIcons/components/Play.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Plus.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Profile.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/QRCode.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/Rectangle.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/Revert.jsx +0 -14
- package/dist/Molecular/CustomIcons/components/Star.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Star2.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Trash.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/TrashRed.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Triggers.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/User.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Visa.jsx +0 -32
- package/dist/Molecular/CustomIcons/components/X.jsx +0 -13
- package/dist/Molecular/FormElement/FormElement.jsx +0 -52
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +0 -161
- package/dist/Molecular/InputAddress/InputAddress.jsx +0 -641
- package/dist/Molecular/InputPassword/InputPassword.jsx +0 -50
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import moment from 'moment-timezone';
|
|
4
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
import Arrow from '../../UI/Arrow/Arrow';
|
|
7
|
-
|
|
8
|
-
import './RangeCalendar.scss';
|
|
9
|
-
|
|
10
|
-
function RangeCalendar(props) {
|
|
11
|
-
const {
|
|
12
|
-
className,
|
|
13
|
-
date,
|
|
14
|
-
setDate,
|
|
15
|
-
startDate,
|
|
16
|
-
endDate,
|
|
17
|
-
allowPrev = true,
|
|
18
|
-
allowNext = true,
|
|
19
|
-
onClick = () => {},
|
|
20
|
-
onHover = () => {},
|
|
21
|
-
startPrevDate,
|
|
22
|
-
endPrevDate,
|
|
23
|
-
limitRange,
|
|
24
|
-
isShortWeekNames,
|
|
25
|
-
minDate,
|
|
26
|
-
maxDate,
|
|
27
|
-
momentMinDate,
|
|
28
|
-
momentMaxDate,
|
|
29
|
-
isDontLimitFuture,
|
|
30
|
-
testId = 'range-calendar',
|
|
31
|
-
} = props;
|
|
32
|
-
|
|
33
|
-
const [days, setDays] = useState({});
|
|
34
|
-
|
|
35
|
-
const title = useMemo(
|
|
36
|
-
() => `${moment(date).format('MMM')} ${moment(date).format('YYYY')}`,
|
|
37
|
-
[date],
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const result = {};
|
|
42
|
-
const day = moment(date).startOf('month');
|
|
43
|
-
const daysInMonth = day.daysInMonth();
|
|
44
|
-
for (let d = 0; d < daysInMonth; d += 1) {
|
|
45
|
-
let week = day.week();
|
|
46
|
-
if (day.month() === 11 && week === 1) week = 53;
|
|
47
|
-
if (day.month() === 0 && week === 53) week = 0;
|
|
48
|
-
if (!Object.prototype.hasOwnProperty.call(result, week)) {
|
|
49
|
-
result[week] = {};
|
|
50
|
-
}
|
|
51
|
-
result[week][day.weekday()] = { date: day.toDate() };
|
|
52
|
-
day.add(1, 'd');
|
|
53
|
-
}
|
|
54
|
-
setDays(result);
|
|
55
|
-
}, [date]);
|
|
56
|
-
|
|
57
|
-
const renderDay = (week, dayOfWeek) => {
|
|
58
|
-
const day = days[week][dayOfWeek];
|
|
59
|
-
const isFutureDay = day && moment(day.date).isAfter(moment(), 'day');
|
|
60
|
-
const isPastDay = limitRange
|
|
61
|
-
? day
|
|
62
|
-
&& moment(day.date).isBefore(moment().subtract(limitRange, 'days'), 'day')
|
|
63
|
-
: null;
|
|
64
|
-
const isRangeStart = day && moment(day.date).isSame(startDate, 'day');
|
|
65
|
-
const isRangeEnd
|
|
66
|
-
= day
|
|
67
|
-
&& moment(day.date).isSame(moment(endDate).subtract(1, 'hour'), 'day');
|
|
68
|
-
const isRangeInside
|
|
69
|
-
= day
|
|
70
|
-
&& startDate
|
|
71
|
-
&& endDate
|
|
72
|
-
&& moment(day.date).isAfter(startDate, 'day')
|
|
73
|
-
&& moment(day.date).isBefore(moment(endDate).subtract(1, 'hour'), 'day');
|
|
74
|
-
const isPrevRangeEnd
|
|
75
|
-
= day
|
|
76
|
-
&& (moment(day.date).isSame(startPrevDate, 'day')
|
|
77
|
-
|| moment(day.date).isSame(moment(endPrevDate).subtract(1, 'day'), 'day'));
|
|
78
|
-
const isPrevRangeInside
|
|
79
|
-
= day
|
|
80
|
-
&& startPrevDate
|
|
81
|
-
&& endPrevDate
|
|
82
|
-
&& moment(day.date).isAfter(startPrevDate, 'day')
|
|
83
|
-
&& moment(day.date).isBefore(moment(endPrevDate).subtract(1, 'day'), 'day');
|
|
84
|
-
const classNames = cn(
|
|
85
|
-
'range-calendar__day',
|
|
86
|
-
{ 'range-calendar__day--clickable': day },
|
|
87
|
-
{
|
|
88
|
-
'range-calendar__day--disabled':
|
|
89
|
-
isPastDay
|
|
90
|
-
|| (minDate && moment(day?.date).isBefore(momentMinDate, 'day'))
|
|
91
|
-
|| (!isDontLimitFuture
|
|
92
|
-
&& (maxDate ? moment(day?.date).isAfter(momentMaxDate) : isFutureDay)),
|
|
93
|
-
},
|
|
94
|
-
{ 'range-calendar__day--range-start': isRangeStart },
|
|
95
|
-
{ 'range-calendar__day--range-end': isRangeEnd },
|
|
96
|
-
{ 'range-calendar__day--range-inside': isRangeInside },
|
|
97
|
-
{ 'range-calendar__day--prev-range-end': isPrevRangeEnd },
|
|
98
|
-
{ 'range-calendar__day--prev-range-inside': isPrevRangeInside },
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<div
|
|
103
|
-
key={`${week}_${dayOfWeek}`}
|
|
104
|
-
className={classNames}
|
|
105
|
-
onClick={day ? e => onClick(day.date, e) : null}
|
|
106
|
-
onMouseOver={day ? () => onHover(day.date) : null}
|
|
107
|
-
onMouseLeave={() => onHover(null)}
|
|
108
|
-
>
|
|
109
|
-
<span className="calendar__day-num">{day && day.date.getDate()}</span>
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const handlePrev = () => {
|
|
115
|
-
setDate(moment(date).subtract(1, 'month').toDate());
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const handleNext = () => {
|
|
119
|
-
setDate(moment(date).add(1, 'month').toDate());
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const getFormatedWeekName = input =>
|
|
123
|
-
isShortWeekNames ? input.charAt(0) : input;
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<div className={cn('range-calendar', className)} data-testid={testId}>
|
|
127
|
-
<div className="range-calendar-header">
|
|
128
|
-
<Arrow
|
|
129
|
-
type="left"
|
|
130
|
-
disabled={
|
|
131
|
-
!allowPrev
|
|
132
|
-
|| (minDate
|
|
133
|
-
&& moment(date)
|
|
134
|
-
.startOf('month')
|
|
135
|
-
.isSameOrBefore(momentMinDate, 'months'))
|
|
136
|
-
}
|
|
137
|
-
onClick={handlePrev}
|
|
138
|
-
className="range-calendar-header__prev"
|
|
139
|
-
/>
|
|
140
|
-
|
|
141
|
-
<div className="range-calendar-header__title">{title}</div>
|
|
142
|
-
|
|
143
|
-
<Arrow
|
|
144
|
-
type="right"
|
|
145
|
-
disabled={
|
|
146
|
-
!allowNext
|
|
147
|
-
|| (!isDontLimitFuture
|
|
148
|
-
&& moment(date)
|
|
149
|
-
.startOf('month')
|
|
150
|
-
.isSameOrAfter(
|
|
151
|
-
maxDate
|
|
152
|
-
? momentMaxDate
|
|
153
|
-
: moment().add(1, 'day').startOf('day'),
|
|
154
|
-
'months',
|
|
155
|
-
))
|
|
156
|
-
}
|
|
157
|
-
onClick={handleNext}
|
|
158
|
-
className="range-calendar-header__next"
|
|
159
|
-
/>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
<div className="range-calendar__week range-calendar__week-title">
|
|
163
|
-
{[...Array.from({ length: 7 }).keys()].map((dayOfWeek) => {
|
|
164
|
-
return (
|
|
165
|
-
<div
|
|
166
|
-
key={`day-of-week_${dayOfWeek}`}
|
|
167
|
-
className="range-calendar__day range-calendar__day--title"
|
|
168
|
-
>
|
|
169
|
-
{getFormatedWeekName(moment().weekday(dayOfWeek).format('dd'))}
|
|
170
|
-
</div>
|
|
171
|
-
);
|
|
172
|
-
})}
|
|
173
|
-
</div>
|
|
174
|
-
{Object.keys(days).map((week, index) => (
|
|
175
|
-
<div key={`week_${index}`} className="range-calendar__week">
|
|
176
|
-
{[...Array.from({ length: 7 }).keys()].map(dayOfWeek => renderDay(week, dayOfWeek))}
|
|
177
|
-
</div>
|
|
178
|
-
))}
|
|
179
|
-
</div>
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export default RangeCalendar;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import { useRef, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
// import { numberFilter, numberFilterWithoutDots, rounded } from '../../../Functions/utils';
|
|
6
|
-
import { addRangeDefault } from '../../../Functions/operations';
|
|
7
|
-
import Button from '../../UI/Button/Button';
|
|
8
|
-
import Input from '../Input/Input';
|
|
9
|
-
|
|
10
|
-
import RangeListRow, { RangeListCell } from './partial/RangeListRow';
|
|
11
|
-
|
|
12
|
-
import './RangeList.scss';
|
|
13
|
-
|
|
14
|
-
const RC = 'range-list';
|
|
15
|
-
const DEFAULT_STATE = { from: '', to: '' };
|
|
16
|
-
|
|
17
|
-
function RangeList(props) {
|
|
18
|
-
const {
|
|
19
|
-
className,
|
|
20
|
-
value = [],
|
|
21
|
-
disabled,
|
|
22
|
-
validateErrors,
|
|
23
|
-
onChange,
|
|
24
|
-
isFloatValues,
|
|
25
|
-
decimalPlaces,
|
|
26
|
-
error,
|
|
27
|
-
defaultErrorText,
|
|
28
|
-
nullValueText,
|
|
29
|
-
isOnlyOneRow = false,
|
|
30
|
-
testId = 'range-list',
|
|
31
|
-
} = props;
|
|
32
|
-
|
|
33
|
-
const NULL_VALUE_TEXT = nullValueText ?? 'No data';
|
|
34
|
-
|
|
35
|
-
const [state, setState] = useState(DEFAULT_STATE);
|
|
36
|
-
const [innerError, setInnerError] = useState('');
|
|
37
|
-
const [outerError, setOuterError] = useState('');
|
|
38
|
-
|
|
39
|
-
const inputFromRef = useRef(null);
|
|
40
|
-
const inputToRef = useRef(null);
|
|
41
|
-
|
|
42
|
-
const isValidRange = Boolean(
|
|
43
|
-
state?.from && state?.to && Number(state?.from) <= Number(state?.to),
|
|
44
|
-
);
|
|
45
|
-
const isShowRow = (isOnlyOneRow && value?.length === 0) || !isOnlyOneRow;
|
|
46
|
-
|
|
47
|
-
const handle = {
|
|
48
|
-
inputsChange: (val, prop) => setState({ ...state, [prop]: val }),
|
|
49
|
-
addRange: () => {
|
|
50
|
-
if (
|
|
51
|
-
isValidRange
|
|
52
|
-
&& (!validateErrors?.(Number(state.from), Number(state.to)) ?? true)
|
|
53
|
-
) {
|
|
54
|
-
onChange(
|
|
55
|
-
addRangeDefault(
|
|
56
|
-
Number(state.from),
|
|
57
|
-
Number(state.to),
|
|
58
|
-
value,
|
|
59
|
-
isFloatValues ? decimalPlaces : null,
|
|
60
|
-
),
|
|
61
|
-
);
|
|
62
|
-
setState(DEFAULT_STATE);
|
|
63
|
-
setInnerError('');
|
|
64
|
-
setOuterError('');
|
|
65
|
-
}
|
|
66
|
-
else if (!isValidRange) {
|
|
67
|
-
setInnerError(defaultErrorText);
|
|
68
|
-
}
|
|
69
|
-
else if (validateErrors) {
|
|
70
|
-
setOuterError(validateErrors(Number(state.from), Number(state.to)));
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
removeRange: index =>
|
|
74
|
-
onChange(value.filter((item, idx) => idx !== index)),
|
|
75
|
-
rangeValidation: (e, key) => {
|
|
76
|
-
const oppositeKey = key === 'from' ? 'to' : 'from';
|
|
77
|
-
|
|
78
|
-
if (!state?.from && !state?.to) {
|
|
79
|
-
setInnerError('');
|
|
80
|
-
setOuterError('');
|
|
81
|
-
return e;
|
|
82
|
-
}
|
|
83
|
-
if (!state[oppositeKey]) {
|
|
84
|
-
const mustToFocus
|
|
85
|
-
= key === 'from' ? inputToRef.current : inputFromRef.current;
|
|
86
|
-
mustToFocus.focus();
|
|
87
|
-
}
|
|
88
|
-
else if (!isValidRange) {
|
|
89
|
-
setInnerError(defaultErrorText);
|
|
90
|
-
if (validateErrors)
|
|
91
|
-
setOuterError(validateErrors(Number(state.from), Number(state.to)));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
setInnerError('');
|
|
95
|
-
if (validateErrors)
|
|
96
|
-
setOuterError(validateErrors(Number(state.from), Number(state.to)));
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
},
|
|
100
|
-
onKeyUpFromInput: (code) => {
|
|
101
|
-
if (code === 13) {
|
|
102
|
-
if (isValidRange) inputFromRef.current.blur();
|
|
103
|
-
else if (!state.to) inputToRef.current.focus();
|
|
104
|
-
else if (state.from) inputFromRef.current.select();
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
onKeyUpToInput: (code) => {
|
|
108
|
-
if (code === 13) inputToRef.current.blur();
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const renderInputsAndAddButtonRow = () => (
|
|
113
|
-
<div className={cn(`${RC}__row`, `${RC}__inputs`)}>
|
|
114
|
-
<RangeListCell className={`${RC}__cell-input`}>
|
|
115
|
-
<Input
|
|
116
|
-
ref={inputFromRef}
|
|
117
|
-
onlyNumbers={
|
|
118
|
-
isFloatValues
|
|
119
|
-
? { type: 'float', decimalPlaces: decimalPlaces || 0 }
|
|
120
|
-
: { type: 'int' }
|
|
121
|
-
}
|
|
122
|
-
value={state.from}
|
|
123
|
-
onBlur={e => handle.rangeValidation(e, 'from')}
|
|
124
|
-
onChange={val => handle.inputsChange(val, 'from')}
|
|
125
|
-
onKeyUp={code => handle.onKeyUpFromInput(code)}
|
|
126
|
-
/>
|
|
127
|
-
</RangeListCell>
|
|
128
|
-
<RangeListCell className={`${RC}__cell-input`}>
|
|
129
|
-
<Input
|
|
130
|
-
ref={inputToRef}
|
|
131
|
-
onlyNumbers={
|
|
132
|
-
isFloatValues
|
|
133
|
-
? { type: 'float', decimalPlaces: decimalPlaces || 0 }
|
|
134
|
-
: { type: 'int' }
|
|
135
|
-
}
|
|
136
|
-
value={state.to}
|
|
137
|
-
onBlur={e => handle.rangeValidation(e, 'to')}
|
|
138
|
-
onChange={val => handle.inputsChange(val, 'to')}
|
|
139
|
-
onKeyUp={code => handle.onKeyUpToInput(code)}
|
|
140
|
-
/>
|
|
141
|
-
</RangeListCell>
|
|
142
|
-
<RangeListCell className={`${RC}__cell-button`}>
|
|
143
|
-
<Button onClick={handle.addRange}>Add</Button>
|
|
144
|
-
</RangeListCell>
|
|
145
|
-
</div>
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<div
|
|
150
|
-
data-testid={testId}
|
|
151
|
-
className={cn(RC, className, { [`${RC}_disabled`]: disabled })}
|
|
152
|
-
>
|
|
153
|
-
<div className={cn(`${RC}__row`, `${RC}__labels`)}>
|
|
154
|
-
<RangeListCell className={`${RC}__cell-label`}>From</RangeListCell>
|
|
155
|
-
<RangeListCell className={`${RC}__cell-label`}>To</RangeListCell>
|
|
156
|
-
</div>
|
|
157
|
-
{isShowRow && renderInputsAndAddButtonRow()}
|
|
158
|
-
{(innerError || outerError || error) && (
|
|
159
|
-
<span className={`${RC}__error`}>
|
|
160
|
-
{innerError || error || outerError}
|
|
161
|
-
</span>
|
|
162
|
-
)}
|
|
163
|
-
{!value?.length && (
|
|
164
|
-
<div className={cn(`${RC}__row`, `${RC}__values`, `${RC}__null-value`)}>
|
|
165
|
-
{NULL_VALUE_TEXT}
|
|
166
|
-
</div>
|
|
167
|
-
)}
|
|
168
|
-
{value.map((row, idx) => (
|
|
169
|
-
<RangeListRow
|
|
170
|
-
data-testid={`${testId}-row-${idx}`}
|
|
171
|
-
key={`idx-${idx}-from-${row.from}-to${row.to}`}
|
|
172
|
-
{...row}
|
|
173
|
-
idx={idx}
|
|
174
|
-
actionClick={() => handle.removeRange(idx)}
|
|
175
|
-
/>
|
|
176
|
-
))}
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export default RangeList;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
import { Trash2 } from 'react-feather';
|
|
3
|
-
|
|
4
|
-
const RC = 'range-list';
|
|
5
|
-
|
|
6
|
-
export function RangeListCell({ children, idx, className, onClick }) {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
className={cn(`${RC}__cell`, className, { [`${RC}__cell-${idx}`]: idx })}
|
|
10
|
-
onClick={onClick}
|
|
11
|
-
>
|
|
12
|
-
{children}
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function RangeListRow({ from, to, idx, actionClick }) {
|
|
18
|
-
return (
|
|
19
|
-
<div
|
|
20
|
-
className={cn(`${RC}__row`, `${RC}__values`, {
|
|
21
|
-
[`${RC}__values_first-value`]: idx === 0,
|
|
22
|
-
})}
|
|
23
|
-
>
|
|
24
|
-
<RangeListCell idx={1} className={`${RC}__cell-value`}>
|
|
25
|
-
{from}
|
|
26
|
-
</RangeListCell>
|
|
27
|
-
<RangeListCell idx={2} className={`${RC}__cell-value`}>
|
|
28
|
-
{to}
|
|
29
|
-
</RangeListCell>
|
|
30
|
-
<RangeListCell
|
|
31
|
-
idx={3}
|
|
32
|
-
className={`${RC}__cell-action`}
|
|
33
|
-
onClick={() => actionClick(idx)}
|
|
34
|
-
>
|
|
35
|
-
<Trash2 />
|
|
36
|
-
</RangeListCell>
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default RangeListRow;
|