rsuite 5.16.2 → 5.16.3

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.
@@ -566,6 +566,11 @@ var CheckTreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
566
566
  var visibleChildren = _isUndefined(searchKeywordState) || searchKeywordState.length === 0 ? !!children : hasVisibleChildren(node, childrenKey);
567
567
 
568
568
  var nodeProps = _extends({}, getTreeNodeProps(_extends({}, node, {
569
+ /**
570
+ * spread operator dont copy unenumerable properties
571
+ * so we need to copy them manually
572
+ */
573
+ parent: node.parent,
569
574
  expand: expand
570
575
  }), layer), {
571
576
  hasChildren: visibleChildren
@@ -5,7 +5,7 @@ import { PickerToggleProps } from '../Picker';
5
5
  import { FormControlBaseProps, PickerBaseProps, RsRefForwardingComponent } from '../@types/common';
6
6
  export type { RangeType } from './Toolbar';
7
7
  export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null>, Pick<PickerToggleProps, 'caretAs' | 'readOnly' | 'plaintext'> {
8
- /** Configure shortcut options */
8
+ /** Predefined date Ranges */
9
9
  ranges?: RangeType<Date>[];
10
10
  /** Calendar panel default presentation date and time */
11
11
  calendarDefaultDate?: Date;
@@ -80,7 +80,7 @@ var Toolbar = /*#__PURE__*/React.forwardRef(function (props, ref) {
80
80
  return;
81
81
  }
82
82
 
83
- onClickShortcut === null || onClickShortcut === void 0 ? void 0 : onClickShortcut(value, closeOverlay !== null && closeOverlay !== void 0 ? closeOverlay : false, event);
83
+ onClickShortcut === null || onClickShortcut === void 0 ? void 0 : onClickShortcut(value, closeOverlay !== false ? true : false, event);
84
84
  };
85
85
 
86
86
  return /*#__PURE__*/React.createElement(Button, {
@@ -3,7 +3,7 @@ import { FormControlBaseProps, PickerBaseProps } from '../@types/common';
3
3
  import { PickerComponent, PickerToggleProps } from '../Picker';
4
4
  import { DisabledDateFunction, RangeType, DateRange } from './types';
5
5
  export interface DateRangePickerProps extends PickerBaseProps, FormControlBaseProps<DateRange | null>, Pick<PickerToggleProps, 'caretAs' | 'readOnly' | 'plaintext'> {
6
- /** Configure shortcut options */
6
+ /** Predefined date ranges */
7
7
  ranges?: RangeType[];
8
8
  /** Format date */
9
9
  format?: string;
@@ -19,7 +19,7 @@ export interface DropdownMenuProps<Multiple = false> extends StandardProps, Omit
19
19
  rowHeight?: number;
20
20
  rowGroupHeight?: number;
21
21
  virtualized?: boolean;
22
- listProps?: ListProps;
22
+ listProps?: Partial<ListProps>;
23
23
  /** Custom selected option */
24
24
  renderMenuItem?: (itemLabel: React.ReactNode, item: any) => React.ReactNode;
25
25
  renderMenuGroup?: (title: React.ReactNode, item: any) => React.ReactNode;
@@ -1,8 +1,8 @@
1
1
  import React, { Ref } from 'react';
2
2
  import { PickerLocale } from '../locales';
3
3
  import { PickerInstance, PickerToggleProps } from '../Picker';
4
+ import { ListProps } from '../Picker/VirtualizedList';
4
5
  import { FormControlPickerProps, ItemDataType } from '../@types/common';
5
- import { ListProps } from 'react-virtualized/dist/commonjs/List';
6
6
  export interface SelectProps<T> {
7
7
  /** Set group condition key in data */
8
8
  groupBy?: string;
@@ -14,7 +14,7 @@ export interface SelectProps<T> {
14
14
  * List-related properties in `react-virtualized`
15
15
  * https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types
16
16
  */
17
- listProps?: ListProps;
17
+ listProps?: Partial<ListProps>;
18
18
  /** Custom search rules. */
19
19
  searchBy?: (keyword: string, label: React.ReactNode, item: ItemDataType) => boolean;
20
20
  /** Sort options */
@@ -85,4 +85,13 @@ React.createElement(SelectPicker, {
85
85
  return /*#__PURE__*/React.createElement("div", null);
86
86
  },
87
87
  data: []
88
+ }); // Override the default value of listProps.
89
+
90
+ /*#__PURE__*/
91
+ React.createElement(SelectPicker, {
92
+ data: [],
93
+ virtualized: true,
94
+ listProps: {
95
+ rowHeight: 70
96
+ }
88
97
  });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { StandardProps, ItemDataType, RsRefForwardingComponent } from '../@types/common';
3
- import { ListProps } from 'react-virtualized/dist/commonjs/List';
3
+ import { ListProps } from '../Picker/VirtualizedList';
4
4
  /**
5
5
  * Tree Node Drag Type
6
6
  */
@@ -50,7 +50,7 @@ export interface TreeBaseProps<ValueType = string | number, ItemDataType = Recor
50
50
  * List-related properties in `react-virtualized`
51
51
  * https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types
52
52
  */
53
- listProps?: ListProps;
53
+ listProps?: Partial<ListProps>;
54
54
  /** Expand all nodes By default */
55
55
  defaultExpandAll?: boolean;
56
56
  /** searchKeyword (Controlled) */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import Tree from '../Tree'; // Override the default value of listProps.
3
+
4
+ /*#__PURE__*/
5
+ React.createElement(Tree, {
6
+ data: [],
7
+ virtualized: true,
8
+ listProps: {
9
+ rowHeight: 70
10
+ }
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.16.2",
3
+ "version": "5.16.3",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",