@aloudata/aloudata-design 0.4.8-beta.5 → 0.4.8-beta.6
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/dist/Button/index.js +5 -5
- package/dist/Button/style/index.less +44 -40
- package/dist/Button/style/variables.less +13 -13
- package/dist/Menu/style/index.less +71 -0
- package/dist/Modal/index.js +3 -1
- package/dist/Modal/style/index.less +23 -6
- package/dist/Select/index.js +27 -5
- package/dist/Select/style/index.less +1 -0
- package/dist/Select/style/multiple.less +2 -0
- package/dist/Select/style/single.less +2 -0
- package/package.json +1 -1
package/dist/Button/index.js
CHANGED
|
@@ -17,9 +17,9 @@ import { Button as AntdButton } from 'antd';
|
|
|
17
17
|
import classNames from 'classnames';
|
|
18
18
|
import React from 'react';
|
|
19
19
|
var iconPrefixCls = 'aldicon';
|
|
20
|
-
var ICON_LARGE =
|
|
21
|
-
var ICON_MIDDLE =
|
|
22
|
-
var ICON_SMALL =
|
|
20
|
+
var ICON_LARGE = 20;
|
|
21
|
+
var ICON_MIDDLE = 16;
|
|
22
|
+
var ICON_SMALL = 14;
|
|
23
23
|
export var btnPrefix = 'ald-btn';
|
|
24
24
|
export function getButtonType(buttonType) {
|
|
25
25
|
if (!['primary', 'secondary', 'dangerous', 'text', 'link'].includes(buttonType)) {
|
|
@@ -44,7 +44,7 @@ export function getDangerStatus(buttonType) {
|
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
46
|
export function getButtonSizeClass(ButtonSize) {
|
|
47
|
-
return
|
|
47
|
+
return ['small', 'large'].includes(ButtonSize) ? "".concat(btnPrefix, "-").concat(ButtonSize) : "".concat(btnPrefix, "-middle");
|
|
48
48
|
}
|
|
49
49
|
export function getIconSize(ButtonSize) {
|
|
50
50
|
if (ButtonSize === 'large') {
|
|
@@ -80,7 +80,7 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
80
80
|
if (loading) {
|
|
81
81
|
return /*#__PURE__*/React.createElement(LoadingLine, {
|
|
82
82
|
spin: true,
|
|
83
|
-
size:
|
|
83
|
+
size: getIconSize(size),
|
|
84
84
|
className: classNames("".concat(iconPrefixCls, "-icon-left"), iconPrefixCls),
|
|
85
85
|
fill: "currentColor"
|
|
86
86
|
});
|
|
@@ -254,13 +254,14 @@
|
|
|
254
254
|
|
|
255
255
|
.aldicon-icon-left {
|
|
256
256
|
svg {
|
|
257
|
-
vertical-align: -
|
|
257
|
+
vertical-align: -4px;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
gap:@button-left-icon-margin-right-large;
|
|
262
|
+
// .aldicon-icon-left + span {
|
|
263
|
+
// margin-left: @button-left-icon-margin-right-large;
|
|
264
|
+
// }
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
&-middle {
|
|
@@ -284,13 +285,14 @@
|
|
|
284
285
|
|
|
285
286
|
.aldicon-icon-left {
|
|
286
287
|
svg {
|
|
287
|
-
vertical-align: -
|
|
288
|
+
vertical-align: -3px;
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
gap:@button-left-icon-margin-right-middle;
|
|
293
|
+
// .aldicon-icon-left + span {
|
|
294
|
+
// margin-left: @button-left-icon-margin-right-middle;
|
|
295
|
+
// }
|
|
294
296
|
}
|
|
295
297
|
|
|
296
298
|
&-small {
|
|
@@ -318,39 +320,41 @@
|
|
|
318
320
|
}
|
|
319
321
|
}
|
|
320
322
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
323
|
+
gap:@button-left-icon-margin-right-small;
|
|
324
|
+
// .aldicon-icon-left + span {
|
|
325
|
+
// margin-left: @button-left-icon-margin-right-small;
|
|
326
|
+
// }
|
|
324
327
|
}
|
|
325
328
|
|
|
326
|
-
&-mini {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
329
|
+
// &-mini {
|
|
330
|
+
// height: @button-height-mini;
|
|
331
|
+
// padding: @button-border-padding-mini;
|
|
332
|
+
// font-size: @button-text-size-mini;
|
|
333
|
+
// line-height: 22px;
|
|
334
|
+
// border-radius: @button-border-radius-mini;
|
|
335
|
+
|
|
336
|
+
// &.ant-btn-icon-only {
|
|
337
|
+
// min-width: @button-height-mini;
|
|
338
|
+
// height: @button-height-mini;
|
|
339
|
+
// border-radius: @button-border-radius-mini;
|
|
340
|
+
// }
|
|
341
|
+
|
|
342
|
+
// &.ant-btn-circle {
|
|
343
|
+
// min-width: @button-height-mini;
|
|
344
|
+
// height: @button-height-mini;
|
|
345
|
+
// border-radius: 50%;
|
|
346
|
+
// }
|
|
347
|
+
|
|
348
|
+
// .aldicon-icon-left {
|
|
349
|
+
// svg {
|
|
350
|
+
// vertical-align: -2px;
|
|
351
|
+
// }
|
|
352
|
+
// }
|
|
353
|
+
|
|
354
|
+
// gap:@button-left-icon-margin-right-mini;
|
|
355
|
+
// // .aldicon-icon-left + span {
|
|
356
|
+
// // margin-left: @button-left-icon-margin-right-mini;
|
|
357
|
+
// // }
|
|
358
|
+
// }
|
|
355
359
|
}
|
|
356
360
|
}
|
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
/** size控制 **/
|
|
7
7
|
@button-height-large: 36px;
|
|
8
8
|
@button-text-size-large: 16px;
|
|
9
|
-
@button-border-radius-large:
|
|
10
|
-
@button-border-padding-large: 6px
|
|
9
|
+
@button-border-radius-large: 6px;
|
|
10
|
+
@button-border-padding-large: 6px 24px;
|
|
11
11
|
@button-left-icon-margin-right-large: 8px;
|
|
12
12
|
|
|
13
13
|
@button-height-middle: 32px;
|
|
14
|
-
@button-text-size-middle:
|
|
15
|
-
@button-border-radius-middle:
|
|
16
|
-
@button-border-padding-middle: 6px
|
|
17
|
-
@button-left-icon-margin-right-middle:
|
|
14
|
+
@button-text-size-middle: 13px;
|
|
15
|
+
@button-border-radius-middle: 4px;
|
|
16
|
+
@button-border-padding-middle: 6px 20px;
|
|
17
|
+
@button-left-icon-margin-right-middle: 4px;
|
|
18
18
|
|
|
19
19
|
@button-height-small: 28px;
|
|
20
20
|
@button-text-size-small: 12px;
|
|
21
|
-
@button-border-radius-small:
|
|
22
|
-
@button-border-padding-small: 6px
|
|
21
|
+
@button-border-radius-small: 4px;
|
|
22
|
+
@button-border-padding-small: 6px 16px;
|
|
23
23
|
@button-left-icon-margin-right-small: 4px;
|
|
24
24
|
|
|
25
|
-
@button-height-mini: 24px;
|
|
26
|
-
@button-text-size-mini: 12px;
|
|
27
|
-
@button-border-radius-mini: 4px;
|
|
28
|
-
@button-border-padding-mini: 0 7px;
|
|
29
|
-
@button-left-icon-margin-right-mini: 4px;
|
|
25
|
+
// @button-height-mini: 24px;
|
|
26
|
+
// @button-text-size-mini: 12px;
|
|
27
|
+
// @button-border-radius-mini: 4px;
|
|
28
|
+
// @button-border-padding-mini: 0 7px;
|
|
29
|
+
// @button-left-icon-margin-right-mini: 4px;
|
|
30
30
|
|
|
31
31
|
/**** type控制 ****/
|
|
32
32
|
@button-primary-bg-color: @B40;
|
|
@@ -68,3 +68,74 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
.ant-menu-submenu.ant-menu-submenu-popup.ant-menu{
|
|
73
|
+
.ant-menu-vertical {
|
|
74
|
+
border: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ant-menu-item,
|
|
78
|
+
.ant-menu-submenu,
|
|
79
|
+
.ant-menu-item-selected {
|
|
80
|
+
margin: 0;
|
|
81
|
+
height: initial;
|
|
82
|
+
padding: 6px 12px;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
width: 100%;
|
|
86
|
+
border-radius: 0;
|
|
87
|
+
border: none;
|
|
88
|
+
background-color: @BG100;
|
|
89
|
+
color: @NL0;
|
|
90
|
+
transition: none;
|
|
91
|
+
|
|
92
|
+
&:hover {
|
|
93
|
+
background-color: @BG90 !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:active {
|
|
97
|
+
background-color: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:not(.ant-menu-item-selected):active {
|
|
101
|
+
background-color: @BG90;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.ant-menu-item-disabled {
|
|
105
|
+
color: @NL50 !important;
|
|
106
|
+
transition: none;
|
|
107
|
+
background-color: @BG100 !important;
|
|
108
|
+
cursor: default;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ant-menu-submenu-title {
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
font-size: 13px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
padding:0;
|
|
116
|
+
height: initial;
|
|
117
|
+
margin:0;
|
|
118
|
+
|
|
119
|
+
&:hover{
|
|
120
|
+
background: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ant-menu.ant-menu-sub{
|
|
126
|
+
padding:4px 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ant-menu-title-content{
|
|
130
|
+
line-height: 20px;
|
|
131
|
+
font-size: 13px;
|
|
132
|
+
width: 100%;
|
|
133
|
+
padding:0;
|
|
134
|
+
height: initial;
|
|
135
|
+
margin:0;
|
|
136
|
+
|
|
137
|
+
&:hover{
|
|
138
|
+
background: none;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
package/dist/Modal/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
|
3
3
|
_excluded3 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"],
|
|
4
4
|
_excluded4 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"],
|
|
5
5
|
_excluded5 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"],
|
|
6
|
-
_excluded6 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"],
|
|
6
|
+
_excluded6 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "className", "width"],
|
|
7
7
|
_excluded7 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"];
|
|
8
8
|
|
|
9
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -172,6 +172,7 @@ Modal.warning = function modalWarn(props) {
|
|
|
172
172
|
_props$cancelButtonPr5 = props.cancelButtonProps,
|
|
173
173
|
cancelButtonProps = _props$cancelButtonPr5 === void 0 ? {} : _props$cancelButtonPr5,
|
|
174
174
|
okType = props.okType,
|
|
175
|
+
className = props.className,
|
|
175
176
|
width = props.width,
|
|
176
177
|
restProps = _objectWithoutProperties(props, _excluded6);
|
|
177
178
|
|
|
@@ -179,6 +180,7 @@ Modal.warning = function modalWarn(props) {
|
|
|
179
180
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
180
181
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
181
182
|
width: width || DEFAULT_WIDTH,
|
|
183
|
+
className: classNames('ald-modal-warning', className),
|
|
182
184
|
icon: icon || /*#__PURE__*/React.createElement(AlertTriangleDuotone, {
|
|
183
185
|
fill: [theme.SB40, theme.ND0],
|
|
184
186
|
theme: "multi-color",
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
.ald-modal-title-container {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
|
+
gap: 12px;
|
|
20
21
|
|
|
21
22
|
.ald-modal-text-container {
|
|
22
|
-
margin-left: 12px;
|
|
23
|
+
// margin-left: 12px;
|
|
23
24
|
flex: 1;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -61,12 +62,12 @@
|
|
|
61
62
|
font-size: 13px;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
.ant-modal-footer{
|
|
65
|
+
.ant-modal-footer {
|
|
65
66
|
.ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
|
|
66
67
|
margin-bottom: 0;
|
|
67
68
|
margin-inline-start: 12px;
|
|
68
69
|
}
|
|
69
|
-
}
|
|
70
|
+
}
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
.ant-modal-confirm {
|
|
@@ -75,15 +76,31 @@
|
|
|
75
76
|
flex: 1;
|
|
76
77
|
overflow: initial;
|
|
77
78
|
margin-inline-start: 12px;
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
& + .ant-modal-confirm-content {
|
|
80
81
|
margin-block-start: 16px;
|
|
81
|
-
margin-left:28px;
|
|
82
|
+
margin-left: 28px;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
.ant-modal-confirm-btns{
|
|
87
|
+
.ant-modal-confirm-btns {
|
|
87
88
|
margin-block-start: 16px;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
91
|
+
|
|
92
|
+
.ald-modal-warning {
|
|
93
|
+
.ant-modal-confirm-btns {
|
|
94
|
+
.ald-btn {
|
|
95
|
+
background-color: @SB40;
|
|
96
|
+
border-color: @SB40;
|
|
97
|
+
|
|
98
|
+
&:hover,
|
|
99
|
+
&:active,
|
|
100
|
+
&:focus {
|
|
101
|
+
background-color: @SB40;
|
|
102
|
+
border-color: @SB40;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
package/dist/Select/index.js
CHANGED
|
@@ -28,6 +28,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
28
28
|
|
|
29
29
|
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; }
|
|
30
30
|
|
|
31
|
+
import { FoldDownFill } from '@aloudata/icons-react';
|
|
31
32
|
import { Select as AntdSelect } from 'antd';
|
|
32
33
|
import classNames from 'classnames';
|
|
33
34
|
import List from 'rc-virtual-list';
|
|
@@ -35,6 +36,12 @@ import React, { forwardRef, useEffect, useLayoutEffect, useMemo } from 'react';
|
|
|
35
36
|
import Empty from "../Empty";
|
|
36
37
|
import MultipleOption from "./components/MultipleOption";
|
|
37
38
|
import SingleOption from "./components/SingleOption";
|
|
39
|
+
import theme from "../style/themes/default/themeColor.module.less";
|
|
40
|
+
var suffixIconSizeMap = {
|
|
41
|
+
large: 20,
|
|
42
|
+
middle: 16,
|
|
43
|
+
small: 14
|
|
44
|
+
};
|
|
38
45
|
|
|
39
46
|
var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue) {
|
|
40
47
|
if (typeof value !== 'undefined') {
|
|
@@ -92,7 +99,8 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
92
99
|
className = props.className,
|
|
93
100
|
popupClassName = props.popupClassName,
|
|
94
101
|
listHeight = props.listHeight,
|
|
95
|
-
listItemHeight = props.listItemHeight,
|
|
102
|
+
_props$listItemHeight = props.listItemHeight,
|
|
103
|
+
listItemHeight = _props$listItemHeight === void 0 ? 36 : _props$listItemHeight,
|
|
96
104
|
_props$notFoundConten = props.notFoundContent,
|
|
97
105
|
notFoundContent = _props$notFoundConten === void 0 ? /*#__PURE__*/React.createElement(Empty, null) : _props$notFoundConten,
|
|
98
106
|
value = props.value,
|
|
@@ -147,14 +155,24 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
147
155
|
}), newOptions);
|
|
148
156
|
};
|
|
149
157
|
|
|
158
|
+
var getListHeight = function getListHeight() {
|
|
159
|
+
if (typeof listHeight === 'number' && options !== null && options !== void 0 && options.length) {
|
|
160
|
+
if (listHeight <= options.length * listItemHeight) {
|
|
161
|
+
return listHeight;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return 0;
|
|
166
|
+
};
|
|
167
|
+
|
|
150
168
|
var multipleRender = function multipleRender() {
|
|
151
169
|
return /*#__PURE__*/React.createElement("div", {
|
|
152
170
|
className: "ald-multiple-option-list"
|
|
153
171
|
}, /*#__PURE__*/React.createElement(List, {
|
|
154
172
|
data: options || [],
|
|
155
173
|
"data-id": "list",
|
|
156
|
-
height:
|
|
157
|
-
itemHeight: listItemHeight
|
|
174
|
+
height: getListHeight(),
|
|
175
|
+
itemHeight: listItemHeight,
|
|
158
176
|
itemKey: "value"
|
|
159
177
|
}, function (option) {
|
|
160
178
|
var isSelected = selectedOptions.some(function (selectedOption) {
|
|
@@ -191,8 +209,8 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
191
209
|
}, /*#__PURE__*/React.createElement(List, {
|
|
192
210
|
data: options || [],
|
|
193
211
|
"data-id": "list",
|
|
194
|
-
height:
|
|
195
|
-
itemHeight: listItemHeight
|
|
212
|
+
height: getListHeight(),
|
|
213
|
+
itemHeight: listItemHeight,
|
|
196
214
|
itemKey: "value"
|
|
197
215
|
}, function (option) {
|
|
198
216
|
var isSelected = selectedOptions.some(function (selectedOption) {
|
|
@@ -314,6 +332,10 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
314
332
|
style: {
|
|
315
333
|
width: '100%'
|
|
316
334
|
},
|
|
335
|
+
suffixIcon: /*#__PURE__*/React.createElement(FoldDownFill, {
|
|
336
|
+
size: suffixIconSizeMap[props.size || 'middle'],
|
|
337
|
+
fill: theme.NL50
|
|
338
|
+
}),
|
|
317
339
|
onDropdownVisibleChange: function onDropdownVisibleChange(open) {
|
|
318
340
|
setIsOpen(open);
|
|
319
341
|
|