@synerise/ds-date-picker 0.9.6 → 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,25 @@
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
+
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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **date-range-picker:** selected date numbers must to be centered ([aeeb9b5](https://github.com/Synerise/synerise-design/commit/aeeb9b5ac9150b177564c885b3bb594e3a7b5f57))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.9.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-date-picker@0.9.5...@synerise/ds-date-picker@0.9.6) (2023-04-14)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-date-picker
@@ -27,7 +27,7 @@ export var DayTooltip = styled.div.withConfig({
27
27
  export var DayPicker = styled(DayPickerBase).withConfig({
28
28
  displayName: "DayPickerstyles__DayPicker",
29
29
  componentId: "oi7l9r-4"
30
- })(["display:inline-block;font-size:12px;.DayPicker-wrapper{position:relative;flex-direction:row;}.DayPicker-Months{display:flex;flex-wrap:wrap;justify-content:center;}.DayPicker-Month{display:table;margin:8px;border-spacing:0;border-collapse:collapse;}.DayPicker-Weekdays{display:table-header-group;}.DayPicker-WeekdaysRow{display:table-row;}.DayPicker-Weekday{min-width:39px;height:32px;display:table-cell;vertical-align:middle;text-align:center;font-weight:500;}.DayPicker-Weekday abbr[title]{border-bottom:none;text-decoration:none;}.DayPicker-Body{display:table-row-group;}.DayPicker-Week{display:table-row;}.DayPicker--interactionDisabled ", "{cursor:default;}", "{width:40px;height:40px;display:table-cell;cursor:pointer;position:relative;box-sizing:border-box;> div{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;margin:4px;min-width:32px;}&--start > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;}&--end > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;}&--today{font-weight:500;}&--today", "{& > ", "{font-weight:400;}}&--entered", ":not(", "){& > ", "{border-color:", ";margin-right:0;margin-left:4px;}& > ", "{margin-right:0;background-color:", ";}}&--entered", ":not(", "){& > ", "{border-color:", ";margin-right:4px;margin-left:4px;}& > ", "{margin-right:4px;background-color:", ";}}&--entered:not(", "):not(", "){& > ", "{background-color:", ";}}&--today", ":not(", "){& > ", "{background-color:", ";}}&--today", ":not(", "){& > ", "{background-color:transparent;font-weight:400;color:", ";}& > ", "{background-color:", ";}& > ", "{border:2px solid transparent;}}&--today:not(", "){& > ", "{background-color:", ";color:", ";}& > ", "{border:2px solid ", ";}}&--entered > ", "{background-color:", ";}&--entered > ", "{color:", ";}&--entered-start:not(", ") > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;}&--entered-end:not(", ") > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;}&--outside{& > ", "{color:", ";}}&--disabled{cursor:default;& > ", "{color:", ";}}}", ":not(", "):not(", "):not(", "),", ":not(", "):not(", "):not(", "){&:last-child > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;margin-right:4px;padding-right:0;}&:first-child > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;margin-left:4px;padding-left:0;}}", ":not(", "):not(", "){& > div{padding-left:4px;margin-left:0;padding-right:4px;margin-right:0;}& > ", "{background-color:", ";}& > ", "{color:", ";}&", "{& > ", "{background-color:", ";}& > ", "{color:inherit;}}}", ":not(", "):not(", "){& > div{padding-left:4px;margin-left:0;padding-right:4px;margin-right:0;text-align:center;}&& > ", "{background-color:", ";}&& > ", "{color:", ";}&", "{&& > ", "{background-color:", ";}&& > ", "{color:inherit;}}}", ":not(", "):not(", "){& > ", "{border-radius:50%;font-weight:500;color:", ";background-color:", ";margin-right:4px;padding-left:4px;}& > ", "{background-color:", ";}& > div{padding-left:0px;margin-left:4px;}}", ":not(", "):not(", "):last-child,", ":not(", "):not(", "):first-child{& > div{margin-right:4px;}& > ", "{background-color:", ";}}", ":not(", "):not(", "){& > ", "{border-radius:50%;font-weight:500;background-color:", ";color:", ";margin-left:4px;padding-left:4px;}& > div{padding-right:4px;margin-right:4px;}}", ":not(", "):not(", "){& > div{padding-right:4px;}}", ":not(", "):hover{position:relative;", "{height:24px;position:absolute;top:-30px;margin-left:calc(-50% + 16px);display:block;white-space:nowrap;background-color:rgba(56,67,80,0.9);padding:3px 8px;border-radius:3px;z-index:9;font-weight:400;color:", ";}}", ":not(", "):not(", "),", ":not(", "){& > ", "{background:transparent;}}", "{& > ", "{border-radius:50%;}}&.relative{", ":not(", "):not(", "){& > ", "{font-weight:500;}", ":not(", "):not(", "){& > ", "{background-color:", ";}& > ", "{color:", ";}}}"], DaySelectorPrefix, DaySelectorPrefix, DayBackground, DayBackground, daySelector('selected'), DayText, daySelector('entered-start'), daySelector('entered-end'), DayForeground, function (props) {
30
+ })(["display:inline-block;font-size:12px;.DayPicker-wrapper{position:relative;flex-direction:row;}.DayPicker-Months{display:flex;flex-wrap:wrap;justify-content:center;}.DayPicker-Month{display:table;margin:8px;border-spacing:0;border-collapse:collapse;}.DayPicker-Weekdays{display:table-header-group;}.DayPicker-WeekdaysRow{display:table-row;}.DayPicker-Weekday{min-width:39px;height:32px;display:table-cell;vertical-align:middle;text-align:center;font-weight:500;}.DayPicker-Weekday abbr[title]{border-bottom:none;text-decoration:none;}.DayPicker-Body{display:table-row-group;}.DayPicker-Week{display:table-row;}.DayPicker--interactionDisabled ", "{cursor:default;}", "{width:40px;height:40px;display:table-cell;cursor:pointer;position:relative;box-sizing:border-box;> div{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;margin:4px;min-width:32px;}&--start > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;}&--end > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;}&--today{font-weight:500;}&--today", "{& > ", "{font-weight:400;}}&--entered", ":not(", "){& > ", "{border-color:", ";margin-right:0;margin-left:4px;}& > ", "{margin-right:0;background-color:", ";}}&--entered", ":not(", "){& > ", "{border-color:", ";margin-right:4px;margin-left:4px;}& > ", "{margin-right:4px;background-color:", ";}}&--entered:not(", "):not(", "){& > ", "{background-color:", ";}}&--today", ":not(", "){& > ", "{background-color:", ";}}&--today", ":not(", "){& > ", "{background-color:transparent;font-weight:400;color:", ";}& > ", "{background-color:", ";}& > ", "{border:2px solid transparent;}}&--today:not(", "){& > ", "{background-color:", ";color:", ";}& > ", "{border:2px solid ", ";}}&--entered > ", "{background-color:", ";}&--entered > ", "{color:", ";}&--entered-start:not(", ") > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;}&--entered-end:not(", ") > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;}&--outside{& > ", "{color:", ";}}&--disabled{cursor:default;& > ", "{color:", ";}}}", ":not(", "):not(", "):not(", "),", ":not(", "):not(", "):not(", "){&:last-child > ", "{border-top-right-radius:50%;border-bottom-right-radius:50%;margin-right:4px;padding-right:0;}&:first-child > ", "{border-top-left-radius:50%;border-bottom-left-radius:50%;margin-left:4px;padding-left:0;}}", ":not(", "):not(", "){& > div{padding-left:4px;margin-left:0;padding-right:4px;margin-right:0;}& > ", "{background-color:", ";}& > ", "{color:", ";}&", "{& > ", "{background-color:", ";}& > ", "{color:inherit;}}}", ":not(", "):not(", "){& > div{padding-left:4px;margin-left:0;padding-right:4px;margin-right:0;text-align:center;}&& > ", "{background-color:", ";}&& > ", "{color:", ";}&", "{&& > ", "{background-color:", ";}&& > ", "{color:inherit;}}}", ":not(", "):not(", "){& > ", "{border-radius:50%;font-weight:500;color:", ";background-color:", ";margin-right:4px;padding-left:0px;padding-right:0px;}& > ", "{background-color:", ";}& > div{padding-left:0px;margin-left:4px;}}", ":not(", "):not(", "):last-child,", ":not(", "):not(", "):first-child{& > div{margin-right:4px;}& > ", "{background-color:", ";}}", ":not(", "):not(", "){& > ", "{border-radius:50%;font-weight:500;background-color:", ";color:", ";margin-left:4px;padding-left:4px;}& > div{padding-right:4px;margin-right:4px;}}", ":not(", "):not(", "){& > div{padding-right:4px;}}", ":not(", "):hover{position:relative;", "{height:24px;position:absolute;top:-30px;margin-left:calc(-50% + 16px);display:block;white-space:nowrap;background-color:rgba(56,67,80,0.9);padding:3px 8px;border-radius:3px;z-index:9;font-weight:400;color:", ";}}", ":not(", "):not(", "),", ":not(", "){& > ", "{background:transparent;}}", "{& > ", "{border-radius:50%;}}&.relative{", ":not(", "):not(", "){& > ", "{font-weight:500;}", ":not(", "):not(", "){& > ", "{background-color:", ";}& > ", "{color:", ";}}}"], DaySelectorPrefix, DaySelectorPrefix, DayBackground, DayBackground, daySelector('selected'), DayText, daySelector('entered-start'), daySelector('entered-end'), DayForeground, function (props) {
31
31
  return props.theme.palette['blue-300'];
32
32
  }, DayBackground, function (props) {
33
33
  return props.theme.palette['blue-100'];
@@ -1,9 +1,8 @@
1
1
  import * as React from 'react';
2
- import { MonthPickerProps, MonthPickerState } from './MonthPicker.types';
3
- export default class MonthPicker extends React.PureComponent<MonthPickerProps, MonthPickerState> {
4
- state: MonthPickerState;
5
- getSnapshotBeforeUpdate(prevProps: Readonly<MonthPickerProps>): null;
6
- handleLongPrev: () => void;
7
- handleLongNext: () => void;
8
- render(): React.ReactNode;
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 { MonthPicker as default };
135
+ export default injectIntl(MonthPicker);
@@ -1,8 +1,10 @@
1
+ import { IntlShape } from 'react-intl';
1
2
  export declare type MonthPickerProps = {
2
3
  min?: Date;
3
4
  max?: Date;
4
5
  value: Date;
5
6
  onChange: (date: Date) => void;
7
+ intl: IntlShape;
6
8
  };
7
9
  export declare type MonthPickerState = {
8
10
  cursor: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-date-picker",
3
- "version": "0.9.6",
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.12",
36
+ "@synerise/ds-button": "^0.17.13",
37
37
  "@synerise/ds-core": "^0.39.7",
38
- "@synerise/ds-icon": "^0.54.0",
39
- "@synerise/ds-time-picker": "^0.7.5",
40
- "@synerise/ds-tooltip": "^0.13.0",
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": "a81aad1ee5bb7249f069115cab0ec06b66ab12b0"
51
+ "gitHead": "3b8c3b1437ecbdda775a790ac3c27d6b1b6cbf26"
52
52
  }