@synerise/ds-date-picker 0.9.7 → 0.9.8
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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.9.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.9.7...@synerise/ds-date-picker@0.9.8) (2023-04-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-date-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.9.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.9.6...@synerise/ds-date-picker@0.9.7) (2023-04-17)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { MonthPickerProps
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
import { MonthPickerProps } from './MonthPicker.types';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<MonthPickerProps, "max" | "min" | "onChange" | "value"> & {
|
|
4
|
+
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
5
|
+
} & React.RefAttributes<any>> & {
|
|
6
|
+
WrappedComponent: React.ComponentType<MonthPickerProps>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -5,6 +5,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
5
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
6
|
|
|
7
7
|
import * as React from 'react';
|
|
8
|
+
import { injectIntl } from 'react-intl';
|
|
8
9
|
import { range } from 'lodash';
|
|
9
10
|
import { legacyParse } from '@date-fns/upgrade/v2';
|
|
10
11
|
import { fnsStartOfMonth, fnsEndOfMonth, fnsSetMonth, fnsIsBefore, fnsAddYears, fnsIsAfter, fnsIsSameMonth } from '../../fns';
|
|
@@ -20,14 +21,14 @@ function getInitialState(props) {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
function getCells(cursor, min, max) {
|
|
24
|
+
function getCells(cursor, min, max, locale) {
|
|
24
25
|
var minDate = min ? fnsStartOfMonth(min) : fnsSetMonth(cursor, 0);
|
|
25
26
|
var maxDate = max ? fnsEndOfMonth(max) : fnsSetMonth(cursor, 12);
|
|
26
27
|
return range(0, 12).map(function (index) {
|
|
27
28
|
var date = fnsSetMonth(cursor, index);
|
|
28
29
|
return {
|
|
29
30
|
key: date.toISOString(),
|
|
30
|
-
text: fnsFormat(date, 'MMM'),
|
|
31
|
+
text: fnsFormat(date, 'MMM', locale),
|
|
31
32
|
disabled: fnsIsAfter(date, maxDate) || fnsIsBefore(date, minDate)
|
|
32
33
|
};
|
|
33
34
|
});
|
|
@@ -88,8 +89,9 @@ var MonthPicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
88
89
|
min = _this$props.min,
|
|
89
90
|
max = _this$props.max,
|
|
90
91
|
value = _this$props.value,
|
|
92
|
+
intl = _this$props.intl,
|
|
91
93
|
onChange = _this$props.onChange;
|
|
92
|
-
var cells = getCells(cursor, min, max);
|
|
94
|
+
var cells = getCells(cursor, min, max, intl == null ? void 0 : intl.locale);
|
|
93
95
|
var valueCell = value ? cells.find(function (cell) {
|
|
94
96
|
return fnsIsSameMonth(value, legacyParse(cell.key));
|
|
95
97
|
}) : null;
|
|
@@ -130,4 +132,4 @@ var MonthPicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
130
132
|
return MonthPicker;
|
|
131
133
|
}(React.PureComponent);
|
|
132
134
|
|
|
133
|
-
export
|
|
135
|
+
export default injectIntl(MonthPicker);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-date-picker",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "DatePicker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@date-fns/upgrade": "^1.0.3",
|
|
36
|
-
"@synerise/ds-button": "^0.17.
|
|
36
|
+
"@synerise/ds-button": "^0.17.13",
|
|
37
37
|
"@synerise/ds-core": "^0.39.7",
|
|
38
|
-
"@synerise/ds-icon": "^0.
|
|
39
|
-
"@synerise/ds-time-picker": "^0.7.
|
|
40
|
-
"@synerise/ds-tooltip": "^0.13.
|
|
38
|
+
"@synerise/ds-icon": "^0.55.0",
|
|
39
|
+
"@synerise/ds-time-picker": "^0.7.6",
|
|
40
|
+
"@synerise/ds-tooltip": "^0.13.1",
|
|
41
41
|
"classnames": "^2.2.6",
|
|
42
42
|
"date-fns": "2.16.1",
|
|
43
43
|
"lodash": "^4.17.20",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@synerise/ds-core": "*",
|
|
49
49
|
"react": ">=16.9.0 < 17.0.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "3b8c3b1437ecbdda775a790ac3c27d6b1b6cbf26"
|
|
52
52
|
}
|