rsuite 5.31.0 → 5.31.1

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import Calendar from './CalendarContainer';
2
+ import CalendarContainer from './CalendarContainer';
3
3
  import { CalendarLocale } from '../locales';
4
4
  import { RsRefForwardingComponent, WithAsProps } from '../@types/common';
5
5
  export interface CalendarProps extends WithAsProps {
@@ -24,5 +24,5 @@ export interface CalendarProps extends WithAsProps {
24
24
  /** Custom render calendar cells */
25
25
  renderCell?: (date: Date) => React.ReactNode;
26
26
  }
27
- declare const CalendarPanel: RsRefForwardingComponent<typeof Calendar, CalendarProps>;
28
- export default CalendarPanel;
27
+ declare const Calendar: RsRefForwardingComponent<typeof CalendarContainer, CalendarProps>;
28
+ export default Calendar;
@@ -3,14 +3,14 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  import React, { useCallback } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import isSameMonth from 'date-fns/isSameMonth';
6
- import Calendar from './CalendarContainer';
6
+ import CalendarContainer from './CalendarContainer';
7
7
  import Button from '../Button';
8
8
  import { FormattedDate } from '../CustomProvider';
9
9
  import { useClassNames, useCustom } from '../utils';
10
10
  import useCalendarDate from './useCalendarDate';
11
- var CalendarPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
+ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
12
12
  var _props$as = props.as,
13
- Component = _props$as === void 0 ? Calendar : _props$as,
13
+ Component = _props$as === void 0 ? CalendarContainer : _props$as,
14
14
  bordered = props.bordered,
15
15
  className = props.className,
16
16
  _props$classPrefix = props.classPrefix,
@@ -95,8 +95,8 @@ var CalendarPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
95
95
  onSelect: handleSelect
96
96
  }));
97
97
  });
98
- CalendarPanel.displayName = 'CalendarPanel';
99
- CalendarPanel.propTypes = {
98
+ Calendar.displayName = 'Calendar';
99
+ Calendar.propTypes = {
100
100
  value: PropTypes.instanceOf(Date),
101
101
  defaultValue: PropTypes.instanceOf(Date),
102
102
  isoWeek: PropTypes.bool,
@@ -109,4 +109,4 @@ CalendarPanel.propTypes = {
109
109
  onSelect: PropTypes.func,
110
110
  renderCell: PropTypes.func
111
111
  };
112
- export default CalendarPanel;
112
+ export default Calendar;
@@ -30,8 +30,6 @@ export interface CalendarProps extends WithAsProps, Omit<HTMLAttributes<HTMLDivE
30
30
  hideSeconds?: (second: number, date: Date) => boolean;
31
31
  /** The value that mouse hover on in range selection */
32
32
  hoverRangeValue?: [Date, Date];
33
- /** Is it in the same month as today */
34
- inSameMonth?: (date: Date) => boolean;
35
33
  /** ISO 8601 standard, each calendar week begins on Monday and Sunday on the seventh day */
36
34
  isoWeek?: boolean;
37
35
  /** Limit showing how many years in the future */
@@ -7,8 +7,8 @@ import MonthDropdown from './MonthDropdown';
7
7
  import TimeDropdown from './TimeDropdown';
8
8
  import CalendarBody from './CalendarBody';
9
9
  import CalendarHeader from './CalendarHeader';
10
- import { useClassNames, composeFunctions } from '../utils';
11
- import { disabledTime, addMonths, shouldRenderDate, shouldRenderTime, shouldRenderMonth, setDate, isSameMonth, calendarOnlyProps, omitHideDisabledProps } from '../utils/dateUtils';
10
+ import { useClassNames } from '../utils';
11
+ import { disabledTime, addMonths, shouldRenderDate, shouldRenderTime, shouldRenderMonth, isSameMonth, calendarOnlyProps, omitHideDisabledProps } from '../utils/dateUtils';
12
12
  import { CalendarProvider } from './CalendarContext';
13
13
  import useCalendarState, { CalendarState } from './useCalendarState';
14
14
  import AngleUpIcon from '@rsuite/icons/legacy/AngleUp';
@@ -25,7 +25,6 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
25
25
  disabledForward = props.disabledForward,
26
26
  format = props.format,
27
27
  hoverRangeValue = props.hoverRangeValue,
28
- inSameMonth = props.inSameMonth,
29
28
  _props$isoWeek = props.isoWeek,
30
29
  isoWeek = _props$isoWeek === void 0 ? false : _props$isoWeek,
31
30
  limitEndYear = props.limitEndYear,
@@ -46,7 +45,7 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
46
45
  showMeridian = props.showMeridian,
47
46
  showWeekNumbers = props.showWeekNumbers,
48
47
  inline = props.inline,
49
- rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "dateRange", "disabledBackward", "defaultState", "disabledDate", "disabledForward", "format", "hoverRangeValue", "inSameMonth", "isoWeek", "limitEndYear", "locale", "onChangeMonth", "onChangeTime", "onMouseMove", "onMoveBackward", "onMoveForward", "onSelect", "onToggleMeridian", "onToggleMonthDropdown", "onToggleTimeDropdown", "calendarDate", "renderCell", "renderTitle", "renderToolbar", "showMeridian", "showWeekNumbers", "inline"]);
48
+ rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "dateRange", "disabledBackward", "defaultState", "disabledDate", "disabledForward", "format", "hoverRangeValue", "isoWeek", "limitEndYear", "locale", "onChangeMonth", "onChangeTime", "onMouseMove", "onMoveBackward", "onMoveForward", "onSelect", "onToggleMeridian", "onToggleMonthDropdown", "onToggleTimeDropdown", "calendarDate", "renderCell", "renderTitle", "renderToolbar", "showMeridian", "showWeekNumbers", "inline"]);
50
49
 
