rsuite 5.23.0 → 5.23.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 +7 -0
- package/cjs/AutoComplete/AutoComplete.js +9 -2
- package/cjs/MultiCascader/utils.js +3 -3
- package/dist/rsuite.js +2 -2
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/AutoComplete/AutoComplete.js +9 -3
- package/esm/MultiCascader/utils.js +3 -3
- package/package.json +1 -1
|
@@ -3,8 +3,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React, { useState, useRef, useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import pick from 'lodash/pick';
|
|
6
|
+
import omit from 'lodash/omit';
|
|
6
7
|
import Input from '../Input';
|
|
7
|
-
import { useClassNames, useControlled, PLACEMENT, mergeRefs, useIsMounted } from '../utils';
|
|
8
|
+
import { useClassNames, useControlled, PLACEMENT, mergeRefs, useIsMounted, partitionHTMLProps } from '../utils';
|
|
8
9
|
import { animationPropTypes } from '../Animation/utils';
|
|
9
10
|
import { PickerToggleTrigger, onMenuKeyDown, DropdownMenu, DropdownMenuItem, PickerOverlay, useFocusItemValue, usePublicMethods, pickTriggerPropKeys } from '../Picker';
|
|
10
11
|
import { transformData, shouldDisplay } from './utils';
|
|
@@ -157,6 +158,11 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
157
158
|
disabled: disabled
|
|
158
159
|
}));
|
|
159
160
|
var triggerRef = useRef(null);
|
|
161
|
+
|
|
162
|
+
var _partitionHTMLProps = partitionHTMLProps(omit(rest, pickTriggerPropKeys)),
|
|
163
|
+
htmlInputProps = _partitionHTMLProps[0],
|
|
164
|
+
restProps = _partitionHTMLProps[1];
|
|
165
|
+
|
|
160
166
|
usePublicMethods(ref, {
|
|
161
167
|
triggerRef: triggerRef,
|
|
162
168
|
overlayRef: overlayRef
|
|
@@ -198,10 +204,10 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
198
204
|
trigger: ['click', 'focus'],
|
|
199
205
|
open: open || focus && hasItems,
|
|
200
206
|
speaker: renderDropdownMenu
|
|
201
|
-
}, /*#__PURE__*/React.createElement(Component, {
|
|
207
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
202
208
|
className: classes,
|
|
203
209
|
style: style
|
|
204
|
-
}, /*#__PURE__*/React.createElement(Input, _extends({},
|
|
210
|
+
}, restProps), /*#__PURE__*/React.createElement(Input, _extends({}, htmlInputProps, {
|
|
205
211
|
id: id,
|
|
206
212
|
disabled: disabled,
|
|
207
213
|
value: value,
|
|
@@ -162,7 +162,7 @@ export var removeAllChildrenValue = function removeAllChildrenValue(value, item,
|
|
|
162
162
|
export function useFlattenData(data, itemKeys) {
|
|
163
163
|
var childrenKey = itemKeys.childrenKey;
|
|
164
164
|
|
|
165
|
-
var _useState = useState(flattenTree(data)),
|
|
165
|
+
var _useState = useState(flattenTree(data, itemKeys.childrenKey)),
|
|
166
166
|
flattenData = _useState[0],
|
|
167
167
|
setFlattenData = _useState[1];
|
|
168
168
|
|
|
@@ -174,8 +174,8 @@ export function useFlattenData(data, itemKeys) {
|
|
|
174
174
|
setFlattenData([].concat(flattenData, nodes));
|
|
175
175
|
}, [childrenKey, flattenData]);
|
|
176
176
|
useEffect(function () {
|
|
177
|
-
setFlattenData(flattenTree(data));
|
|
178
|
-
}, [data]);
|
|
177
|
+
setFlattenData(flattenTree(data, itemKeys.childrenKey));
|
|
178
|
+
}, [data, itemKeys.childrenKey]);
|
|
179
179
|
return {
|
|
180
180
|
addFlattenData: addFlattenData,
|
|
181
181
|
flattenData: flattenData
|