@aloudata/aloudata-design 0.1.0-beta1 → 0.1.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/README.md +22 -13
- package/es/Button/demo/Icon/index.d.ts +3 -0
- package/es/Button/demo/Icon/index.js +67 -0
- package/{src → es}/Button/demo/Icon/index.less +0 -0
- package/es/Button/demo/basic/index.d.ts +4 -0
- package/es/Button/demo/basic/index.js +57 -0
- package/{src → es}/Button/demo/basic/index.less +0 -1
- package/es/Button/demo/disable/index.d.ts +3 -0
- package/es/Button/demo/disable/index.js +23 -0
- package/{src → es}/Button/demo/disable/index.less +0 -0
- package/es/Button/demo/href/index.d.ts +2 -0
- package/es/Button/demo/href/index.js +17 -0
- package/es/Button/demo/loading/index.d.ts +3 -0
- package/es/Button/demo/loading/index.js +37 -0
- package/{src → es}/Button/demo/loading/index.less +0 -0
- package/es/Button/index.d.ts +50 -0
- package/es/Button/index.js +108 -0
- package/es/Button/style/index.d.ts +2 -0
- package/es/Button/style/index.js +2 -0
- package/{src → es}/Button/style/index.less +5 -5
- package/es/Dropdown/Button.d.ts +69 -0
- package/es/Dropdown/Button.js +39 -0
- package/es/Dropdown/demo/basic/index.d.ts +4 -0
- package/es/Dropdown/demo/basic/index.js +18 -0
- package/es/Dropdown/demo/button/index.d.ts +3 -0
- package/es/Dropdown/demo/button/index.js +159 -0
- package/{src → es}/Dropdown/demo/button/index.less +0 -0
- package/es/Dropdown/demo/placement/index.d.ts +2 -0
- package/es/Dropdown/demo/placement/index.js +40 -0
- package/es/Dropdown/demo/subMenu/index.d.ts +2 -0
- package/es/Dropdown/demo/subMenu/index.js +42 -0
- package/es/Dropdown/demo/trigger/index.d.ts +2 -0
- package/es/Dropdown/demo/trigger/index.js +17 -0
- package/es/Dropdown/index.d.ts +59 -0
- package/es/Dropdown/index.js +33 -0
- package/es/Dropdown/style/index.d.ts +2 -0
- package/es/Dropdown/style/index.js +2 -0
- package/{src → es}/Dropdown/style/index.less +0 -0
- package/{src → es}/Icon/iconfont/demo.css +0 -0
- package/{src → es}/Icon/iconfont/demo_index.html +49 -3
- package/es/Icon/iconfont/iconfont.css +101 -0
- package/es/Icon/iconfont/iconfont.js +46 -0
- package/{src → es}/Icon/iconfont/iconfont.json +14 -0
- package/es/Icon/iconfont/iconfont.ttf +0 -0
- package/es/Icon/iconfont/iconfont.woff +0 -0
- package/es/Icon/iconfont/iconfont.woff2 +0 -0
- package/es/Icon/index.d.ts +11 -0
- package/es/Icon/index.js +42 -0
- package/{src → es}/Icon/index.less +3 -3
- package/es/Input/components/Group/index.d.ts +15 -0
- package/es/Input/components/Group/index.js +12 -0
- package/es/Input/components/Password/index.d.ts +10 -0
- package/es/Input/components/Password/index.js +20 -0
- package/es/Input/components/TextArea/index.d.ts +52 -0
- package/es/Input/components/TextArea/index.js +14 -0
- package/es/Input/demo/allowClear/index.d.ts +3 -0
- package/es/Input/demo/allowClear/index.js +11 -0
- package/{src → es}/Input/demo/allowClear/index.less +0 -0
- package/es/Input/demo/basic/index.d.ts +4 -0
- package/es/Input/demo/basic/index.js +65 -0
- package/{src → es}/Input/demo/basic/index.less +1 -1
- package/es/Input/demo/gourp/index.d.ts +2 -0
- package/es/Input/demo/gourp/index.js +67 -0
- package/es/Input/demo/password/index.d.ts +3 -0
- package/es/Input/demo/password/index.js +21 -0
- package/{src → es}/Input/demo/password/index.less +0 -0
- package/es/Input/demo/prefix/index.d.ts +3 -0
- package/es/Input/demo/prefix/index.js +17 -0
- package/{src → es}/Input/demo/prefix/index.less +0 -0
- package/es/Input/demo/showCount/index.d.ts +3 -0
- package/es/Input/demo/showCount/index.js +17 -0
- package/{src → es}/Input/demo/showCount/index.less +0 -0
- package/es/Input/demo/textArea/autoSize.d.ts +2 -0
- package/es/Input/demo/textArea/autoSize.js +50 -0
- package/es/Input/index.d.ts +65 -0
- package/es/Input/index.js +46 -0
- package/es/Input/style/index.d.ts +2 -0
- package/es/Input/style/index.js +2 -0
- package/{src → es}/Input/style/index.less +4 -1
- package/es/Menu/Divider.d.ts +5 -0
- package/es/Menu/Divider.js +15 -0
- package/es/Menu/MenuItem.d.ts +17 -0
- package/es/Menu/MenuItem.js +15 -0
- package/es/Menu/SubMenu.d.ts +26 -0
- package/es/Menu/SubMenu.js +29 -0
- package/es/Menu/index.d.ts +20 -0
- package/es/Menu/index.js +31 -0
- package/es/Menu/style/index.d.ts +2 -0
- package/es/Menu/style/index.js +2 -0
- package/{src → es}/Menu/style/index.less +0 -0
- package/es/Select/BaseSelect.d.ts +5 -0
- package/es/Select/BaseSelect.js +400 -0
- package/{src/Select/OptionsList/OptGroup.tsx → es/Select/OptionsList/OptGroup.d.ts} +2 -4
- package/es/Select/OptionsList/OptGroup.js +6 -0
- package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
- package/es/Select/OptionsList/OptionItem/RenderGroup.js +16 -0
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +44 -0
- package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
- package/es/Select/OptionsList/OptionItem/RenderOption.js +79 -0
- package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
- package/es/Select/OptionsList/OptionItem/RenderTooltip.js +25 -0
- package/es/Select/OptionsList/OptionItem.d.ts +4 -0
- package/es/Select/OptionsList/OptionItem.js +4 -0
- package/es/Select/OptionsList/Options.d.ts +7 -0
- package/es/Select/OptionsList/Options.js +6 -0
- package/es/Select/OptionsList/index.d.ts +4 -0
- package/es/Select/OptionsList/index.js +187 -0
- package/es/Select/Selector/index.d.ts +4 -0
- package/es/Select/Selector/index.js +252 -0
- package/es/Select/VirtualList.d.ts +5 -0
- package/es/Select/VirtualList.js +29 -0
- package/es/Select/demo/disabled/index.d.ts +2 -0
- package/es/Select/demo/disabled/index.js +50 -0
- package/es/Select/demo/multiple/index.d.ts +2 -0
- package/es/Select/demo/multiple/index.js +140 -0
- package/es/Select/demo/options/index.d.ts +2 -0
- package/es/Select/demo/options/index.js +55 -0
- package/es/Select/demo/single/index.d.ts +3 -0
- package/es/Select/demo/single/index.js +89 -0
- package/es/Select/demo/single/index.less +5 -0
- package/es/Select/hooks/useCacheOption.d.ts +9 -0
- package/es/Select/hooks/useCacheOption.js +107 -0
- package/es/Select/index.d.ts +12 -0
- package/es/Select/index.js +9 -0
- package/es/Select/interface.d.ts +227 -0
- package/es/Select/interface.js +1 -0
- package/es/Select/style/index.d.ts +2 -0
- package/es/Select/style/index.js +2 -0
- package/{src → es}/Select/style/index.less +3 -10
- package/es/Select/utils.d.ts +21 -0
- package/es/Select/utils.js +193 -0
- package/es/Tabs/TabPane.d.ts +21 -0
- package/es/Tabs/TabPane.js +12 -0
- package/es/Tabs/demo/adaptHeight/index.d.ts +3 -0
- package/es/Tabs/demo/adaptHeight/index.js +19 -0
- package/{src → es}/Tabs/demo/adaptHeight/index.less +0 -0
- package/es/Tabs/demo/basic/index.d.ts +4 -0
- package/es/Tabs/demo/basic/index.js +44 -0
- package/{src → es}/Tabs/demo/basic/index.less +0 -0
- package/es/Tabs/demo/horizontalScroll/index.d.ts +3 -0
- package/es/Tabs/demo/horizontalScroll/index.js +30 -0
- package/{src → es}/Tabs/demo/horizontalScroll/index.less +0 -0
- package/es/Tabs/index.d.ts +41 -0
- package/es/Tabs/index.js +42 -0
- package/es/Tabs/style/index.d.ts +2 -0
- package/es/Tabs/style/index.js +2 -0
- package/{src → es}/Tabs/style/index.less +0 -0
- package/es/Tooltip/demo/basic/index.d.ts +2 -0
- package/es/Tooltip/demo/basic/index.js +7 -0
- package/es/Tooltip/demo/overflow/index.d.ts +2 -0
- package/es/Tooltip/demo/overflow/index.js +7 -0
- package/es/Tooltip/demo/placement/index.d.ts +6 -0
- package/es/Tooltip/demo/placement/index.js +70 -0
- package/{src → es}/Tooltip/demo/placement/index.less +0 -0
- package/es/Tooltip/demo/trigger/index.d.ts +3 -0
- package/es/Tooltip/demo/trigger/index.js +20 -0
- package/{src → es}/Tooltip/demo/trigger/index.less +0 -0
- package/es/Tooltip/index.d.ts +64 -0
- package/es/Tooltip/index.js +33 -0
- package/es/Tooltip/style/index.d.ts +2 -0
- package/es/Tooltip/style/index.js +2 -0
- package/{src → es}/Tooltip/style/index.less +0 -0
- package/es/_utils/hooks/useControlledState.d.ts +2 -0
- package/es/_utils/hooks/useControlledState.js +54 -0
- package/es/_utils/hooks/usePrefixCls.d.ts +2 -0
- package/es/_utils/hooks/usePrefixCls.js +14 -0
- package/es/index.d.ts +8 -0
- package/{src/index.ts → es/index.js} +0 -0
- package/es/style/index.d.ts +2 -0
- package/{src/style/index.ts → es/style/index.js} +0 -0
- package/{src → es}/style/index.less +0 -0
- package/{src → es}/style/mixins/index.less +0 -0
- package/{src → es}/style/themes/default/index.less +1 -1
- package/{lib/style/themes/default/themeColor.less → es/style/themes/default/themeColor.module.less} +0 -0
- package/es/style/themes/default/themeColor.module.less.d.ts +108 -0
- package/lib/Button/demo/basic/index.less +0 -1
- package/lib/Button/index.js +2 -2
- package/lib/Button/style/index.less +5 -5
- package/lib/Dropdown/demo/button/index.js +1 -1
- package/lib/Icon/iconfont/demo_index.html +49 -3
- package/lib/Icon/iconfont/iconfont.css +11 -3
- package/lib/Icon/iconfont/iconfont.js +1 -1
- package/lib/Icon/iconfont/iconfont.json +14 -0
- package/lib/Icon/iconfont/iconfont.ttf +0 -0
- package/lib/Icon/iconfont/iconfont.woff +0 -0
- package/lib/Icon/iconfont/iconfont.woff2 +0 -0
- package/lib/Icon/index.less +3 -3
- package/lib/Input/demo/basic/index.less +1 -1
- package/lib/Input/style/index.less +4 -1
- package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
- package/lib/Select/OptionsList/OptionItem/RenderGroup.js +27 -0
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +58 -0
- package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
- package/lib/Select/OptionsList/OptionItem/RenderOption.js +94 -0
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +37 -0
- package/lib/Select/OptionsList/OptionItem.d.ts +4 -35
- package/lib/Select/OptionsList/OptionItem.js +26 -172
- package/lib/Select/OptionsList/Options.d.ts +2 -2
- package/lib/Select/OptionsList/index.js +1 -1
- package/lib/Select/Selector/index.d.ts +2 -2
- package/lib/Select/Selector/index.js +13 -10
- package/lib/Select/demo/single/index.d.ts +1 -0
- package/lib/Select/demo/single/index.js +5 -1
- package/lib/Select/demo/single/index.less +5 -0
- package/lib/Select/interface.d.ts +8 -2
- package/lib/Select/style/index.less +3 -10
- package/lib/Tooltip/index.d.ts +1 -0
- package/lib/Tooltip/index.js +3 -1
- package/lib/style/themes/default/index.less +1 -1
- package/{src/style/themes/default/themeColor.less → lib/style/themes/default/themeColor.module.less} +0 -0
- package/lib/style/themes/default/themeColor.module.less.d.ts +108 -0
- package/package.json +17 -7
- package/.editorconfig +0 -16
- package/.eslintrc.js +0 -43
- package/.fatherrc.ts +0 -16
- package/.prettierignore +0 -7
- package/.prettierrc.js +0 -1
- package/.stylelintrc.json +0 -36
- package/.umirc.ts +0 -15
- package/commitlint.config.js +0 -21
- package/docs/index.md +0 -21
- package/jest/setupTests.js +0 -1
- package/public/favicon.ico +0 -0
- package/src/Button/demo/Icon/index.tsx +0 -41
- package/src/Button/demo/basic/index.tsx +0 -26
- package/src/Button/demo/disable/index.tsx +0 -16
- package/src/Button/demo/href/index.tsx +0 -14
- package/src/Button/demo/loading/index.tsx +0 -21
- package/src/Button/index.md +0 -25
- package/src/Button/index.test.tsx +0 -58
- package/src/Button/index.tsx +0 -136
- package/src/Button/style/index.ts +0 -2
- package/src/Dropdown/Button.tsx +0 -93
- package/src/Dropdown/demo/basic/index.tsx +0 -20
- package/src/Dropdown/demo/button/index.tsx +0 -98
- package/src/Dropdown/demo/placement/index.tsx +0 -47
- package/src/Dropdown/demo/subMenu/index.tsx +0 -35
- package/src/Dropdown/demo/trigger/index.tsx +0 -19
- package/src/Dropdown/index.md +0 -35
- package/src/Dropdown/index.test.tsx +0 -185
- package/src/Dropdown/index.tsx +0 -71
- package/src/Dropdown/style/index.ts +0 -2
- package/src/Icon/iconfont/iconfont.css +0 -93
- package/src/Icon/iconfont/iconfont.js +0 -1
- package/src/Icon/iconfont/iconfont.ttf +0 -0
- package/src/Icon/iconfont/iconfont.woff +0 -0
- package/src/Icon/iconfont/iconfont.woff2 +0 -0
- package/src/Icon/index.tsx +0 -38
- package/src/Input/components/Group/index.tsx +0 -21
- package/src/Input/components/Password/index.tsx +0 -23
- package/src/Input/components/TextArea/index.tsx +0 -57
- package/src/Input/demo/allowClear/index.tsx +0 -10
- package/src/Input/demo/basic/index.tsx +0 -25
- package/src/Input/demo/gourp/index.tsx +0 -30
- package/src/Input/demo/password/index.tsx +0 -11
- package/src/Input/demo/prefix/index.tsx +0 -13
- package/src/Input/demo/showCount/index.tsx +0 -16
- package/src/Input/demo/textArea/autoSize.tsx +0 -21
- package/src/Input/index.md +0 -37
- package/src/Input/index.test.tsx +0 -78
- package/src/Input/index.tsx +0 -91
- package/src/Input/style/index.ts +0 -2
- package/src/Menu/Divider.tsx +0 -12
- package/src/Menu/MenuItem.tsx +0 -24
- package/src/Menu/SubMenu.tsx +0 -37
- package/src/Menu/index.md +0 -36
- package/src/Menu/index.test.tsx +0 -144
- package/src/Menu/index.tsx +0 -27
- package/src/Menu/style/index.ts +0 -2
- package/src/Select/BaseSelect.tsx +0 -321
- package/src/Select/OptionsList/OptionItem.tsx +0 -151
- package/src/Select/OptionsList/Options.tsx +0 -11
- package/src/Select/OptionsList/index.tsx +0 -169
- package/src/Select/Selector/index.tsx +0 -211
- package/src/Select/VirtualList.tsx +0 -36
- package/src/Select/demo/disabled/index.tsx +0 -44
- package/src/Select/demo/multiple/index.tsx +0 -77
- package/src/Select/demo/options/index.tsx +0 -63
- package/src/Select/demo/single/index.tsx +0 -50
- package/src/Select/hooks/useCacheOption.ts +0 -67
- package/src/Select/index.md +0 -72
- package/src/Select/index.tsx +0 -23
- package/src/Select/interface.ts +0 -231
- package/src/Select/style/index.ts +0 -2
- package/src/Select/utils.tsx +0 -133
- package/src/Tabs/TabPane.tsx +0 -28
- package/src/Tabs/demo/adaptHeight/index.tsx +0 -33
- package/src/Tabs/demo/basic/index.tsx +0 -30
- package/src/Tabs/demo/horizontalScroll/index.tsx +0 -36
- package/src/Tabs/index.md +0 -30
- package/src/Tabs/index.test.tsx +0 -100
- package/src/Tabs/index.tsx +0 -64
- package/src/Tabs/style/index.ts +0 -2
- package/src/Tooltip/demo/basic/index.tsx +0 -10
- package/src/Tooltip/demo/overflow/index.tsx +0 -10
- package/src/Tooltip/demo/placement/index.tsx +0 -60
- package/src/Tooltip/demo/trigger/index.tsx +0 -22
- package/src/Tooltip/index.md +0 -28
- package/src/Tooltip/index.test.tsx +0 -152
- package/src/Tooltip/index.tsx +0 -113
- package/src/Tooltip/style/index.ts +0 -2
- package/src/_utils/hooks/useControlledState.ts +0 -39
- package/src/_utils/hooks/usePrefixCls.ts +0 -11
- package/tsconfig.json +0 -13
- package/typings.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# design
|
|
1
|
+
# aloudata-design
|
|
2
2
|
|
|
3
3
|
## Getting Started
|
|
4
4
|
|
|
@@ -34,19 +34,24 @@ $ npm run docs:build
|
|
|
34
34
|
```bash
|
|
35
35
|
$ npm test
|
|
36
36
|
```
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
// 基于antd组件开发新组件,必须需要额外antd的组件样式文件
|
|
40
|
-
// 非基于antd组件开发不需要引入这一条,下面以button为例:
|
|
41
|
-
@import '~antd/lib/button/style/index.less';
|
|
37
|
+
发布npm包
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
```bash
|
|
40
|
+
# 先登录npm账号
|
|
41
|
+
$ npm run release
|
|
42
|
+
//会自动打包,并基于version打tag
|
|
43
|
+
```
|
|
44
|
+
## 组件开发目录结构
|
|
45
|
+
```
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
--- component
|
|
48
|
+
--- index.tsx //组件开发 需引用./style
|
|
49
|
+
--- index.test.tsx //单测
|
|
50
|
+
--- index.md //组件文档
|
|
51
|
+
style文件夹
|
|
52
|
+
---index.ts //引用../../style ,引用./index.less
|
|
53
|
+
---index.less //用于自定义,需引用'../../style/index.less';
|
|
54
|
+
demo文件夹 //用于放组件文档用例
|
|
50
55
|
···
|
|
51
56
|
```
|
|
52
57
|
|
|
@@ -77,6 +82,10 @@ $ npm test
|
|
|
77
82
|
link 到本地后,其它项目可以通过 link 本项目直接 import 使用
|
|
78
83
|
|
|
79
84
|
```
|
|
80
|
-
cd es
|
|
81
85
|
npm link
|
|
86
|
+
//转到 目标项目
|
|
87
|
+
npm link @aloudata/aloudata-design
|
|
88
|
+
|
|
89
|
+
// 移除link
|
|
90
|
+
npm unlink @aloudata/aloudata-design
|
|
82
91
|
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@aloudata/aloudata-design';
|
|
3
|
+
import './index.less';
|
|
4
|
+
import Icon from '../../../Icon';
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "ald-button-demo"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
9
|
+
type: "primary",
|
|
10
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
+
type: "add",
|
|
12
|
+
size: 20
|
|
13
|
+
})
|
|
14
|
+
}, "Search"), /*#__PURE__*/React.createElement(Button, {
|
|
15
|
+
type: "secondary",
|
|
16
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
+
type: "add",
|
|
18
|
+
size: 20
|
|
19
|
+
})
|
|
20
|
+
}, "Search"), /*#__PURE__*/React.createElement(Button, {
|
|
21
|
+
type: "text",
|
|
22
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
23
|
+
type: "add",
|
|
24
|
+
size: 20
|
|
25
|
+
})
|
|
26
|
+
}, "Search"), /*#__PURE__*/React.createElement(Button, {
|
|
27
|
+
type: "danger",
|
|
28
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
+
type: "add",
|
|
30
|
+
size: 20
|
|
31
|
+
})
|
|
32
|
+
}, "Search"), /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
type: "link",
|
|
34
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
35
|
+
type: "add",
|
|
36
|
+
size: 20
|
|
37
|
+
})
|
|
38
|
+
}, "Search"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
39
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
40
|
+
type: "add",
|
|
41
|
+
size: 20
|
|
42
|
+
})
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
shape: 'circle',
|
|
45
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
+
type: "add",
|
|
47
|
+
size: 20
|
|
48
|
+
})
|
|
49
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
shape: 'circle'
|
|
51
|
+
}, "S"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
52
|
+
size: 'small',
|
|
53
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
54
|
+
type: "add",
|
|
55
|
+
size: 20
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
58
|
+
shape: 'circle',
|
|
59
|
+
size: "large",
|
|
60
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
+
type: "add",
|
|
62
|
+
size: 20
|
|
63
|
+
})
|
|
64
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
65
|
+
shape: 'circle'
|
|
66
|
+
}, "M"));
|
|
67
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "antd/es/radio/style";
|
|
2
|
+
import _Radio from "antd/es/radio";
|
|
3
|
+
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
+
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
+
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { Button } from '@aloudata/aloudata-design';
|
|
18
|
+
import '../../style/index.less';
|
|
19
|
+
import './index.less';
|
|
20
|
+
export default (function () {
|
|
21
|
+
var _React$useState = React.useState('default'),
|
|
22
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
23
|
+
size = _React$useState2[0],
|
|
24
|
+
setSize = _React$useState2[1];
|
|
25
|
+
|
|
26
|
+
var handleSizeChange = function handleSizeChange(e) {
|
|
27
|
+
setSize(e.target.value);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: 'ald-button-demo'
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
33
|
+
value: size,
|
|
34
|
+
onChange: handleSizeChange
|
|
35
|
+
}, /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
36
|
+
value: "small"
|
|
37
|
+
}, "Small"), /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
38
|
+
value: 'default'
|
|
39
|
+
}, "Default"), /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
40
|
+
value: "large"
|
|
41
|
+
}, "Large")), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
42
|
+
type: "primary",
|
|
43
|
+
size: size
|
|
44
|
+
}, "Primary Button"), /*#__PURE__*/React.createElement(Button, {
|
|
45
|
+
type: "danger",
|
|
46
|
+
size: size
|
|
47
|
+
}, "danger Button"), /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
type: "secondary",
|
|
49
|
+
size: size
|
|
50
|
+
}, "secondary Button"), /*#__PURE__*/React.createElement(Button, {
|
|
51
|
+
type: "text",
|
|
52
|
+
size: size
|
|
53
|
+
}, "Text Button"), /*#__PURE__*/React.createElement(Button, {
|
|
54
|
+
type: "link",
|
|
55
|
+
size: size
|
|
56
|
+
}, "Link Button"));
|
|
57
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@aloudata/aloudata-design';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
className: "ald-button-demo"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
8
|
+
type: "primary",
|
|
9
|
+
disabled: true
|
|
10
|
+
}, "primary disable"), /*#__PURE__*/React.createElement(Button, {
|
|
11
|
+
type: "secondary",
|
|
12
|
+
disabled: true
|
|
13
|
+
}, "secondary disable"), /*#__PURE__*/React.createElement(Button, {
|
|
14
|
+
type: "text",
|
|
15
|
+
disabled: true
|
|
16
|
+
}, "text disable"), /*#__PURE__*/React.createElement(Button, {
|
|
17
|
+
type: "danger",
|
|
18
|
+
disabled: true
|
|
19
|
+
}, "danger disable"), /*#__PURE__*/React.createElement(Button, {
|
|
20
|
+
type: "link",
|
|
21
|
+
disabled: true
|
|
22
|
+
}, "link disable"));
|
|
23
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@aloudata/aloudata-design';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5
|
+
className: "ald-button-demo"
|
|
6
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
7
|
+
href: "https://www.aloudata.com/"
|
|
8
|
+
}, "aloudata"), /*#__PURE__*/React.createElement(Button, {
|
|
9
|
+
href: "https://www.aloudata.com/",
|
|
10
|
+
target: "_blank"
|
|
11
|
+
}, "target _blank aloudata"), /*#__PURE__*/React.createElement(Button, {
|
|
12
|
+
href: "https://www.aloudata.com/",
|
|
13
|
+
target: "_self"
|
|
14
|
+
}, "target _self aloudata"), /*#__PURE__*/React.createElement(Button, {
|
|
15
|
+
target: "_blank"
|
|
16
|
+
}, " \u65E0href target _blank"));
|
|
17
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { Button } from "@aloudata/aloudata-design";
|
|
15
|
+
import './index.less';
|
|
16
|
+
export default (function () {
|
|
17
|
+
var _React$useState = React.useState(false),
|
|
18
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19
|
+
loading = _React$useState2[0],
|
|
20
|
+
setLoading = _React$useState2[1];
|
|
21
|
+
|
|
22
|
+
var handleChange = function handleChange(e) {
|
|
23
|
+
setLoading(true);
|
|
24
|
+
setTimeout(setLoading.bind(false), 3000);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "ald-button-demo"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
30
|
+
loading: true
|
|
31
|
+
}, "loading"), /*#__PURE__*/React.createElement(Button, {
|
|
32
|
+
loading: true
|
|
33
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
loading: loading,
|
|
35
|
+
onClick: handleChange
|
|
36
|
+
}, "\u70B9\u51FB\u63D0\u4EA4"));
|
|
37
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
|
|
4
|
+
export declare type ButtonType = 'primary' | 'secondary' | 'danger' | 'text' | 'link';
|
|
5
|
+
export declare type Size = 'small' | 'default' | 'large';
|
|
6
|
+
export interface IButtonProps extends Omit<AntdButtonProps, 'type' | 'size' | 'danger' | 'shape' | 'icon' | 'href' | 'target' | 'onClick' | 'loading'> {
|
|
7
|
+
/**
|
|
8
|
+
* @description 类型
|
|
9
|
+
* @type 'primary' | 'secondary' | 'danger' | 'text' | 'link'
|
|
10
|
+
* @default primary
|
|
11
|
+
*/
|
|
12
|
+
type?: ButtonType;
|
|
13
|
+
/**
|
|
14
|
+
* @description 尺寸
|
|
15
|
+
* @type 'small' | 'default' | 'large'
|
|
16
|
+
* @default large
|
|
17
|
+
*/
|
|
18
|
+
size?: Size;
|
|
19
|
+
/**
|
|
20
|
+
* @description 是否禁用
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @description 设置按钮的图标组件
|
|
26
|
+
*/
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
shape?: 'circle' | 'default';
|
|
29
|
+
/**
|
|
30
|
+
* @description 指定此属性,点击行为和a链接一致
|
|
31
|
+
*/
|
|
32
|
+
href?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description 相当于 a 链接的 target 属性,href 存在时生效
|
|
35
|
+
*/
|
|
36
|
+
target?: string;
|
|
37
|
+
/**
|
|
38
|
+
* @description 点击按钮时的回调
|
|
39
|
+
*/
|
|
40
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
41
|
+
/**
|
|
42
|
+
* @description 设置按钮进入载入状态
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
loading?: boolean | {
|
|
46
|
+
delay?: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
declare function Button(props: IButtonProps): JSX.Element;
|
|
50
|
+
export default Button;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import "antd/es/button/style";
|
|
2
|
+
import _Button from "antd/es/button";
|
|
3
|
+
var _excluded = ["type", "size", "shape", "icon", "className"];
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
|
|
13
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
+
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import './style';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import usePrefixCls from '../_utils/hooks/usePrefixCls';
|
|
19
|
+
var iconPrefixCls = 'anticon';
|
|
20
|
+
var ICON_LARGE = 20;
|
|
21
|
+
var ICON_SMALL = 16;
|
|
22
|
+
|
|
23
|
+
function Button(props) {
|
|
24
|
+
var prefix = usePrefixCls('btn');
|
|
25
|
+
|
|
26
|
+
var _props$type = props.type,
|
|
27
|
+
type = _props$type === void 0 ? 'secondary' : _props$type,
|
|
28
|
+
_props$size = props.size,
|
|
29
|
+
size = _props$size === void 0 ? 'default' : _props$size,
|
|
30
|
+
_props$shape = props.shape,
|
|
31
|
+
shape = _props$shape === void 0 ? 'default' : _props$shape,
|
|
32
|
+
icon = props.icon,
|
|
33
|
+
className = props.className,
|
|
34
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
|
|
36
|
+
function getButtonType(buttonType) {
|
|
37
|
+
if (!['primary', 'secondary', 'danger', 'text', 'link'].includes(buttonType)) {
|
|
38
|
+
return 'default';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (buttonType === 'danger') {
|
|
42
|
+
return 'primary';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (buttonType === 'secondary') {
|
|
46
|
+
return 'default';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return buttonType;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getDangerStatus(buttonType) {
|
|
53
|
+
if (buttonType === 'danger') {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getButtonSize(ButtonSize) {
|
|
61
|
+
switch (ButtonSize) {
|
|
62
|
+
case 'small':
|
|
63
|
+
return 'small';
|
|
64
|
+
|
|
65
|
+
case 'large':
|
|
66
|
+
return 'large';
|
|
67
|
+
|
|
68
|
+
default:
|
|
69
|
+
return 'middle';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getShape(ButtonShape) {
|
|
74
|
+
if (ButtonShape === 'circle') {
|
|
75
|
+
return ButtonShape;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return 'default';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var setIcon = function setIcon(iconNode) {
|
|
82
|
+
if (iconNode) {
|
|
83
|
+
var p = _objectSpread({
|
|
84
|
+
className: '',
|
|
85
|
+
size: ICON_LARGE
|
|
86
|
+
}, iconNode.props); // eslint-disable-next-line
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
p.className = classNames("".concat(iconPrefixCls, "-icon-left"), p.className); // eslint-disable-next-line
|
|
90
|
+
|
|
91
|
+
p.size = size === 'large' ? ICON_LARGE : ICON_SMALL;
|
|
92
|
+
return /*#__PURE__*/React.cloneElement(iconNode, p);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return /*#__PURE__*/React.createElement(_Button, _objectSpread(_objectSpread({}, rest), {}, {
|
|
99
|
+
icon: setIcon(icon),
|
|
100
|
+
type: getButtonType(type),
|
|
101
|
+
className: classNames("".concat(prefix, "-").concat(type), className),
|
|
102
|
+
size: getButtonSize(size),
|
|
103
|
+
danger: getDangerStatus(type),
|
|
104
|
+
shape: getShape(shape)
|
|
105
|
+
}), props.children);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '../../style/index.less';
|
|
1
|
+
@import '../../style/index.less';
|
|
2
2
|
|
|
3
3
|
@ald-prefix:ant;
|
|
4
4
|
@ald-iconfont-css-prefix:anticon;
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
&-text,
|
|
16
16
|
&-link {
|
|
17
17
|
font-size: 12px;
|
|
18
|
-
height:
|
|
18
|
+
height: @height-base;
|
|
19
19
|
padding: 0 12px;
|
|
20
20
|
display: inline-flex;
|
|
21
|
-
line-height:
|
|
21
|
+
line-height: @height-base;
|
|
22
22
|
align-items: center;
|
|
23
23
|
font-weight: 500;
|
|
24
|
-
justify-content:
|
|
24
|
+
justify-content: center;
|
|
25
25
|
.@{ald-iconfont-css-prefix} {
|
|
26
26
|
+ span {
|
|
27
27
|
margin-left: 4px;
|
|
@@ -252,4 +252,4 @@
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { ButtonType, Size } from '../Button';
|
|
3
|
+
import './style';
|
|
4
|
+
export declare type ActionType = 'hover' | 'click' | 'contextMenu';
|
|
5
|
+
export interface IDropdownButton {
|
|
6
|
+
/**
|
|
7
|
+
* @description 类型
|
|
8
|
+
* @type 'primary' | 'secondary' | 'danger' | 'text' | 'link'
|
|
9
|
+
* @default primary
|
|
10
|
+
*/
|
|
11
|
+
type?: ButtonType;
|
|
12
|
+
/**
|
|
13
|
+
* @description 尺寸
|
|
14
|
+
* @type 'small' | 'default' | 'large'
|
|
15
|
+
* @default large
|
|
16
|
+
*/
|
|
17
|
+
size?: Size;
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否禁用
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @description 设置按钮的图标组件
|
|
25
|
+
*/
|
|
26
|
+
icon?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* @description 设置按钮进入载入状态
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
loading?: boolean | {
|
|
32
|
+
delay?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @description 菜单
|
|
36
|
+
* @type Menu | () => Menu
|
|
37
|
+
* @default -
|
|
38
|
+
*/
|
|
39
|
+
overlay: ReactElement | (() => ReactElement);
|
|
40
|
+
/**
|
|
41
|
+
* @description 菜单弹出位置
|
|
42
|
+
* @default bottomLeft
|
|
43
|
+
*/
|
|
44
|
+
placement?: 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight';
|
|
45
|
+
/**
|
|
46
|
+
* @description 触发下拉的行为
|
|
47
|
+
* @type ActionType[], 其中 ActionType 为 'hover' | 'click' | 'contextMenu';
|
|
48
|
+
* @default [hover]
|
|
49
|
+
*/
|
|
50
|
+
trigger?: ActionType[];
|
|
51
|
+
/**
|
|
52
|
+
* @description 菜单是否显示
|
|
53
|
+
* @default -
|
|
54
|
+
*/
|
|
55
|
+
visible?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @description 菜单显示状态改变时调用,参数为 visible,点击菜单按钮导致的消失不会触发
|
|
58
|
+
* @default -
|
|
59
|
+
*/
|
|
60
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
61
|
+
/**
|
|
62
|
+
* @description 点击按钮时的回调
|
|
63
|
+
* FIXME: onClick和trigger冲突,antd按钮和下拉菜单触发区域不同,需要和视觉确认
|
|
64
|
+
*/
|
|
65
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
export default function DropdownButton(props: IDropdownButton): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var _excluded = ["children", "overlay", "placement", "trigger", "visible", "disabled", "onVisibleChange"];
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import Button from '../Button'; // eslint-disable-next-line import/no-cycle
|
|
15
|
+
|
|
16
|
+
import Dropdown from './index';
|
|
17
|
+
import Icon from '../Icon';
|
|
18
|
+
import './style';
|
|
19
|
+
export default function DropdownButton(props) {
|
|
20
|
+
var children = props.children,
|
|
21
|
+
overlay = props.overlay,
|
|
22
|
+
placement = props.placement,
|
|
23
|
+
trigger = props.trigger,
|
|
24
|
+
visible = props.visible,
|
|
25
|
+
disabled = props.disabled,
|
|
26
|
+
onVisibleChange = props.onVisibleChange,
|
|
27
|
+
buttonProps = _objectWithoutProperties(props, _excluded);
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
30
|
+
overlay: overlay,
|
|
31
|
+
placement: placement,
|
|
32
|
+
trigger: trigger,
|
|
33
|
+
visible: visible,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
onVisibleChange: onVisibleChange
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Button, _objectSpread({}, buttonProps), children, /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
+
type: "expand_more"
|
|
38
|
+
})));
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dropdown, Menu } from '@aloudata/aloudata-design';
|
|
3
|
+
import '../../style/index.less';
|
|
4
|
+
import '../../../Menu/style/index.less';
|
|
5
|
+
var MenuItem = Menu.Item;
|
|
6
|
+
export default (function () {
|
|
7
|
+
var menu = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem, {
|
|
8
|
+
key: 1
|
|
9
|
+
}, "1st menu item"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
10
|
+
key: 2,
|
|
11
|
+
disabled: true
|
|
12
|
+
}, "2nd menu item"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
13
|
+
key: 3
|
|
14
|
+
}, "3nd menu item"));
|
|
15
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
16
|
+
overlay: menu
|
|
17
|
+
}, /*#__PURE__*/React.createElement("span", null, "Hover me"));
|
|
18
|
+
});
|