@aloudata/aloudata-design 0.4.8-beta.4 → 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 +26 -14
- package/dist/Modal/style/index.less +23 -6
- package/dist/Radio/components/Radio/index.js +3 -1
- package/dist/Radio/style/index.less +58 -21
- 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
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
var _excluded = ["className", "
|
|
2
|
-
_excluded2 = ["
|
|
1
|
+
var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
2
|
+
_excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title"],
|
|
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
|
+
_excluded7 = ["icon", "okButtonProps", "cancelButtonProps", "okType", "width"];
|
|
8
|
+
|
|
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); }
|
|
7
10
|
|
|
8
11
|
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; }
|
|
9
12
|
|
|
@@ -11,8 +14,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
14
|
|
|
12
15
|
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; }
|
|
13
16
|
|
|
14
|
-
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); }
|
|
15
|
-
|
|
16
17
|
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; }
|
|
17
18
|
|
|
18
19
|
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; }
|
|
@@ -31,6 +32,7 @@ var DEFAULT_WIDTH = 552;
|
|
|
31
32
|
|
|
32
33
|
function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
33
34
|
var btnType = okType || defaultBtnType;
|
|
35
|
+
|
|
34
36
|
var buttonClassName = buttonProps.className,
|
|
35
37
|
_buttonProps$type = buttonProps.type,
|
|
36
38
|
type = _buttonProps$type === void 0 ? btnType : _buttonProps$type,
|
|
@@ -39,15 +41,17 @@ function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
|
39
41
|
size = _buttonProps$size === void 0 ? 'middle' : _buttonProps$size,
|
|
40
42
|
disabled = buttonProps.disabled,
|
|
41
43
|
_buttonProps$shape = buttonProps.shape,
|
|
42
|
-
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape
|
|
43
|
-
|
|
44
|
+
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape,
|
|
45
|
+
restProps = _objectWithoutProperties(buttonProps, _excluded);
|
|
46
|
+
|
|
47
|
+
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
44
48
|
disabled: loading ? true : disabled,
|
|
45
49
|
loading: loading,
|
|
46
50
|
type: getButtonType(type),
|
|
47
51
|
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), buttonClassName, getButtonSizeClass(size)),
|
|
48
52
|
danger: getDangerStatus(type),
|
|
49
53
|
shape: getShape(shape)
|
|
50
|
-
};
|
|
54
|
+
});
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
var OriginModal = function OriginModal(props) {
|
|
@@ -61,9 +65,13 @@ var OriginModal = function OriginModal(props) {
|
|
|
61
65
|
okButtonProps = _props$okButtonProps === void 0 ? {} : _props$okButtonProps,
|
|
62
66
|
_props$cancelButtonPr = props.cancelButtonProps,
|
|
63
67
|
cancelButtonProps = _props$cancelButtonPr === void 0 ? {} : _props$cancelButtonPr,
|
|
68
|
+
_props$okText = props.okText,
|
|
69
|
+
okText = _props$okText === void 0 ? "确定" : _props$okText,
|
|
70
|
+
_props$cancelText = props.cancelText,
|
|
71
|
+
cancelText = _props$cancelText === void 0 ? "取消" : _props$cancelText,
|
|
64
72
|
icon = props.icon,
|
|
65
73
|
title = props.title,
|
|
66
|
-
restProps = _objectWithoutProperties(props,
|
|
74
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
67
75
|
|
|
68
76
|
return /*#__PURE__*/React.createElement(AntdModal, _extends({}, restProps, {
|
|
69
77
|
title: /*#__PURE__*/React.createElement("div", {
|
|
@@ -78,6 +86,8 @@ var OriginModal = function OriginModal(props) {
|
|
|
78
86
|
className: classNames('ald-modal', className),
|
|
79
87
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
80
88
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
89
|
+
okText: okText,
|
|
90
|
+
cancelText: cancelText,
|
|
81
91
|
width: width || DEFAULT_WIDTH,
|
|
82
92
|
closeIcon: closeIcon || /*#__PURE__*/React.createElement(CloseLLine, {
|
|
83
93
|
size: 16,
|
|
@@ -97,7 +107,7 @@ Modal.info = function infoFn(props) {
|
|
|
97
107
|
cancelButtonProps = _props$cancelButtonPr2 === void 0 ? {} : _props$cancelButtonPr2,
|
|
98
108
|
okType = props.okType,
|
|
99
109
|
width = props.width,
|
|
100
|
-
restProps = _objectWithoutProperties(props,
|
|
110
|
+
restProps = _objectWithoutProperties(props, _excluded3);
|
|
101
111
|
|
|
102
112
|
return AntdModal.success(_objectSpread({
|
|
103
113
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
@@ -119,7 +129,7 @@ Modal.success = function successFn(props) {
|
|
|
119
129
|
cancelButtonProps = _props$cancelButtonPr3 === void 0 ? {} : _props$cancelButtonPr3,
|
|
120
130
|
okType = props.okType,
|
|
121
131
|
width = props.width,
|
|
122
|
-
restProps = _objectWithoutProperties(props,
|
|
132
|
+
restProps = _objectWithoutProperties(props, _excluded4);
|
|
123
133
|
|
|
124
134
|
return AntdModal.success(_objectSpread({
|
|
125
135
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
@@ -141,7 +151,7 @@ Modal.error = function errorFn(props) {
|
|
|
141
151
|
cancelButtonProps = _props$cancelButtonPr4 === void 0 ? {} : _props$cancelButtonPr4,
|
|
142
152
|
okType = props.okType,
|
|
143
153
|
width = props.width,
|
|
144
|
-
restProps = _objectWithoutProperties(props,
|
|
154
|
+
restProps = _objectWithoutProperties(props, _excluded5);
|
|
145
155
|
|
|
146
156
|
return AntdModal.success(_objectSpread({
|
|
147
157
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
@@ -162,13 +172,15 @@ Modal.warning = function modalWarn(props) {
|
|
|
162
172
|
_props$cancelButtonPr5 = props.cancelButtonProps,
|
|
163
173
|
cancelButtonProps = _props$cancelButtonPr5 === void 0 ? {} : _props$cancelButtonPr5,
|
|
164
174
|
okType = props.okType,
|
|
175
|
+
className = props.className,
|
|
165
176
|
width = props.width,
|
|
166
|
-
restProps = _objectWithoutProperties(props,
|
|
177
|
+
restProps = _objectWithoutProperties(props, _excluded6);
|
|
167
178
|
|
|
168
179
|
return AntdModal.success(_objectSpread({
|
|
169
180
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
170
181
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
171
182
|
width: width || DEFAULT_WIDTH,
|
|
183
|
+
className: classNames('ald-modal-warning', className),
|
|
172
184
|
icon: icon || /*#__PURE__*/React.createElement(AlertTriangleDuotone, {
|
|
173
185
|
fill: [theme.SB40, theme.ND0],
|
|
174
186
|
theme: "multi-color",
|
|
@@ -185,7 +197,7 @@ Modal.confirm = function confirmFn(props) {
|
|
|
185
197
|
cancelButtonProps = _props$cancelButtonPr6 === void 0 ? {} : _props$cancelButtonPr6,
|
|
186
198
|
okType = props.okType,
|
|
187
199
|
width = props.width,
|
|
188
|
-
restProps = _objectWithoutProperties(props,
|
|
200
|
+
restProps = _objectWithoutProperties(props, _excluded7);
|
|
189
201
|
|
|
190
202
|
return AntdModal.success(_objectSpread({
|
|
191
203
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
@@ -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
|
+
}
|
|
@@ -43,8 +43,10 @@ export default function Radio(props) {
|
|
|
43
43
|
} else if (groupContext.type === 'iconButton') {
|
|
44
44
|
if (groupContext.radioGroupStyle === 'filled') {
|
|
45
45
|
otherClass = 'ald-radio-icon-button-wrapper-filled';
|
|
46
|
-
} else {
|
|
46
|
+
} else if (groupContext.radioGroupStyle === 'border') {
|
|
47
47
|
otherClass = 'ald-radio-icon-button-wrapper-border';
|
|
48
|
+
} else {
|
|
49
|
+
otherClass = 'ald-radio-icon-button-wrapper-border-primary';
|
|
48
50
|
}
|
|
49
51
|
} else {
|
|
50
52
|
// 当type未设置或者是radio时
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
@radio-icon-button-padding-large:
|
|
3
|
+
@radio-icon-button-padding-large: 8px;
|
|
4
4
|
@radio-icon-button-padding-middle: 9px;
|
|
5
|
-
@radio-icon-button-padding-small:
|
|
5
|
+
@radio-icon-button-padding-small: 7px;
|
|
6
6
|
@radio-group-height-large: 36px;
|
|
7
7
|
@radio-group-height-middle: 32px;
|
|
8
8
|
@radio-group-height-small: 28px;
|
|
@@ -114,7 +114,9 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.ald-radio-button-wrapper-border-primary,
|
|
117
|
-
.ald-radio-button-wrapper-border
|
|
117
|
+
.ald-radio-button-wrapper-border,
|
|
118
|
+
.ald-radio-icon-button-wrapper-border,
|
|
119
|
+
.ald-radio-icon-button-wrapper-border-primary {
|
|
118
120
|
&.ald-radio-label.ald-radio-wrapper-disabled {
|
|
119
121
|
opacity: 0.5;
|
|
120
122
|
|
|
@@ -191,7 +193,8 @@
|
|
|
191
193
|
|
|
192
194
|
.ald-radio-button-wrapper-border,
|
|
193
195
|
.ald-radio-button-wrapper-border-primary,
|
|
194
|
-
.ald-radio-icon-button-wrapper-border
|
|
196
|
+
.ald-radio-icon-button-wrapper-border,
|
|
197
|
+
.ald-radio-icon-button-wrapper-border-primary {
|
|
195
198
|
position: relative;
|
|
196
199
|
display: flex;
|
|
197
200
|
align-items: center;
|
|
@@ -231,7 +234,8 @@
|
|
|
231
234
|
// button选中状态下的样式
|
|
232
235
|
.ald-radio-wrapper-checked.ald-radio-button-wrapper-border,
|
|
233
236
|
.ald-radio-wrapper-checked.ald-radio-button-wrapper-border-primary,
|
|
234
|
-
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-border
|
|
237
|
+
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-border,
|
|
238
|
+
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-border-primary {
|
|
235
239
|
background: @BG80;
|
|
236
240
|
transition: background 0.5s ease;
|
|
237
241
|
|
|
@@ -242,7 +246,8 @@
|
|
|
242
246
|
}
|
|
243
247
|
}
|
|
244
248
|
|
|
245
|
-
.ald-radio-wrapper-checked.ald-radio-button-wrapper-border-primary
|
|
249
|
+
.ald-radio-wrapper-checked.ald-radio-button-wrapper-border-primary,
|
|
250
|
+
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-border-primary {
|
|
246
251
|
background: @B40;
|
|
247
252
|
transition: background 0.5s ease;
|
|
248
253
|
|
|
@@ -310,6 +315,12 @@
|
|
|
310
315
|
&.ald-radio-group-middle {
|
|
311
316
|
height: @radio-group-height-middle;
|
|
312
317
|
|
|
318
|
+
.ald-radio-label {
|
|
319
|
+
.ald-radio-desc {
|
|
320
|
+
font-size: @font-size-middle;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
313
324
|
.ald-radio-icon-button-wrapper-filled {
|
|
314
325
|
padding: 0 @radio-icon-button-padding-middle;
|
|
315
326
|
}
|
|
@@ -319,13 +330,17 @@
|
|
|
319
330
|
padding: 0 @radio-button-padding-middle - 1;
|
|
320
331
|
}
|
|
321
332
|
|
|
322
|
-
.ald-radio-icon-button-wrapper-border
|
|
333
|
+
.ald-radio-icon-button-wrapper-border,
|
|
334
|
+
.ald-radio-icon-button-wrapper-border-primary {
|
|
323
335
|
padding: 0 @radio-icon-button-padding-middle - 1;
|
|
324
|
-
}
|
|
325
336
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
337
|
+
&.ald-radio-label .ald-radio-desc {
|
|
338
|
+
font-size: 14px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
&:not(:last-child) {
|
|
342
|
+
padding: 0 @radio-icon-button-padding-middle 0
|
|
343
|
+
@radio-icon-button-padding-middle - 1;
|
|
329
344
|
}
|
|
330
345
|
}
|
|
331
346
|
}
|
|
@@ -333,6 +348,12 @@
|
|
|
333
348
|
&.ald-radio-group-small {
|
|
334
349
|
height: @radio-group-height-small;
|
|
335
350
|
|
|
351
|
+
.ald-radio-label {
|
|
352
|
+
.ald-radio-desc {
|
|
353
|
+
font-size: @font-size-small;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
336
357
|
.ald-radio-icon-button-wrapper-filled {
|
|
337
358
|
padding: 0 @radio-icon-button-padding-small;
|
|
338
359
|
}
|
|
@@ -342,19 +363,24 @@
|
|
|
342
363
|
padding: 0 @radio-button-padding-small - 1;
|
|
343
364
|
}
|
|
344
365
|
|
|
345
|
-
.ald-radio-icon-button-wrapper-border
|
|
366
|
+
.ald-radio-icon-button-wrapper-border,
|
|
367
|
+
.ald-radio-icon-button-wrapper-border-primary {
|
|
346
368
|
padding: 0 @radio-icon-button-padding-small - 1;
|
|
347
|
-
}
|
|
348
369
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
370
|
+
&.ald-radio-label .ald-radio-desc {
|
|
371
|
+
font-size: 14px;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
&:not(:last-child) {
|
|
375
|
+
padding: 0 @radio-icon-button-padding-small 0
|
|
376
|
+
@radio-icon-button-padding-small - 1;
|
|
352
377
|
}
|
|
353
378
|
}
|
|
354
379
|
|
|
355
380
|
.ald-radio-button-wrapper-border,
|
|
356
381
|
.ald-radio-icon-button-wrapper-border,
|
|
357
382
|
.ald-radio-button-wrapper-border-primary,
|
|
383
|
+
.ald-radio-icon-button-wrapper-border-primary,
|
|
358
384
|
.ald-radio-button-wrapper-filled,
|
|
359
385
|
.ald-radio-icon-button-wrapper-filled {
|
|
360
386
|
&:first-of-type {
|
|
@@ -374,6 +400,12 @@
|
|
|
374
400
|
&.ald-radio-group.ald-radio-group-large {
|
|
375
401
|
height: @radio-group-height-large;
|
|
376
402
|
|
|
403
|
+
.ald-radio-label {
|
|
404
|
+
.ald-radio-desc {
|
|
405
|
+
font-size: @font-size-large;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
377
409
|
.ald-radio-icon-button-wrapper-filled {
|
|
378
410
|
padding: 0 @radio-icon-button-padding-large;
|
|
379
411
|
}
|
|
@@ -383,19 +415,24 @@
|
|
|
383
415
|
padding: 0 @radio-button-padding-large - 1;
|
|
384
416
|
}
|
|
385
417
|
|
|
386
|
-
.ald-radio-icon-button-wrapper-border
|
|
418
|
+
.ald-radio-icon-button-wrapper-border,
|
|
419
|
+
.ald-radio-icon-button-wrapper-border-primary {
|
|
387
420
|
padding: 0 @radio-icon-button-padding-large - 1;
|
|
388
|
-
}
|
|
389
421
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
422
|
+
&.ald-radio-label .ald-radio-desc {
|
|
423
|
+
font-size: 20px;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
&:not(:last-child) {
|
|
427
|
+
padding: 0 @radio-icon-button-padding-large 0
|
|
428
|
+
@radio-icon-button-padding-large - 1;
|
|
393
429
|
}
|
|
394
430
|
}
|
|
395
431
|
|
|
396
432
|
.ald-radio-button-wrapper-border,
|
|
397
433
|
.ald-radio-icon-button-wrapper-border,
|
|
398
434
|
.ald-radio-button-wrapper-border-primary,
|
|
435
|
+
.ald-radio-icon-button-wrapper-border-primary,
|
|
399
436
|
.ald-radio-button-wrapper-filled,
|
|
400
437
|
.ald-radio-icon-button-wrapper-filled {
|
|
401
438
|
&:first-of-type {
|
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
|
|