@synerise/ds-date-range-picker 1.1.3 → 1.1.5
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 +16 -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.js +1 -1
- package/dist/RawDateRangePicker.js +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.js +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.js +4 -4
- 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 +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-date-range-picker
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.1.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-range-picker@1.1.2...@synerise/ds-date-range-picker@1.1.3) (2025-04-01)
|
|
7
23
|
|
|
8
24
|
**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
|
-
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
4
|
import { theme } from '@synerise/ds-core';
|
|
@@ -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, useMemo, useCallback } from 'react';
|
|
3
3
|
import { omitBy, isUndefined } from 'lodash';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
@@ -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,
|
|
@@ -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.1.
|
|
3
|
+
"version": "1.1.5",
|
|
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,24 @@
|
|
|
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.4",
|
|
39
|
+
"@synerise/ds-button": "^1.1.3",
|
|
40
|
+
"@synerise/ds-button-group": "^1.0.4",
|
|
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-icon": "^1.
|
|
45
|
-
"@synerise/ds-inline-edit": "^1.0.
|
|
46
|
-
"@synerise/ds-input": "^1.0.
|
|
47
|
-
"@synerise/ds-input-number": "^1.0.
|
|
48
|
-
"@synerise/ds-list-item": "^1.0.
|
|
49
|
-
"@synerise/ds-manageable-list": "^1.2.
|
|
50
|
-
"@synerise/ds-scrollbar": "^1.0.
|
|
51
|
-
"@synerise/ds-select": "^1.0.
|
|
52
|
-
"@synerise/ds-slider": "^1.0.
|
|
53
|
-
"@synerise/ds-tag": "^1.1.
|
|
54
|
-
"@synerise/ds-time-picker": "^1.0.
|
|
55
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
42
|
+
"@synerise/ds-date-picker": "^1.0.4",
|
|
43
|
+
"@synerise/ds-dropdown": "^1.0.4",
|
|
44
|
+
"@synerise/ds-icon": "^1.3.0",
|
|
45
|
+
"@synerise/ds-inline-edit": "^1.0.5",
|
|
46
|
+
"@synerise/ds-input": "^1.0.4",
|
|
47
|
+
"@synerise/ds-input-number": "^1.0.4",
|
|
48
|
+
"@synerise/ds-list-item": "^1.0.4",
|
|
49
|
+
"@synerise/ds-manageable-list": "^1.2.4",
|
|
50
|
+
"@synerise/ds-scrollbar": "^1.0.4",
|
|
51
|
+
"@synerise/ds-select": "^1.0.4",
|
|
52
|
+
"@synerise/ds-slider": "^1.0.4",
|
|
53
|
+
"@synerise/ds-tag": "^1.1.3",
|
|
54
|
+
"@synerise/ds-time-picker": "^1.0.4",
|
|
55
|
+
"@synerise/ds-tooltip": "^1.1.3",
|
|
56
56
|
"@synerise/ds-utils": "^1.0.1",
|
|
57
57
|
"date-fns": "^2.16.1",
|
|
58
58
|
"date-fns-tz": "1.1.4",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
70
70
|
"styled-components": "^5.3.3"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "55537c6449492265a1d50c1e055ef7cc03c7935e"
|
|
73
73
|
}
|