51
50
  var _useClassNames = useClassNames(classPrefix),
52
51
  withClassPrefix = _useClassNames.withClassPrefix,
@@ -106,12 +105,8 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
106
105
  var showTime = calendarState === CalendarState.TIME || onlyShowTime;
107
106
  var showMonth = calendarState === CalendarState.MONTH || onlyShowMonth;
108
107
  var inSameThisMonthDate = useCallback(function (date) {
109
- return composeFunctions(function (d) {
110
- return setDate(d, 1);
111
- }, function (d) {
112
- return isSameMonth(d, date);
113
- })(date);
114
- }, []);
108
+ return isSameMonth(calendarDate, date);
109
+ }, [calendarDate]);
115
110
  var calendarClasses = merge(className, withClassPrefix({
116
111
  'time-view': showTime,
117
112
  'month-view': showMonth,
@@ -129,7 +124,7 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
129
124
  disabledDate: isDisabledDate,
130
125
  format: format,
131
126
  hoverRangeValue: hoverRangeValue,
132
- inSameMonth: inSameMonth !== null && inSameMonth !== void 0 ? inSameMonth : inSameThisMonthDate,
127
+ inSameMonth: inSameThisMonthDate,
133
128
  isoWeek: isoWeek,
134
129
  locale: locale,
135
130
  onChangeMonth: handleChangeMonth,
@@ -140,7 +135,7 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
140
135
  showWeekNumbers: showWeekNumbers,
141
136
  inline: inline
142
137
  };
143
- }, [calendarDate, dateRange, format, handleChangeMonth, hoverRangeValue, inSameMonth, inSameThisMonthDate, inline, isDisabledDate, isoWeek, locale, onChangeTime, onMouseMove, onSelect, renderCell, showWeekNumbers]);
138
+ }, [calendarDate, dateRange, format, handleChangeMonth, hoverRangeValue, inSameThisMonthDate, inline, isDisabledDate, isoWeek, locale, onChangeTime, onMouseMove, onSelect, renderCell, showWeekNumbers]);
144
139
  return /*#__PURE__*/React.createElement(CalendarProvider, {
145
140
  value: contextValue
146
141
  }, /*#__PURE__*/React.createElement(Component, _extends({}, omitHideDisabledProps(rest), {
@@ -186,7 +181,6 @@ CalendarContainer.propTypes = {
186
181
  hideHours: PropTypes.func,
187
182
  hideMinutes: PropTypes.func,
188
183
  hideSeconds: PropTypes.func,
189
- inSameMonth: PropTypes.func,
190
184
  isoWeek: PropTypes.bool,
191
185
  limitEndYear: PropTypes.number,
192
186
  locale: PropTypes.object,
@@ -343,9 +343,6 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
343
343
  };
344
344
  });
345
345
  }, [props]);
