rsuite 5.70.3 → 5.71.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.
@@ -101,15 +101,15 @@ export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, Form
101
101
  */
102
102
  shouldDisableSecond?: (second: number, date: Date) => boolean;
103
103
  /**
104
- * Hidden hours on the time view
104
+ * Hide specific hour options
105
105
  */
106
106
  hideHours?: (hour: number, date: Date) => boolean;
107
107
  /**
108
- * Hidden minutes on the time view
108
+ * Hide specific minute options
109
109
  */
110
110
  hideMinutes?: (minute: number, date: Date) => boolean;
111
111
  /**
112
- * Hidden seconds on the time view
112
+ * Hide specific second options
113
113
  */
114
114
  hideSeconds?: (second: number, date: Date) => boolean;
115
115
  /**
@@ -97,6 +97,18 @@ export interface DateRangePickerProps extends PickerBaseProps<DateRangePickerLoc
97
97
  * @version 5.69.0
98
98
  */
99
99
  calendarSnapping?: boolean;
100
+ /**
101
+ * Hide specific hour options
102
+ */
103
+ hideHours?: (hour: number, date: Date) => boolean;
104
+ /**
105
+ * Hide specific minute options
106
+ */
107
+ hideMinutes?: (minute: number, date: Date) => boolean;
108
+ /**
109
+ * Hide specific second options
110
+ */
111
+ hideSeconds?: (second: number, date: Date) => boolean;
100
112
  /**
101
113
  * Disabled date
102
114
  * @deprecated Use {@link shouldDisableDate} instead
@@ -3,7 +3,7 @@ import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTempla
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  var _templateObject, _templateObject2;
6
- var _excluded = ["as", "classPrefix", "className", "appearance", "editable", "cleanable", "character", "calendarSnapping", "defaultCalendarValue", "defaultValue", "plaintext", "disabled", "disabledDate", "shouldDisableDate", "format", "hoverRange", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "readOnly", "showOneCalendar", "showWeekNumbers", "showMeridian", "showHeader", "style", "size", "caretAs", "value", "monthDropdownProps", "onChange", "onClean", "onEnter", "onExit", "onOk", "onSelect", "onShortcutClick", "renderTitle", "renderValue"];
6
+ var _excluded = ["as", "classPrefix", "className", "appearance", "editable", "cleanable", "character", "calendarSnapping", "defaultCalendarValue", "defaultValue", "plaintext", "disabled", "disabledDate", "shouldDisableDate", "format", "hoverRange", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "readOnly", "showOneCalendar", "showWeekNumbers", "showMeridian", "showHeader", "style", "size", "caretAs", "value", "monthDropdownProps", "hideHours", "hideMinutes", "hideSeconds", "onChange", "onClean", "onEnter", "onExit", "onOk", "onSelect", "onShortcutClick", "renderTitle", "renderValue"];
7
7
  import React, { useEffect, useRef, useState, useMemo } from 'react';
8
8
  import isNil from 'lodash/isNil';
9
9
  import omit from 'lodash/omit';
@@ -89,6 +89,9 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
89
89
  caretAsProp = props.caretAs,
90
90
  valueProp = props.value,
91
91
  monthDropdownProps = props.monthDropdownProps,
92
+ hideHours = props.hideHours,
93
+ hideMinutes = props.hideMinutes,
94
+ hideSeconds = props.hideSeconds,
92
95
  onChange = props.onChange,
93
96
  onClean = props.onClean,
94
97
  onEnter = props.onEnter,
@@ -624,6 +627,9 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
624
627
  value: selectedDates,
625
628
  monthDropdownProps: monthDropdownProps,
626
629
  hoverRangeValue: hoverDateRange !== null && hoverDateRange !== void 0 ? hoverDateRange : undefined,
630
+ hideHours: hideHours,
631
+ hideMinutes: hideMinutes,
632
+ hideSeconds: hideSeconds,
627
633
  disabledDate: disableCalendarDate,
628
634
  onSelect: handleSelectDate,
629
635
  onChangeCalendarMonth: onChangeCalendarMonth,
@@ -818,6 +824,9 @@ DateRangePicker.propTypes = _extends({}, pickerPropTypes, {
818
824
  defaultCalendarValue: PropTypes.arrayOf(PropTypes.instanceOf(Date)),
819
825
  hoverRange: PropTypes.oneOfType([oneOf(['week', 'month']), PropTypes.func]),
820
826
  format: PropTypes.string,
827
+ hideHours: PropTypes.func,
828
+ hideMinutes: PropTypes.func,
829
+ hideSeconds: PropTypes.func,
821
830
  isoWeek: PropTypes.bool,
822
831
  weekStart: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]),
823
832
  oneTap: PropTypes.bool,
@@ -33,7 +33,8 @@ export default function useFormValidate(_formError, props) {
33
33
  var errorCount = 0;
34
34
  var model = getCombinedModel();
35
35
  var checkField = function checkField(key, type, value, formErrorObj) {
36
- var checkResult = type.check(value);
36
+ model.setSchemaOptionsForAllType(formValue || {});
37
+ var checkResult = type.check(value, formValue, key);
37
38
  if (checkResult.hasError === true) {
38
39
  errorCount += 1;
39
40
  formErrorObj[key] = (checkResult === null || checkResult === void 0 ? void 0 : checkResult.errorMessage) || checkResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.70.3",
3
+ "version": "5.71.0",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",