@hi-ui/dropdown 4.2.0 → 4.2.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 +6 -0
- package/lib/cjs/use-dropdown.js +2 -0
- package/lib/esm/use-dropdown.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hi-ui/dropdown
|
|
2
2
|
|
|
3
|
+
## 4.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2934](https://github.com/XiaoMi/hiui/pull/2934) [`cafc0a56b`](https://github.com/XiaoMi/hiui/commit/cafc0a56b2630ab145fceeea4838b7914bbd8da1) Thanks [@xiamiao1121](https://github.com/xiamiao1121)! - fix: 修复 overlay={{className: 'xx'}} 不生效问题
|
|
8
|
+
|
|
3
9
|
## 4.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/lib/cjs/use-dropdown.js
CHANGED
|
@@ -128,12 +128,14 @@ var useDropdown = function useDropdown(props) {
|
|
|
128
128
|
if (ref === void 0) {
|
|
129
129
|
ref = null;
|
|
130
130
|
}
|
|
131
|
+
var _a;
|
|
131
132
|
var menuParents = parents.concat(triggerElementRef);
|
|
132
133
|
var menuProps = Object.assign(Object.assign({}, props), {
|
|
133
134
|
ref: reactUtils.mergeRefs(popperElementRef, ref),
|
|
134
135
|
parents: menuParents,
|
|
135
136
|
style: Object.assign(Object.assign({}, props.style), (_Object$assign = {}, _Object$assign[classname.getPrefixStyleVar('dropdown-menu-width')] = typeAssertion.isNumeric(width) ? width + 'px' : width, _Object$assign)),
|
|
136
137
|
overlay: Object.assign(Object.assign(Object.assign({}, overlay), props.overlay), {
|
|
138
|
+
className: (_a = props.overlay.className) !== null && _a !== void 0 ? _a : overlay === null || overlay === void 0 ? void 0 : overlay.className,
|
|
137
139
|
closeOnOutsideClick: true,
|
|
138
140
|
visible: menuVisible,
|
|
139
141
|
attachEl: triggerElementRef.current,
|
package/lib/esm/use-dropdown.js
CHANGED
|
@@ -123,12 +123,14 @@ var useDropdown = function useDropdown(props) {
|
|
|
123
123
|
if (ref === void 0) {
|
|
124
124
|
ref = null;
|
|
125
125
|
}
|
|
126
|
+
var _a;
|
|
126
127
|
var menuParents = parents.concat(triggerElementRef);
|
|
127
128
|
var menuProps = Object.assign(Object.assign({}, props), {
|
|
128
129
|
ref: mergeRefs(popperElementRef, ref),
|
|
129
130
|
parents: menuParents,
|
|
130
131
|
style: Object.assign(Object.assign({}, props.style), (_Object$assign = {}, _Object$assign[getPrefixStyleVar('dropdown-menu-width')] = isNumeric(width) ? width + 'px' : width, _Object$assign)),
|
|
131
132
|
overlay: Object.assign(Object.assign(Object.assign({}, overlay), props.overlay), {
|
|
133
|
+
className: (_a = props.overlay.className) !== null && _a !== void 0 ? _a : overlay === null || overlay === void 0 ? void 0 : overlay.className,
|
|
132
134
|
closeOnOutsideClick: true,
|
|
133
135
|
visible: menuVisible,
|
|
134
136
|
attachEl: triggerElementRef.current,
|