346
- var inSameMonth = useCallback(function (date) {
347
- return DateUtils.isSameMonth(date, calendarDate);
348
- }, [calendarDate]);
349
346
  var calendar = /*#__PURE__*/React.createElement(CalendarContainer, _extends({}, calendarProps, {
350
347
  locale: locale,
351
348
  showWeekNumbers: showWeekNumbers,
@@ -357,7 +354,6 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
357
354
  limitEndYear: limitEndYear,
358
355
  format: formatStr,
359
356
  isoWeek: isoWeek,
360
- inSameMonth: inSameMonth,
361
357
  calendarDate: calendarDate,
362
358
  onMoveForward: handleMoveForward,
363
359
  onMoveBackward: handleMoveBackward,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  import PropTypes from 'prop-types';
4
4
  import React, { useCallback } from 'react';
5
- import { addMonths, isSameMonth } from '../utils/dateUtils';
5
+ import { addMonths } from '../utils/dateUtils';
6
6
  import CalendarCore from '../Calendar/CalendarContainer';
7
7
  import { DATERANGE_DISABLED_TARGET } from '../utils';
8
8
  var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -42,9 +42,6 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
42
42
  var handleToggleMeridian = useCallback(function (event) {
43
43
  onToggleMeridian(index, event);
44
44
  }, [index, onToggleMeridian]);
45
- var inSameMonth = useCallback(function (date) {
46
- return isSameMonth(date, calendarDate[index]);
47
- }, [calendarDate, index]);
48
45
  var getCalendarDate = useCallback(function () {
49
46
  return calendarDate[index];
50
47
  }, [calendarDate, index]);
@@ -61,7 +58,6 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
61
58
  format: format,
62
59
  dateRange: value,
63
60
  disabledDate: disabledMonth,
64
- inSameMonth: inSameMonth,
65
61
  index: index,
66
62
  limitEndYear: limitEndYear,
67
63
  onChangeMonth: handleChangeMonth,
@@ -15,7 +15,7 @@ var Calendar = {
15
15
  minutes: 'Минут',
16
16
  seconds: 'Секунд',
17
17
  formattedMonthPattern: 'MMM, yyyy',
18
- formattedDayPattern: 'MMM dd, yyyy',
18
+ formattedDayPattern: 'dd MMM yyyy',
19
19
  dateLocale: ru
20
20
  };
21
21
  export default {
@@ -25,8 +25,8 @@ export default {
25
25
  },
26
26
  Plaintext: {
27
27
  unfilled: 'незаполненной',
28
- notSelected: 'Није изабран',
29
- notUploaded: 'Није отпремљено'
28
+ notSelected: 'Не выбрано',
29
+ notUploaded: 'Не загружено'
30
30
  },
31
31
  Pagination: {
32
32
  more: 'Больше',
@@ -36,7 +36,7 @@ export default {
36
36
  last: 'Последняя',
37
37
  limit: '{0} / страниц',
38
38
  total: 'всего: {0}',
39
- skip: 'Идти к{0}'
39
+ skip: 'Перейти к {0}'
40
40
  },
41
41
  Calendar: Calendar,
42
42
  DatePicker: _extends({}, Calendar),
@@ -55,9 +55,9 @@ export default {
55
55
  },
56
56
  Uploader: {
57
57
  inited: 'Начало',
58
- progress: 'Выгрузка',
58
+ progress: 'Загрузка',
59
59
  error: 'Ошибка',
60
- complete: 'Завершенно',
60
+ complete: 'Завершено',
61
61
  emptyFile: 'Пусто',
62
62
  upload: 'Загрузить'
63
63
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.31.0",
3
+ "version": "5.31.1",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",