@synerise/ds-date-range-picker 1.6.11 → 1.6.13
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/CHANGELOG.md +8 -0
- package/dist/AddonCollapse/AddonCollapse.d.ts +2 -2
- package/dist/AddonCollapse/AddonCollapse.js +22 -19
- package/dist/AddonCollapse/AddonCollapse.styles.d.ts +5 -5
- package/dist/AddonCollapse/AddonCollapse.styles.js +16 -13
- package/dist/AddonCollapse/AddonCollapse.types.d.ts +1 -1
- package/dist/AddonCollapse/AddonCollapse.types.js +1 -1
- package/dist/DateRangePicker.d.ts +2 -2
- package/dist/DateRangePicker.js +64 -112
- package/dist/DateRangePicker.styles.d.ts +8 -8
- package/dist/DateRangePicker.styles.js +24 -24
- package/dist/DateRangePicker.types.d.ts +11 -11
- package/dist/DateRangePicker.types.js +1 -1
- package/dist/Footer/Footer.d.ts +2 -2
- package/dist/Footer/Footer.js +63 -65
- package/dist/Footer/Footer.styles.d.ts +6 -6
- package/dist/Footer/Footer.styles.js +19 -27
- package/dist/Footer/Footer.types.d.ts +3 -3
- package/dist/Footer/Footer.types.js +1 -1
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.d.ts +8 -8
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.js +55 -44
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.styles.d.ts +1 -1
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.styles.js +6 -3
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.d.ts +3 -3
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.js +283 -324
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.styles.d.ts +11 -11
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.styles.js +26 -18
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.d.ts +7 -7
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.js +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.d.ts +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.js +45 -44
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.types.d.ts +5 -5
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.types.js +1 -1
- package/dist/RangeFilter/Filters/new/Daily/Daily.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Daily/Daily.js +72 -92
- package/dist/RangeFilter/Filters/new/Daily/Daily.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Daily/Daily.types.js +1 -1
- package/dist/RangeFilter/Filters/new/Filters.types.d.ts +3 -3
- package/dist/RangeFilter/Filters/new/Filters.types.js +1 -1
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.js +207 -264
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.types.d.ts +7 -7
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.types.js +1 -1
- package/dist/RangeFilter/Filters/new/Monthly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Monthly/utils.js +17 -20
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +173 -227
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.types.js +1 -1
- package/dist/RangeFilter/Filters/new/Weekly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Weekly/utils.js +22 -26
- package/dist/RangeFilter/Filters/new/constants.js +17 -9
- package/dist/RangeFilter/Filters/new/filters.spec.constants.d.ts +333 -0
- package/dist/RangeFilter/Filters/new/filters.spec.constants.js +218 -0
- package/dist/RangeFilter/Filters/new/hooks/useShiftAndControlKeys.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/hooks/useShiftAndControlKeys.js +16 -23
- package/dist/RangeFilter/RangeFilter.d.ts +3 -3
- package/dist/RangeFilter/RangeFilter.js +171 -168
- package/dist/RangeFilter/RangeFilter.styles.d.ts +9 -9
- package/dist/RangeFilter/RangeFilter.styles.js +24 -17
- package/dist/RangeFilter/RangeFilter.types.d.ts +6 -6
- package/dist/RangeFilter/RangeFilter.types.js +1 -1
- package/dist/RangeFilter/Shared/AddButton/AddButton.d.ts +2 -2
- package/dist/RangeFilter/Shared/AddButton/AddButton.js +17 -19
- package/dist/RangeFilter/Shared/AddButton/AddButton.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/AddButton/AddButton.types.js +1 -1
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.d.ts +2 -2
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.js +31 -54
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.styles.d.ts +3 -3
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.styles.js +11 -6
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.types.js +1 -1
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.d.ts +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.js +34 -46
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.styles.d.ts +6 -6
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.styles.js +21 -17
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.types.js +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.d.ts +2 -2
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.js +26 -45
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.styles.d.ts +2 -2
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.styles.js +9 -5
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.types.js +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.d.ts +2 -2
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.js +18 -7
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.styles.d.ts +2 -2
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.styles.js +8 -4
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.types.js +1 -1
- package/dist/RangeFilter/Shared/SelectionHint/SelectionHint.d.ts +2 -2
- package/dist/RangeFilter/Shared/SelectionHint/SelectionHint.js +17 -12
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.js +39 -66
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.styles.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.styles.js +13 -13
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.js +43 -47
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.js +15 -20
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.styles.d.ts +5 -5
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.styles.js +14 -7
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.js +33 -56
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.styles.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.styles.js +9 -5
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.constants.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.constants.js +22 -14
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.js +89 -157
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.styles.d.ts +5 -5
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.styles.js +13 -13
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.utils.js +18 -14
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.js +100 -117
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.styles.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.styles.js +6 -3
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.types.d.ts +6 -6
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.js +26 -18
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.styles.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.styles.js +9 -9
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.d.ts +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.js +324 -345
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.styles.d.ts +8 -8
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.styles.js +23 -19
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.types.d.ts +9 -9
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.types.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/constants/timeWindow.constants.js +10 -4
- package/dist/RangeFilter/Shared/TimeWindow/utils.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/utils.js +24 -22
- package/dist/RangeFilter/Shared/index.js +16 -7
- package/dist/RangeFilter/constants.d.ts +6 -6
- package/dist/RangeFilter/constants.js +120 -86
- package/dist/RangeFilter/utils.d.ts +2 -2
- package/dist/RangeFilter/utils.js +165 -186
- package/dist/RangePicker/RangePicker.d.ts +2 -2
- package/dist/RangePicker/RangePicker.js +351 -330
- package/dist/RangePicker/RangePicker.styles.d.ts +5 -5
- package/dist/RangePicker/RangePicker.styles.js +19 -13
- package/dist/RangePicker/RangePicker.types.d.ts +3 -3
- package/dist/RangePicker/RangePicker.types.js +1 -1
- package/dist/RangePicker/utils.d.ts +3 -3
- package/dist/RangePicker/utils.js +84 -80
- package/dist/RangePickerInput/RangePickerInput.d.ts +2 -2
- package/dist/RangePickerInput/RangePickerInput.js +76 -103
- package/dist/RangePickerInput/RangePickerInput.styles.d.ts +8 -8
- package/dist/RangePickerInput/RangePickerInput.styles.js +25 -25
- package/dist/RangePickerInput/RangePickerInput.types.d.ts +5 -5
- package/dist/RangePickerInput/RangePickerInput.types.js +1 -1
- package/dist/RawDateRangePicker.d.ts +3 -3
- package/dist/RawDateRangePicker.js +195 -253
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.js +40 -60
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.js +43 -52
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.js +41 -49
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.js +29 -53
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.js +21 -22
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.d.ts +3 -3
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.js +57 -87
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.js +39 -68
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.types.js +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.js +70 -102
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.types.js +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.d.ts +4 -4
- package/dist/RelativeRangePicker/RelativeRangePicker.js +189 -170
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.d.ts +17 -17
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.js +47 -48
- package/dist/RelativeRangePicker/RelativeRangePicker.types.d.ts +3 -3
- package/dist/RelativeRangePicker/RelativeRangePicker.types.js +1 -1
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.d.ts +7 -7
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.js +12 -9
- package/dist/RelativeRangePicker/utils/findRangeByKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/findRangeByKey.utils.js +6 -5
- package/dist/RelativeRangePicker/utils/getCurrentGroupFromProps.utils.d.ts +2 -2
- package/dist/RelativeRangePicker/utils/getCurrentGroupFromProps.utils.js +8 -4
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.js +18 -17
- package/dist/RelativeRangePicker/utils/index.js +20 -9
- package/dist/RelativeRangePicker/utils/isAbsolute.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/isAbsolute.utils.js +5 -4
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.js +9 -6
- package/dist/RelativeRangePicker/utils/setFuture.utils.js +6 -3
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.js +9 -6
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.js +14 -10
- package/dist/constants.d.ts +3 -3
- package/dist/constants.js +112 -85
- package/dist/date.types.d.ts +3 -3
- package/dist/date.types.js +1 -1
- package/dist/dateUtils/Date.d.ts +1 -1
- package/dist/dateUtils/Date.js +14 -16
- package/dist/dateUtils/add.d.ts +7 -7
- package/dist/dateUtils/add.js +12 -9
- package/dist/dateUtils/difference.d.ts +7 -7
- package/dist/dateUtils/difference.js +12 -9
- package/dist/dateUtils/endOf.d.ts +7 -7
- package/dist/dateUtils/endOf.js +12 -9
- package/dist/dateUtils/format.js +14 -15
- package/dist/dateUtils/get.d.ts +3 -3
- package/dist/dateUtils/get.js +8 -5
- package/dist/dateUtils/getDateFromString.js +3 -3
- package/dist/dateUtils/getRelativePresetForRange.d.ts +1 -1
- package/dist/dateUtils/getRelativePresetForRange.js +9 -9
- package/dist/dateUtils/index.js +2 -1
- package/dist/dateUtils/relativeToAbsolute.d.ts +1 -1
- package/dist/dateUtils/relativeToAbsolute.js +35 -27
- package/dist/dateUtils/set.d.ts +3 -3
- package/dist/dateUtils/set.js +8 -5
- package/dist/dateUtils/startOf.d.ts +7 -7
- package/dist/dateUtils/startOf.js +12 -9
- package/dist/dateUtils/sub.d.ts +7 -7
- package/dist/dateUtils/sub.js +12 -9
- package/dist/fns.d.ts +20 -20
- package/dist/fns.js +42 -40
- package/dist/index.js +44 -13
- package/dist/utils.d.ts +5 -5
- package/dist/utils.js +158 -153
- package/package.json +24 -24
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateRange } from '../../date.types';
|
|
2
2
|
export declare const findMatchingPreset: (range: DateRange) => {
|
|
3
3
|
type: "RELATIVE" | "SINCE";
|
|
4
4
|
offset: {
|
|
5
|
-
type: import(
|
|
5
|
+
type: import('../../date.types').RelativeUnits;
|
|
6
6
|
value: number;
|
|
7
7
|
};
|
|
8
|
-
duration: import(
|
|
9
|
-
from?: import(
|
|
10
|
-
to?: import(
|
|
11
|
-
key: import(
|
|
8
|
+
duration: import('../../date.types').Duration;
|
|
9
|
+
from?: import('../../date.types').NullableDateLimit;
|
|
10
|
+
to?: import('../../date.types').NullableDateLimit;
|
|
11
|
+
key: import('../../date.types').RangeKey | string;
|
|
12
12
|
future?: boolean;
|
|
13
|
-
filter?: import(
|
|
13
|
+
filter?: import('../../date.types').DateFilter;
|
|
14
14
|
translationKey?: string;
|
|
15
15
|
id?: React.ReactText;
|
|
16
16
|
timestamp?: Date;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!range || range.type !== CONST.RELATIVE) {
|
|
1
|
+
import { RELATIVE, RELATIVE_PRESETS } from "../../constants.js";
|
|
2
|
+
const findMatchingPreset = (range) => {
|
|
3
|
+
if (!range || range.type !== RELATIVE) {
|
|
5
4
|
return;
|
|
6
5
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return Boolean(preset.future) === Boolean(range.future) && ((_preset$offset = preset.offset) == null ? void 0 : _preset$offset.type) === ((_range$offset = range.offset) == null ? void 0 : _range$offset.type) && ((_preset$offset2 = preset.offset) == null ? void 0 : _preset$offset2.value) === ((_range$offset2 = range.offset) == null ? void 0 : _range$offset2.value) && ((_preset$duration = preset.duration) == null ? void 0 : _preset$duration.type) === ((_range$duration = range.duration) == null ? void 0 : _range$duration.type) && ((_preset$duration2 = preset.duration) == null ? void 0 : _preset$duration2.value) === ((_range$duration2 = range.duration) == null ? void 0 : _range$duration2.value);
|
|
6
|
+
const matchingPreset = RELATIVE_PRESETS.find((preset) => {
|
|
7
|
+
return Boolean(preset.future) === Boolean(range.future) && preset.offset?.type === range.offset?.type && preset.offset?.value === range.offset?.value && preset.duration?.type === range.duration?.type && preset.duration?.value === range.duration?.value;
|
|
10
8
|
});
|
|
11
|
-
return matchingPreset &&
|
|
12
|
-
|
|
9
|
+
return matchingPreset && {
|
|
10
|
+
...matchingPreset
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
findMatchingPreset
|
|
15
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateRange } from '../../date.types';
|
|
2
2
|
export declare const findRangeByKey: (ranges: DateRange[], key: string) => DateRange | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
return ranges.find(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const findRangeByKey = (ranges, key) => {
|
|
2
|
+
return ranges.find((range) => range.key === key);
|
|
3
|
+
};
|
|
4
|
+
export {
|
|
5
|
+
findRangeByKey
|
|
6
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RelativeMode } from '../../DateRangePicker.types';
|
|
2
|
+
import { RelativeRangePickerProps } from '../RelativeRangePicker.types';
|
|
3
3
|
export declare function getCurrentGroupFromProps({ relativeModes, }: RelativeRangePickerProps): RelativeMode | null;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function getCurrentGroupFromProps({
|
|
2
|
+
relativeModes
|
|
3
|
+
}) {
|
|
4
|
+
if (!!relativeModes && relativeModes?.length > 0) {
|
|
4
5
|
return relativeModes[0];
|
|
5
6
|
}
|
|
6
7
|
return null;
|
|
7
|
-
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
getCurrentGroupFromProps
|
|
11
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const getDefaultCustomRange: (currentGroup: string | null) => RelativeDateRange;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { RELATIVE, RANGES_MODE } from "../../constants.js";
|
|
2
|
+
const getDefaultCustomRange = (currentGroup) => ({
|
|
3
|
+
type: RELATIVE,
|
|
4
|
+
from: void 0,
|
|
5
|
+
to: void 0,
|
|
6
|
+
future: currentGroup === RANGES_MODE.FUTURE,
|
|
7
|
+
offset: {
|
|
8
|
+
type: "DAYS",
|
|
9
|
+
value: 0
|
|
10
|
+
},
|
|
11
|
+
duration: {
|
|
12
|
+
type: "DAYS",
|
|
13
|
+
value: 30
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
getDefaultCustomRange
|
|
18
|
+
};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { findMatchingPreset } from "./findMatchingPreset.utils.js";
|
|
2
|
+
import { setFuture } from "./setFuture.utils.js";
|
|
3
|
+
import { updatePresetKey } from "./updatePresetKey.utils.js";
|
|
4
|
+
import { setDurationValue } from "./setDurationValue.utils.js";
|
|
5
|
+
import { setOffsetValue } from "./setOffsetValue.utils.js";
|
|
6
|
+
import { getDefaultCustomRange } from "./getDefaultCustomRange.utils.js";
|
|
7
|
+
import { getCurrentGroupFromProps } from "./getCurrentGroupFromProps.utils.js";
|
|
8
|
+
import { isAbsolute } from "./isAbsolute.utils.js";
|
|
9
|
+
import { findRangeByKey } from "./findRangeByKey.utils.js";
|
|
10
|
+
export {
|
|
11
|
+
findMatchingPreset,
|
|
12
|
+
findRangeByKey,
|
|
13
|
+
getCurrentGroupFromProps,
|
|
14
|
+
getDefaultCustomRange,
|
|
15
|
+
isAbsolute,
|
|
16
|
+
setDurationValue,
|
|
17
|
+
setFuture,
|
|
18
|
+
setOffsetValue,
|
|
19
|
+
updatePresetKey
|
|
20
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateRange } from '../../date.types';
|
|
2
2
|
export declare const isAbsolute: (value: DateRange) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ABSOLUTE } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ABSOLUTE } from "../../constants.js";
|
|
2
|
+
const isAbsolute = (value) => value.type === ABSOLUTE && !value.from && !value.to;
|
|
3
|
+
export {
|
|
4
|
+
isAbsolute
|
|
5
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const setDurationValue: (value: number | string, currentRange: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import lensPath from
|
|
2
|
-
import set from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return set(lensPath([
|
|
6
|
-
};
|
|
1
|
+
import lensPath from "ramda/src/lensPath";
|
|
2
|
+
import set from "ramda/src/set";
|
|
3
|
+
const setDurationValue = (value, currentRange) => {
|
|
4
|
+
const updatedValue = value === "" ? null : value;
|
|
5
|
+
return set(lensPath(["duration", "value"]))(typeof updatedValue === "number" && updatedValue >= 1 ? Math.round(updatedValue) : 1, currentRange);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
setDurationValue
|
|
9
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import lensPath from
|
|
2
|
-
import set from
|
|
3
|
-
|
|
1
|
+
import lensPath from "ramda/src/lensPath";
|
|
2
|
+
import set from "ramda/src/set";
|
|
3
|
+
const setFuture = set(lensPath(["future"]));
|
|
4
|
+
export {
|
|
5
|
+
setFuture
|
|
6
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const setOffsetValue: (value: number | string, currentRange: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import lensPath from
|
|
2
|
-
import set from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return set(lensPath([
|
|
6
|
-
};
|
|
1
|
+
import lensPath from "ramda/src/lensPath";
|
|
2
|
+
import set from "ramda/src/set";
|
|
3
|
+
const setOffsetValue = (value, currentRange) => {
|
|
4
|
+
const updatedValue = value === "" ? null : value;
|
|
5
|
+
return set(lensPath(["offset", "value"]))(typeof updatedValue === "number" && updatedValue >= 0 ? Math.round(updatedValue) : 0, currentRange);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
setOffsetValue
|
|
9
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const updatePresetKey: (range: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var matchingPreset = findMatchingPreset(range);
|
|
1
|
+
import { CUSTOM_RANGE_KEY } from "../../constants.js";
|
|
2
|
+
import { findMatchingPreset } from "./findMatchingPreset.utils.js";
|
|
3
|
+
const updatePresetKey = (range) => {
|
|
4
|
+
const matchingPreset = findMatchingPreset(range);
|
|
6
5
|
if (matchingPreset && matchingPreset.key) {
|
|
7
|
-
return
|
|
6
|
+
return {
|
|
7
|
+
...range,
|
|
8
8
|
key: matchingPreset.key,
|
|
9
9
|
translationKey: matchingPreset.translationKey
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return {
|
|
13
|
+
...range,
|
|
13
14
|
key: CUSTOM_RANGE_KEY,
|
|
14
15
|
translationKey: CUSTOM_RANGE_KEY
|
|
15
|
-
}
|
|
16
|
-
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
updatePresetKey
|
|
20
|
+
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FlipConfig, OffsetConfig, ShiftConfig } from '@synerise/ds-popover';
|
|
3
|
+
import { AbsoluteDateRangePreset, RangeKey, RelativeDateRangePreset, RelativeUnits } from './date.types';
|
|
4
4
|
export declare const SECONDS = "SECONDS";
|
|
5
5
|
export declare const MINUTES = "MINUTES";
|
|
6
6
|
export declare const HOURS = "HOURS";
|
package/dist/constants.js
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { limitShift } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
PAST:
|
|
19
|
-
FUTURE:
|
|
20
|
-
SINCE:
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SinceArrowRightM, ArrowRightM, ArrowLeftM } from "@synerise/ds-icon";
|
|
3
|
+
import { limitShift } from "@synerise/ds-popover";
|
|
4
|
+
const SECONDS = "SECONDS";
|
|
5
|
+
const MINUTES = "MINUTES";
|
|
6
|
+
const HOURS = "HOURS";
|
|
7
|
+
const DAYS = "DAYS";
|
|
8
|
+
const WEEKS = "WEEKS";
|
|
9
|
+
const MONTHS = "MONTHS";
|
|
10
|
+
const YEARS = "YEARS";
|
|
11
|
+
const ABSOLUTE = "ABSOLUTE";
|
|
12
|
+
const RELATIVE = "RELATIVE";
|
|
13
|
+
const RELATIVE_OFFSET_MAX = 999999;
|
|
14
|
+
const RELATIVE_DURATION_MAX = 999999;
|
|
15
|
+
const RELATIVE_UNITS = [SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS, YEARS];
|
|
16
|
+
const ALL_TIME = "ALL_TIME";
|
|
17
|
+
const RANGES_MODE = {
|
|
18
|
+
PAST: "PAST",
|
|
19
|
+
FUTURE: "FUTURE",
|
|
20
|
+
SINCE: "SINCE"
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
PAST:
|
|
24
|
-
FUTURE:
|
|
25
|
-
SINCE:
|
|
22
|
+
const RANGES_ICON = {
|
|
23
|
+
PAST: /* @__PURE__ */ jsx(ArrowLeftM, {}),
|
|
24
|
+
FUTURE: /* @__PURE__ */ jsx(ArrowRightM, {}),
|
|
25
|
+
SINCE: /* @__PURE__ */ jsx(SinceArrowRightM, {})
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
const range = (start, end) => {
|
|
28
28
|
if (end <= start) {
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
return Array.from(Array(size).keys()).map(
|
|
33
|
-
return i + start;
|
|
34
|
-
});
|
|
31
|
+
const size = end - start;
|
|
32
|
+
return Array.from(Array(size).keys()).map((i) => i + start);
|
|
35
33
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
LAST:
|
|
39
|
-
NEXT:
|
|
34
|
+
const CUSTOM_RANGE_KEY = "custom";
|
|
35
|
+
const DURATION_MODIFIERS = {
|
|
36
|
+
LAST: "timestampLast",
|
|
37
|
+
NEXT: "timestampNext"
|
|
40
38
|
};
|
|
41
|
-
|
|
42
|
-
key:
|
|
43
|
-
translationKey:
|
|
39
|
+
const RELATIVE_PRESETS = [{
|
|
40
|
+
key: "TODAY",
|
|
41
|
+
translationKey: "today",
|
|
44
42
|
type: RELATIVE,
|
|
45
43
|
from: null,
|
|
46
44
|
to: null,
|
|
@@ -54,8 +52,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
54
52
|
value: 1
|
|
55
53
|
}
|
|
56
54
|
}, {
|
|
57
|
-
key:
|
|
58
|
-
translationKey:
|
|
55
|
+
key: "YESTERDAY",
|
|
56
|
+
translationKey: "yesterday",
|
|
59
57
|
type: RELATIVE,
|
|
60
58
|
from: null,
|
|
61
59
|
to: null,
|
|
@@ -69,8 +67,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
69
67
|
value: 1
|
|
70
68
|
}
|
|
71
69
|
}, {
|
|
72
|
-
key:
|
|
73
|
-
translationKey:
|
|
70
|
+
key: "TOMORROW",
|
|
71
|
+
translationKey: "tomorrow",
|
|
74
72
|
type: RELATIVE,
|
|
75
73
|
from: null,
|
|
76
74
|
to: null,
|
|
@@ -84,8 +82,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
84
82
|
value: 1
|
|
85
83
|
}
|
|
86
84
|
}, {
|
|
87
|
-
key:
|
|
88
|
-
translationKey:
|
|
85
|
+
key: "LAST_WEEK",
|
|
86
|
+
translationKey: "lastWeek",
|
|
89
87
|
type: RELATIVE,
|
|
90
88
|
from: null,
|
|
91
89
|
to: null,
|
|
@@ -99,8 +97,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
99
97
|
value: 1
|
|
100
98
|
}
|
|
101
99
|
}, {
|
|
102
|
-
key:
|
|
103
|
-
translationKey:
|
|
100
|
+
key: "THIS_WEEK",
|
|
101
|
+
translationKey: "thisWeek",
|
|
104
102
|
type: RELATIVE,
|
|
105
103
|
from: null,
|
|
106
104
|
to: null,
|
|
@@ -114,8 +112,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
114
112
|
value: 1
|
|
115
113
|
}
|
|
116
114
|
}, {
|
|
117
|
-
key:
|
|
118
|
-
translationKey:
|
|
115
|
+
key: "NEXT_WEEK",
|
|
116
|
+
translationKey: "nextWeek",
|
|
119
117
|
type: RELATIVE,
|
|
120
118
|
from: null,
|
|
121
119
|
to: null,
|
|
@@ -129,8 +127,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
129
127
|
value: 1
|
|
130
128
|
}
|
|
131
129
|
}, {
|
|
132
|
-
key:
|
|
133
|
-
translationKey:
|
|
130
|
+
key: "LAST_7_DAYS",
|
|
131
|
+
translationKey: "last7Days",
|
|
134
132
|
type: RELATIVE,
|
|
135
133
|
from: null,
|
|
136
134
|
to: null,
|
|
@@ -144,8 +142,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
144
142
|
value: 7
|
|
145
143
|
}
|
|
146
144
|
}, {
|
|
147
|
-
key:
|
|
148
|
-
translationKey:
|
|
145
|
+
key: "NEXT_7_DAYS",
|
|
146
|
+
translationKey: "next7Days",
|
|
149
147
|
type: RELATIVE,
|
|
150
148
|
from: null,
|
|
151
149
|
to: null,
|
|
@@ -159,8 +157,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
159
157
|
value: 7
|
|
160
158
|
}
|
|
161
159
|
}, {
|
|
162
|
-
key:
|
|
163
|
-
translationKey:
|
|
160
|
+
key: "LAST_MONTH",
|
|
161
|
+
translationKey: "lastMonth",
|
|
164
162
|
type: RELATIVE,
|
|
165
163
|
from: null,
|
|
166
164
|
to: null,
|
|
@@ -174,8 +172,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
174
172
|
value: 1
|
|
175
173
|
}
|
|
176
174
|
}, {
|
|
177
|
-
key:
|
|
178
|
-
translationKey:
|
|
175
|
+
key: "THIS_MONTH",
|
|
176
|
+
translationKey: "thisMonth",
|
|
179
177
|
type: RELATIVE,
|
|
180
178
|
from: null,
|
|
181
179
|
to: null,
|
|
@@ -189,8 +187,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
189
187
|
value: 1
|
|
190
188
|
}
|
|
191
189
|
}, {
|
|
192
|
-
key:
|
|
193
|
-
translationKey:
|
|
190
|
+
key: "NEXT_MONTH",
|
|
191
|
+
translationKey: "nextMonth",
|
|
194
192
|
type: RELATIVE,
|
|
195
193
|
from: null,
|
|
196
194
|
to: null,
|
|
@@ -204,8 +202,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
204
202
|
value: 1
|
|
205
203
|
}
|
|
206
204
|
}, {
|
|
207
|
-
key:
|
|
208
|
-
translationKey:
|
|
205
|
+
key: "LAST_3_MONTHS",
|
|
206
|
+
translationKey: "last3Months",
|
|
209
207
|
type: RELATIVE,
|
|
210
208
|
from: null,
|
|
211
209
|
to: null,
|
|
@@ -219,8 +217,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
219
217
|
value: 3
|
|
220
218
|
}
|
|
221
219
|
}, {
|
|
222
|
-
key:
|
|
223
|
-
translationKey:
|
|
220
|
+
key: "NEXT_3_MONTHS",
|
|
221
|
+
translationKey: "next3Months",
|
|
224
222
|
type: RELATIVE,
|
|
225
223
|
from: null,
|
|
226
224
|
to: null,
|
|
@@ -234,8 +232,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
234
232
|
value: 3
|
|
235
233
|
}
|
|
236
234
|
}, {
|
|
237
|
-
key:
|
|
238
|
-
translationKey:
|
|
235
|
+
key: "LAST_6_MONTHS",
|
|
236
|
+
translationKey: "last6Months",
|
|
239
237
|
type: RELATIVE,
|
|
240
238
|
from: null,
|
|
241
239
|
to: null,
|
|
@@ -249,8 +247,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
249
247
|
value: 6
|
|
250
248
|
}
|
|
251
249
|
}, {
|
|
252
|
-
key:
|
|
253
|
-
translationKey:
|
|
250
|
+
key: "NEXT_6_MONTHS",
|
|
251
|
+
translationKey: "next6Months",
|
|
254
252
|
type: RELATIVE,
|
|
255
253
|
from: null,
|
|
256
254
|
to: null,
|
|
@@ -264,8 +262,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
264
262
|
value: 6
|
|
265
263
|
}
|
|
266
264
|
}, {
|
|
267
|
-
key:
|
|
268
|
-
translationKey:
|
|
265
|
+
key: "LAST_YEAR",
|
|
266
|
+
translationKey: "lastYear",
|
|
269
267
|
type: RELATIVE,
|
|
270
268
|
from: null,
|
|
271
269
|
to: null,
|
|
@@ -279,8 +277,8 @@ export var RELATIVE_PRESETS = [{
|
|
|
279
277
|
value: 1
|
|
280
278
|
}
|
|
281
279
|
}, {
|
|
282
|
-
key:
|
|
283
|
-
translationKey:
|
|
280
|
+
key: "NEXT_YEAR",
|
|
281
|
+
translationKey: "nextYear",
|
|
284
282
|
type: RELATIVE,
|
|
285
283
|
from: null,
|
|
286
284
|
to: null,
|
|
@@ -294,38 +292,67 @@ export var RELATIVE_PRESETS = [{
|
|
|
294
292
|
value: 1
|
|
295
293
|
}
|
|
296
294
|
}];
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
const RELATIVE_SECTION_BUTTON_KEYS_ORDER = [CUSTOM_RANGE_KEY, ALL_TIME, "TODAY", "YESTERDAY", "LAST_WEEK", "LAST_MONTH", "LAST_YEAR", "THIS_WEEK", "THIS_MONTH", "LAST_7_DAYS", "LAST_3_MONTHS", "LAST_6_MONTHS"];
|
|
296
|
+
const ABSOLUTE_PRESETS = [{
|
|
299
297
|
key: ALL_TIME,
|
|
300
|
-
translationKey:
|
|
298
|
+
translationKey: "allTime",
|
|
301
299
|
type: ABSOLUTE,
|
|
302
300
|
future: false
|
|
303
301
|
}];
|
|
304
|
-
|
|
302
|
+
const TIME_OPTIONS = {
|
|
305
303
|
HOURS: range(0, 24),
|
|
306
304
|
MINUTES: range(0, 60),
|
|
307
305
|
SECONDS: range(0, 60)
|
|
308
306
|
};
|
|
309
|
-
|
|
310
|
-
DATE:
|
|
311
|
-
TIME:
|
|
312
|
-
FILTER:
|
|
307
|
+
const MODES = {
|
|
308
|
+
DATE: "date",
|
|
309
|
+
TIME: "time",
|
|
310
|
+
FILTER: "filter"
|
|
313
311
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
LEFT
|
|
318
|
-
RIGHT
|
|
312
|
+
const LEFT = "left";
|
|
313
|
+
const RIGHT = "right";
|
|
314
|
+
const COLUMNS = {
|
|
315
|
+
LEFT,
|
|
316
|
+
RIGHT
|
|
319
317
|
};
|
|
320
|
-
|
|
318
|
+
const POPOVER_OFFSET_CONFIG = {
|
|
321
319
|
mainAxis: 8
|
|
322
320
|
};
|
|
323
|
-
|
|
321
|
+
const POPOVER_FLIP_CONFIG = {
|
|
324
322
|
crossAxis: true,
|
|
325
323
|
mainAxis: true
|
|
326
324
|
};
|
|
327
|
-
|
|
325
|
+
const POPOVER_SHIFT_CONFIG = {
|
|
328
326
|
crossAxis: true,
|
|
329
327
|
mainAxis: false,
|
|
330
328
|
limiter: limitShift()
|
|
331
|
-
};
|
|
329
|
+
};
|
|
330
|
+
export {
|
|
331
|
+
ABSOLUTE,
|
|
332
|
+
ABSOLUTE_PRESETS,
|
|
333
|
+
ALL_TIME,
|
|
334
|
+
COLUMNS,
|
|
335
|
+
CUSTOM_RANGE_KEY,
|
|
336
|
+
DAYS,
|
|
337
|
+
DURATION_MODIFIERS,
|
|
338
|
+
HOURS,
|
|
339
|
+
MINUTES,
|
|
340
|
+
MODES,
|
|
341
|
+
MONTHS,
|
|
342
|
+
POPOVER_FLIP_CONFIG,
|
|
343
|
+
POPOVER_OFFSET_CONFIG,
|
|
344
|
+
POPOVER_SHIFT_CONFIG,
|
|
345
|
+
RANGES_ICON,
|
|
346
|
+
RANGES_MODE,
|
|
347
|
+
RELATIVE,
|
|
348
|
+
RELATIVE_DURATION_MAX,
|
|
349
|
+
RELATIVE_OFFSET_MAX,
|
|
350
|
+
RELATIVE_PRESETS,
|
|
351
|
+
RELATIVE_SECTION_BUTTON_KEYS_ORDER,
|
|
352
|
+
RELATIVE_UNITS,
|
|
353
|
+
SECONDS,
|
|
354
|
+
TIME_OPTIONS,
|
|
355
|
+
WEEKS,
|
|
356
|
+
YEARS,
|
|
357
|
+
range
|
|
358
|
+
};
|
package/dist/date.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as endOf } from './dateUtils/endOf';
|
|
3
|
+
import { default as startOf } from './dateUtils/startOf';
|
|
4
4
|
export type RelativeUnits = 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS' | 'SINCE' | keyof typeof startOf | keyof typeof endOf;
|
|
5
5
|
export type RangeKey = 'TODAY' | 'YESTERDAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'LAST_7_DAYS' | 'NEXT_7_DAYS' | 'LAST_MONTH' | 'THIS_MONTH' | 'NEXT_MONTH' | 'LAST_3_MONTHS' | 'NEXT_3_MONTHS' | 'LAST_6_MONTHS' | 'NEXT_6_MONTHS' | 'LAST_YEAR' | 'NEXT_YEAR' | 'ALL_TIME';
|
|
6
6
|
export type NullableDateLimit = null | string | Date;
|
package/dist/date.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|