@synerise/ds-date-range-picker 1.3.15 → 1.3.16
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.styles.d.ts +1 -1
- package/dist/DateRangePicker.styles.d.ts +6 -6
- package/dist/DateRangePicker.types.d.ts +2 -1
- package/dist/Footer/Footer.js +2 -2
- package/dist/Footer/Footer.types.d.ts +0 -1
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.js +1 -0
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.styles.d.ts +1 -2
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.d.ts +2 -3
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.d.ts +0 -1
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.js +23 -5
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +22 -5
- package/dist/RangeFilter/RangeFilter.js +12 -4
- package/dist/RangeFilter/RangeFilter.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.styles.d.ts +1 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.js +1 -0
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.styles.d.ts +10 -11
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.styles.d.ts +1 -24
- package/dist/RangeFilter/Shared/SelectionHint/SelectionHint.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.styles.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.styles.d.ts +1 -2
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.d.ts +2 -2
- package/dist/RangeFilter/constants.d.ts +1 -1
- package/dist/RangeFilter/utils.js +3 -1
- package/dist/RangePicker/RangePicker.d.ts +2 -2
- package/dist/RangePicker/RangePicker.js +1 -1
- package/dist/RangePicker/RangePicker.styles.d.ts +1 -24
- package/dist/RangePickerInput/RangePickerInput.styles.d.ts +6 -6
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.types.d.ts +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.d.ts +2 -2
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.d.ts +3 -6
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.d.ts +9 -10
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +4 -2
- package/dist/dateUtils/format.js +1 -1
- package/dist/dateUtils/relativeToAbsolute.js +12 -4
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.3.15...@synerise/ds-date-range-picker@1.3.16) (2025-07-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.3.15](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.3.14...@synerise/ds-date-range-picker@1.3.15) (2025-07-17)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const AddonWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
expanded?: boolean
|
|
2
|
+
expanded?: boolean;
|
|
3
3
|
}, never>;
|
|
4
4
|
export declare const Title: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
5
5
|
export declare const AddonHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { type AdditionalMapper } from './DateRangePicker.types';
|
|
2
2
|
export declare const PopupWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
hasFilter?: boolean
|
|
4
|
-
hasRelativePicker?: boolean
|
|
5
|
-
alignContentToTop?: boolean
|
|
3
|
+
hasFilter?: boolean;
|
|
4
|
+
hasRelativePicker?: boolean;
|
|
5
|
+
alignContentToTop?: boolean;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
8
|
export declare const Separator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
9
|
export declare const Addon: import("styled-components").StyledComponent<"div", any, {
|
|
10
|
-
last?: boolean
|
|
10
|
+
last?: boolean;
|
|
11
11
|
}, never>;
|
|
12
12
|
export declare const PickerWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
13
|
-
arrowColor?: AdditionalMapper
|
|
13
|
+
arrowColor?: AdditionalMapper;
|
|
14
14
|
}, never>;
|
|
15
15
|
export declare const OverlayContainer: import("styled-components").StyledComponent<"div", any, {
|
|
16
|
-
visible?: boolean
|
|
16
|
+
visible?: boolean;
|
|
17
17
|
}, never>;
|
|
@@ -6,6 +6,7 @@ import { type Props as FooterProps } from './Footer/Footer.types';
|
|
|
6
6
|
import { type FilterDefinition } from './RangeFilter/RangeFilter.types';
|
|
7
7
|
import { type SavedFilter } from './RangeFilter/Shared/FilterDropdown/FilterDropdown.types';
|
|
8
8
|
import { type DateLimitMode, type RangeDisplayMode } from './RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types';
|
|
9
|
+
import { type RangeFilterType } from './RangeFilter/constants';
|
|
9
10
|
import { type RangePickerInputProps } from './RangePickerInput/RangePickerInput.types';
|
|
10
11
|
import { type DateFilter, type DateRange, type DateRangePreset, type RelativeUnits } from './date.types';
|
|
11
12
|
export type CustomColorArrow = 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
|
|
@@ -80,7 +81,7 @@ export type DateRangePickerProps = {
|
|
|
80
81
|
*/
|
|
81
82
|
readOnly?: RangePickerInputProps['readOnly'];
|
|
82
83
|
};
|
|
83
|
-
allowedFilterTypes?:
|
|
84
|
+
allowedFilterTypes?: RangeFilterType[];
|
|
84
85
|
renderPopoverTrigger?: (...args: any) => JSX.Element;
|
|
85
86
|
isTruncateMs?: boolean;
|
|
86
87
|
filterValueSelectionModes?: DateLimitMode[];
|
package/dist/Footer/Footer.js
CHANGED
|
@@ -43,10 +43,10 @@ var Footer = function Footer(_ref) {
|
|
|
43
43
|
}, [footerFormat, format, formatValue, locale, valueFormatOptions, showTime]);
|
|
44
44
|
var ChosenRange = useMemo(function () {
|
|
45
45
|
if ((value == null ? void 0 : value.key) === CONST.ALL_TIME || value && isLifetime(value)) {
|
|
46
|
-
var _texts
|
|
46
|
+
var _texts;
|
|
47
47
|
return /*#__PURE__*/React.createElement(S.ChosenRange, {
|
|
48
48
|
className: "ds-date-range-picker-value"
|
|
49
|
-
}, value != null && value.translationKey ? (_texts
|
|
49
|
+
}, value != null && value.translationKey ? (_texts = texts[value.translationKey]) != null ? _texts : value.translationKey : (value == null ? void 0 : value.key) || 'LIFETIME');
|
|
50
50
|
}
|
|
51
51
|
return /*#__PURE__*/React.createElement(S.ChosenRange, {
|
|
52
52
|
className: displayDateContainerClass
|
|
@@ -48,6 +48,7 @@ var MonthlyFilter = /*#__PURE__*/function (_PureComponent) {
|
|
|
48
48
|
var result = value.filter(function (item, key) {
|
|
49
49
|
return key !== index;
|
|
50
50
|
});
|
|
51
|
+
// @ts-expect-error requires types refactor
|
|
51
52
|
_this.handleRemoveRowCollapse(value[index].id);
|
|
52
53
|
_this.setData([].concat(result));
|
|
53
54
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type InlineSelectProps } from '@synerise/ds-inline-edit/dist/InlineSelect/InlineSelect.types';
|
|
3
2
|
export declare const MonthlyFilterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const ContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -8,5 +7,5 @@ export declare const DropdownHeader: import("styled-components").StyledComponent
|
|
|
8
7
|
export declare const DropdownDeleteBtn: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
8
|
export declare const AddContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
9
|
export declare const AddButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
-
export declare const Select: import("styled-components").StyledComponent<({ className, style, expanded, dropdownProps, dropdownOverlayStyle, inputStyle, size, disabled, autoFocus, hideIcon, error, input, placeholder, dataSource, initialValue, onValueChange, }: InlineSelectProps
|
|
10
|
+
export declare const Select: import("styled-components").StyledComponent<({ className, style, expanded, dropdownProps, dropdownOverlayStyle, inputStyle, size, disabled, autoFocus, hideIcon, error, input, placeholder, dataSource, initialValue, onValueChange, }: InlineSelectProps) => React.JSX.Element, any, InlineSelectProps, never>;
|
|
12
11
|
export declare const PeriodMode: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type IntlShape } from 'react-intl';
|
|
3
2
|
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
4
3
|
import { type WithTranslations } from '../../../DateRangePicker.types';
|
|
@@ -15,13 +14,13 @@ export type MonthlyFilterProps = {
|
|
|
15
14
|
daysOfPeriods?: MonthlySelectValue<DAYS_OF_PERIOD_ENUM>[];
|
|
16
15
|
countedFromPeriods?: MonthlySelectValue<COUNTED_FROM_ENUM>[];
|
|
17
16
|
timePickerProps?: Partial<TimePickerProps>;
|
|
18
|
-
rangeClipboard?: Partial<FilterDefinition
|
|
17
|
+
rangeClipboard?: Partial<FilterDefinition> | undefined;
|
|
19
18
|
valueSelectionModes?: DateLimitMode[];
|
|
20
19
|
rangeDisplayMode?: RangeDisplayMode;
|
|
21
20
|
} & WithDisabledProp & Partial<RangeActions> & Partial<WithTranslations>;
|
|
22
21
|
export type Month<T = DenormalizedFilter> = {
|
|
23
22
|
id: string | number;
|
|
24
|
-
period:
|
|
23
|
+
period: DAYS_OF_PERIOD_ENUM.DAY_OF_MONTH | DAYS_OF_PERIOD_ENUM.DAY_OF_WEEK;
|
|
25
24
|
periodType?: string;
|
|
26
25
|
definition: {
|
|
27
26
|
[day: number]: T;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type WeeklyFilterProps } from './WeeklyFilter.types';
|
|
3
2
|
declare const WeeklyFilter: ({ value, onChange, onRangeClear, onRangePaste, onRangeCopy, rangeClipboard, intl, valueSelectionModes, rangeDisplayMode, texts, }: WeeklyFilterProps) => JSX.Element;
|
|
4
3
|
export default WeeklyFilter;
|
|
@@ -107,7 +107,10 @@ var Monthly = function Monthly(_ref) {
|
|
|
107
107
|
useEffect(function () {
|
|
108
108
|
var entriesWithActiveDaysValue = activeDays.length ? Object.keys(value).filter(function (id) {
|
|
109
109
|
return activeDays.every(function (day) {
|
|
110
|
-
return
|
|
110
|
+
return (
|
|
111
|
+
// @ts-expect-error - requires type refactor
|
|
112
|
+
!!value[id][day] && haveActiveDaysCommonRange(value[id], activeDays)
|
|
113
|
+
);
|
|
111
114
|
});
|
|
112
115
|
}) : [];
|
|
113
116
|
removeEmptyEntries(value);
|
|
@@ -120,6 +123,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
120
123
|
inverted = dayValue[2];
|
|
121
124
|
if (dayKey instanceof Array) {
|
|
122
125
|
dayKey.forEach(function (day) {
|
|
126
|
+
// @ts-expect-error - requires type refactor
|
|
123
127
|
updatedSchedule[guid][day] = _extends({}, value[guid][day], {
|
|
124
128
|
restricted: true,
|
|
125
129
|
start: start ? dayjs(start).format(DEFAULT_TIME_FORMAT) : undefined,
|
|
@@ -128,6 +132,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
128
132
|
});
|
|
129
133
|
});
|
|
130
134
|
} else {
|
|
135
|
+
// @ts-expect-error - requires type refactor
|
|
131
136
|
updatedSchedule[guid][dayKey] = _extends({}, value[guid][dayKey], {
|
|
132
137
|
restricted: true,
|
|
133
138
|
start: start ? dayjs(start).format(DEFAULT_TIME_FORMAT) : undefined,
|
|
@@ -138,7 +143,9 @@ var Monthly = function Monthly(_ref) {
|
|
|
138
143
|
onChange(updatedSchedule);
|
|
139
144
|
}, [value, onChange]);
|
|
140
145
|
var _getDayValue = useCallback(function (dayKey, guid) {
|
|
146
|
+
// @ts-expect-error - requires type refactor
|
|
141
147
|
if (typeof dayKey === 'number' && value[guid] && !!value[guid][dayKey]) {
|
|
148
|
+
// @ts-expect-error - requires type refactor
|
|
142
149
|
return value[guid][dayKey];
|
|
143
150
|
}
|
|
144
151
|
return defaultDayValue;
|
|
@@ -146,6 +153,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
146
153
|
var handleModeChange = useCallback(function (selectedMode, dayKeys, guid) {
|
|
147
154
|
var updatedSchedule = value;
|
|
148
155
|
dayKeys.forEach(function (day) {
|
|
156
|
+
// @ts-expect-error - requires type refactor
|
|
149
157
|
updatedSchedule[guid][day] = _extends({}, value[guid][day], {
|
|
150
158
|
mode: selectedMode
|
|
151
159
|
});
|
|
@@ -155,6 +163,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
155
163
|
var handleRangeDelete = useCallback(function (guid, activeDaysArray) {
|
|
156
164
|
var updatedSchedule = value;
|
|
157
165
|
activeDaysArray.forEach(function (activeDay) {
|
|
166
|
+
// @ts-expect-error - requires type refactor
|
|
158
167
|
delete updatedSchedule[guid][activeDay];
|
|
159
168
|
});
|
|
160
169
|
onChange(_extends({}, updatedSchedule));
|
|
@@ -168,6 +177,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
168
177
|
}, [intl]);
|
|
169
178
|
var dayMonthFormatter = useCallback(function (dayKey) {
|
|
170
179
|
var locale = intl.locale.substring(0, 2);
|
|
180
|
+
// @ts-expect-error - requires type refactor
|
|
171
181
|
return MONTH_DAYS(locale)[dayKey];
|
|
172
182
|
}, [intl]);
|
|
173
183
|
var dayFormatter = useCallback(function (dayKey, _long2) {
|
|
@@ -188,6 +198,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
188
198
|
}));
|
|
189
199
|
}, [activeDays]);
|
|
190
200
|
var isDayRestricted = useCallback(function (dayKey) {
|
|
201
|
+
// @ts-expect-error - requires type refactor
|
|
191
202
|
return Object.keys(value).some(function (key) {
|
|
192
203
|
return !!value[key][dayKey];
|
|
193
204
|
});
|
|
@@ -195,6 +206,7 @@ var Monthly = function Monthly(_ref) {
|
|
|
195
206
|
var removeDaySelection = useCallback(function (dayKey) {
|
|
196
207
|
var updatedSchedule = value;
|
|
197
208
|
Object.keys(value).forEach(function (key) {
|
|
209
|
+
// @ts-expect-error - requires type refactor
|
|
198
210
|
delete updatedSchedule[key][dayKey];
|
|
199
211
|
});
|
|
200
212
|
excludeDayFromActive(dayKey);
|
|
@@ -254,11 +266,15 @@ var Monthly = function Monthly(_ref) {
|
|
|
254
266
|
var _extends2;
|
|
255
267
|
var updatedDay = {};
|
|
256
268
|
var guid = Object.keys(value).find(function (key) {
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
|
|
269
|
+
return (
|
|
270
|
+
// @ts-expect-error - requires type refactor
|
|
271
|
+
activeDays.every(function (day) {
|
|
272
|
+
return value[key][day] === undefined;
|
|
273
|
+
})
|
|
274
|
+
);
|
|
260
275
|
});
|
|
261
276
|
activeDays.forEach(function (day) {
|
|
277
|
+
// @ts-expect-error - requires type refactor
|
|
262
278
|
updatedDay[day] = defaultDayValue;
|
|
263
279
|
});
|
|
264
280
|
var restOfScheduleObject = guid ? value[guid] : EMPTY_OBJECT;
|
|
@@ -275,7 +291,9 @@ var Monthly = function Monthly(_ref) {
|
|
|
275
291
|
var isAnyDaySelected = activeDays.length > 0;
|
|
276
292
|
var shouldRenderAddButton = isAnyDaySelected && filteredSchedule.length < maxEntries && canAddRange && !disabled;
|
|
277
293
|
var getErrorTextsForFormRow = function getErrorTextsForFormRow(guid) {
|
|
278
|
-
return activeDays.length === 1 && errorTexts && errorTexts[guid] &&
|
|
294
|
+
return activeDays.length === 1 && errorTexts && errorTexts[guid] &&
|
|
295
|
+
// @ts-expect-error - requires type refactor
|
|
296
|
+
errorTexts[guid][activeDays[0]];
|
|
279
297
|
};
|
|
280
298
|
return /*#__PURE__*/React.createElement(S.NewFilterContainer, {
|
|
281
299
|
ref: ref
|
|
@@ -61,7 +61,10 @@ var Weekly = function Weekly(_ref) {
|
|
|
61
61
|
removeEmptyEntries(value);
|
|
62
62
|
var entriesWithActiveDaysValue = activeDays.length ? Object.keys(value).filter(function (id) {
|
|
63
63
|
return activeDays.every(function (day) {
|
|
64
|
-
return
|
|
64
|
+
return (
|
|
65
|
+
// @ts-expect-error - requires type refactor
|
|
66
|
+
!!value[id][day] && haveActiveDaysCommonRange(value[id], activeDays)
|
|
67
|
+
);
|
|
65
68
|
});
|
|
66
69
|
}) : [];
|
|
67
70
|
setFilteredSchedule(entriesWithActiveDaysValue);
|
|
@@ -74,6 +77,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
74
77
|
if (dayKey instanceof Array) {
|
|
75
78
|
dayKey.forEach(function (day) {
|
|
76
79
|
if (guid in updatedSchedule) {
|
|
80
|
+
// @ts-expect-error - requires type refactor
|
|
77
81
|
updatedSchedule[guid][day] = _extends({}, value[guid][day], {
|
|
78
82
|
restricted: true,
|
|
79
83
|
start: start ? dayjs(start).format(DEFAULT_TIME_FORMAT) : undefined,
|
|
@@ -83,6 +87,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
83
87
|
}
|
|
84
88
|
});
|
|
85
89
|
} else if (guid in updatedSchedule) {
|
|
90
|
+
// @ts-expect-error - requires type refactor
|
|
86
91
|
updatedSchedule[guid][dayKey] = _extends({}, value[guid][dayKey], {
|
|
87
92
|
restricted: true,
|
|
88
93
|
start: start ? dayjs(start).format(DEFAULT_TIME_FORMAT) : undefined,
|
|
@@ -93,7 +98,9 @@ var Weekly = function Weekly(_ref) {
|
|
|
93
98
|
onChange(updatedSchedule);
|
|
94
99
|
}, [value, onChange]);
|
|
95
100
|
var _getDayValue = useCallback(function (dayKey, guid) {
|
|
101
|
+
// @ts-expect-error - requires type refactor
|
|
96
102
|
if (typeof dayKey === 'number' && value[guid] && !!value[guid][dayKey]) {
|
|
103
|
+
// @ts-expect-error - requires type refactor
|
|
97
104
|
return value[guid][dayKey];
|
|
98
105
|
}
|
|
99
106
|
return defaultDayValue;
|
|
@@ -101,6 +108,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
101
108
|
var handleModeChange = useCallback(function (selectedMode, dayKeys, guid) {
|
|
102
109
|
var updatedSchedule = value;
|
|
103
110
|
dayKeys.forEach(function (day) {
|
|
111
|
+
// @ts-expect-error - requires type refactor
|
|
104
112
|
updatedSchedule[guid][day] = _extends({}, value[guid][day], {
|
|
105
113
|
mode: selectedMode
|
|
106
114
|
});
|
|
@@ -110,6 +118,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
110
118
|
var handleRangeDelete = useCallback(function (guid, activeDaysArray) {
|
|
111
119
|
var updatedSchedule = value;
|
|
112
120
|
activeDaysArray.forEach(function (activeDay) {
|
|
121
|
+
// @ts-expect-error - requires type refactor
|
|
113
122
|
delete updatedSchedule[guid][activeDay];
|
|
114
123
|
});
|
|
115
124
|
onChange(_extends({}, updatedSchedule));
|
|
@@ -131,6 +140,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
131
140
|
}));
|
|
132
141
|
}, [activeDays]);
|
|
133
142
|
var isDayRestricted = useCallback(function (dayKey) {
|
|
143
|
+
// @ts-expect-error - requires type refactor
|
|
134
144
|
return Object.keys(value).some(function (key) {
|
|
135
145
|
return !!value[key][dayKey];
|
|
136
146
|
});
|
|
@@ -138,6 +148,7 @@ var Weekly = function Weekly(_ref) {
|
|
|
138
148
|
var removeDaySelection = useCallback(function (dayKey) {
|
|
139
149
|
var updatedSchedule = value;
|
|
140
150
|
Object.keys(value).forEach(function (key) {
|
|
151
|
+
// @ts-expect-error - requires type refactor
|
|
141
152
|
delete updatedSchedule[key][dayKey];
|
|
142
153
|
});
|
|
143
154
|
excludeDayFromActive(dayKey);
|
|
@@ -197,11 +208,15 @@ var Weekly = function Weekly(_ref) {
|
|
|
197
208
|
var _extends2;
|
|
198
209
|
var updatedDay = {};
|
|
199
210
|
var guid = Object.keys(value).find(function (key) {
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
211
|
+
return (
|
|
212
|
+
// @ts-expect-error - requires type refactor
|
|
213
|
+
activeDays.every(function (day) {
|
|
214
|
+
return value[key][day] === undefined;
|
|
215
|
+
})
|
|
216
|
+
);
|
|
203
217
|
});
|
|
204
218
|
activeDays.forEach(function (day) {
|
|
219
|
+
// @ts-expect-error - requires type refactor
|
|
205
220
|
updatedDay[day] = defaultDayValue;
|
|
206
221
|
});
|
|
207
222
|
var restOfScheduleObject = guid ? value[guid] : EMPTY_OBJECT;
|
|
@@ -218,7 +233,9 @@ var Weekly = function Weekly(_ref) {
|
|
|
218
233
|
var isAnyDaySelected = activeDays.length > 0;
|
|
219
234
|
var shouldRenderAddButton = isAnyDaySelected && filteredSchedule.length < maxEntries && canAddRange && !disabled;
|
|
220
235
|
var getErrorTextsForFormRow = function getErrorTextsForFormRow(guid) {
|
|
221
|
-
return activeDays.length === 1 && errorTexts && errorTexts[guid] &&
|
|
236
|
+
return activeDays.length === 1 && errorTexts && errorTexts[guid] &&
|
|
237
|
+
// @ts-expect-error - requires type refactor
|
|
238
|
+
errorTexts[guid][activeDays[0]];
|
|
222
239
|
};
|
|
223
240
|
return /*#__PURE__*/React.createElement(S.NewFilterContainer, {
|
|
224
241
|
ref: ref
|
|
@@ -142,8 +142,12 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
142
142
|
})), /*#__PURE__*/React.createElement(S.MainComponentWrapper, null, Component && /*#__PURE__*/React.createElement(Component, {
|
|
143
143
|
intl: intl,
|
|
144
144
|
texts: allTexts,
|
|
145
|
-
rangeDisplayMode: rangeDisplayMode
|
|
146
|
-
|
|
145
|
+
rangeDisplayMode: rangeDisplayMode
|
|
146
|
+
// @ts-expect-error - requires type refactor
|
|
147
|
+
,
|
|
148
|
+
value: definition
|
|
149
|
+
// @ts-expect-error - requires type refactor
|
|
150
|
+
,
|
|
147
151
|
onChange: function onChange(def) {
|
|
148
152
|
var _updatedFilter;
|
|
149
153
|
var updatedFilter = (_updatedFilter = {}, _updatedFilter[activeType] = _extends({}, activeValue, {
|
|
@@ -151,8 +155,12 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
151
155
|
}), _updatedFilter);
|
|
152
156
|
_this6.setState(updatedFilter);
|
|
153
157
|
},
|
|
154
|
-
onRangeCopy: this.handleRangeCopy
|
|
155
|
-
|
|
158
|
+
onRangeCopy: this.handleRangeCopy
|
|
159
|
+
// @ts-expect-error - requires type refactor
|
|
160
|
+
,
|
|
161
|
+
rangeClipboard: rangeClipboard
|
|
162
|
+
// @ts-expect-error - requires type refactor
|
|
163
|
+
,
|
|
156
164
|
valueSelectionModes: valueSelectionModes
|
|
157
165
|
}))), !hideFooter && /*#__PURE__*/React.createElement(S.Footer, {
|
|
158
166
|
"data-testid": "range-filter-footer"
|
|
@@ -3,7 +3,7 @@ import { type IntlShape } from 'react-intl';
|
|
|
3
3
|
import { type DateRangePickerProps, type Texts } from '../DateRangePicker.types';
|
|
4
4
|
import { type SavedFilter } from './Shared/FilterDropdown/FilterDropdown.types';
|
|
5
5
|
import { type DateLimitMode, type RangeDisplayMode } from './Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types';
|
|
6
|
-
import { type COUNTED_FROM_ENUM, type DAYS_OF_PERIOD_ENUM } from './constants';
|
|
6
|
+
import { type COUNTED_FROM_ENUM, type DAYS_OF_PERIOD_ENUM, type RangeFilterType } from './constants';
|
|
7
7
|
export type FilterValue<T = FilterDefinition> = {
|
|
8
8
|
definition?: Partial<T>;
|
|
9
9
|
type: string;
|
|
@@ -18,7 +18,7 @@ export type RangeFilterProps = {
|
|
|
18
18
|
savedFilters?: SavedFilter[];
|
|
19
19
|
onFilterSave?: (filters: SavedFilter[]) => void;
|
|
20
20
|
texts?: Partial<Texts>;
|
|
21
|
-
allowedFilterTypes?:
|
|
21
|
+
allowedFilterTypes?: RangeFilterType[];
|
|
22
22
|
valueSelectionModes?: DateLimitMode[];
|
|
23
23
|
rangeDisplayMode?: RangeDisplayMode;
|
|
24
24
|
rangeUnits?: Pick<DateRangePickerProps, 'rangeUnits'>;
|
|
@@ -26,7 +26,7 @@ export type RangeFilterProps = {
|
|
|
26
26
|
export type RangeFilterState = {
|
|
27
27
|
previousFilter?: FilterValue;
|
|
28
28
|
[filterType: string]: FilterValue | Partial<FilterDefinition> | string | undefined;
|
|
29
|
-
activeType:
|
|
29
|
+
activeType: RangeFilterType;
|
|
30
30
|
rangeClipboard?: Partial<FilterDefinition>;
|
|
31
31
|
};
|
|
32
32
|
export type FilterDefinition = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const DropdownMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const DropdownMenuItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) =>
|
|
2
|
+
export declare const DropdownMenuItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => React.JSX.Element, any, {}, never>;
|
|
4
3
|
export declare const RemoveIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -35,6 +35,7 @@ var RangeFilterStatus = function RangeFilterStatus(_ref) {
|
|
|
35
35
|
}))),
|
|
36
36
|
item: {
|
|
37
37
|
id: 'filter-trigger',
|
|
38
|
+
// @ts-expect-error requires DRP types refactor
|
|
38
39
|
name: texts[filter.type.toLocaleLowerCase()] || intl.formatMessage({
|
|
39
40
|
id: "DS.DATE-RANGE-PICKER." + filter.type,
|
|
40
41
|
defaultMessage: 'Filter'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import Button from '@synerise/ds-button';
|
|
3
|
-
export declare const ContentItem: import("styled-components").StyledComponent<(({ onRemove, onUpdate, onDuplicate, draggable, dashed, item, greyBackground, changeOrderDisabled, texts, hideExpander, expanded, onExpand, headerSuffix, headerPrefix, contentWithoutPadding, onMoveTop, onMoveBottom, isFirst, isLast, size, dragHandleProps, isDragPlaceholder, isDragOverlay, ...rest }: import("@synerise/ds-manageable-list/dist/Item/ContentItem/ContentItem.types").ContentItemProps) =>
|
|
2
|
+
export declare const ContentItem: import("styled-components").StyledComponent<(({ onRemove, onUpdate, onDuplicate, draggable, dashed, item, greyBackground, changeOrderDisabled, texts, hideExpander, expanded, onExpand, headerSuffix, headerPrefix, contentWithoutPadding, onMoveTop, onMoveBottom, isFirst, isLast, size, dragHandleProps, isDragPlaceholder, isDragOverlay, ...rest }: import("@synerise/ds-manageable-list/dist/Item/ContentItem/ContentItem.types").ContentItemProps) => React.JSX.Element) & {
|
|
4
3
|
AdditionalSuffix: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
4
|
ContentWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
6
5
|
withoutPadding: boolean;
|
|
@@ -8,23 +7,23 @@ export declare const ContentItem: import("styled-components").StyledComponent<((
|
|
|
8
7
|
DraggerWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
9
8
|
disabled: boolean;
|
|
10
9
|
}, never>;
|
|
11
|
-
DropdownTrigger: import("styled-components").StyledComponent<typeof
|
|
10
|
+
DropdownTrigger: import("styled-components").StyledComponent<typeof import("@synerise/ds-button").default, any, {}, never>;
|
|
12
11
|
DropdownWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
-
FilterDropdownTrigger: import("styled-components").StyledComponent<typeof
|
|
12
|
+
FilterDropdownTrigger: import("styled-components").StyledComponent<typeof import("@synerise/ds-button").default, any, {}, never>;
|
|
14
13
|
IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
14
|
ItemContainer: import("styled-components").StyledComponent<"div", any, {
|
|
16
15
|
opened: boolean;
|
|
17
16
|
greyBackground: boolean | undefined;
|
|
18
|
-
size?: "default" | "large"
|
|
19
|
-
dashed?: boolean
|
|
20
|
-
isDisabled?: boolean
|
|
21
|
-
isDragOverlay?: boolean
|
|
22
|
-
isDragPlaceholder?: boolean
|
|
17
|
+
size?: "default" | "large";
|
|
18
|
+
dashed?: boolean;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
isDragOverlay?: boolean;
|
|
21
|
+
isDragPlaceholder?: boolean;
|
|
23
22
|
}, never>;
|
|
24
23
|
ItemHeader: import("styled-components").StyledComponent<"div", any, {
|
|
25
24
|
hasPrefix: boolean;
|
|
26
25
|
hasDescription: boolean;
|
|
27
|
-
size?: "default" | "large"
|
|
26
|
+
size?: "default" | "large";
|
|
28
27
|
}, never>;
|
|
29
28
|
ItemHeaderPrefix: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
29
|
ItemHeaderSuffix: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -34,5 +33,5 @@ export declare const ContentItem: import("styled-components").StyledComponent<((
|
|
|
34
33
|
export declare const BadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
35
34
|
export declare const Title: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
36
35
|
export declare const SuffixText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
37
|
-
export declare const CreatorButton: import("styled-components").StyledComponent<({ onClick, disabled, label, block, status, className, ...htmlAttributes }: import("@synerise/ds-button").CreatorProps) =>
|
|
36
|
+
export declare const CreatorButton: import("styled-components").StyledComponent<({ onClick, disabled, label, block, status, className, ...htmlAttributes }: import("@synerise/ds-button").CreatorProps) => React.JSX.Element, any, {}, never>;
|
|
38
37
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import Button from '@synerise/ds-button';
|
|
3
2
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const FormButton: import("styled-components").StyledComponent<typeof Button, any,
|
|
5
|
-
href: string;
|
|
6
|
-
target?: string | undefined;
|
|
7
|
-
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
8
|
-
} & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
9
|
-
htmlType?: "button" | "submit" | "reset" | undefined;
|
|
10
|
-
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
11
|
-
} & Omit<import("react").ButtonHTMLAttributes<any>, "type" | "onClick">>, "type" | "ghost"> & {
|
|
12
|
-
type?: import("@synerise/ds-utils").LiteralStringUnion<import("@synerise/ds-button/dist/Button.types").ButtonType> | undefined;
|
|
13
|
-
mode?: import("@synerise/ds-utils").LiteralStringUnion<"icon-label" | "single-icon" | "split" | "two-icons" | "label-icon"> | undefined;
|
|
14
|
-
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet"> | undefined;
|
|
15
|
-
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded"> | undefined;
|
|
16
|
-
justifyContent?: string | undefined;
|
|
17
|
-
loading?: boolean | {
|
|
18
|
-
delay?: number | undefined;
|
|
19
|
-
} | undefined;
|
|
20
|
-
onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
|
|
21
|
-
iconColor?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet"> | undefined;
|
|
22
|
-
error?: boolean | undefined;
|
|
23
|
-
readOnly?: boolean | undefined;
|
|
24
|
-
tagProps?: import("@synerise/ds-tag").TagProps | undefined;
|
|
25
|
-
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps | undefined;
|
|
26
|
-
}, never>;
|
|
3
|
+
export declare const FormButton: import("styled-components").StyledComponent<typeof Button, any, import("@synerise/ds-button/dist/Button.types").ButtonProps, never>;
|
|
@@ -3,5 +3,5 @@ export declare const Container: import("styled-components").StyledComponent<"div
|
|
|
3
3
|
export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
5
5
|
active: boolean;
|
|
6
|
-
readonly?: boolean
|
|
6
|
+
readonly?: boolean;
|
|
7
7
|
}, never>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const ActionsMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const ActionItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) =>
|
|
2
|
+
export declare const ActionItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => React.JSX.Element, any, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import { type DateLimitMode } from './RangeFormContainer/RangeForm/RangeForm.types';
|
|
3
3
|
import { type TimeWindowProps } from './TimeWindow.types';
|
|
4
4
|
export declare const DEFAULT_LIMIT_MODE: DateLimitMode;
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: FC<TimeWindowProps>;
|
|
6
6
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type MonthlySelectValue } from './RangeFilter.types';
|
|
3
2
|
export declare const TIME_FORMAT = "HH:mm:ss.SSS";
|
|
4
3
|
export declare const DEFAULT_RANGE_START = "00:00:00.000";
|
|
@@ -17,6 +16,7 @@ export declare const TYPES: {
|
|
|
17
16
|
WEEKLY: string;
|
|
18
17
|
MONTHLY: string;
|
|
19
18
|
};
|
|
19
|
+
export type RangeFilterType = keyof typeof TYPES;
|
|
20
20
|
export declare const DEFAULT_DAYS_OF_PERIODS: MonthlySelectValue<DAYS_OF_PERIOD_ENUM>[];
|
|
21
21
|
export declare const DEFAULT_COUNTED_FROM: MonthlySelectValue<COUNTED_FROM_ENUM>[];
|
|
22
22
|
export declare const defaultId: string;
|
|
@@ -203,7 +203,9 @@ export var validators = (_validators = {}, _validators[TYPES.DAILY] = function (
|
|
|
203
203
|
}, _validators[TYPES.WEEKLY] = function (values) {
|
|
204
204
|
return Boolean((values == null ? void 0 : values.definition) && !!Object.keys(values.definition).length);
|
|
205
205
|
}, _validators[TYPES.MONTHLY] = function (values) {
|
|
206
|
-
return Boolean((values == null ? void 0 : values.definition) && !!Object.keys(values.definition) &&
|
|
206
|
+
return Boolean((values == null ? void 0 : values.definition) && !!Object.keys(values.definition) &&
|
|
207
|
+
// @ts-expect-error requires type refactor
|
|
208
|
+
Object.keys(values.definition[0].definition).length > 0);
|
|
207
209
|
}, _validators);
|
|
208
210
|
export var denormalizeValue = function denormalizeValue(values) {
|
|
209
211
|
return {
|
|
@@ -137,7 +137,7 @@ var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
137
137
|
var _this2 = _this,
|
|
138
138
|
state = _this2.state;
|
|
139
139
|
var forceAdjacentMonths = _this.props.forceAdjacentMonths;
|
|
140
|
-
if (fnsIsSameMonth(month, state[opposite])) {
|
|
140
|
+
if (fnsIsSameMonth(month, legacyParse(state[opposite].month))) {
|
|
141
141
|
var dir = fnsIsAfter(month, legacyParse(state[side].month)) ? 1 : -1;
|
|
142
142
|
var adjacentMonth = ADD.MONTHS(month, dir);
|
|
143
143
|
_this.setState(function (prevState) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import Button from '@synerise/ds-button';
|
|
3
2
|
export declare const Sides: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const Side: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -6,26 +5,4 @@ export declare const Side: import("styled-components").StyledComponent<"div", an
|
|
|
6
5
|
}, never>;
|
|
7
6
|
export declare const PickerFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
7
|
export declare const FooterSeparator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
-
export declare const DateTimeModeSwitch: import("styled-components").StyledComponent<typeof Button, any,
|
|
10
|
-
href: string;
|
|
11
|
-
target?: string | undefined;
|
|
12
|
-
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
13
|
-
} & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
14
|
-
htmlType?: "button" | "submit" | "reset" | undefined;
|
|
15
|
-
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
16
|
-
} & Omit<import("react").ButtonHTMLAttributes<any>, "type" | "onClick">>, "type" | "ghost"> & {
|
|
17
|
-
type?: import("@synerise/ds-utils").LiteralStringUnion<import("@synerise/ds-button/dist/Button.types").ButtonType> | undefined;
|
|
18
|
-
mode?: import("@synerise/ds-utils").LiteralStringUnion<"icon-label" | "single-icon" | "split" | "two-icons" | "label-icon"> | undefined;
|
|
19
|
-
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet"> | undefined;
|
|
20
|
-
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded"> | undefined;
|
|
21
|
-
justifyContent?: string | undefined;
|
|
22
|
-
loading?: boolean | {
|
|
23
|
-
delay?: number | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
|
|
26
|
-
iconColor?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet"> | undefined;
|
|
27
|
-
error?: boolean | undefined;
|
|
28
|
-
readOnly?: boolean | undefined;
|
|
29
|
-
tagProps?: import("@synerise/ds-tag").TagProps | undefined;
|
|
30
|
-
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps | undefined;
|
|
31
|
-
}, never>;
|
|
8
|
+
export declare const DateTimeModeSwitch: import("styled-components").StyledComponent<typeof Button, any, import("@synerise/ds-button/dist/Button.types").ButtonProps, never>;
|
|
@@ -2,14 +2,14 @@ export declare const Container: import("styled-components").StyledComponent<"div
|
|
|
2
2
|
export declare const ClearIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const DefaultIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const RangeInputWrapper: import("styled-components").StyledComponent<"div", any, import("@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles").InputWrapperProps & {
|
|
5
|
-
error?: boolean
|
|
6
|
-
focus?: boolean
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
hover?: boolean
|
|
9
|
-
active?: boolean
|
|
5
|
+
error?: boolean;
|
|
6
|
+
focus?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
hover?: boolean;
|
|
9
|
+
active?: boolean;
|
|
10
10
|
}, never>;
|
|
11
11
|
export declare const DateWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
-
highlight?: boolean
|
|
12
|
+
highlight?: boolean;
|
|
13
13
|
}, never>;
|
|
14
14
|
export declare const DateValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
15
|
export declare const IconSeparator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,7 +3,7 @@ import { type DateRange, type RelativeDateRange, type RelativeUnits } from '../.
|
|
|
3
3
|
export type Props = {
|
|
4
4
|
ranges?: DateRange[];
|
|
5
5
|
currentRange: RelativeDateRange;
|
|
6
|
-
currentGroup:
|
|
6
|
+
currentGroup: RelativeMode | null;
|
|
7
7
|
handleChange: (value: DateRange) => void;
|
|
8
8
|
handleDurationValueChange: (value?: string | number | null) => void;
|
|
9
9
|
handleOffsetValueChange: (value?: string | number | null) => void;
|
|
@@ -3,7 +3,7 @@ import { type DateRange, type RelativeDateRange } from '../../../date.types';
|
|
|
3
3
|
export type Props = {
|
|
4
4
|
ranges?: DateRange[];
|
|
5
5
|
currentRange: RelativeDateRange;
|
|
6
|
-
currentGroup:
|
|
6
|
+
currentGroup: RelativeMode | null;
|
|
7
7
|
onModeChange: (mode: RelativeMode | null) => void;
|
|
8
8
|
modes: RelativeMode[];
|
|
9
9
|
texts: Texts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type WrappedComponentProps } from 'react-intl';
|
|
3
|
-
declare const _default: React.FC<import("react-intl").WithIntlProps<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps
|
|
4
|
-
WrappedComponent: React.ComponentType<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps
|
|
3
|
+
declare const _default: React.FC<import("react-intl").WithIntlProps<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps>> & {
|
|
4
|
+
WrappedComponent: React.ComponentType<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -6,10 +6,7 @@ export declare const Title: import("styled-components").StyledComponent<"div", a
|
|
|
6
6
|
export declare const Help: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
7
|
export declare const Ranges: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
8
|
export declare const CustomForm: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
-
export declare const InputSelectGroup: import("styled-components").StyledComponent<({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: InputGroupProps) => React.JSX.Element, any,
|
|
10
|
-
errors?: string[] | undefined;
|
|
11
|
-
resetMargin?: boolean | undefined;
|
|
12
|
-
} & Omit<import("@synerise/ds-form-field").FormFieldCommonProps, "errorText">, never>;
|
|
9
|
+
export declare const InputSelectGroup: import("styled-components").StyledComponent<({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: InputGroupProps) => React.JSX.Element, any, InputGroupProps, never>;
|
|
13
10
|
export declare const ModeDropdownTrigger: import("styled-components").StyledComponent<({ children, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
14
11
|
export declare const Range: import("styled-components").StyledComponent<({ children, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
15
12
|
export declare const RangeFormColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -19,7 +16,7 @@ export declare const DatePickerWrapper: import("styled-components").StyledCompon
|
|
|
19
16
|
export declare const DropMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
17
|
export declare const DropMenuItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => React.JSX.Element, any, {}, never>;
|
|
21
18
|
export declare const OverlayWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
22
|
-
visible?: boolean
|
|
23
|
-
width?: number
|
|
19
|
+
visible?: boolean;
|
|
20
|
+
width?: number;
|
|
24
21
|
}, never>;
|
|
25
22
|
export declare const DropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type DateRange } from '../../date.types';
|
|
3
2
|
export declare const findMatchingPreset: (range: DateRange) => {
|
|
4
|
-
type: "
|
|
3
|
+
type: "RELATIVE" | "SINCE";
|
|
5
4
|
offset: {
|
|
6
5
|
type: import("../../date.types").RelativeUnits;
|
|
7
6
|
value: number;
|
|
8
7
|
};
|
|
9
8
|
duration: import("../../date.types").Duration;
|
|
10
|
-
from?: import("../../date.types").NullableDateLimit
|
|
11
|
-
to?: import("../../date.types").NullableDateLimit
|
|
12
|
-
key: string;
|
|
13
|
-
future?: boolean
|
|
14
|
-
filter?: import("../../date.types").DateFilter
|
|
15
|
-
translationKey?: string
|
|
16
|
-
id?:
|
|
17
|
-
timestamp?: Date
|
|
9
|
+
from?: import("../../date.types").NullableDateLimit;
|
|
10
|
+
to?: import("../../date.types").NullableDateLimit;
|
|
11
|
+
key: import("../../date.types").RangeKey | string;
|
|
12
|
+
future?: boolean;
|
|
13
|
+
filter?: import("../../date.types").DateFilter;
|
|
14
|
+
translationKey?: string;
|
|
15
|
+
id?: React.ReactText;
|
|
16
|
+
timestamp?: Date;
|
|
18
17
|
} | undefined;
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/dateUtils/format.js
CHANGED
|
@@ -16,7 +16,7 @@ var format = function format(date, formatStr, locale) {
|
|
|
16
16
|
return '';
|
|
17
17
|
}
|
|
18
18
|
return fnsFormat(legacyParse(date), convertTokens(formatStr), {
|
|
19
|
-
locale: locales[locale.substring(0, 2)]
|
|
19
|
+
locale: locales[locale.substring(0, 2)] || locales[defaultLocale]
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
export default format;
|
|
@@ -12,11 +12,19 @@ var relativeToAbsolute = function relativeToAbsolute(range) {
|
|
|
12
12
|
var left;
|
|
13
13
|
var right;
|
|
14
14
|
if (future) {
|
|
15
|
-
left = legacyParse(
|
|
16
|
-
|
|
15
|
+
left = legacyParse(
|
|
16
|
+
// @ts-expect-error - requires type refactor
|
|
17
|
+
ADD[offset.type](START_OF[offset.type](now), offset.value));
|
|
18
|
+
right = legacyParse(
|
|
19
|
+
// @ts-expect-error - requires type refactor
|
|
20
|
+
ADD[duration.type](END_OF[duration.type](left), duration.value - 1));
|
|
17
21
|
} else {
|
|
18
|
-
right = legacyParse(
|
|
19
|
-
|
|
22
|
+
right = legacyParse(
|
|
23
|
+
// @ts-expect-error - requires type refactor
|
|
24
|
+
ADD[offset.type](END_OF[offset.type](now), -offset.value));
|
|
25
|
+
left = legacyParse(
|
|
26
|
+
// @ts-expect-error - requires type refactor
|
|
27
|
+
ADD[duration.type](START_OF[duration.type](right), 1 - duration.value));
|
|
20
28
|
}
|
|
21
29
|
var from = fnsMin([left, right]);
|
|
22
30
|
var to = fnsMax([left, right]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-date-range-picker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "Date-Range-Picker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@date-fns/upgrade": "^1.0.3",
|
|
38
|
-
"@synerise/ds-badge": "^1.0.
|
|
39
|
-
"@synerise/ds-button": "^1.4.
|
|
40
|
-
"@synerise/ds-button-group": "^1.1.
|
|
41
|
-
"@synerise/ds-data-format": "^1.0
|
|
42
|
-
"@synerise/ds-date-picker": "^1.2.
|
|
43
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
44
|
-
"@synerise/ds-form-field": "^1.1.
|
|
45
|
-
"@synerise/ds-icon": "^1.6.
|
|
46
|
-
"@synerise/ds-inline-edit": "^1.0.
|
|
47
|
-
"@synerise/ds-input": "^1.3.
|
|
48
|
-
"@synerise/ds-input-number": "^1.2.
|
|
49
|
-
"@synerise/ds-list-item": "^1.0.
|
|
50
|
-
"@synerise/ds-manageable-list": "^1.3.
|
|
51
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
52
|
-
"@synerise/ds-select": "^1.1.
|
|
53
|
-
"@synerise/ds-slider": "^1.0.
|
|
54
|
-
"@synerise/ds-tag": "^1.1.
|
|
55
|
-
"@synerise/ds-time-picker": "^1.1.
|
|
56
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
57
|
-
"@synerise/ds-utils": "^1.
|
|
38
|
+
"@synerise/ds-badge": "^1.0.17",
|
|
39
|
+
"@synerise/ds-button": "^1.4.6",
|
|
40
|
+
"@synerise/ds-button-group": "^1.1.10",
|
|
41
|
+
"@synerise/ds-data-format": "^1.1.0",
|
|
42
|
+
"@synerise/ds-date-picker": "^1.2.2",
|
|
43
|
+
"@synerise/ds-dropdown": "^1.0.19",
|
|
44
|
+
"@synerise/ds-form-field": "^1.1.12",
|
|
45
|
+
"@synerise/ds-icon": "^1.6.2",
|
|
46
|
+
"@synerise/ds-inline-edit": "^1.0.22",
|
|
47
|
+
"@synerise/ds-input": "^1.3.6",
|
|
48
|
+
"@synerise/ds-input-number": "^1.2.7",
|
|
49
|
+
"@synerise/ds-list-item": "^1.0.17",
|
|
50
|
+
"@synerise/ds-manageable-list": "^1.3.16",
|
|
51
|
+
"@synerise/ds-scrollbar": "^1.1.5",
|
|
52
|
+
"@synerise/ds-select": "^1.1.13",
|
|
53
|
+
"@synerise/ds-slider": "^1.0.19",
|
|
54
|
+
"@synerise/ds-tag": "^1.1.15",
|
|
55
|
+
"@synerise/ds-time-picker": "^1.1.14",
|
|
56
|
+
"@synerise/ds-tooltip": "^1.1.15",
|
|
57
|
+
"@synerise/ds-utils": "^1.4.0",
|
|
58
58
|
"date-fns": "^2.16.1",
|
|
59
59
|
"date-fns-tz": "1.1.4",
|
|
60
60
|
"dayjs": "^1.8.35",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
71
71
|
"styled-components": "^5.3.3"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "b35b1875727156fe9f5b3bad55aed5ca447c8c8d"
|
|
74
74
|
}
|