@hi-ui/dropdown 4.2.2 → 5.0.0-alpha.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.
- package/CHANGELOG.md +43 -0
- package/lib/cjs/Dropdown.js +4 -3
- package/lib/cjs/styles/index.scss.js +1 -1
- package/lib/esm/Dropdown.js +4 -3
- package/lib/esm/styles/index.scss.js +1 -1
- package/package.json +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @hi-ui/dropdown
|
|
2
2
|
|
|
3
|
+
## 5.0.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 1b05b44a4: feat: 组件的 package.json 中的 exports 统一加上 types 配置 (5.0)
|
|
8
|
+
- de7f92b26: style(dropdown): 下拉框带边框&圆角改为 6px&size 改为只有 md 尺寸 (5.0)
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 0cd15438e: style: 修改样式问题 (5.0)
|
|
13
|
+
- 8116f0304: fix: 修改 UI 问题 (5.0)
|
|
14
|
+
- 36bb992d3: style: 修改 UI 问题 (5.0)
|
|
15
|
+
- 8b98ebeaa: style(dropdown): 增加下拉菜单的最大高度和垂直溢出处理 (5.0)
|
|
16
|
+
- 61d132802: build: 将 package.json 中 exports 配置中的 types 配置放在最上面 (5.0)
|
|
17
|
+
- Updated dependencies [dfff90e7c]
|
|
18
|
+
- Updated dependencies [5de7a848b]
|
|
19
|
+
- Updated dependencies [1b05b44a4]
|
|
20
|
+
- Updated dependencies [67960d871]
|
|
21
|
+
- Updated dependencies [de7f92b26]
|
|
22
|
+
- Updated dependencies [8116f0304]
|
|
23
|
+
- Updated dependencies [9fa354f31]
|
|
24
|
+
- Updated dependencies [77ed66eac]
|
|
25
|
+
- Updated dependencies [61d132802]
|
|
26
|
+
- Updated dependencies [489b27cb3]
|
|
27
|
+
- Updated dependencies [6eac4b78b]
|
|
28
|
+
- Updated dependencies [bcd3d08dd]
|
|
29
|
+
- Updated dependencies [4fb586f6f]
|
|
30
|
+
- Updated dependencies [c125e4c48]
|
|
31
|
+
- Updated dependencies [b7ad460d8]
|
|
32
|
+
- @hi-ui/button@5.0.0-alpha.0
|
|
33
|
+
- @hi-ui/core@5.0.0-alpha.0
|
|
34
|
+
- @hi-ui/use-latest@5.0.0-alpha.0
|
|
35
|
+
- @hi-ui/use-timeout@5.0.0-alpha.0
|
|
36
|
+
- @hi-ui/use-toggle@5.0.0-alpha.0
|
|
37
|
+
- @hi-ui/use-unmount-effect@5.0.0-alpha.0
|
|
38
|
+
- @hi-ui/icons@5.0.0-alpha.0
|
|
39
|
+
- @hi-ui/popper@5.0.0-alpha.0
|
|
40
|
+
- @hi-ui/classname@5.0.0-alpha.0
|
|
41
|
+
- @hi-ui/dom-utils@5.0.0-alpha.0
|
|
42
|
+
- @hi-ui/env@5.0.0-alpha.0
|
|
43
|
+
- @hi-ui/react-utils@5.0.0-alpha.0
|
|
44
|
+
- @hi-ui/type-assertion@5.0.0-alpha.0
|
|
45
|
+
|
|
3
46
|
## 4.2.2
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/lib/cjs/Dropdown.js
CHANGED
|
@@ -71,7 +71,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
71
71
|
return treeData.map(function (item) {
|
|
72
72
|
var menu = typeAssertion.isArrayNonEmpty(item.children) ? ( /*#__PURE__*/React__default["default"].createElement(DropdownMenu, {
|
|
73
73
|
overlay: {
|
|
74
|
-
gutterGap:
|
|
74
|
+
gutterGap: 8
|
|
75
75
|
},
|
|
76
76
|
size: size
|
|
77
77
|
}, dig(item.children))) : null;
|
|
@@ -132,7 +132,8 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
132
132
|
}, rootProps), renderButton(), typeAssertion.isArrayNonEmpty(transformedData) ? ( /*#__PURE__*/React__default["default"].createElement(DropdownMenu, Object.assign({}, getMenuProps({
|
|
133
133
|
overlay: {
|
|
134
134
|
disabledPortal: false,
|
|
135
|
-
className: overlayClassName
|
|
135
|
+
className: overlayClassName,
|
|
136
|
+
gutterGap: 4
|
|
136
137
|
}
|
|
137
138
|
}), {
|
|
138
139
|
size: size
|
|
@@ -202,7 +203,7 @@ var DropdownMenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
202
203
|
className: cls
|
|
203
204
|
}, rootProps), /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
204
205
|
className: prefixCls + "__trigger"
|
|
205
|
-
}, getTriggerProps()), shouldUseLink ? ( /*#__PURE__*/React__default["default"].createElement("a", {
|
|
206
|
+
}, menu ? getTriggerProps() : {}), shouldUseLink ? ( /*#__PURE__*/React__default["default"].createElement("a", {
|
|
206
207
|
className: prefixCls + "__link",
|
|
207
208
|
href: href,
|
|
208
209
|
target: target
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
var css_248z = ".hi-
|
|
15
|
+
var css_248z = ".hi-v5-dropdown {display: inline-block;}.hi-v5-dropdown-menu {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;background-color: var(--hi-v5-color-static-white, #fff);border-radius: var(--hi-v5-border-radius-xl, 8px);border: var(--hi-v5-border-size-normal, 1px solid) var(--hi-v5-color-gray-100, #edeff2);font-size: var(--hi-v5-text-size-md, 0.875rem);padding: var(--hi-v5-spacing-2, 4px);color: var(--hi-v5-color-gray-700, #1a1d26);max-height: 268px;overflow-y: auto;width: var(--hi-v5-dropdown-menu-width, 180px);}.hi-v5-dropdown-menu-item {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;list-style: none;margin: 2px 0 0 0;box-sizing: border-box;overflow: visible;}.hi-v5-dropdown-menu-item:first-child {margin-top: 0;}.hi-v5-dropdown-menu-item__link {color: var(--hi-v5-color-gray-700, #1a1d26);width: 100%;text-decoration: none;-webkit-box-sizing: border-box;box-sizing: border-box;}.hi-v5-dropdown-menu-item__arrow {-webkit-transform: rotate(-90deg);transform: rotate(-90deg);}.hi-v5-dropdown-menu-item__trigger {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;height: 100%;cursor: pointer;border-radius: var(--hi-v5-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;}.hi-v5-dropdown-menu--size-lg .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu--size-md .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu--size-sm .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu-item:not(.hi-v5-dropdown-menu-item--disabled) > .hi-v5-dropdown-menu-item__trigger:hover {background-color: var(--hi-v5-color-gray-100, #edeff2);}.hi-v5-dropdown-menu-item--active:not(.hi-v5-dropdown-menu-item--disabled) > .hi-v5-dropdown-menu-item__trigger {background-color: var(--hi-v5-color-gray-100, #edeff2);}.hi-v5-dropdown-menu-item--disabled > .hi-v5-dropdown-menu-item__trigger {cursor: not-allowed;color: var(--hi-v5-color-gray-500, #91959e);}.hi-v5-dropdown-divider {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;list-style: none;background-color: var(--hi-v5-color-gray-200, #e6e8eb);width: 100%;height: 1px;margin: var(--hi-v5-spacing-4, 8px) 0;}";
|
|
16
16
|
var __styleInject__ = require('@hi-ui/style-inject')["default"];
|
|
17
17
|
__styleInject__(css_248z);
|
|
18
18
|
exports["default"] = css_248z;
|
package/lib/esm/Dropdown.js
CHANGED
|
@@ -58,7 +58,7 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
58
58
|
return treeData.map(function (item) {
|
|
59
59
|
var menu = isArrayNonEmpty(item.children) ? ( /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
60
60
|
overlay: {
|
|
61
|
-
gutterGap:
|
|
61
|
+
gutterGap: 8
|
|
62
62
|
},
|
|
63
63
|
size: size
|
|
64
64
|
}, dig(item.children))) : null;
|
|
@@ -119,7 +119,8 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
119
119
|
}, rootProps), renderButton(), isArrayNonEmpty(transformedData) ? ( /*#__PURE__*/React.createElement(DropdownMenu, Object.assign({}, getMenuProps({
|
|
120
120
|
overlay: {
|
|
121
121
|
disabledPortal: false,
|
|
122
|
-
className: overlayClassName
|
|
122
|
+
className: overlayClassName,
|
|
123
|
+
gutterGap: 4
|
|
123
124
|
}
|
|
124
125
|
}), {
|
|
125
126
|
size: size
|
|
@@ -189,7 +190,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
189
190
|
className: cls
|
|
190
191
|
}, rootProps), /*#__PURE__*/React.createElement("div", Object.assign({
|
|
191
192
|
className: prefixCls + "__trigger"
|
|
192
|
-
}, getTriggerProps()), shouldUseLink ? ( /*#__PURE__*/React.createElement("a", {
|
|
193
|
+
}, menu ? getTriggerProps() : {}), shouldUseLink ? ( /*#__PURE__*/React.createElement("a", {
|
|
193
194
|
className: prefixCls + "__link",
|
|
194
195
|
href: href,
|
|
195
196
|
target: target
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import __styleInject__ from '@hi-ui/style-inject';
|
|
11
|
-
var css_248z = ".hi-
|
|
11
|
+
var css_248z = ".hi-v5-dropdown {display: inline-block;}.hi-v5-dropdown-menu {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;background-color: var(--hi-v5-color-static-white, #fff);border-radius: var(--hi-v5-border-radius-xl, 8px);border: var(--hi-v5-border-size-normal, 1px solid) var(--hi-v5-color-gray-100, #edeff2);font-size: var(--hi-v5-text-size-md, 0.875rem);padding: var(--hi-v5-spacing-2, 4px);color: var(--hi-v5-color-gray-700, #1a1d26);max-height: 268px;overflow-y: auto;width: var(--hi-v5-dropdown-menu-width, 180px);}.hi-v5-dropdown-menu-item {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;list-style: none;margin: 2px 0 0 0;box-sizing: border-box;overflow: visible;}.hi-v5-dropdown-menu-item:first-child {margin-top: 0;}.hi-v5-dropdown-menu-item__link {color: var(--hi-v5-color-gray-700, #1a1d26);width: 100%;text-decoration: none;-webkit-box-sizing: border-box;box-sizing: border-box;}.hi-v5-dropdown-menu-item__arrow {-webkit-transform: rotate(-90deg);transform: rotate(-90deg);}.hi-v5-dropdown-menu-item__trigger {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;height: 100%;cursor: pointer;border-radius: var(--hi-v5-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;}.hi-v5-dropdown-menu--size-lg .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu--size-md .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu--size-sm .hi-v5-dropdown-menu-item__trigger {padding: var(--hi-v5-spacing-3, 6px) var(--hi-v5-spacing-4, 8px);}.hi-v5-dropdown-menu-item:not(.hi-v5-dropdown-menu-item--disabled) > .hi-v5-dropdown-menu-item__trigger:hover {background-color: var(--hi-v5-color-gray-100, #edeff2);}.hi-v5-dropdown-menu-item--active:not(.hi-v5-dropdown-menu-item--disabled) > .hi-v5-dropdown-menu-item__trigger {background-color: var(--hi-v5-color-gray-100, #edeff2);}.hi-v5-dropdown-menu-item--disabled > .hi-v5-dropdown-menu-item__trigger {cursor: not-allowed;color: var(--hi-v5-color-gray-500, #91959e);}.hi-v5-dropdown-divider {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;list-style: none;background-color: var(--hi-v5-color-gray-200, #e6e8eb);width: 100%;height: 1px;margin: var(--hi-v5-spacing-4, 8px) 0;}";
|
|
12
12
|
__styleInject__(css_248z);
|
|
13
13
|
export { css_248z as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/dropdown",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.0",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"typings": "lib/types/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"types": "./lib/types/index.d.ts",
|
|
22
23
|
"require": "./lib/cjs/index.js",
|
|
23
24
|
"default": "./lib/esm/index.js"
|
|
24
25
|
}
|
|
@@ -43,27 +44,27 @@
|
|
|
43
44
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@hi-ui/button": "^
|
|
47
|
-
"@hi-ui/classname": "^
|
|
48
|
-
"@hi-ui/dom-utils": "^
|
|
49
|
-
"@hi-ui/env": "^
|
|
50
|
-
"@hi-ui/icons": "^
|
|
51
|
-
"@hi-ui/popper": "^
|
|
52
|
-
"@hi-ui/react-utils": "^
|
|
53
|
-
"@hi-ui/type-assertion": "^
|
|
54
|
-
"@hi-ui/use-latest": "^
|
|
55
|
-
"@hi-ui/use-timeout": "^
|
|
56
|
-
"@hi-ui/use-toggle": "^
|
|
57
|
-
"@hi-ui/use-unmount-effect": "^
|
|
47
|
+
"@hi-ui/button": "^5.0.0-alpha.0",
|
|
48
|
+
"@hi-ui/classname": "^5.0.0-alpha.0",
|
|
49
|
+
"@hi-ui/dom-utils": "^5.0.0-alpha.0",
|
|
50
|
+
"@hi-ui/env": "^5.0.0-alpha.0",
|
|
51
|
+
"@hi-ui/icons": "^5.0.0-alpha.0",
|
|
52
|
+
"@hi-ui/popper": "^5.0.0-alpha.0",
|
|
53
|
+
"@hi-ui/react-utils": "^5.0.0-alpha.0",
|
|
54
|
+
"@hi-ui/type-assertion": "^5.0.0-alpha.0",
|
|
55
|
+
"@hi-ui/use-latest": "^5.0.0-alpha.0",
|
|
56
|
+
"@hi-ui/use-timeout": "^5.0.0-alpha.0",
|
|
57
|
+
"@hi-ui/use-toggle": "^5.0.0-alpha.0",
|
|
58
|
+
"@hi-ui/use-unmount-effect": "^5.0.0-alpha.0"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
|
-
"@hi-ui/core": ">=
|
|
61
|
+
"@hi-ui/core": ">=5.0.0-alpha.0",
|
|
61
62
|
"react": ">=16.8.6",
|
|
62
63
|
"react-dom": ">=16.8.6"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@hi-ui/core": "^
|
|
66
|
-
"@hi-ui/core-css": "^
|
|
66
|
+
"@hi-ui/core": "^5.0.0-alpha.0",
|
|
67
|
+
"@hi-ui/core-css": "^5.0.0-alpha.0",
|
|
67
68
|
"react": "^17.0.1",
|
|
68
69
|
"react-dom": "^17.0.1"
|
|
69
70
|
}
|