@synerise/ds-date-range-picker 1.3.9 → 1.3.10
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 +979 -2654
- package/README.md +85 -86
- package/dist/AddonCollapse/AddonCollapse.d.ts +1 -1
- package/dist/AddonCollapse/AddonCollapse.types.d.ts +1 -1
- package/dist/DateRangePicker.d.ts +2 -2
- package/dist/DateRangePicker.js +8 -6
- package/dist/DateRangePicker.styles.d.ts +1 -1
- package/dist/DateRangePicker.types.d.ts +10 -11
- package/dist/DateRangePicker.types.js +1 -5
- package/dist/Footer/Footer.d.ts +1 -1
- package/dist/Footer/Footer.js +6 -6
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.d.ts +7 -7
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.js +2 -2
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.d.ts +1 -1
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.js +8 -10
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.styles.d.ts +1 -1
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.d.ts +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.js +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.types.d.ts +5 -5
- package/dist/RangeFilter/Filters/new/Daily/Daily.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Daily/Daily.js +6 -8
- package/dist/RangeFilter/Filters/new/Daily/Daily.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Filters.types.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.js +9 -9
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.types.d.ts +7 -7
- package/dist/RangeFilter/Filters/new/Monthly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +9 -9
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Weekly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/constants.js +0 -1
- package/dist/RangeFilter/Filters/new/hooks/useShiftAndControlKeys.js +1 -1
- package/dist/RangeFilter/RangeFilter.d.ts +1 -1
- package/dist/RangeFilter/RangeFilter.js +5 -5
- package/dist/RangeFilter/RangeFilter.types.d.ts +6 -6
- package/dist/RangeFilter/Shared/AddButton/AddButton.d.ts +1 -1
- package/dist/RangeFilter/Shared/AddButton/AddButton.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.d.ts +1 -1
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.js +3 -3
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.d.ts +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.js +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.styles.d.ts +5 -3
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.js +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.styles.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionHint/SelectionHint.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.js +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.js +16 -12
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.js +5 -9
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.js +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.styles.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.js +16 -12
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.utils.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.js +7 -5
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.types.d.ts +10 -6
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.js +27 -15
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.styles.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.types.d.ts +8 -8
- package/dist/RangeFilter/Shared/TimeWindow/utils.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/utils.js +1 -1
- package/dist/RangeFilter/constants.d.ts +1 -1
- package/dist/RangeFilter/constants.js +2 -2
- package/dist/RangeFilter/utils.d.ts +3 -3
- package/dist/RangeFilter/utils.js +44 -37
- package/dist/RangePicker/RangePicker.d.ts +1 -1
- package/dist/RangePicker/RangePicker.js +16 -14
- package/dist/RangePicker/RangePicker.styles.d.ts +1 -1
- package/dist/RangePicker/RangePicker.types.d.ts +3 -3
- package/dist/RangePicker/utils.d.ts +3 -3
- package/dist/RangePicker/utils.js +7 -7
- package/dist/RangePickerInput/RangePickerInput.d.ts +1 -1
- package/dist/RangePickerInput/RangePickerInput.js +4 -4
- package/dist/RangePickerInput/RangePickerInput.types.d.ts +2 -2
- package/dist/RawDateRangePicker.js +10 -10
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.js +4 -4
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.js +5 -5
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.js +3 -3
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.js +2 -2
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.js +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.js +8 -6
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.js +4 -4
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.js +5 -4
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.types.d.ts +2 -2
- package/dist/RelativeRangePicker/RelativeRangePicker.d.ts +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.js +14 -10
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.d.ts +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.js +8 -15
- package/dist/RelativeRangePicker/RelativeRangePicker.types.d.ts +3 -3
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.js +0 -1
- package/dist/RelativeRangePicker/utils/findRangeByKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/getCurrentGroupFromProps.utils.d.ts +3 -3
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/isAbsolute.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/setFuture.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.js +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/date.types.d.ts +2 -2
- package/dist/dateUtils/add.d.ts +7 -7
- package/dist/dateUtils/add.js +7 -7
- package/dist/dateUtils/difference.d.ts +7 -7
- package/dist/dateUtils/difference.js +7 -7
- package/dist/dateUtils/endOf.d.ts +7 -7
- package/dist/dateUtils/endOf.js +7 -7
- package/dist/dateUtils/format.js +2 -2
- package/dist/dateUtils/get.d.ts +3 -3
- package/dist/dateUtils/get.js +3 -3
- package/dist/dateUtils/getRelativePresetForRange.d.ts +1 -1
- package/dist/dateUtils/getRelativePresetForRange.js +1 -1
- package/dist/dateUtils/relativeToAbsolute.d.ts +1 -1
- package/dist/dateUtils/relativeToAbsolute.js +1 -1
- package/dist/dateUtils/set.d.ts +3 -3
- package/dist/dateUtils/set.js +3 -3
- package/dist/dateUtils/startOf.d.ts +7 -7
- package/dist/dateUtils/startOf.js +7 -7
- package/dist/dateUtils/sub.d.ts +7 -7
- package/dist/dateUtils/sub.js +7 -7
- package/dist/fns.d.ts +20 -20
- package/dist/fns.js +20 -20
- package/dist/index.d.ts +2 -2
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +6 -4
- package/package.json +22 -22
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
3
2
|
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
4
|
-
import {
|
|
5
|
-
import { FilterDefinition, WithDisabledProp } from '../../../RangeFilter.types';
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
4
|
+
import { type FilterDefinition, type WithDisabledProp } from '../../../RangeFilter.types';
|
|
5
|
+
import { type DayKey, type RangeActions, type TimeWindowProps, type TimeWindowTexts } from '../TimeWindow.types';
|
|
6
|
+
import { type DateLimitMode, type RangeDisplayMode } from './RangeForm/RangeForm.types';
|
|
7
|
+
export type DateValue = [
|
|
8
|
+
Date | undefined,
|
|
9
|
+
Date | undefined,
|
|
10
|
+
boolean | undefined
|
|
11
|
+
];
|
|
8
12
|
export type FilterErrorType = [ReactNode?, ReactNode?];
|
|
9
13
|
export type RangeFormContainerProps = {
|
|
10
14
|
errorTexts?: FilterErrorType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import * as S from './RangeSummary.styles';
|
|
3
2
|
import { SPACE_UNICODE } from '../../../constants';
|
|
3
|
+
import * as S from './RangeSummary.styles';
|
|
4
4
|
var RangeSummary = function RangeSummary(_ref) {
|
|
5
5
|
var dayKeys = _ref.dayKeys,
|
|
6
6
|
getDayLabel = _ref.getDayLabel,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Texts } from '../../../../DateRangePicker.types';
|
|
3
|
+
import { type DayKey } from '../TimeWindow.types';
|
|
4
4
|
export type RangeSummaryProps = {
|
|
5
5
|
texts: Pick<Texts, 'setTimeFor'>;
|
|
6
6
|
dayKeys: DayKey[];
|
|
7
|
-
getDayLabel: (dayKey: DayKey, long?: boolean) =>
|
|
7
|
+
getDayLabel: (dayKey: DayKey, long?: boolean) => ReactNode;
|
|
8
8
|
monthlyFilter?: boolean;
|
|
9
9
|
monthlyFilterPeriod?: string;
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type DateLimitMode } from './RangeFormContainer/RangeForm/RangeForm.types';
|
|
3
|
+
import { type TimeWindowProps } from './TimeWindow.types';
|
|
4
4
|
export declare const DEFAULT_LIMIT_MODE: DateLimitMode;
|
|
5
5
|
declare const _default: React.FC<TimeWindowProps>;
|
|
6
6
|
export default _default;
|
|
@@ -3,21 +3,21 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
5
5
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
6
|
-
import
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
7
|
import { range } from 'lodash';
|
|
8
|
+
import React, { PureComponent, createRef } from 'react';
|
|
8
9
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
9
|
-
import dayjs from 'dayjs';
|
|
10
10
|
import { withDataFormat } from '@synerise/ds-data-format';
|
|
11
|
-
import * as S from './TimeWindow.styles';
|
|
12
|
-
import { getDateFromDayValue } from './utils';
|
|
13
|
-
import Grid from './Grid/Grid';
|
|
14
|
-
import SelectionCount from '../SelectionCount/SelectionCount';
|
|
15
11
|
import { DEFAULT_RANGE_END, DEFAULT_RANGE_START, TIME_FORMAT } from '../../constants';
|
|
16
12
|
import AddButton from '../AddButton/AddButton';
|
|
17
|
-
import
|
|
18
|
-
import Day from './Day/Day';
|
|
13
|
+
import SelectionCount from '../SelectionCount/SelectionCount';
|
|
19
14
|
import SelectionHint from '../SelectionHint/SelectionHint';
|
|
15
|
+
import Day from './Day/Day';
|
|
16
|
+
import Grid from './Grid/Grid';
|
|
17
|
+
import RangeFormContainer from './RangeFormContainer/RangeFormContainer';
|
|
18
|
+
import * as S from './TimeWindow.styles';
|
|
20
19
|
import { EU_NOTATION_MONTH_DAYS_INDEXES, EU_NOTATION_WEEK_DAYS_INDEXES, US_NOTATION_MONTH_DAYS_INDEXES, US_NOTATION_WEEK_DAYS_INDEXES } from './constants/timeWindow.constants';
|
|
20
|
+
import { getDateFromDayValue } from './utils';
|
|
21
21
|
export var DEFAULT_LIMIT_MODE = 'Range';
|
|
22
22
|
var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
23
23
|
function TimeWindowBase() {
|
|
@@ -26,7 +26,6 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
26
26
|
args[_key] = arguments[_key];
|
|
27
27
|
}
|
|
28
28
|
_this = _PureComponent.call.apply(_PureComponent, [this].concat(args)) || this;
|
|
29
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
30
29
|
_this.state = {
|
|
31
30
|
activeDays: _this.props.daily ? [0] : [],
|
|
32
31
|
controlKeyPressed: false
|
|
@@ -38,7 +37,9 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
38
37
|
};
|
|
39
38
|
_this.checkActiveDay = function (dayKey) {
|
|
40
39
|
var isRangeDefined = _this.state.isRangeDefined;
|
|
41
|
-
if (!_this.isDayRestricted(dayKey) && isRangeDefined && !_this.haveActiveDaysCommonRange())
|
|
40
|
+
if (!_this.isDayRestricted(dayKey) && isRangeDefined && !_this.haveActiveDaysCommonRange()) {
|
|
41
|
+
_this.checkDay(dayKey);
|
|
42
|
+
}
|
|
42
43
|
var _this$state = _this.state,
|
|
43
44
|
activeDays = _this$state.activeDays,
|
|
44
45
|
controlKeyPressed = _this$state.controlKeyPressed,
|
|
@@ -176,7 +177,13 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
176
177
|
daily = _this$props5.daily,
|
|
177
178
|
valueSelectionModes = _this$props5.valueSelectionModes;
|
|
178
179
|
var dayValue = {};
|
|
179
|
-
if (daily)
|
|
180
|
+
if (daily) {
|
|
181
|
+
dayValue = days;
|
|
182
|
+
} else if (days[dayKey]) {
|
|
183
|
+
dayValue = days[dayKey];
|
|
184
|
+
} else if (typeof dayKey === 'number') {
|
|
185
|
+
dayValue = dayTemplate(dayKey);
|
|
186
|
+
} else if (customDays && (_customDays$dayKey = customDays[dayKey]) != null && _customDays$dayKey.template && ((_customDays$dayKey2 = customDays[dayKey]) == null ? void 0 : _customDays$dayKey2.template) !== null) {
|
|
180
187
|
dayValue = customDays[dayKey].template;
|
|
181
188
|
}
|
|
182
189
|
return _extends({
|
|
@@ -196,7 +203,9 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
196
203
|
if (typeof dayKey === 'string' && customDays && customDays[dayKey]) {
|
|
197
204
|
label = customDays[dayKey][_long ? 'longLabel' : 'label'] || customDays[dayKey].label;
|
|
198
205
|
}
|
|
199
|
-
if (!label)
|
|
206
|
+
if (!label) {
|
|
207
|
+
label = dayFormatter(dayKey, _long);
|
|
208
|
+
}
|
|
200
209
|
return label;
|
|
201
210
|
};
|
|
202
211
|
_this.handleRangePaste = function (dayKeys) {
|
|
@@ -236,7 +245,9 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
236
245
|
customDays = _this$props7.customDays;
|
|
237
246
|
var keys = range(numberOfDays);
|
|
238
247
|
keys = _this.replaceDaysIndexesForUSNotation(keys).slice();
|
|
239
|
-
if (customDays)
|
|
248
|
+
if (customDays) {
|
|
249
|
+
keys = [].concat(keys, Object.keys(customDays));
|
|
250
|
+
}
|
|
240
251
|
return keys;
|
|
241
252
|
};
|
|
242
253
|
_this.renderDay = function (dayKey) {
|
|
@@ -251,7 +262,9 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
251
262
|
var Component;
|
|
252
263
|
if (typeof dayKey === 'string' && customDays && customDays[dayKey]) {
|
|
253
264
|
var CustomComponent = customDays[dayKey].component;
|
|
254
|
-
if (CustomComponent)
|
|
265
|
+
if (CustomComponent) {
|
|
266
|
+
Component = CustomComponent;
|
|
267
|
+
}
|
|
255
268
|
}
|
|
256
269
|
if (!Component) {
|
|
257
270
|
Component = Day;
|
|
@@ -391,7 +404,6 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
391
404
|
var activeDays = this.state.activeDays;
|
|
392
405
|
var hasCommonRange = this.haveActiveDaysCommonRange();
|
|
393
406
|
if (prevState.isRangeDefined !== hasCommonRange && activeDays.length) {
|
|
394
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
395
407
|
this.setState(function (state) {
|
|
396
408
|
return _extends({}, state, {
|
|
397
409
|
isRangeDefined: hasCommonRange
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
4
3
|
import type { WithDataFormatProps } from '@synerise/ds-data-format';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
5
|
+
import { type Texts } from '../../../DateRangePicker.types';
|
|
6
|
+
import { type FilterDefinition, type WithDisabledProp } from '../../RangeFilter.types';
|
|
7
|
+
import { type DayProps } from './Day/Day.types';
|
|
8
|
+
import { type GridTexts } from './Grid/Grid.types';
|
|
9
|
+
import { type DateLimitMode, type RangeDisplayMode } from './RangeFormContainer/RangeForm/RangeForm.types';
|
|
10
10
|
export type DayKey = number | string;
|
|
11
11
|
export type DayOptions = {
|
|
12
12
|
display?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type FilterDefinition } from '../../RangeFilter.types';
|
|
2
|
+
import { type DateLimitMode } from './RangeFormContainer/RangeForm/RangeForm.types';
|
|
3
3
|
export declare const getDateFromDayValue: (dayValue?: string, hourTimeFormat?: string) => Date;
|
|
4
4
|
export declare const reverseRange: (inputRange: number[], groupItem: number) => number[];
|
|
5
5
|
export declare const getDefaultFilterForLimitMode: (mode: DateLimitMode) => Partial<FilterDefinition>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { flatten, groupBy, reverse, values } from 'lodash';
|
|
4
|
-
import {
|
|
4
|
+
import { DEFAULT_RANGE_END, DEFAULT_RANGE_START, DEFAULT_TIME_FORMAT } from '../../Filters/new/constants';
|
|
5
5
|
var TODAY = new Date();
|
|
6
6
|
export var getDateFromDayValue = function getDateFromDayValue(dayValue, hourTimeFormat) {
|
|
7
7
|
var DAY_FORMAT = "YYYY-MM-DD";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MonthlySelectValue } from './RangeFilter.types';
|
|
2
|
+
import { type MonthlySelectValue } from './RangeFilter.types';
|
|
3
3
|
export declare const TIME_FORMAT = "HH:mm:ss.SSS";
|
|
4
4
|
export declare const DEFAULT_RANGE_START = "00:00:00.000";
|
|
5
5
|
export declare const DEFAULT_RANGE_END = "23:59:59.999";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { range } from 'lodash';
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
|
3
|
+
import { fnsAddDays, fnsFormat } from '../fns';
|
|
4
|
+
import DailyFilter from './Filters/DailyFilter/DailyFilter';
|
|
3
5
|
import MonthlyFilter from './Filters/MonthlyFilter/MonthlyFilter';
|
|
4
6
|
import WeeklyFilter from './Filters/WeeklyFilter/WeeklyFilter';
|
|
5
|
-
import DailyFilter from './Filters/DailyFilter/DailyFilter';
|
|
6
|
-
import { fnsAddDays, fnsFormat } from '../fns';
|
|
7
7
|
var LONG_MONTH = new Date(0, 0, 1);
|
|
8
8
|
export var TIME_FORMAT = 'HH:mm:ss.SSS';
|
|
9
9
|
export var DEFAULT_RANGE_START = '00:00:00.000';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DenormalizedFilter, FilterDefinition, FilterValue, NormalizedFilter, NormalizedFilterBase, WeekFilter } from './RangeFilter.types';
|
|
2
|
-
import { SavedFilter } from './Shared/FilterDropdown/FilterDropdown.types';
|
|
1
|
+
import { type DenormalizedFilter, type FilterDefinition, type FilterValue, type NormalizedFilter, type NormalizedFilterBase, type WeekFilter } from './RangeFilter.types';
|
|
2
|
+
import { type SavedFilter } from './Shared/FilterDropdown/FilterDropdown.types';
|
|
3
3
|
export declare const mapTimeSchema: (item: DenormalizedFilter) => NormalizedFilter;
|
|
4
4
|
export declare const denormMapTimeSchema: (item: NormalizedFilter) => DenormalizedFilter;
|
|
5
|
-
export declare const normalizeValue: ({ type, definition }: FilterValue) => NormalizedFilterBase | {
|
|
5
|
+
export declare const normalizeValue: ({ type, definition, }: FilterValue) => NormalizedFilterBase | {
|
|
6
6
|
rules: any;
|
|
7
7
|
};
|
|
8
8
|
export declare const createWeeklyRange: (days: NormalizedFilter[]) => {};
|
|
@@ -7,6 +7,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
8
8
|
import { groupBy, omit, range } from 'lodash';
|
|
9
9
|
import { COUNTED_FROM_ENUM, DAYS_OF_PERIOD_ENUM, TYPES } from './constants';
|
|
10
|
+
|
|
10
11
|
/*
|
|
11
12
|
* Map field from components to datefilter schema
|
|
12
13
|
* start => from
|
|
@@ -43,8 +44,6 @@ export var denormMapTimeSchema = function denormMapTimeSchema(item) {
|
|
|
43
44
|
day: day === undefined || day !== undefined && Number.isNaN(+day) || Number.isNaN(+day) ? undefined : +day - 1
|
|
44
45
|
}, rest);
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
47
|
export var normalizeValue = function normalizeValue(_ref) {
|
|
49
48
|
var type = _ref.type,
|
|
50
49
|
definition = _ref.definition;
|
|
@@ -112,8 +111,10 @@ export var normalizeValue = function normalizeValue(_ref) {
|
|
|
112
111
|
break;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
|
-
// @ts-
|
|
116
|
-
result.days = days.map(
|
|
114
|
+
// @ts-expect-error days doesnt exist in type
|
|
115
|
+
result.days = days.map(
|
|
116
|
+
// @ts-expect-error types mismatch
|
|
117
|
+
function (_ref4) {
|
|
117
118
|
var restricted = _ref4.restricted,
|
|
118
119
|
display = _ref4.display,
|
|
119
120
|
rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
@@ -134,42 +135,48 @@ export var createWeeklyRange = function createWeeklyRange(days) {
|
|
|
134
135
|
}, {});
|
|
135
136
|
};
|
|
136
137
|
export var createMonthlyWeekDayRange = function createMonthlyWeekDayRange(rules) {
|
|
137
|
-
return
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
return (
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
140
|
+
range(0, 7 * 5 + 1).reduce(function (acc, i) {
|
|
141
|
+
var _extends3;
|
|
142
|
+
var weekStartIndex = Math.floor(i / 7);
|
|
143
|
+
var week = weekStartIndex;
|
|
144
|
+
var dayOfWeek = i - weekStartIndex * 7;
|
|
142
145
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
// @ts-expect-error: FIXME: Type 'undefined' is not assignable to type 'NormalizedFilter[]'.ts(2322)
|
|
147
|
+
var days = rules.weeks && rules.weeks.reduce(
|
|
148
|
+
// @ts-expect-error: FIXME: Type 'undefined' is not assignable to type 'NormalizedFilter[]'.ts(2322)
|
|
149
|
+
function (prev, item) {
|
|
150
|
+
return [].concat(prev, item.days.map(function (day) {
|
|
151
|
+
return _extends({}, denormMapTimeSchema(day), {
|
|
152
|
+
week: item.week - 1
|
|
153
|
+
});
|
|
154
|
+
}));
|
|
155
|
+
}, []);
|
|
156
|
+
var day = days.find(function (d) {
|
|
157
|
+
return d.week === week && d.day === dayOfWeek;
|
|
158
|
+
});
|
|
159
|
+
return day ? _extends({}, acc, (_extends3 = {}, _extends3[i] = _extends({}, day, {
|
|
160
|
+
restricted: true,
|
|
161
|
+
display: true
|
|
162
|
+
}), _extends3)) : acc;
|
|
163
|
+
}, {})
|
|
164
|
+
);
|
|
161
165
|
};
|
|
162
166
|
export var createMonthlyDayRange = function createMonthlyDayRange(rules) {
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
return (
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
169
|
+
range(0, 32).reduce(function (acc, i) {
|
|
170
|
+
var _extends4;
|
|
171
|
+
var day = rules.days && rules.days.find(function (d) {
|
|
172
|
+
return d.day === i;
|
|
173
|
+
});
|
|
174
|
+
return day ? _extends({}, acc, (_extends4 = {}, _extends4[i - 1] = _extends({}, denormMapTimeSchema(day), {
|
|
175
|
+
restricted: true,
|
|
176
|
+
display: true
|
|
177
|
+
}), _extends4)) : acc;
|
|
178
|
+
}, {})
|
|
179
|
+
);
|
|
173
180
|
};
|
|
174
181
|
export var denormalizers = (_denormalizers = {}, _denormalizers[TYPES.DAILY] = function (values) {
|
|
175
182
|
return denormMapTimeSchema(values);
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
3
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
|
-
import React, { PureComponent } from 'react';
|
|
5
|
-
import { DateUtils } from 'react-day-picker';
|
|
6
4
|
import fnsIsSameDay from 'date-fns/isSameDay';
|
|
7
5
|
import fnsIsValid from 'date-fns/isValid';
|
|
6
|
+
import React, { PureComponent } from 'react';
|
|
7
|
+
import { DateUtils } from 'react-day-picker';
|
|
8
8
|
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
9
|
+
import { getDefaultDataTimeOptions, withDataFormat } from '@synerise/ds-data-format';
|
|
10
|
+
import DayPicker from '@synerise/ds-date-picker/dist/Elements/DayPicker/DayPicker';
|
|
11
|
+
import { DayBackground, DayForeground, DayText, DayTooltip } from '@synerise/ds-date-picker/dist/Elements/DayPicker/DayPicker.styles';
|
|
9
12
|
import MonthPicker from '@synerise/ds-date-picker/dist/Elements/MonthPicker/MonthPicker';
|
|
10
13
|
import TimePicker from '@synerise/ds-date-picker/dist/Elements/TimePicker/TimePicker';
|
|
11
|
-
import { DayBackground, DayForeground, DayText, DayTooltip } from '@synerise/ds-date-picker/dist/Elements/DayPicker/DayPicker.styles';
|
|
12
14
|
import YearPicker from '@synerise/ds-date-picker/dist/Elements/YearPicker/YearPicker';
|
|
13
|
-
import DayPicker from '@synerise/ds-date-picker/dist/Elements/DayPicker/DayPicker';
|
|
14
|
-
import Icon, { CalendarM, ClockM } from '@synerise/ds-icon';
|
|
15
15
|
import { fnsDifferenceInYears } from '@synerise/ds-date-picker/dist/fns';
|
|
16
|
-
import localeUtils from '@synerise/ds-date-picker/dist/localeUtils';
|
|
17
16
|
import fnsFormat from '@synerise/ds-date-picker/dist/format';
|
|
18
|
-
import
|
|
17
|
+
import localeUtils from '@synerise/ds-date-picker/dist/localeUtils';
|
|
18
|
+
import Icon, { CalendarM, ClockM } from '@synerise/ds-icon';
|
|
19
19
|
import { Range } from '../RelativeRangePicker/RelativeRangePicker.styles';
|
|
20
|
-
import { fnsStartOfDay, fnsEndOfDay, fnsIsSameMonth, fnsIsAfter, fnsAddMinutes, fnsAddDays } from '../fns';
|
|
21
|
-
import * as S from './RangePicker.styles';
|
|
22
20
|
import { ABSOLUTE, COLUMNS, MODES } from '../constants';
|
|
23
21
|
import ADD from '../dateUtils/add';
|
|
24
22
|
import getDateFromString from '../dateUtils/getDateFromString';
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
import { fnsAddDays, fnsAddMinutes, fnsEndOfDay, fnsIsAfter, fnsIsSameMonth, fnsStartOfDay } from '../fns';
|
|
24
|
+
import * as S from './RangePicker.styles';
|
|
25
|
+
import { getDisabledTimeOptions, getModifiers, getSidesState } from './utils';
|
|
28
26
|
var NOOP = function NOOP() {};
|
|
29
27
|
var TOOLTIP_FORMAT = 'MMM d, yyyy, HH:mm';
|
|
30
28
|
function replaceRange(value, day) {
|
|
@@ -80,7 +78,9 @@ var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
80
78
|
var _this$props = _this.props,
|
|
81
79
|
value = _this$props.value,
|
|
82
80
|
onChange = _this$props.onChange;
|
|
83
|
-
if (modifiers.disabled)
|
|
81
|
+
if (modifiers.disabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
84
|
var _replaceRange = replaceRange(value, day),
|
|
85
85
|
from = _replaceRange.from,
|
|
86
86
|
to = _replaceRange.to;
|
|
@@ -338,7 +338,9 @@ var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
338
338
|
_this.renderSide = function (side) {
|
|
339
339
|
var mode = _this.props.mode;
|
|
340
340
|
var sideState = _this.state[side];
|
|
341
|
-
if (mode === MODES.TIME)
|
|
341
|
+
if (mode === MODES.TIME) {
|
|
342
|
+
return _this.renderTimePicker(side);
|
|
343
|
+
}
|
|
342
344
|
switch (sideState.mode) {
|
|
343
345
|
case 'date':
|
|
344
346
|
return _this.renderDatePicker(side);
|
|
@@ -15,7 +15,7 @@ export declare const DateTimeModeSwitch: import("styled-components").StyledCompo
|
|
|
15
15
|
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
16
16
|
} & Omit<import("react").ButtonHTMLAttributes<any>, "type" | "onClick">>, "type" | "ghost"> & {
|
|
17
17
|
type?: import("@synerise/ds-utils").LiteralStringUnion<import("@synerise/ds-button/dist/Button.types").ButtonType> | undefined;
|
|
18
|
-
mode?: import("@synerise/ds-utils").LiteralStringUnion<"
|
|
18
|
+
mode?: import("@synerise/ds-utils").LiteralStringUnion<"icon-label" | "single-icon" | "split" | "two-icons" | "label-icon"> | undefined;
|
|
19
19
|
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet"> | undefined;
|
|
20
20
|
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded"> | undefined;
|
|
21
21
|
justifyContent?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WrappedComponentProps } from 'react-intl';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
2
|
+
import { type Texts } from '../DateRangePicker.types';
|
|
3
|
+
import { type DateRange } from '../date.types';
|
|
4
4
|
export interface RangePickerProps extends WrappedComponentProps {
|
|
5
5
|
value: DateRange;
|
|
6
6
|
onChange: (value: DateRange) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Modifiers } from 'react-day-picker';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type Modifiers } from 'react-day-picker';
|
|
2
|
+
import { type DateRange, type NullableDateLimit } from '../date.types';
|
|
3
|
+
import { type State } from './RangePicker.types';
|
|
4
4
|
export declare const getDisabledTimeOptions: (initialDay: string | Date | undefined, granularity: string, initialLowerLimit?: NullableDateLimit, initialUpperLimit?: NullableDateLimit, is12HoursClock?: boolean) => number[];
|
|
5
5
|
export declare const getSidesState: (value: DateRange, forceAdjacentMonths?: boolean) => State;
|
|
6
6
|
export declare const getModifiers: (from: NullableDateLimit | undefined, to: NullableDateLimit | undefined, enteredTo: NullableDateLimit | undefined) => Modifiers;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import fnsIsValid from 'date-fns/isValid';
|
|
1
2
|
import fnsIsWithinRange from 'date-fns/isWithinInterval';
|
|
2
|
-
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
3
|
-
import fnsMin from 'date-fns/min';
|
|
4
3
|
import fnsMax from 'date-fns/max';
|
|
5
|
-
import
|
|
4
|
+
import fnsMin from 'date-fns/min';
|
|
6
5
|
import dayjs from 'dayjs';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
7
|
+
import { AM, DISABLE_CLOCK_MODE_HOUR, HOUR, HOUR_12, MAP_24_HOUR_TO_12, PM } from '@synerise/ds-time-picker';
|
|
9
8
|
import { TIME_OPTIONS } from '../constants';
|
|
10
|
-
import SET from '../dateUtils/set';
|
|
11
|
-
import GET from '../dateUtils/get';
|
|
12
9
|
import ADD from '../dateUtils/add';
|
|
13
10
|
import format from '../dateUtils/format';
|
|
11
|
+
import GET from '../dateUtils/get';
|
|
12
|
+
import SET from '../dateUtils/set';
|
|
13
|
+
import { fnsEndOfDay, fnsIsBefore, fnsIsSameMonth, fnsStartOfDay, fnsStartOfMonth } from '../fns';
|
|
14
14
|
var NOW = new Date();
|
|
15
15
|
var HOURS_GRANULARITY = 'HOURS';
|
|
16
16
|
var getAmOrPmFromDate = function getAmOrPmFromDate(date) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RangePickerInputProps } from './RangePickerInput.types';
|
|
2
|
+
import { type RangePickerInputProps } from './RangePickerInput.types';
|
|
3
3
|
declare const RangePickerInput: ({ value, valueFormatOptions, showTime, onChange, onClick, highlight, texts, active, label, description, tooltip, tooltipConfig, disabled, readOnly, onFocus, allowClear, onBlur, error, errorText, preferRelativeDesc, }: RangePickerInputProps) => React.JSX.Element;
|
|
4
4
|
export default RangePickerInput;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import Icon, { ArrowRightS, CalendarM, Close3S } from '@synerise/ds-icon';
|
|
4
3
|
import { useTheme } from '@synerise/ds-core';
|
|
5
|
-
import Tooltip from '@synerise/ds-tooltip';
|
|
6
4
|
import { getDefaultDataTimeOptions, useDataFormat } from '@synerise/ds-data-format';
|
|
7
5
|
import FormField from '@synerise/ds-form-field';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import Icon, { ArrowRightS, CalendarM, Close3S } from '@synerise/ds-icon';
|
|
7
|
+
import Tooltip from '@synerise/ds-tooltip';
|
|
10
8
|
import { isLifetime } from '../RelativeRangePicker/Elements/RangeDropdown/RangeDropdown';
|
|
9
|
+
import { normalizeRange } from '../utils';
|
|
10
|
+
import * as S from './RangePickerInput.styles';
|
|
11
11
|
var RangePickerInput = function RangePickerInput(_ref) {
|
|
12
12
|
var value = _ref.value,
|
|
13
13
|
valueFormatOptions = _ref.valueFormatOptions,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CSSProperties, MouseEvent as ReactMouseEvent,
|
|
1
|
+
import type { CSSProperties, FocusEventHandler, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
2
|
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
3
3
|
import type { FormFieldCommonProps } from '@synerise/ds-form-field';
|
|
4
|
-
import type { DateFilter, DateRange } from '../date.types';
|
|
5
4
|
import type { Texts } from '../DateRangePicker.types';
|
|
5
|
+
import type { DateFilter, DateRange } from '../date.types';
|
|
6
6
|
export type RangePickerInputProps = {
|
|
7
7
|
size?: 'large' | 'default' | 'small';
|
|
8
8
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useState, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
-
import { omitBy, isUndefined } from 'lodash';
|
|
4
|
-
import { useIntl } from 'react-intl';
|
|
5
2
|
import fnsIsValid from 'date-fns/isValid';
|
|
6
3
|
import fnsStartOfSecond from 'date-fns/startOfSecond';
|
|
4
|
+
import { isUndefined, omitBy } from 'lodash';
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
7
|
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
8
|
-
import { Container, Separator, Addon, PopupWrapper } from './DateRangePicker.styles';
|
|
9
|
-
import RangePicker from './RangePicker/RangePicker';
|
|
10
|
-
import { RELATIVE, ABSOLUTE, MODES, RELATIVE_PRESETS, ABSOLUTE_PRESETS } from './constants';
|
|
11
|
-
import * as CONST from './constants';
|
|
12
|
-
import relativeToAbsolute from './dateUtils/relativeToAbsolute';
|
|
13
8
|
import AddonCollapse from './AddonCollapse/AddonCollapse';
|
|
14
|
-
import
|
|
9
|
+
import { Addon, Container, PopupWrapper, Separator } from './DateRangePicker.styles';
|
|
15
10
|
import Footer from './Footer/Footer';
|
|
16
|
-
import { getDefaultTexts, normalizeRange, toIsoString } from './utils';
|
|
17
11
|
import RangeFilter from './RangeFilter/RangeFilter';
|
|
18
12
|
import RangeFilterStatus from './RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus';
|
|
13
|
+
import RangePicker from './RangePicker/RangePicker';
|
|
19
14
|
import { isLifetime } from './RelativeRangePicker/Elements/RangeDropdown/RangeDropdown';
|
|
15
|
+
import RelativeRangePicker from './RelativeRangePicker/RelativeRangePicker';
|
|
16
|
+
import { ABSOLUTE, ABSOLUTE_PRESETS, MODES, RELATIVE, RELATIVE_PRESETS } from './constants';
|
|
17
|
+
import * as CONST from './constants';
|
|
18
|
+
import relativeToAbsolute from './dateUtils/relativeToAbsolute';
|
|
19
|
+
import { getDefaultTexts, normalizeRange, toIsoString } from './utils';
|
|
20
20
|
var isRelative = function isRelative(dateRange) {
|
|
21
21
|
var isLegacyCustom = Object.keys(dateRange).includes('key') && dateRange.key === undefined;
|
|
22
22
|
return dateRange.key && (CONST.RELATIVE_PRESETS.map(function (preset) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Props } from './CustomRangeForm.types';
|
|
2
|
+
import { type Props } from './CustomRangeForm.types';
|
|
3
3
|
export declare const setOffsetType: (a: any, obj: any) => any;
|
|
4
4
|
declare const CustomRangeForm: ({ ranges, rangeUnits, currentRange, currentGroup, handleDurationValueChange, handleOffsetValueChange, handleModeChange, handleChange, texts, handleTimestampChange, timestamp, relativeModes, }: Props) => React.JSX.Element;
|
|
5
5
|
export default CustomRangeForm;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import set from 'ramda/src/set';
|
|
3
1
|
import lensPath from 'ramda/src/lensPath';
|
|
2
|
+
import set from 'ramda/src/set';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { RANGES_MODE } from '../../../constants';
|
|
4
5
|
import * as S from '../../RelativeRangePicker.styles';
|
|
5
6
|
import ModeDropdown from '../ModeDropdown/ModeDropdown';
|
|
7
|
+
import TimestampRange from '../TimestampRange/TimestampRange';
|
|
6
8
|
import DurationField from './DurationField/DurationField';
|
|
7
9
|
import OffsetField from './OffsetField/OffsetField';
|
|
8
|
-
import { RANGES_MODE } from '../../../constants';
|
|
9
|
-
import TimestampRange from '../TimestampRange/TimestampRange';
|
|
10
10
|
export var setOffsetType = set(lensPath(['offset', 'type']));
|
|
11
11
|
var CustomRangeForm = function CustomRangeForm(_ref) {
|
|
12
12
|
var ranges = _ref.ranges,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RelativeMode, Texts
|
|
2
|
-
import { DateRange, RelativeDateRange, RelativeUnits } from '../../../date.types';
|
|
1
|
+
import { type DateRangePickerProps, type RelativeMode, type Texts } from '../../../DateRangePicker.types';
|
|
2
|
+
import { type DateRange, type RelativeDateRange, type RelativeUnits } from '../../../date.types';
|
|
3
3
|
export type Props = {
|
|
4
4
|
ranges?: DateRange[];
|
|
5
5
|
currentRange: RelativeDateRange;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Props } from './DurationField.types';
|
|
2
|
+
import { type Props } from './DurationField.types';
|
|
3
3
|
export declare const setDurationType: (a: any, obj: any) => any;
|
|
4
4
|
declare const DurationField: ({ currentGroup, currentRange, handleChange, handleDurationValueChange, rangeUnits, texts, }: Props) => React.JSX.Element;
|
|
5
5
|
export default DurationField;
|