rsuite 5.77.0 → 5.77.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [5.77.1](https://github.com/rsuite/rsuite/compare/v5.77.0...v5.77.1) (2025-02-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **DateRangePicker:** allow ranges option value to be null ([#4141](https://github.com/rsuite/rsuite/issues/4141)) ([32017c4](https://github.com/rsuite/rsuite/commit/32017c4429d15e9d3ca881b0e59e9d63bb89427a))
7
+ * **Dropdown:** prevent focus moving to first item when focusing on disabled item ([#4142](https://github.com/rsuite/rsuite/issues/4142)) ([caa4a9a](https://github.com/rsuite/rsuite/commit/caa4a9adad08f69fb09f226a99c17a6becb58041))
8
+ * **Form:** validation for nested array fields ([#4139](https://github.com/rsuite/rsuite/issues/4139)) ([dbf15cb](https://github.com/rsuite/rsuite/commit/dbf15cb5232c25d54c691411884c2aad0583bedd))
9
+ * prevent duplicate className in DatePicker and DateRangePicker components ([#4140](https://github.com/rsuite/rsuite/issues/4140)) ([fa3f40d](https://github.com/rsuite/rsuite/commit/fa3f40d30752a4af5a6d463c65d1df70adf9a74a))
10
+
11
+
12
+
1
13
  # [5.77.0](https://github.com/rsuite/rsuite/compare/v5.76.3...v5.77.0) (2025-01-21)
2
14
 
3
15
 
@@ -1448,7 +1448,6 @@
1448
1448
  color: #717273;
1449
1449
  color: var(--rs-text-disabled);
1450
1450
  cursor: not-allowed;
1451
- pointer-events: none;
1452
1451
  }
1453
1452
  .rs-dropdown-item-disabled .rs-text {
1454
1453
  color: #717273;
@@ -173,7 +173,6 @@
173
173
  &-disabled {
174
174
  color: var(--rs-text-disabled);
175
175
  cursor: @cursor-disabled;
176
- pointer-events: none;
177
176
 
178
177
  .rs-text {
179
178
  color: var(--rs-text-disabled);
@@ -1491,7 +1491,6 @@
1491
1491
  color: #717273;
1492
1492
  color: var(--rs-text-disabled);
1493
1493
  cursor: not-allowed;
1494
- pointer-events: none;
1495
1494
  }
1496
1495
  .rs-dropdown-item-disabled .rs-text {
1497
1496
  color: #717273;
@@ -1491,7 +1491,6 @@
1491
1491
  color: #717273;
1492
1492
  color: var(--rs-text-disabled);
1493
1493
  cursor: not-allowed;
1494
- pointer-events: none;
1495
1494
  }
1496
1495
  .rs-dropdown-item-disabled .rs-text {
1497
1496
  color: #717273;
@@ -1491,7 +1491,6 @@
1491
1491
  color: #717273;
1492
1492
  color: var(--rs-text-disabled);
1493
1493
  cursor: not-allowed;
1494
- pointer-events: none;
1495
1494
  }
1496
1495
  .rs-dropdown-item-disabled .rs-text {
1497
1496
  color: #717273;
@@ -436,6 +436,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
436
436
  };
437
437
  var hasValue = (0, _date.isValid)(value);
438
438
  var _usePickerClassName = (0, _Picker.usePickerClassName)((0, _extends2.default)({}, props, {
439
+ className: className,
439
440
  classPrefix: classPrefix,
440
441
  name: 'date',
441
442
  appearance: appearance,
@@ -491,7 +492,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
491
492
  onExit: (0, _utils2.createChainedFunction)(events.onInactive, onExit),
492
493
  speaker: renderCalendarOverlay
493
494
  }, /*#__PURE__*/_react.default.createElement(Component, {
494
- className: merge(className, classes, (_merge = {}, _merge[prefix('error')] = invalidValue, _merge)),
495
+ className: merge(classes, (_merge = {}, _merge[prefix('error')] = invalidValue, _merge)),
495
496
  style: style,
496
497
  ref: root
497
498
  }, plaintext ? /*#__PURE__*/_react.default.createElement(_DateInput.default, {
@@ -3,11 +3,11 @@ export type ToolbarValue = Date | [Date?, Date?];
3
3
  export interface RangeType<T> {
4
4
  label: ReactNode;
5
5
  closeOverlay?: boolean;
6
- value: T | ((value: T) => T);
6
+ value: T | ((value: T) => T) | null;
7
7
  placement?: 'bottom' | 'left';
8
8
  }
9
9
  export interface InnerRange<T> extends Omit<RangeType<T>, 'value'> {
10
- value: T;
10
+ value: T | null;
11
11
  }
12
12
  export interface DeprecatedProps {
13
13
  /**
@@ -592,6 +592,9 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
592
592
  if (selectedDates === void 0) {
593
593
  selectedDates = [];
594
594
  }
595
+ if (selectedDates === null) {
596
+ return false;
597
+ }
595
598
  var _selectedDates = selectedDates,
596
599
  startDate = _selectedDates[0],
597
600
  endDate = _selectedDates[1];
@@ -747,6 +750,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
747
750
  var hasValue = !(0, _isNil.default)(value) && value.length > 1;
748
751
  var _usePickerClassName = (0, _Picker.usePickerClassName)((0, _extends2.default)({}, props, {
749
752
  classPrefix: classPrefix,
753
+ className: className,
750
754
  name: 'daterange',
751
755
  appearance: appearance,
752
756
  hasValue: hasValue,
@@ -818,7 +822,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
818
822
  speaker: renderCalendarOverlay
819
823
  }, /*#__PURE__*/_react.default.createElement(Component, {
820
824
  ref: root,
821
- className: merge(className, classes, (_merge = {}, _merge[prefix('error')] = invalidValue, _merge)),
825
+ className: merge(classes, (_merge = {}, _merge[prefix('error')] = invalidValue, _merge)),
822
826
  style: style
823
827
  }, plaintext ? /*#__PURE__*/_react.default.createElement(_DateRangeInput.default, {
824
828
  value: value,
@@ -1,13 +1,8 @@
1
- import React from 'react';
2
1
  import { DATERANGE_DISABLED_TARGET } from '../internals/constants';
3
- export type ValueType = [Date?, Date?];
2
+ import type { RangeType as DatePickerRangeType } from '../DatePicker/types';
3
+ export type ValueType = [Date?, Date?] | null;
4
4
  export type DateRange = [Date, Date];
5
- export interface RangeType<T = DateRange> {
6
- label: React.ReactNode;
7
- value: T | ((value?: T) => T);
8
- closeOverlay?: boolean;
9
- placement?: 'bottom' | 'left';
10
- }
5
+ export type RangeType<T = DateRange> = DatePickerRangeType<T>;
11
6
  export type DisabledDateFunction = (
12
7
  /**
13
8
  * Date used to determine if disabling is required.
@@ -37,7 +37,10 @@ function Menubar(_ref) {
37
37
  if ((0, _utils.isFocusEntering)(event) &&
38
38
  // Skip if focus is moving to a focusable element within this menu
39
39
  !(event.target !== event.currentTarget && (0, _utils.isFocusableElement)(event.target))) {
40
- if (activeItemIndex === null) {
40
+ var disabled = event.target.getAttribute('aria-disabled');
41
+
42
+ // Skip if the item is disabled
43
+ if (activeItemIndex === null && disabled !== 'true') {
41
44
  dispatch({
42
45
  type: _MenuContext.MenuActionTypes.MoveFocus,
43
46
  to: _MenuContext.MoveFocusTo.First
@@ -5420,7 +5420,6 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
5420
5420
  color: #717273;
5421
5421
  color: var(--rs-text-disabled);
5422
5422
  cursor: not-allowed;
5423
- pointer-events: none;
5424
5423
  }
5425
5424
  .rs-dropdown-item-disabled .rs-text {
5426
5425
  color: #717273;