@synerise/ds-date-range-picker 1.1.4 → 1.2.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 +24 -0
- package/dist/DateRangePicker.js +1 -1
- package/dist/Footer/Footer.js +2 -2
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.js +4 -4
- package/dist/RangeFilter/Filters/new/Daily/Daily.js +1 -1
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.js +1 -1
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +1 -1
- package/dist/RangeFilter/Filters/new/hooks/useShiftAndControlKeys.js +3 -3
- package/dist/RangeFilter/RangeFilter.js +15 -16
- package/dist/RangeFilter/Shared/AddButton/AddButton.js +3 -3
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.js +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.js +6 -6
- package/dist/RangeFilter/constants.js +6 -6
- package/dist/RangeFilter/utils.js +2 -2
- package/dist/RangePicker/RangePicker.js +6 -7
- package/dist/RangePickerInput/RangePickerInput.d.ts +1 -1
- package/dist/RangePickerInput/RangePickerInput.js +15 -7
- package/dist/RangePickerInput/RangePickerInput.styles.d.ts +0 -5
- package/dist/RangePickerInput/RangePickerInput.styles.js +1 -22
- package/dist/RangePickerInput/RangePickerInput.types.d.ts +11 -14
- package/dist/RawDateRangePicker.js +5 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.js +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.js +4 -4
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.d.ts +4 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.js +2 -2
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +20 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.1.5...@synerise/ds-date-range-picker@1.2.0) (2025-04-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **date-range-picker:** fix clearing local value ([dc04ce0](https://github.com/Synerise/synerise-design/commit/dc04ce02685cf9fb15b22482f86a8a6065911dc1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **form-field:** add form-field component ([7f6b191](https://github.com/Synerise/synerise-design/commit/7f6b191132a3b0d694c21fb4d649f4deea6acb89))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.1.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.1.4...@synerise/ds-date-range-picker@1.1.5) (2025-04-04)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [1.1.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.1.3...@synerise/ds-date-range-picker@1.1.4) (2025-04-02)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
package/dist/DateRangePicker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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, useState, useRef, useMemo, useEffect } from 'react';
|
|
3
3
|
import { isEqual } from 'lodash';
|
|
4
4
|
import "./style/index.css";
|
package/dist/Footer/Footer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["canApply", "onApply", "canSwitchMode", "onSwitchMode", "mode", "dateOnly", "message", "texts", "value", "format", "valueFormatOptions", "showTime", "displayDateContainerClass"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
4
|
import React, { useMemo, useCallback } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import Button from '@synerise/ds-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
function _inheritsLoose(
|
|
3
|
-
function _setPrototypeOf(
|
|
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
|
+
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
4
|
import React, { PureComponent } from 'react';
|
|
5
5
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
6
6
|
import ContentItem from '@synerise/ds-manageable-list/dist/Item/ContentItem/ContentItem';
|
|
@@ -13,7 +13,6 @@ import * as S from './MonthlyFilter.styles';
|
|
|
13
13
|
import TimeWindow from '../../Shared/TimeWindow/TimeWindow';
|
|
14
14
|
import { getDefaultTexts } from '../../../utils';
|
|
15
15
|
var MonthlyFilter = /*#__PURE__*/function (_PureComponent) {
|
|
16
|
-
_inheritsLoose(MonthlyFilter, _PureComponent);
|
|
17
16
|
function MonthlyFilter() {
|
|
18
17
|
var _visible;
|
|
19
18
|
var _this;
|
|
@@ -265,6 +264,7 @@ var MonthlyFilter = /*#__PURE__*/function (_PureComponent) {
|
|
|
265
264
|
};
|
|
266
265
|
return _this;
|
|
267
266
|
}
|
|
267
|
+
_inheritsLoose(MonthlyFilter, _PureComponent);
|
|
268
268
|
var _proto = MonthlyFilter.prototype;
|
|
269
269
|
_proto.componentDidMount = function componentDidMount() {
|
|
270
270
|
var value = this.props.value;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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, { useMemo, useCallback } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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, { useRef, useEffect, useCallback, useState, useMemo } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
var KEYS
|
|
3
|
-
(function (KEYS) {
|
|
2
|
+
var KEYS = /*#__PURE__*/function (KEYS) {
|
|
4
3
|
KEYS["SHIFT"] = "Shift";
|
|
5
4
|
KEYS["COMMAND"] = "Meta";
|
|
6
5
|
KEYS["CONTROL"] = "Control";
|
|
7
|
-
|
|
6
|
+
return KEYS;
|
|
7
|
+
}(KEYS || {}); // eslint-disable-next-line import/prefer-default-export
|
|
8
8
|
export var useShiftAndControlKeys = function useShiftAndControlKeys(ref) {
|
|
9
9
|
var _React$useState = React.useState(false),
|
|
10
10
|
controlPressed = _React$useState[0],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
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
|
+
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { cloneDeep } from 'lodash';
|
|
7
6
|
import ButtonGroup from '@synerise/ds-button-group';
|
|
@@ -15,14 +14,13 @@ import FilterDropdown from './Shared/FilterDropdown/FilterDropdown';
|
|
|
15
14
|
import SaveFilterForm from './Shared/SaveFilterForm/SaveFilterForm';
|
|
16
15
|
import { getDefaultTexts } from '../utils';
|
|
17
16
|
var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
18
|
-
_inheritsLoose(RangeFilter, _React$PureComponent);
|
|
19
17
|
function RangeFilter(props) {
|
|
20
18
|
var _props$allowedFilterT, _props$value, _props$value2, _props$value3, _this$state;
|
|
21
19
|
var _this;
|
|
22
20
|
_this = _React$PureComponent.call(this, props) || this;
|
|
23
21
|
_this.componentDidUpdate = function () {
|
|
24
|
-
var
|
|
25
|
-
state =
|
|
22
|
+
var _this2 = _this,
|
|
23
|
+
state = _this2.state;
|
|
26
24
|
var allowedFilterTypes = _this.props.allowedFilterTypes;
|
|
27
25
|
var activeType = state.activeType;
|
|
28
26
|
if (allowedFilterTypes != null && allowedFilterTypes.length && !allowedFilterTypes.includes(activeType)) {
|
|
@@ -30,8 +28,8 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
30
28
|
}
|
|
31
29
|
};
|
|
32
30
|
_this.handleApply = function () {
|
|
33
|
-
var
|
|
34
|
-
state =
|
|
31
|
+
var _this3 = _this,
|
|
32
|
+
state = _this3.state;
|
|
35
33
|
var onApply = _this.props.onApply;
|
|
36
34
|
var activeType = state.activeType;
|
|
37
35
|
var filter = state[String(activeType)];
|
|
@@ -43,8 +41,8 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
43
41
|
};
|
|
44
42
|
_this.handleTypeChange = function (type) {
|
|
45
43
|
var _this$setState;
|
|
46
|
-
var
|
|
47
|
-
state =
|
|
44
|
+
var _this4 = _this,
|
|
45
|
+
state = _this4.state;
|
|
48
46
|
var previousValue = state[type];
|
|
49
47
|
var previousDefinition = previousValue == null ? void 0 : previousValue.definition;
|
|
50
48
|
_this.setState((_this$setState = {
|
|
@@ -61,8 +59,8 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
61
59
|
});
|
|
62
60
|
};
|
|
63
61
|
_this.handleFilterSave = function (filterName) {
|
|
64
|
-
var
|
|
65
|
-
state =
|
|
62
|
+
var _this5 = _this,
|
|
63
|
+
state = _this5.state;
|
|
66
64
|
var activeType = state.activeType;
|
|
67
65
|
var _this$props = _this.props,
|
|
68
66
|
onFilterSave = _this$props.onFilterSave,
|
|
@@ -100,9 +98,10 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
100
98
|
}, _this$state[String(valueType)] = _extends({}, denormalizeValue(props.value)), _this$state);
|
|
101
99
|
return _this;
|
|
102
100
|
}
|
|
101
|
+
_inheritsLoose(RangeFilter, _React$PureComponent);
|
|
103
102
|
var _proto = RangeFilter.prototype;
|
|
104
103
|
_proto.render = function render() {
|
|
105
|
-
var
|
|
104
|
+
var _this6 = this;
|
|
106
105
|
var state = this.state;
|
|
107
106
|
var activeType = state.activeType,
|
|
108
107
|
rangeClipboard = state.rangeClipboard;
|
|
@@ -137,7 +136,7 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
136
|
key: key,
|
|
138
137
|
type: activeType === key ? 'primary' : undefined,
|
|
139
138
|
onClick: function onClick() {
|
|
140
|
-
return
|
|
139
|
+
return _this6.handleTypeChange(key);
|
|
141
140
|
}
|
|
142
141
|
}, allTexts[key.toLowerCase()]);
|
|
143
142
|
})), /*#__PURE__*/React.createElement(S.MainComponentWrapper, null, Component && /*#__PURE__*/React.createElement(Component, {
|
|
@@ -150,7 +149,7 @@ var RangeFilter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
150
149
|
var updatedFilter = (_updatedFilter = {}, _updatedFilter[activeType] = _extends({}, activeValue, {
|
|
151
150
|
definition: def
|
|
152
151
|
}), _updatedFilter);
|
|
153
|
-
|
|
152
|
+
_this6.setState(updatedFilter);
|
|
154
153
|
},
|
|
155
154
|
onRangeCopy: this.handleRangeCopy,
|
|
156
155
|
rangeClipboard: rangeClipboard,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["label"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Button from '@synerise/ds-button';
|
|
6
6
|
import Icon, { Add3M } from '@synerise/ds-icon';
|
|
@@ -17,4 +17,4 @@ var AddButton = function AddButton(_ref) {
|
|
|
17
17
|
type: "ghost"
|
|
18
18
|
}, rest), icon, label);
|
|
19
19
|
};
|
|
20
|
-
export default React.memo(AddButton);
|
|
20
|
+
export default /*#__PURE__*/React.memo(AddButton);
|
|
@@ -5,4 +5,4 @@ var SelectionCount = function SelectionCount(_ref) {
|
|
|
5
5
|
selectedDayCount = _ref.selectedDayCount;
|
|
6
6
|
return /*#__PURE__*/React.createElement(S.Container, null, /*#__PURE__*/React.createElement("span", null, label, ":"), /*#__PURE__*/React.createElement(S.Count, null, selectedDayCount));
|
|
7
7
|
};
|
|
8
|
-
export default React.memo(SelectionCount);
|
|
8
|
+
export default /*#__PURE__*/React.memo(SelectionCount);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["active", "label", "onToggle", "onClear", "readOnly", "restricted", "dayKey", "texts", "intl"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
4
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
6
|
import customParseFormatPlugin from 'dayjs/plugin/customParseFormat';
|
|
@@ -72,4 +72,4 @@ var Day = function Day(_ref) {
|
|
|
72
72
|
active: hovered
|
|
73
73
|
}, icon)));
|
|
74
74
|
};
|
|
75
|
-
export default memo(Day);
|
|
75
|
+
export default /*#__PURE__*/memo(Day);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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, { useState, useEffect } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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 from 'react';
|
|
3
3
|
import RangeForm from './RangeForm/RangeForm';
|
|
4
4
|
import { RANGE_DISPLAY_MODES } from './RangeForm/RangeForm.constants';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _excluded = ["days", "numberOfDays", "daily", "intl", "texts", "disabled"];
|
|
2
|
-
function _objectWithoutPropertiesLoose(
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
4
|
-
function _inheritsLoose(
|
|
5
|
-
function _setPrototypeOf(
|
|
2
|
+
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; }
|
|
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
|
+
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
5
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
6
6
|
import React, { PureComponent, createRef } from 'react';
|
|
7
7
|
import { range } from 'lodash';
|
|
8
8
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
@@ -20,7 +20,6 @@ import SelectionHint from '../SelectionHint/SelectionHint';
|
|
|
20
20
|
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';
|
|
21
21
|
export var DEFAULT_LIMIT_MODE = 'Range';
|
|
22
22
|
var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
23
|
-
_inheritsLoose(TimeWindowBase, _PureComponent);
|
|
24
23
|
function TimeWindowBase() {
|
|
25
24
|
var _this;
|
|
26
25
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -32,7 +31,7 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
32
31
|
activeDays: _this.props.daily ? [0] : [],
|
|
33
32
|
controlKeyPressed: false
|
|
34
33
|
};
|
|
35
|
-
_this.wrapperRef = createRef();
|
|
34
|
+
_this.wrapperRef = /*#__PURE__*/createRef();
|
|
36
35
|
_this.isDayRestricted = function (dayKey) {
|
|
37
36
|
var days = _this.props.days;
|
|
38
37
|
return !!days[dayKey] && days[dayKey].restricted;
|
|
@@ -379,6 +378,7 @@ var TimeWindowBase = /*#__PURE__*/function (_PureComponent) {
|
|
|
379
378
|
};
|
|
380
379
|
return _this;
|
|
381
380
|
}
|
|
381
|
+
_inheritsLoose(TimeWindowBase, _PureComponent);
|
|
382
382
|
var _proto = TimeWindowBase.prototype;
|
|
383
383
|
_proto.componentDidMount = function componentDidMount() {
|
|
384
384
|
var wrapper = this.wrapperRef;
|
|
@@ -13,16 +13,16 @@ export var MONTH_DAYS = function MONTH_DAYS(locale) {
|
|
|
13
13
|
return locale === 'pl' ? i + 1 + "." : fnsFormat(fnsAddDays(LONG_MONTH, i), 'Do');
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
export var DAYS_OF_PERIOD_ENUM
|
|
17
|
-
(function (DAYS_OF_PERIOD_ENUM) {
|
|
16
|
+
export var DAYS_OF_PERIOD_ENUM = /*#__PURE__*/function (DAYS_OF_PERIOD_ENUM) {
|
|
18
17
|
DAYS_OF_PERIOD_ENUM["DAY_OF_MONTH"] = "MONTH";
|
|
19
18
|
DAYS_OF_PERIOD_ENUM["DAY_OF_WEEK"] = "WEEK";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return DAYS_OF_PERIOD_ENUM;
|
|
20
|
+
}({});
|
|
21
|
+
export var COUNTED_FROM_ENUM = /*#__PURE__*/function (COUNTED_FROM_ENUM) {
|
|
23
22
|
COUNTED_FROM_ENUM["BEGINNING"] = "BEGINNING";
|
|
24
23
|
COUNTED_FROM_ENUM["ENDING"] = "ENDING";
|
|
25
|
-
|
|
24
|
+
return COUNTED_FROM_ENUM;
|
|
25
|
+
}({});
|
|
26
26
|
export var TYPES = {
|
|
27
27
|
DAILY: 'DAILY',
|
|
28
28
|
WEEKLY: 'WEEKLY',
|
|
@@ -3,8 +3,8 @@ var _excluded = ["start", "stop", "day"],
|
|
|
3
3
|
_excluded2 = ["from", "to", "day"],
|
|
4
4
|
_excluded3 = ["restricted", "display"],
|
|
5
5
|
_excluded4 = ["restricted", "display"];
|
|
6
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
7
|
-
function _objectWithoutPropertiesLoose(
|
|
6
|
+
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); }
|
|
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
|
/*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
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
|
+
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
5
4
|
import React, { PureComponent } from 'react';
|
|
6
5
|
import { DateUtils } from 'react-day-picker';
|
|
7
6
|
import fnsIsSameDay from 'date-fns/isSameDay';
|
|
@@ -61,7 +60,6 @@ function replaceRange(value, day) {
|
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
64
|
-
_inheritsLoose(RangePicker, _PureComponent);
|
|
65
63
|
function RangePicker(props) {
|
|
66
64
|
var _this;
|
|
67
65
|
_this = _PureComponent.call(this, props) || this;
|
|
@@ -136,8 +134,8 @@ var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
136
134
|
};
|
|
137
135
|
_this.handleSideMonthChange = function (side, month, mode) {
|
|
138
136
|
var opposite = side === COLUMNS.LEFT ? COLUMNS.RIGHT : COLUMNS.LEFT;
|
|
139
|
-
var
|
|
140
|
-
state =
|
|
137
|
+
var _this2 = _this,
|
|
138
|
+
state = _this2.state;
|
|
141
139
|
var forceAdjacentMonths = _this.props.forceAdjacentMonths;
|
|
142
140
|
if (fnsIsSameMonth(month, state[opposite])) {
|
|
143
141
|
var dir = fnsIsAfter(month, legacyParse(state[side].month)) ? 1 : -1;
|
|
@@ -357,6 +355,7 @@ var RangePicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
357
355
|
}, getSidesState(props.value));
|
|
358
356
|
return _this;
|
|
359
357
|
}
|
|
358
|
+
_inheritsLoose(RangePicker, _PureComponent);
|
|
360
359
|
var _proto = RangePicker.prototype;
|
|
361
360
|
_proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(prevProps) {
|
|
362
361
|
var _prevProps$value, _prevProps$value2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RangePickerInputProps } from './RangePickerInput.types';
|
|
3
|
-
declare const RangePickerInput: ({ value, valueFormatOptions, showTime, onChange, onClick, highlight, texts, active, label, description, tooltip, disabled, readOnly, onFocus, allowClear, onBlur, error, errorText, preferRelativeDesc, }: RangePickerInputProps) => React.JSX.Element;
|
|
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,9 +1,10 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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
3
|
import Icon, { ArrowRightS, CalendarM, Close3S } from '@synerise/ds-icon';
|
|
4
|
-
import {
|
|
4
|
+
import { useTheme } from '@synerise/ds-core';
|
|
5
5
|
import Tooltip from '@synerise/ds-tooltip';
|
|
6
6
|
import { getDefaultDataTimeOptions, useDataFormat } from '@synerise/ds-data-format';
|
|
7
|
+
import FormField from '@synerise/ds-form-field';
|
|
7
8
|
import * as S from './RangePickerInput.styles';
|
|
8
9
|
import { normalizeRange } from '../utils';
|
|
9
10
|
import { isLifetime } from '../RelativeRangePicker/Elements/RangeDropdown/RangeDropdown';
|
|
@@ -19,6 +20,7 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
19
20
|
label = _ref.label,
|
|
20
21
|
description = _ref.description,
|
|
21
22
|
tooltip = _ref.tooltip,
|
|
23
|
+
tooltipConfig = _ref.tooltipConfig,
|
|
22
24
|
disabled = _ref.disabled,
|
|
23
25
|
readOnly = _ref.readOnly,
|
|
24
26
|
onFocus = _ref.onFocus,
|
|
@@ -29,6 +31,7 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
29
31
|
errorText = _ref.errorText,
|
|
30
32
|
_ref$preferRelativeDe = _ref.preferRelativeDesc,
|
|
31
33
|
preferRelativeDesc = _ref$preferRelativeDe === void 0 ? false : _ref$preferRelativeDe;
|
|
34
|
+
var theme = useTheme();
|
|
32
35
|
var _useDataFormat = useDataFormat(),
|
|
33
36
|
formatValue = _useDataFormat.formatValue;
|
|
34
37
|
var dateRangeValue = value ? normalizeRange(value) : value;
|
|
@@ -74,15 +77,19 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
74
77
|
component: /*#__PURE__*/React.createElement(ArrowRightS, null),
|
|
75
78
|
color: theme.palette['grey-400']
|
|
76
79
|
}), renderEndDate(), preferRelativeDesc && (dateRangeValue == null ? void 0 : dateRangeValue.translationKey) && value && ')');
|
|
77
|
-
}, [
|
|
78
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
80
|
+
}, [value, preferRelativeDesc, dateRangeValue == null ? void 0 : dateRangeValue.translationKey, texts, renderFromDate, theme.palette, renderEndDate]);
|
|
81
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormField, {
|
|
82
|
+
errorText: errorText,
|
|
79
83
|
label: label,
|
|
80
|
-
tooltip: tooltip
|
|
81
|
-
|
|
84
|
+
tooltip: tooltip,
|
|
85
|
+
tooltipConfig: tooltipConfig,
|
|
86
|
+
description: description
|
|
87
|
+
}, /*#__PURE__*/React.createElement(S.Container, {
|
|
82
88
|
tabIndex: 0,
|
|
83
89
|
onFocus: onFocus,
|
|
84
90
|
onClick: !disabled ? onClick : undefined,
|
|
85
91
|
onBlur: onBlur,
|
|
92
|
+
"data-testid": "date-range-picker-input-wrapper",
|
|
86
93
|
onMouseEnter: handleIconMouseEnter,
|
|
87
94
|
onMouseLeave: handleIconMouseLeave
|
|
88
95
|
}, /*#__PURE__*/React.createElement(S.RangeInputWrapper, {
|
|
@@ -95,10 +102,11 @@ var RangePickerInput = function RangePickerInput(_ref) {
|
|
|
95
102
|
title: texts == null ? void 0 : texts.clear
|
|
96
103
|
}, /*#__PURE__*/React.createElement(S.ClearIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
97
104
|
component: /*#__PURE__*/React.createElement(Close3S, null),
|
|
105
|
+
"data-testid": "date-range-picker-input-clear",
|
|
98
106
|
onClick: handleClear
|
|
99
107
|
}))) : /*#__PURE__*/React.createElement(S.DefaultIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
100
108
|
component: /*#__PURE__*/React.createElement(CalendarM, null),
|
|
101
109
|
color: theme.palette['grey-600']
|
|
102
|
-
}))))
|
|
110
|
+
}))))));
|
|
103
111
|
};
|
|
104
112
|
export default RangePickerInput;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const ClearIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const DefaultIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -15,7 +14,3 @@ export declare const DateWrapper: import("styled-components").StyledComponent<"d
|
|
|
15
14
|
export declare const DateValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
15
|
export declare const IconSeparator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
16
|
export declare const SuffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
-
export declare const Label: import("styled-components").StyledComponent<({ id, className, label, tooltip, tooltipConfig, style }: import("@synerise/ds-input/dist/Label/Label.types").LabelProps) => import("react").JSX.Element, any, {}, never>;
|
|
19
|
-
export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
-
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
-
export declare const ContentBelow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { InputWrapper } from '@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles';
|
|
3
|
-
import { Label as DSLabel } from '@synerise/ds-input';
|
|
4
3
|
export var Container = styled.div.withConfig({
|
|
5
4
|
displayName: "RangePickerInputstyles__Container",
|
|
6
5
|
componentId: "sc-1b9h1ef-0"
|
|
@@ -42,24 +41,4 @@ export var IconSeparator = styled.div.withConfig({
|
|
|
42
41
|
export var SuffixWrapper = styled.div.withConfig({
|
|
43
42
|
displayName: "RangePickerInputstyles__SuffixWrapper",
|
|
44
43
|
componentId: "sc-1b9h1ef-7"
|
|
45
|
-
})([""]);
|
|
46
|
-
export var Label = styled(DSLabel).withConfig({
|
|
47
|
-
displayName: "RangePickerInputstyles__Label",
|
|
48
|
-
componentId: "sc-1b9h1ef-8"
|
|
49
|
-
})(["margin-bottom:8px;"]);
|
|
50
|
-
export var ErrorText = styled.div.withConfig({
|
|
51
|
-
displayName: "RangePickerInputstyles__ErrorText",
|
|
52
|
-
componentId: "sc-1b9h1ef-9"
|
|
53
|
-
})(["color:", ";margin-bottom:4px;"], function (props) {
|
|
54
|
-
return props.theme.palette['red-600'];
|
|
55
|
-
});
|
|
56
|
-
export var Description = styled.div.withConfig({
|
|
57
|
-
displayName: "RangePickerInputstyles__Description",
|
|
58
|
-
componentId: "sc-1b9h1ef-10"
|
|
59
|
-
})(["color:", ";"], function (props) {
|
|
60
|
-
return props.theme.palette['grey-600'];
|
|
61
|
-
});
|
|
62
|
-
export var ContentBelow = styled.div.withConfig({
|
|
63
|
-
displayName: "RangePickerInputstyles__ContentBelow",
|
|
64
|
-
componentId: "sc-1b9h1ef-11"
|
|
65
|
-
})(["margin-top:8px;"]);
|
|
44
|
+
})([""]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { CSSProperties, MouseEvent as ReactMouseEvent, FocusEventHandler, ReactNode } from 'react';
|
|
2
|
+
import type { DateToFormatOptions } from '@synerise/ds-data-format';
|
|
3
|
+
import type { FormFieldCommonProps } from '@synerise/ds-form-field';
|
|
4
|
+
import type { DateFilter, DateRange } from '../date.types';
|
|
5
|
+
import type { Texts } from '../DateRangePicker.types';
|
|
5
6
|
export type RangePickerInputProps = {
|
|
6
7
|
size?: 'large' | 'default' | 'small';
|
|
7
8
|
/**
|
|
@@ -13,25 +14,21 @@ export type RangePickerInputProps = {
|
|
|
13
14
|
allowClear?: boolean;
|
|
14
15
|
value?: Pick<DateRange, 'from'> & Pick<DateRange, 'to'>;
|
|
15
16
|
onChange?: (value: Partial<DateFilter> | undefined) => void;
|
|
16
|
-
style?:
|
|
17
|
+
style?: CSSProperties;
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
disabled?: boolean;
|
|
19
20
|
readOnly?: boolean;
|
|
20
|
-
onClick?: (
|
|
21
|
+
onClick?: (event?: ReactMouseEvent<HTMLElement, MouseEvent>) => void;
|
|
21
22
|
onClear?: () => void;
|
|
22
|
-
onFocus?:
|
|
23
|
-
onBlur?:
|
|
24
|
-
clearTooltip?:
|
|
23
|
+
onFocus?: FocusEventHandler;
|
|
24
|
+
onBlur?: FocusEventHandler;
|
|
25
|
+
clearTooltip?: ReactNode;
|
|
25
26
|
highlight?: boolean;
|
|
26
27
|
texts?: Texts;
|
|
27
28
|
active?: boolean;
|
|
28
|
-
label?: string | React.ReactNode;
|
|
29
|
-
description?: string | React.ReactNode;
|
|
30
|
-
tooltip?: string | React.ReactNode;
|
|
31
29
|
error?: boolean;
|
|
32
|
-
errorText?: React.ReactNode | string;
|
|
33
30
|
preferRelativeDesc?: boolean;
|
|
34
|
-
};
|
|
31
|
+
} & FormFieldCommonProps;
|
|
35
32
|
/**
|
|
36
33
|
* @deprecated use `RangePickerInputProps`
|
|
37
34
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, { useState, useMemo, useCallback } from 'react';
|
|
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
3
|
import { omitBy, isUndefined } from 'lodash';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
import fnsIsValid from 'date-fns/isValid';
|
|
@@ -121,6 +121,9 @@ export var RawDateRangePicker = function RawDateRangePicker(_ref) {
|
|
|
121
121
|
setVisibleAddonKey = _useState3[1];
|
|
122
122
|
var intl = useIntl();
|
|
123
123
|
var timeZone = intl.timeZone;
|
|
124
|
+
useEffect(function () {
|
|
125
|
+
setLocalValue(normalizeRange(value));
|
|
126
|
+
}, [value]);
|
|
124
127
|
var allTexts = useMemo(function () {
|
|
125
128
|
return getDefaultTexts(intl, false, texts);
|
|
126
129
|
}, [intl, texts]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
function _inheritsLoose(
|
|
3
|
-
function _setPrototypeOf(
|
|
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
|
+
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
|
|
3
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { injectIntl } from 'react-intl';
|
|
6
6
|
import * as S from './RelativeRangePicker.styles';
|
|
@@ -14,7 +14,6 @@ import { fnsIsAfter } from '../fns';
|
|
|
14
14
|
import { DEFAULT_RANGE, normalizeRange } from '../utils';
|
|
15
15
|
import { CUSTOM_RANGE_KEY, RANGES_MODE } from '../constants';
|
|
16
16
|
var RelativeRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
17
|
-
_inheritsLoose(RelativeRangePicker, _React$PureComponent);
|
|
18
17
|
function RelativeRangePicker(props) {
|
|
19
18
|
var _this;
|
|
20
19
|
_this = _React$PureComponent.call(this, props) || this;
|
|
@@ -155,6 +154,7 @@ var RelativeRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
155
154
|
};
|
|
156
155
|
return _this;
|
|
157
156
|
}
|
|
157
|
+
_inheritsLoose(RelativeRangePicker, _React$PureComponent);
|
|
158
158
|
RelativeRangePicker.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
|
159
159
|
var ranges = nextProps.ranges,
|
|
160
160
|
value = nextProps.value,
|
|
@@ -6,7 +6,10 @@ 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, ...antdInputGroupProps }: InputGroupProps) => React.JSX.Element, any,
|
|
9
|
+
export declare const InputSelectGroup: import("styled-components").StyledComponent<({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: InputGroupProps) => React.JSX.Element, any, import("antd/es/input").GroupProps & {
|
|
10
|
+
errors?: string[] | undefined;
|
|
11
|
+
resetMargin?: boolean | undefined;
|
|
12
|
+
} & Omit<import("@synerise/ds-form-field").FormFieldCommonProps, "errorText">, never>;
|
|
10
13
|
export declare const ModeDropdownTrigger: import("styled-components").StyledComponent<({ children, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
11
14
|
export declare const Range: import("styled-components").StyledComponent<({ children, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
12
15
|
export declare const RangeFormColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["children"],
|
|
2
2
|
_excluded2 = ["children"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
4
|
-
function _objectWithoutPropertiesLoose(
|
|
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
|
+
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; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import Button from '@synerise/ds-button';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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 * as CONST from '../../constants';
|
|
3
3
|
export var findMatchingPreset = function findMatchingPreset(range) {
|
|
4
4
|
if (!range || range.type !== CONST.RELATIVE) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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 { findMatchingPreset } from './findMatchingPreset.utils';
|
|
3
3
|
import { CUSTOM_RANGE_KEY } from '../../constants';
|
|
4
4
|
export var updatePresetKey = function updatePresetKey(range) {
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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 fnsMin from 'date-fns/min';
|
|
3
3
|
import fnsMax from 'date-fns/max';
|
|
4
4
|
import { getTimezoneOffset } from 'date-fns-tz';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-date-range-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Date-Range-Picker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,24 +35,25 @@
|
|
|
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.1.
|
|
40
|
-
"@synerise/ds-button-group": "^1.0.
|
|
38
|
+
"@synerise/ds-badge": "^1.0.5",
|
|
39
|
+
"@synerise/ds-button": "^1.1.4",
|
|
40
|
+
"@synerise/ds-button-group": "^1.0.5",
|
|
41
41
|
"@synerise/ds-data-format": "^1.0.0",
|
|
42
|
-
"@synerise/ds-date-picker": "^1.0
|
|
43
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
44
|
-
"@synerise/ds-
|
|
45
|
-
"@synerise/ds-
|
|
46
|
-
"@synerise/ds-
|
|
47
|
-
"@synerise/ds-input
|
|
48
|
-
"@synerise/ds-
|
|
49
|
-
"@synerise/ds-
|
|
50
|
-
"@synerise/ds-
|
|
51
|
-
"@synerise/ds-
|
|
52
|
-
"@synerise/ds-
|
|
53
|
-
"@synerise/ds-
|
|
54
|
-
"@synerise/ds-
|
|
55
|
-
"@synerise/ds-
|
|
42
|
+
"@synerise/ds-date-picker": "^1.1.0",
|
|
43
|
+
"@synerise/ds-dropdown": "^1.0.5",
|
|
44
|
+
"@synerise/ds-form-field": "^1.1.0",
|
|
45
|
+
"@synerise/ds-icon": "^1.4.0",
|
|
46
|
+
"@synerise/ds-inline-edit": "^1.0.6",
|
|
47
|
+
"@synerise/ds-input": "^1.1.0",
|
|
48
|
+
"@synerise/ds-input-number": "^1.1.0",
|
|
49
|
+
"@synerise/ds-list-item": "^1.0.5",
|
|
50
|
+
"@synerise/ds-manageable-list": "^1.2.5",
|
|
51
|
+
"@synerise/ds-scrollbar": "^1.0.5",
|
|
52
|
+
"@synerise/ds-select": "^1.1.0",
|
|
53
|
+
"@synerise/ds-slider": "^1.0.5",
|
|
54
|
+
"@synerise/ds-tag": "^1.1.4",
|
|
55
|
+
"@synerise/ds-time-picker": "^1.1.0",
|
|
56
|
+
"@synerise/ds-tooltip": "^1.1.4",
|
|
56
57
|
"@synerise/ds-utils": "^1.0.1",
|
|
57
58
|
"date-fns": "^2.16.1",
|
|
58
59
|
"date-fns-tz": "1.1.4",
|
|
@@ -69,5 +70,5 @@
|
|
|
69
70
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
70
71
|
"styled-components": "^5.3.3"
|
|
71
72
|
},
|
|
72
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "6735f9babfeef53122f54ca86cba5f581e8870d9"
|
|
73
74
|
}
|