@synerise/ds-date-range-picker 0.19.13 → 0.20.0
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 +17 -0
- package/dist/DateRangePicker.js +2 -0
- package/dist/DateRangePicker.types.d.ts +5 -0
- package/dist/Footer/Footer.d.ts +1 -1
- package/dist/Footer/Footer.js +22 -4
- package/dist/Footer/Footer.types.d.ts +5 -0
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Filters.types.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +8 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.js +17 -10
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.d.ts +1 -5
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.js +10 -2
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.types.d.ts +3 -2
- package/dist/RangeFilter/Shared/TimeWindow/constants/timeWindow.constants.d.ts +2 -0
- package/dist/RangeFilter/Shared/TimeWindow/constants/timeWindow.constants.js +2 -0
- package/dist/RangePicker/RangePicker.d.ts +3 -22
- package/dist/RangePicker/RangePicker.js +15 -4
- package/dist/RangePicker/utils.d.ts +1 -1
- package/dist/RangePicker/utils.js +71 -6
- package/dist/RangePickerInput/RangePickerInput.js +22 -5
- package/dist/RangePickerInput/RangePickerInput.types.d.ts +5 -0
- package/dist/RawDateRangePicker.d.ts +1 -1
- package/dist/RawDateRangePicker.js +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
# [0.20.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@0.19.13...@synerise/ds-date-range-picker@0.20.0) (2023-03-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **data-format:** import types fix ([c3d20f2](https://github.com/Synerise/synerise-design/commit/c3d20f2bff43ce4605224c96b824a6f91662d961))
|
|
12
|
+
* **date-range-picker:** useMemo deps fix ([12f0904](https://github.com/Synerise/synerise-design/commit/12f0904351ba6862df469523260d8f99354c39df))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **data-format:** data format tools in pickers plus new tools ([c4adbfe](https://github.com/Synerise/synerise-design/commit/c4adbfe563af93f9daffc7e0b327098432c5e31e))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [0.19.13](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@0.19.12...@synerise/ds-date-range-picker@0.19.13) (2023-03-08)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
package/dist/DateRangePicker.js
CHANGED
|
@@ -24,6 +24,7 @@ var DateRangePicker = function DateRangePicker(props) {
|
|
|
24
24
|
forceAdjacentMonths = props.forceAdjacentMonths,
|
|
25
25
|
disableDefaultTexts = props.disableDefaultTexts,
|
|
26
26
|
arrowColor = props.arrowColor,
|
|
27
|
+
valueFormatOptions = props.valueFormatOptions,
|
|
27
28
|
_onVisibleChange = props.onVisibleChange,
|
|
28
29
|
_props$popoverProps = props.popoverProps,
|
|
29
30
|
popoverProps = _props$popoverProps === void 0 ? {} : _props$popoverProps,
|
|
@@ -84,6 +85,7 @@ var DateRangePicker = function DateRangePicker(props) {
|
|
|
84
85
|
value: selectedDate,
|
|
85
86
|
showTime: showTime,
|
|
86
87
|
texts: allTexts,
|
|
88
|
+
valueFormatOptions: valueFormatOptions,
|
|
87
89
|
onChange: onApplyCallback,
|
|
88
90
|
active: !!inputActive
|
|
89
91
|
}, rangePickerInputProps, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { PopoverProps } from 'antd/lib/popover';
|
|
4
|
+
import { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
4
5
|
import { DateFilter, DateRange, RelativeUnits } from './date.types';
|
|
5
6
|
import { FilterDefinition } from './RangeFilter/RangeFilter.types';
|
|
6
7
|
import { SavedFilter } from './RangeFilter/Shared/FilterDropdown/FilterDropdown.types';
|
|
@@ -26,7 +27,11 @@ export interface DateRangePickerProps extends WrappedComponentProps {
|
|
|
26
27
|
readOnly?: boolean;
|
|
27
28
|
disableDefaultTexts?: boolean;
|
|
28
29
|
disabledDate?: (date?: Date) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated use `valueFormatOptions` instead
|
|
32
|
+
*/
|
|
29
33
|
format?: string;
|
|
34
|
+
valueFormatOptions?: DateToFormatOptions;
|
|
30
35
|
forceAdjacentMonths?: boolean;
|
|
31
36
|
forceAbsolute?: boolean;
|
|
32
37
|
footerProps?: Partial<FooterProps>;
|
package/dist/Footer/Footer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Props } from './Footer.types';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "texts" | "format" | "mode" | "value" | "message" | "onApply" | "showTime" | "dateOnly" | "canSwitchMode" | "onSwitchMode" | "canApply" | "displayDateContainerClass"> & {
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "texts" | "format" | "mode" | "value" | "message" | "valueFormatOptions" | "onApply" | "showTime" | "dateOnly" | "canSwitchMode" | "onSwitchMode" | "canApply" | "displayDateContainerClass"> & {
|
|
4
4
|
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
5
5
|
} & React.RefAttributes<any>> & {
|
|
6
6
|
WrappedComponent: React.ComponentType<Props>;
|
package/dist/Footer/Footer.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
var _excluded = ["canApply", "onApply", "intl", "canSwitchMode", "onSwitchMode", "mode", "dateOnly", "message", "texts", "value", "format", "showTime", "displayDateContainerClass"];
|
|
1
|
+
var _excluded = ["canApply", "onApply", "intl", "canSwitchMode", "onSwitchMode", "mode", "dateOnly", "message", "texts", "value", "format", "valueFormatOptions", "showTime", "displayDateContainerClass"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
5
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
12
|
|
|
7
13
|
import * as React from 'react';
|
|
@@ -9,6 +15,7 @@ import { injectIntl } from 'react-intl';
|
|
|
9
15
|
import Button from '@synerise/ds-button';
|
|
10
16
|
import Tooltip from '@synerise/ds-tooltip';
|
|
11
17
|
import Icon, { ArrowRightS } from '@synerise/ds-icon';
|
|
18
|
+
import { getDefaultDataTimeOptions, useDataFormat } from '@synerise/ds-data-format';
|
|
12
19
|
import * as S from './Footer.styles';
|
|
13
20
|
import fnsFormat from '../dateUtils/format';
|
|
14
21
|
import getDateFromString from '../dateUtils/getDateFromString';
|
|
@@ -27,12 +34,23 @@ var Footer = function Footer(_ref) {
|
|
|
27
34
|
texts = _ref.texts,
|
|
28
35
|
value = _ref.value,
|
|
29
36
|
format = _ref.format,
|
|
37
|
+
valueFormatOptions = _ref.valueFormatOptions,
|
|
30
38
|
showTime = _ref.showTime,
|
|
31
39
|
_ref$displayDateConta = _ref.displayDateContainerClass,
|
|
32
40
|
displayDateContainerClass = _ref$displayDateConta === void 0 ? 'ds-date-range-picker-value' : _ref$displayDateConta,
|
|
33
41
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
42
|
|
|
43
|
+
var _useDataFormat = useDataFormat(),
|
|
44
|
+
formatValue = _useDataFormat.formatValue;
|
|
45
|
+
|
|
35
46
|
var footerFormat = format || (showTime ? 'MMM D, YYYY, HH:mm' : 'MMM D, YYYY');
|
|
47
|
+
var footerDateToString = React.useCallback(function (date) {
|
|
48
|
+
if (format || typeof date === 'string') {
|
|
49
|
+
return fnsFormat(getDateFromString(date), footerFormat, intl.locale);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return formatValue(date, _objectSpread({}, getDefaultDataTimeOptions(showTime), {}, valueFormatOptions));
|
|
53
|
+
}, [footerFormat, format, formatValue, intl.locale, valueFormatOptions, showTime]);
|
|
36
54
|
var ChosenRange = React.useMemo(function () {
|
|
37
55
|
if ((value == null ? void 0 : value.key) === CONST.ALL_TIME || value && isLifetime(value)) {
|
|
38
56
|
var _texts$value$translat;
|
|
@@ -44,10 +62,10 @@ var Footer = function Footer(_ref) {
|
|
|
44
62
|
|
|
45
63
|
return /*#__PURE__*/React.createElement(S.ChosenRange, {
|
|
46
64
|
className: displayDateContainerClass
|
|
47
|
-
}, !!value && !!value.from ?
|
|
65
|
+
}, !!value && !!value.from ? footerDateToString(value == null ? void 0 : value.from) : texts.startDatePlaceholder, /*#__PURE__*/React.createElement(S.InvisibleTextContent, null, ' – '), /*#__PURE__*/React.createElement(Icon, {
|
|
48
66
|
component: /*#__PURE__*/React.createElement(ArrowRightS, null)
|
|
49
|
-
}), !!value && !!value.to ?
|
|
50
|
-
}, [value,
|
|
67
|
+
}), !!value && !!value.to ? footerDateToString(value == null ? void 0 : value.to) : texts.endDatePlaceholder);
|
|
68
|
+
}, [value, texts, displayDateContainerClass, footerDateToString]);
|
|
51
69
|
return /*#__PURE__*/React.createElement(S.Container, _extends({
|
|
52
70
|
className: "ds-date-range-picker-footer"
|
|
53
71
|
}, rest), ChosenRange, /*#__PURE__*/React.createElement(S.ActionsPlaceholder, null), /*#__PURE__*/React.createElement(S.Actions, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
import { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
3
4
|
import { Texts } from 'DateRangePicker.types';
|
|
4
5
|
import { DateRange } from '../date.types';
|
|
5
6
|
export declare type Props = {
|
|
@@ -12,7 +13,11 @@ export declare type Props = {
|
|
|
12
13
|
onSwitchMode?: () => void;
|
|
13
14
|
message?: React.ReactNode | string;
|
|
14
15
|
texts: Texts;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated use `valueFormatOptions` instead
|
|
18
|
+
*/
|
|
15
19
|
format?: string;
|
|
20
|
+
valueFormatOptions?: DateToFormatOptions;
|
|
16
21
|
showTime?: boolean;
|
|
17
22
|
displayDateContainerClass?: string;
|
|
18
23
|
} & WrappedComponentProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IntlShape } from 'react-intl';
|
|
3
|
-
import { TimePickerProps } from '@synerise/ds-time-picker
|
|
3
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
4
4
|
import { RangeActions } from '../../Shared/TimeWindow/TimeWindow.types';
|
|
5
5
|
import { DenormalizedFilter, FilterDefinition, MonthlySelectValue, WithDisabledProp } from '../../RangeFilter.types';
|
|
6
6
|
import { WithTranslations } from '../../../DateRangePicker.types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimePickerProps } from '@synerise/ds-time-picker
|
|
1
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
2
2
|
import { DateLimitMode } from '../../Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types';
|
|
3
3
|
export declare type FilterBaseProps = {
|
|
4
4
|
maxEntries?: number;
|
|
@@ -8,6 +8,7 @@ import * as React from 'react';
|
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
9
|
import * as dayjs from 'dayjs';
|
|
10
10
|
import { v4 as uuid } from 'uuid';
|
|
11
|
+
import { useDataFormat } from '@synerise/ds-data-format';
|
|
11
12
|
import RangeFormContainer from '../../../Shared/TimeWindow/RangeFormContainer/RangeFormContainer';
|
|
12
13
|
import { SelectionCount, SelectionHint, AddButton } from '../../../Shared';
|
|
13
14
|
import Grid from '../../../Shared/TimeWindow/Grid/Grid';
|
|
@@ -16,6 +17,7 @@ import * as S from '../../../RangeFilter.styles';
|
|
|
16
17
|
import { useShiftAndControlKeys } from '../hooks/useShiftAndControlKeys';
|
|
17
18
|
import { canAddAnotherRange, haveActiveDaysCommonRange, range } from './utils';
|
|
18
19
|
import { DEFAULT_RANGE_START, DEFAULT_RANGE_END, DEFAULT_TIME_FORMAT, EMPTY_OBJECT, DEFAULT_MAX_ENTRIES, RENDER_EMPTY_NODE_FN, NOOP } from '../constants';
|
|
20
|
+
import { EU_NOTATION_WEEK_DAYS_INDEXES, US_NOTATION_WEEK_DAYS_INDEXES } from '../../../Shared/TimeWindow/constants/timeWindow.constants';
|
|
19
21
|
|
|
20
22
|
var Weekly = function Weekly(_ref) {
|
|
21
23
|
var _ref$maxEntries = _ref.maxEntries,
|
|
@@ -55,9 +57,13 @@ var Weekly = function Weekly(_ref) {
|
|
|
55
57
|
shiftKeyPressed = _useShiftAndControlKe[1];
|
|
56
58
|
|
|
57
59
|
var intl = useIntl();
|
|
60
|
+
|
|
61
|
+
var _useDataFormat = useDataFormat(),
|
|
62
|
+
isSundayFirstWeekDay = _useDataFormat.isSundayFirstWeekDay;
|
|
63
|
+
|
|
58
64
|
var allKeys = React.useMemo(function () {
|
|
59
|
-
return
|
|
60
|
-
}, []);
|
|
65
|
+
return isSundayFirstWeekDay ? US_NOTATION_WEEK_DAYS_INDEXES : EU_NOTATION_WEEK_DAYS_INDEXES;
|
|
66
|
+
}, [isSundayFirstWeekDay]);
|
|
61
67
|
React.useEffect(function () {
|
|
62
68
|
setFilteredSchedule(Object.keys(value));
|
|
63
69
|
}, [value]);
|
|
@@ -3,8 +3,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import Select from '@synerise/ds-select';
|
|
5
5
|
import Icon, { CloseS } from '@synerise/ds-icon';
|
|
6
|
-
import
|
|
6
|
+
import { useDataFormat } from '@synerise/ds-data-format';
|
|
7
7
|
import TimePicker from '@synerise/ds-time-picker';
|
|
8
|
+
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
8
9
|
import * as S from './RangeForm.styles';
|
|
9
10
|
import { getDisabledTimeOptions } from '../../../../../RangePicker/utils';
|
|
10
11
|
export var FORM_MODES = {
|
|
@@ -28,6 +29,9 @@ var RangeForm = function RangeForm(_ref) {
|
|
|
28
29
|
timePickerProps = _ref.timePickerProps,
|
|
29
30
|
texts = _ref.texts;
|
|
30
31
|
|
|
32
|
+
var _useDataFormat = useDataFormat(),
|
|
33
|
+
is12HoursClock = _useDataFormat.is12HoursClock;
|
|
34
|
+
|
|
31
35
|
var _React$useState = React.useState(startDate),
|
|
32
36
|
start = _React$useState[0],
|
|
33
37
|
setStart = _React$useState[1];
|
|
@@ -58,9 +62,10 @@ var RangeForm = function RangeForm(_ref) {
|
|
|
58
62
|
},
|
|
59
63
|
disabledHours: [],
|
|
60
64
|
disabledMinutes: [],
|
|
61
|
-
disabledSeconds: []
|
|
65
|
+
disabledSeconds: [],
|
|
66
|
+
use12HourClock: is12HoursClock
|
|
62
67
|
}, timePickerProps));
|
|
63
|
-
}, [start, onExactHourSelect, getPopupContainer, texts, timePickerProps, disabled]);
|
|
68
|
+
}, [start, onExactHourSelect, getPopupContainer, texts, timePickerProps, disabled, is12HoursClock]);
|
|
64
69
|
var renderRangePicker = React.useCallback(function () {
|
|
65
70
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TimePicker, _extends({
|
|
66
71
|
disabled: disabled,
|
|
@@ -73,9 +78,10 @@ var RangeForm = function RangeForm(_ref) {
|
|
|
73
78
|
dropdownProps: {
|
|
74
79
|
getPopupContainer: getPopupContainer
|
|
75
80
|
},
|
|
76
|
-
disabledHours: getDisabledTimeOptions(start || end, 'HOURS', null, end),
|
|
77
|
-
disabledMinutes: getDisabledTimeOptions(start || end, 'MINUTES', null, end),
|
|
78
|
-
disabledSeconds: getDisabledTimeOptions(start || end, 'SECONDS', null, end)
|
|
81
|
+
disabledHours: getDisabledTimeOptions(start || end, 'HOURS', null, end, is12HoursClock),
|
|
82
|
+
disabledMinutes: getDisabledTimeOptions(start || end, 'MINUTES', null, end, is12HoursClock),
|
|
83
|
+
disabledSeconds: getDisabledTimeOptions(start || end, 'SECONDS', null, end, is12HoursClock),
|
|
84
|
+
use12HourClock: is12HoursClock
|
|
79
85
|
}, timePickerProps)), /*#__PURE__*/React.createElement(S.Separator, null, "-"), /*#__PURE__*/React.createElement(TimePicker, _extends({
|
|
80
86
|
disabled: disabled,
|
|
81
87
|
clearTooltip: texts == null ? void 0 : texts.clear,
|
|
@@ -87,11 +93,12 @@ var RangeForm = function RangeForm(_ref) {
|
|
|
87
93
|
dropdownProps: {
|
|
88
94
|
getPopupContainer: getPopupContainer
|
|
89
95
|
},
|
|
90
|
-
disabledHours: getDisabledTimeOptions(end || start, 'HOURS', start, null),
|
|
91
|
-
disabledMinutes: getDisabledTimeOptions(end || start, 'MINUTES', start, null),
|
|
92
|
-
disabledSeconds: getDisabledTimeOptions(end || start, 'SECONDS', start, null)
|
|
96
|
+
disabledHours: getDisabledTimeOptions(end || start, 'HOURS', start, null, is12HoursClock),
|
|
97
|
+
disabledMinutes: getDisabledTimeOptions(end || start, 'MINUTES', start, null, is12HoursClock),
|
|
98
|
+
disabledSeconds: getDisabledTimeOptions(end || start, 'SECONDS', start, null, is12HoursClock),
|
|
99
|
+
use12HourClock: is12HoursClock
|
|
93
100
|
}, timePickerProps)));
|
|
94
|
-
}, [start, end, onStartChange, onEndChange, setStart, setEnd, getPopupContainer, texts, timePickerProps, disabled]);
|
|
101
|
+
}, [start, end, onStartChange, onEndChange, setStart, setEnd, getPopupContainer, texts, timePickerProps, disabled, is12HoursClock]);
|
|
95
102
|
var limitModeSelect = React.useMemo(function () {
|
|
96
103
|
return valueSelectionModes.length > 1 ? /*#__PURE__*/React.createElement(Select, {
|
|
97
104
|
value: mode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TimePickerProps } from '@synerise/ds-time-picker
|
|
2
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
3
3
|
import { DayKey, RangeActions, TimeWindowProps, TimeWindowTexts } from '../TimeWindow.types';
|
|
4
4
|
import { FilterDefinition, WithDisabledProp } from '../../../RangeFilter.types';
|
|
5
5
|
import { DateLimitMode } from './RangeForm/RangeForm.types';
|
|
@@ -2,9 +2,5 @@ import * as React from 'react';
|
|
|
2
2
|
import { TimeWindowProps } from './TimeWindow.types';
|
|
3
3
|
import { DateLimitMode } from './RangeFormContainer/RangeForm/RangeForm.types';
|
|
4
4
|
export declare const DEFAULT_LIMIT_MODE: DateLimitMode;
|
|
5
|
-
declare const _default: React.
|
|
6
|
-
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
7
|
-
} & React.RefAttributes<any>> & {
|
|
8
|
-
WrappedComponent: React.ComponentType<TimeWindowProps>;
|
|
9
|
-
};
|
|
5
|
+
declare const _default: React.FC<TimeWindowProps>;
|
|
10
6
|
export default _default;
|
|
@@ -20,6 +20,7 @@ import { FormattedMessage, injectIntl } from 'react-intl'; // eslint-disable-nex
|
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
|
|
22
22
|
import dayjs from 'dayjs';
|
|
23
|
+
import { withDataFormat } from '@synerise/ds-data-format';
|
|
23
24
|
import * as S from './TimeWindow.styles';
|
|
24
25
|
import { getDateFromDayValue } from './utils';
|
|
25
26
|
import Grid from './Grid/Grid';
|
|
@@ -29,6 +30,7 @@ import AddButton from '../AddButton/AddButton';
|
|
|
29
30
|
import RangeFormContainer from './RangeFormContainer/RangeFormContainer';
|
|
30
31
|
import Day from './Day/Day';
|
|
31
32
|
import SelectionHint from '../SelectionHint/SelectionHint';
|
|
33
|
+
import { EU_NOTATION_WEEK_DAYS_INDEXES, US_NOTATION_WEEK_DAYS_INDEXES } from './constants/timeWindow.constants';
|
|
32
34
|
export var DEFAULT_LIMIT_MODE = 'Range';
|
|
33
35
|
|
|
34
36
|
var TimeWindowBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -264,8 +266,14 @@ var TimeWindowBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
264
266
|
_defineProperty(_assertThisInitialized(_this), "getAllKeys", function () {
|
|
265
267
|
var _this$props7 = _this.props,
|
|
266
268
|
numberOfDays = _this$props7.numberOfDays,
|
|
267
|
-
customDays = _this$props7.customDays
|
|
269
|
+
customDays = _this$props7.customDays,
|
|
270
|
+
isSundayFirstWeekDay = _this$props7.isSundayFirstWeekDay;
|
|
268
271
|
var keys = range(numberOfDays);
|
|
272
|
+
|
|
273
|
+
if (JSON.stringify(keys) === JSON.stringify(EU_NOTATION_WEEK_DAYS_INDEXES) && isSundayFirstWeekDay) {
|
|
274
|
+
keys = US_NOTATION_WEEK_DAYS_INDEXES;
|
|
275
|
+
}
|
|
276
|
+
|
|
269
277
|
if (customDays) keys = [].concat(keys, Object.keys(customDays));
|
|
270
278
|
return keys;
|
|
271
279
|
});
|
|
@@ -523,4 +531,4 @@ _defineProperty(TimeWindowBase, "defaultProps", {
|
|
|
523
531
|
}
|
|
524
532
|
});
|
|
525
533
|
|
|
526
|
-
export default injectIntl(TimeWindowBase);
|
|
534
|
+
export default withDataFormat(injectIntl(TimeWindowBase));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TimePickerProps } from '@synerise/ds-time-picker/dist/TimePicker.types';
|
|
3
2
|
import { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
import type { TimePickerProps } from '@synerise/ds-time-picker';
|
|
4
|
+
import type { WithDataFormatProps } from '@synerise/ds-data-format';
|
|
4
5
|
import { DayProps } from './Day/Day.types';
|
|
5
6
|
import { FilterDefinition, WithDisabledProp } from '../../RangeFilter.types';
|
|
6
7
|
import { GridTexts } from './Grid/Grid.types';
|
|
@@ -57,7 +58,7 @@ export declare type TimeWindowProps = {
|
|
|
57
58
|
texts?: TimeWindowTexts & GridTexts;
|
|
58
59
|
renderRangeFormSuffix?: () => React.ReactNode;
|
|
59
60
|
timePickerProps?: Partial<TimePickerProps>;
|
|
60
|
-
} & Partial<RangeActions> & WithDisabledProp & WrappedComponentProps;
|
|
61
|
+
} & Partial<RangeActions> & WithDataFormatProps & WithDisabledProp & WrappedComponentProps;
|
|
61
62
|
export declare type State = {
|
|
62
63
|
activeDays: DayKey[];
|
|
63
64
|
controlKeyPressed: boolean;
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export default
|
|
5
|
-
constructor(props: Props);
|
|
6
|
-
getSnapshotBeforeUpdate(prevProps: Readonly<Props>): null;
|
|
7
|
-
componentDidUpdate: () => void;
|
|
8
|
-
handleDayMouseEnter: (day: Date) => void;
|
|
9
|
-
handleDayMouseLeave: () => void;
|
|
10
|
-
handleDayClick: (day: Date, modifiers: DayModifiers, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
handleFromTimeChange: (from: string | Date | undefined) => void;
|
|
12
|
-
handleToTimeChange: (to: string | Date | undefined) => void;
|
|
13
|
-
handleAddDay: (numberOfDays: number, side: string) => void;
|
|
14
|
-
handleSideMonthChange: (side: 'left' | 'right', month: Date, mode: string) => void;
|
|
15
|
-
handleSideModeChange: (side: string, mode: string) => void;
|
|
16
|
-
renderDay: (day: Date) => React.ReactNode;
|
|
17
|
-
renderYearPicker: (side: SideType) => React.ReactNode;
|
|
18
|
-
renderMonthPicker: (side: SideType) => React.ReactNode;
|
|
19
|
-
renderDatePicker: (side: SideType) => React.ReactNode;
|
|
20
|
-
renderTimePicker: (side: SideType) => React.ReactNode;
|
|
21
|
-
renderSide: (side: SideType) => React.ReactNode | null;
|
|
22
|
-
render(): JSX.Element;
|
|
23
|
-
}
|
|
2
|
+
import { RangePickerProps as Props } from './RangePicker.types';
|
|
3
|
+
declare const _default: React.FC<Props>;
|
|
4
|
+
export default _default;
|
|
@@ -12,6 +12,7 @@ import * as React from 'react';
|
|
|
12
12
|
import { DateUtils } from 'react-day-picker';
|
|
13
13
|
import fnsIsSameDay from 'date-fns/isSameDay';
|
|
14
14
|
import fnsIsValid from 'date-fns/isValid';
|
|
15
|
+
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
15
16
|
import MonthPicker from '@synerise/ds-date-picker/dist/Elements/MonthPicker/MonthPicker';
|
|
16
17
|
import TimePicker from '@synerise/ds-date-picker/dist/Elements/TimePicker/TimePicker';
|
|
17
18
|
import { DayBackground, DayForeground, DayText, DayTooltip } from '@synerise/ds-date-picker/dist/Elements/DayPicker/DayPicker.styles';
|
|
@@ -21,7 +22,7 @@ import Icon, { CalendarM, ClockM } from '@synerise/ds-icon';
|
|
|
21
22
|
import { fnsDifferenceInYears } from '@synerise/ds-date-picker/dist/fns';
|
|
22
23
|
import localeUtils from '@synerise/ds-date-picker/dist/localeUtils';
|
|
23
24
|
import fnsFormat from '@synerise/ds-date-picker/dist/format';
|
|
24
|
-
import {
|
|
25
|
+
import { getDefaultDataTimeOptions, withDataFormat } from '@synerise/ds-data-format';
|
|
25
26
|
import { Range } from '../RelativeRangePicker/RelativeRangePicker.styles';
|
|
26
27
|
import { fnsStartOfDay, fnsEndOfDay, fnsIsSameMonth, fnsIsAfter, fnsAddMinutes, fnsAddDays } from '../fns';
|
|
27
28
|
import * as S from './RangePicker.styles';
|
|
@@ -224,13 +225,23 @@ var RangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
224
225
|
var text = day.getDate();
|
|
225
226
|
var _this$props6 = _this.props,
|
|
226
227
|
value = _this$props6.value,
|
|
227
|
-
intl = _this$props6.intl
|
|
228
|
+
intl = _this$props6.intl,
|
|
229
|
+
formatValue = _this$props6.formatValue;
|
|
230
|
+
|
|
231
|
+
var formatDate = function formatDate(date) {
|
|
232
|
+
if (typeof date === 'string') {
|
|
233
|
+
return fnsFormat(legacyParse(date), TOOLTIP_FORMAT, intl.locale);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return formatValue(date, _objectSpread({}, getDefaultDataTimeOptions(true)));
|
|
237
|
+
};
|
|
238
|
+
|
|
228
239
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DayBackground, {
|
|
229
240
|
className: "DayPicker-Day-BG"
|
|
230
241
|
}), /*#__PURE__*/React.createElement(DayText, {
|
|
231
242
|
className: "DayPicker-Day-Text",
|
|
232
243
|
"data-attr": text
|
|
233
|
-
}, value.to && value.from && /*#__PURE__*/React.createElement(DayTooltip, null,
|
|
244
|
+
}, value.to && value.from && /*#__PURE__*/React.createElement(DayTooltip, null, formatDate(value.from), " - ", formatDate(value.to)), text), /*#__PURE__*/React.createElement(DayForeground, {
|
|
234
245
|
className: "DayPicker-Day-FG"
|
|
235
246
|
}));
|
|
236
247
|
});
|
|
@@ -490,4 +501,4 @@ var RangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
490
501
|
return RangePicker;
|
|
491
502
|
}(React.PureComponent);
|
|
492
503
|
|
|
493
|
-
export
|
|
504
|
+
export default withDataFormat(RangePicker);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Modifiers } from 'react-day-picker';
|
|
2
2
|
import { State } from './RangePicker.types';
|
|
3
3
|
import { DateRange, NullableDateLimit } from '../date.types';
|
|
4
|
-
export declare const getDisabledTimeOptions: (
|
|
4
|
+
export declare const getDisabledTimeOptions: (initialDay: string | Date | undefined, granularity: string, initialLowerLimit?: NullableDateLimit, initialUpperLimit?: NullableDateLimit, is12HoursClock?: boolean | undefined) => number[];
|
|
5
5
|
export declare const getSidesState: (value: DateRange, forceAdjacentMonths?: boolean | undefined) => State;
|
|
6
6
|
export declare const getModifiers: (from: NullableDateLimit | undefined, to: NullableDateLimit | undefined, enteredTo: NullableDateLimit | undefined) => Modifiers;
|
|
@@ -3,6 +3,8 @@ import { legacyParse } from '@date-fns/upgrade/v2';
|
|
|
3
3
|
import fnsMin from 'date-fns/min';
|
|
4
4
|
import fnsMax from 'date-fns/max';
|
|
5
5
|
import fnsIsValid from 'date-fns/isValid';
|
|
6
|
+
import * as dayjs from 'dayjs';
|
|
7
|
+
import { AM, PM, HOUR_12, MAP_24_HOUR_TO_12, HOUR } from '@synerise/ds-time-picker';
|
|
6
8
|
import { fnsEndOfDay, fnsIsSameMonth, fnsStartOfDay, fnsStartOfMonth } from '../fns';
|
|
7
9
|
import { TIME_OPTIONS } from '../constants';
|
|
8
10
|
import SET from '../dateUtils/set';
|
|
@@ -10,25 +12,78 @@ import GET from '../dateUtils/get';
|
|
|
10
12
|
import ADD from '../dateUtils/add';
|
|
11
13
|
import format from '../dateUtils/format';
|
|
12
14
|
var NOW = new Date();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var HOURS_GRANULARITY = 'HOURS';
|
|
16
|
+
|
|
17
|
+
var getAmOrPmFromDate = function getAmOrPmFromDate(date) {
|
|
18
|
+
return dayjs(date).get(HOUR) >= HOUR_12 ? PM : AM;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var change24To12Hour = function change24To12Hour(date) {
|
|
22
|
+
var dateBuilder = dayjs(date);
|
|
23
|
+
var hour = dateBuilder.get(HOUR);
|
|
24
|
+
var hourToMap = MAP_24_HOUR_TO_12[hour];
|
|
25
|
+
dateBuilder = dateBuilder.set(HOUR, hourToMap);
|
|
26
|
+
return dateBuilder.toDate();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export var getDisabledTimeOptions = function getDisabledTimeOptions(initialDay, granularity, initialLowerLimit, initialUpperLimit, is12HoursClock) {
|
|
30
|
+
if (initialLowerLimit === void 0) {
|
|
31
|
+
initialLowerLimit = null;
|
|
16
32
|
}
|
|
17
33
|
|
|
18
|
-
if (
|
|
19
|
-
|
|
34
|
+
if (initialUpperLimit === void 0) {
|
|
35
|
+
initialUpperLimit = null;
|
|
20
36
|
}
|
|
21
37
|
|
|
38
|
+
var day = initialDay;
|
|
39
|
+
var lowerLimit = initialLowerLimit;
|
|
40
|
+
var upperLimit = initialUpperLimit;
|
|
41
|
+
|
|
22
42
|
if (!day) {
|
|
23
43
|
return [];
|
|
24
44
|
}
|
|
25
45
|
|
|
46
|
+
var dayClockMode = getAmOrPmFromDate(legacyParse(day));
|
|
47
|
+
var lowerLimitClockMode = getAmOrPmFromDate(legacyParse(lowerLimit));
|
|
48
|
+
var upperLimitClockMode = getAmOrPmFromDate(legacyParse(upperLimit));
|
|
49
|
+
|
|
50
|
+
if (is12HoursClock && lowerLimit) {
|
|
51
|
+
if (lowerLimitClockMode === PM && dayjs(lowerLimit).get(HOUR) === HOUR_12) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (lowerLimitClockMode === AM && dayClockMode === PM) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (lowerLimitClockMode === PM && dayClockMode === PM) {
|
|
60
|
+
day = change24To12Hour(legacyParse(day));
|
|
61
|
+
lowerLimit = change24To12Hour(legacyParse(lowerLimit));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (is12HoursClock && upperLimit) {
|
|
66
|
+
if (upperLimitClockMode === PM && dayClockMode === PM) {
|
|
67
|
+
day = change24To12Hour(legacyParse(day));
|
|
68
|
+
upperLimit = change24To12Hour(legacyParse(upperLimit));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (is12HoursClock && granularity !== HOURS_GRANULARITY) {
|
|
73
|
+
var dayBuilder = dayjs(day);
|
|
74
|
+
var hour = dayBuilder.get(HOUR);
|
|
75
|
+
|
|
76
|
+
if (hour === HOUR_12) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
26
81
|
var lowLimit = lowerLimit || fnsStartOfDay(legacyParse(day));
|
|
27
82
|
var upLimit = upperLimit || fnsEndOfDay(legacyParse(day));
|
|
28
83
|
var options = TIME_OPTIONS[granularity].map(function (option) {
|
|
29
84
|
return SET[granularity](day, option);
|
|
30
85
|
});
|
|
31
|
-
|
|
86
|
+
var result = options.filter(function (opt) {
|
|
32
87
|
return !fnsIsWithinRange(legacyParse(opt), {
|
|
33
88
|
start: legacyParse(lowLimit),
|
|
34
89
|
end: legacyParse(upLimit)
|
|
@@ -36,6 +91,16 @@ export var getDisabledTimeOptions = function getDisabledTimeOptions(day, granula
|
|
|
36
91
|
}).map(function (option) {
|
|
37
92
|
return GET[granularity](option);
|
|
38
93
|
});
|
|
94
|
+
|
|
95
|
+
if (is12HoursClock) {
|
|
96
|
+
if (granularity === HOURS_GRANULARITY) {
|
|
97
|
+
result = result.filter(function (item) {
|
|
98
|
+
return item !== HOUR_12;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return result;
|
|
39
104
|
};
|
|
40
105
|
export var getSidesState = function getSidesState(value, forceAdjacentMonths) {
|
|
41
106
|
var from = fnsStartOfMonth(fnsIsValid(value.from) ? legacyParse(value.from) : new Date());
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
import * as React from 'react';
|
|
2
|
-
import Icon, { ArrowRightS, CalendarM, Close3S } from '@synerise/ds-icon';
|
|
3
8
|
import fnsIsValid from 'date-fns/isValid';
|
|
9
|
+
import Icon, { ArrowRightS, CalendarM, Close3S } from '@synerise/ds-icon';
|
|
4
10
|
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
5
|
-
import Tooltip from '@synerise/ds-tooltip';
|
|
11
|
+
import Tooltip from '@synerise/ds-tooltip';
|
|
12
|
+
import { getDefaultDataTimeOptions, useDataFormat } from '@synerise/ds-data-format'; // eslint-disable-next-line import/no-named-default
|
|
6
13
|
|
|
7
14
|
import { default as fnsFormat } from '../dateUtils/format';
|
|
8
15
|
import * as S from './RangePickerInput.styles';
|
|
@@ -12,6 +19,7 @@ import { isLifetime } from '../RelativeRangePicker/Elements/RangeDropdown/RangeD
|
|
|
12
19
|
var RangePickerInput = function RangePickerInput(_ref) {
|
|
13
20
|
var value = _ref.value,
|
|
14
21
|
format = _ref.format,
|
|
22
|
+
valueFormatOptions = _ref.valueFormatOptions,
|
|
15
23
|
showTime = _ref.showTime,
|
|
16
24
|
onChange = _ref.onChange,
|
|
17
25
|
onClick = _ref.onClick,
|
|
@@ -29,6 +37,10 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
29
37
|
errorText = _ref.errorText,
|
|
30
38
|
_ref$preferRelativeDe = _ref.preferRelativeDesc,
|
|
31
39
|
preferRelativeDesc = _ref$preferRelativeDe === void 0 ? false : _ref$preferRelativeDe;
|
|
40
|
+
|
|
41
|
+
var _useDataFormat = useDataFormat(),
|
|
42
|
+
formatValue = _useDataFormat.formatValue;
|
|
43
|
+
|
|
32
44
|
var dateRangeValue = value ? normalizeRange(value) : value;
|
|
33
45
|
|
|
34
46
|
var _React$useState = React.useState(false),
|
|
@@ -52,9 +64,14 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
52
64
|
var getText = React.useCallback(function (dateToDisplay) {
|
|
53
65
|
if (!dateToDisplay || !fnsIsValid(dateToDisplay)) return '';
|
|
54
66
|
var dateValue = dateToDisplay;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
|
|
68
|
+
if (typeof dateToDisplay === 'string') {
|
|
69
|
+
dateValue = new Date(dateToDisplay);
|
|
70
|
+
return fnsFormat(dateValue, format || showTime ? 'MMM D, YYYY, HH:mm' : 'MMM D, YYYY');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return formatValue(dateToDisplay, _objectSpread({}, getDefaultDataTimeOptions(showTime), {}, valueFormatOptions));
|
|
74
|
+
}, [format, showTime, formatValue, valueFormatOptions]);
|
|
58
75
|
var renderFromDate = React.useCallback(function () {
|
|
59
76
|
var isFromDateDefined = dateRangeValue && dateRangeValue.from;
|
|
60
77
|
var text = dateRangeValue && isFromDateDefined ? /*#__PURE__*/React.createElement(S.DateValue, null, getText(dateRangeValue.from)) : texts == null ? void 0 : texts.startDatePlaceholder;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
2
3
|
import { DateFilter, DateRange } from '../date.types';
|
|
3
4
|
import { Texts } from '../DateRangePicker.types';
|
|
4
5
|
export declare type RangePickerInputProps = {
|
|
5
6
|
size?: 'large' | 'default' | 'small';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use `valueFormatOptions` instead
|
|
9
|
+
*/
|
|
6
10
|
format?: string;
|
|
11
|
+
valueFormatOptions?: DateToFormatOptions;
|
|
7
12
|
showTime?: boolean;
|
|
8
13
|
allowClear?: boolean;
|
|
9
14
|
value?: Pick<DateRange, 'from'> & Pick<DateRange, 'to'>;
|
|
@@ -26,7 +26,7 @@ export declare class RawDateRangePicker extends React.PureComponent<DateRangePic
|
|
|
26
26
|
getAddons: () => AddonType[];
|
|
27
27
|
render(): JSX.Element;
|
|
28
28
|
}
|
|
29
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<DateRangePickerProps, "readOnly" | "texts" | "format" | "value" | "onVisibleChange" | "rangeUnits" | "containerClass" | "disableDefaultTexts" | "disabledDate" | "forceAdjacentMonths" | "forceAbsolute" | "footerProps" | "onValueChange" | "onApply" | "onFilterSave" | "popoverProps" | "popoverTrigger" | "ranges" | "relativeFuture" | "relativePast" | "relativeModes" | "savedFilters" | "showRelativePicker" | "showFilter" | "showTime" | "showCustomRange" | "validate" | "valueTransformer" | "arrowColor" | "disableAbsoluteTimepickerInRelative" | "rangePickerInputProps" | "renderPopoverTrigger"> & {
|
|
29
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<DateRangePickerProps, "readOnly" | "texts" | "format" | "value" | "onVisibleChange" | "rangeUnits" | "containerClass" | "disableDefaultTexts" | "disabledDate" | "valueFormatOptions" | "forceAdjacentMonths" | "forceAbsolute" | "footerProps" | "onValueChange" | "onApply" | "onFilterSave" | "popoverProps" | "popoverTrigger" | "ranges" | "relativeFuture" | "relativePast" | "relativeModes" | "savedFilters" | "showRelativePicker" | "showFilter" | "showTime" | "showCustomRange" | "validate" | "valueTransformer" | "arrowColor" | "disableAbsoluteTimepickerInRelative" | "rangePickerInputProps" | "renderPopoverTrigger"> & {
|
|
30
30
|
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
31
31
|
} & React.RefAttributes<any>> & {
|
|
32
32
|
WrappedComponent: React.ComponentType<DateRangePickerProps>;
|
|
@@ -291,6 +291,7 @@ export var RawDateRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
291
291
|
var _this$props4 = this.props,
|
|
292
292
|
showTime = _this$props4.showTime,
|
|
293
293
|
format = _this$props4.format,
|
|
294
|
+
valueFormatOptions = _this$props4.valueFormatOptions,
|
|
294
295
|
disabledDate = _this$props4.disabledDate,
|
|
295
296
|
validate = _this$props4.validate,
|
|
296
297
|
forceAdjacentMonths = _this$props4.forceAdjacentMonths,
|
|
@@ -374,7 +375,8 @@ export var RawDateRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
374
375
|
texts: texts,
|
|
375
376
|
value: value,
|
|
376
377
|
showTime: showTime,
|
|
377
|
-
format: format
|
|
378
|
+
format: format,
|
|
379
|
+
valueFormatOptions: valueFormatOptions
|
|
378
380
|
}, footerProps)));
|
|
379
381
|
};
|
|
380
382
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-date-range-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Date-Range-Picker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@date-fns/upgrade": "^1.0.3",
|
|
36
36
|
"@synerise/ds-button": "^0.17.12",
|
|
37
|
-
"@synerise/ds-date-picker": "^0.9.
|
|
37
|
+
"@synerise/ds-date-picker": "^0.9.1",
|
|
38
38
|
"@synerise/ds-icon": "^0.54.0",
|
|
39
|
-
"@synerise/ds-manageable-list": "^0.24.
|
|
40
|
-
"@synerise/ds-time-picker": "^0.
|
|
39
|
+
"@synerise/ds-manageable-list": "^0.24.9",
|
|
40
|
+
"@synerise/ds-time-picker": "^0.7.0",
|
|
41
41
|
"@synerise/ds-tooltip": "^0.13.0",
|
|
42
42
|
"@synerise/ds-utils": "^0.19.0",
|
|
43
43
|
"date-fns": "^2.16.1",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/ramda": "^0.27.14"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "41419f123b90134def2fecde455da13946fc2c0e"
|
|
58
58
|
}
|