@aloudata/aloudata-design 0.4.8 → 0.4.10
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 +48 -44
- package/dist/Button/style/variables.less +13 -13
- package/dist/Checkbox/style/index.less +34 -13
- package/dist/DoubleCircleIcon/index.d.ts +1 -0
- package/dist/DoubleCircleIcon/index.js +5 -2
- package/dist/DoubleCircleIcon/style/index.less +33 -1
- package/dist/Dropdown/style/index.less +15 -10
- package/dist/Empty/image/SearchSmall.js +5 -0
- package/dist/Empty/style/index.less +11 -0
- package/dist/Icon/icons.js +32 -0
- package/dist/Input/style/index.less +64 -42
- package/dist/InputNumber/style/index.less +9 -4
- package/dist/Menu/style/index.less +78 -2
- package/dist/Modal/index.d.ts +4 -1
- package/dist/Modal/index.js +178 -67
- package/dist/Modal/style/index.less +48 -7
- package/dist/Radio/components/Group/index.js +11 -6
- package/dist/Radio/components/Radio/index.js +13 -6
- package/dist/Radio/interface/radioGroup.d.ts +6 -1
- package/dist/Radio/style/index.less +220 -53
- package/dist/Select/components/MultipleOption.d.ts +1 -0
- package/dist/Select/components/MultipleOption.js +7 -3
- package/dist/Select/components/SingleOption.d.ts +1 -0
- package/dist/Select/components/SingleOption.js +6 -2
- package/dist/Select/index.js +74 -13
- package/dist/Select/style/index.less +8 -3
- package/dist/Select/style/multiple.less +13 -2
- package/dist/Select/style/single.less +12 -1
- package/dist/Select/style/status.less +1 -1
- package/dist/Table/style/index.less +14 -8
- package/dist/Tabs/index.d.ts +15 -0
- package/dist/Tabs/index.js +46 -6
- package/dist/Tabs/style/index.less +42 -1
- package/dist/Tooltip/style/index.less +7 -1
- package/dist/notification/demo/index.js +28 -7
- package/dist/notification/index.d.ts +9 -1
- package/dist/notification/index.js +132 -1
- package/dist/notification/style/index.less +28 -0
- package/dist/style/themes/default/index.less +25 -25
- package/dist/style/themes/default/themeColor.module.less +9 -9
- package/package.json +4 -4
package/dist/Modal/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
var _excluded = ["className", "
|
|
2
|
-
_excluded2 = ["
|
|
3
|
-
_excluded3 = ["
|
|
4
|
-
_excluded4 = ["
|
|
5
|
-
_excluded5 = ["
|
|
6
|
-
_excluded6 = ["
|
|
1
|
+
var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
2
|
+
_excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title", "paddingLess"],
|
|
3
|
+
_excluded3 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
4
|
+
_excluded4 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
5
|
+
_excluded5 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
6
|
+
_excluded6 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
7
|
+
_excluded7 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "className", "okText", "cancelText"];
|
|
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; }
|
|
@@ -24,6 +25,7 @@ import useModal from 'antd/lib/modal/useModal/index';
|
|
|
24
25
|
import classNames from 'classnames';
|
|
25
26
|
import React from 'react';
|
|
26
27
|
import { btnPrefix, getButtonSizeClass, getButtonType, getDangerStatus, getShape } from "../Button";
|
|
28
|
+
import DoubleCircleIcon from "../DoubleCircleIcon";
|
|
27
29
|
import theme from "../style/themes/default/themeColor.module.less"; // export type { ModalProps, ModalFuncProps };
|
|
28
30
|
|
|
29
31
|
export var destroyFns = [];
|
|
@@ -31,6 +33,7 @@ var DEFAULT_WIDTH = 552;
|
|
|
31
33
|
|
|
32
34
|
function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
33
35
|
var btnType = okType || defaultBtnType;
|
|
36
|
+
|
|
34
37
|
var buttonClassName = buttonProps.className,
|
|
35
38
|
_buttonProps$type = buttonProps.type,
|
|
36
39
|
type = _buttonProps$type === void 0 ? btnType : _buttonProps$type,
|
|
@@ -39,17 +42,34 @@ function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
|
39
42
|
size = _buttonProps$size === void 0 ? 'middle' : _buttonProps$size,
|
|
40
43
|
disabled = buttonProps.disabled,
|
|
41
44
|
_buttonProps$shape = buttonProps.shape,
|
|
42
|
-
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape
|
|
43
|
-
|
|
45
|
+
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape,
|
|
46
|
+
restProps = _objectWithoutProperties(buttonProps, _excluded);
|
|
47
|
+
|
|
48
|
+
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
44
49
|
disabled: loading ? true : disabled,
|
|
45
50
|
loading: loading,
|
|
46
51
|
type: getButtonType(type),
|
|
47
52
|
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), buttonClassName, getButtonSizeClass(size)),
|
|
48
53
|
danger: getDangerStatus(type),
|
|
49
54
|
shape: getShape(shape)
|
|
50
|
-
};
|
|
55
|
+
});
|
|
51
56
|
}
|
|
52
57
|
|
|
58
|
+
var ModalTitle = function ModalTitle(_ref) {
|
|
59
|
+
var icon = _ref.icon,
|
|
60
|
+
title = _ref.title,
|
|
61
|
+
subTitle = _ref.subTitle;
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: 'ald-modal-title-container'
|
|
64
|
+
}, icon, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: 'ald-modal-text-container'
|
|
66
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: 'title'
|
|
68
|
+
}, title), subTitle && /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: 'subTitle'
|
|
70
|
+
}, subTitle)));
|
|
71
|
+
};
|
|
72
|
+
|
|
53
73
|
var OriginModal = function OriginModal(props) {
|
|
54
74
|
var className = props.className,
|
|
55
75
|
children = props.children,
|
|
@@ -61,26 +81,41 @@ var OriginModal = function OriginModal(props) {
|
|
|
61
81
|
okButtonProps = _props$okButtonProps === void 0 ? {} : _props$okButtonProps,
|
|
62
82
|
_props$cancelButtonPr = props.cancelButtonProps,
|
|
63
83
|
cancelButtonProps = _props$cancelButtonPr === void 0 ? {} : _props$cancelButtonPr,
|
|
84
|
+
_props$okText = props.okText,
|
|
85
|
+
okText = _props$okText === void 0 ? '确定' : _props$okText,
|
|
86
|
+
_props$cancelText = props.cancelText,
|
|
87
|
+
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
64
88
|
icon = props.icon,
|
|
65
89
|
title = props.title,
|
|
66
|
-
|
|
90
|
+
paddingLess = props.paddingLess,
|
|
91
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
67
92
|
|
|
68
93
|
return /*#__PURE__*/React.createElement(AntdModal, _extends({}, restProps, {
|
|
69
|
-
title:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
className
|
|
94
|
+
title: ModalTitle({
|
|
95
|
+
icon: icon,
|
|
96
|
+
title: title,
|
|
97
|
+
subTitle: subTitle
|
|
98
|
+
}) // title={
|
|
99
|
+
// <div className={'ald-modal-title-container'}>
|
|
100
|
+
// {icon}
|
|
101
|
+
// <div className={'ald-modal-text-container'}>
|
|
102
|
+
// {title && <div className={'title'}>{title}</div>}
|
|
103
|
+
// {subTitle && <div className={'subTitle'}>{subTitle}</div>}
|
|
104
|
+
// </div>
|
|
105
|
+
// </div>
|
|
106
|
+
// }
|
|
107
|
+
,
|
|
108
|
+
className: classNames('ald-modal', className, {
|
|
109
|
+
'ald-modal-padding-less': paddingLess
|
|
110
|
+
}),
|
|
79
111
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
80
|
-
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary'
|
|
112
|
+
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary'),
|
|
113
|
+
okText: okText,
|
|
114
|
+
cancelText: cancelText,
|
|
81
115
|
width: width || DEFAULT_WIDTH,
|
|
82
116
|
closeIcon: closeIcon || /*#__PURE__*/React.createElement(CloseLLine, {
|
|
83
117
|
size: 16,
|
|
118
|
+
fill: theme.NL40,
|
|
84
119
|
className: "ald-modal-close"
|
|
85
120
|
})
|
|
86
121
|
}), children);
|
|
@@ -90,112 +125,188 @@ OriginModal.useModal = useModal;
|
|
|
90
125
|
var Modal = OriginModal;
|
|
91
126
|
|
|
92
127
|
Modal.info = function infoFn(props) {
|
|
93
|
-
var
|
|
94
|
-
_props$okButtonProps2 = props.okButtonProps,
|
|
128
|
+
var _props$okButtonProps2 = props.okButtonProps,
|
|
95
129
|
okButtonProps = _props$okButtonProps2 === void 0 ? {} : _props$okButtonProps2,
|
|
96
130
|
_props$cancelButtonPr2 = props.cancelButtonProps,
|
|
97
131
|
cancelButtonProps = _props$cancelButtonPr2 === void 0 ? {} : _props$cancelButtonPr2,
|
|
98
132
|
okType = props.okType,
|
|
99
133
|
width = props.width,
|
|
100
|
-
|
|
134
|
+
title = props.title,
|
|
135
|
+
subTitle = props.subTitle,
|
|
136
|
+
_props$okText2 = props.okText,
|
|
137
|
+
okText = _props$okText2 === void 0 ? '确定' : _props$okText2,
|
|
138
|
+
_props$cancelText2 = props.cancelText,
|
|
139
|
+
cancelText = _props$cancelText2 === void 0 ? '取消' : _props$cancelText2,
|
|
140
|
+
className = props.className,
|
|
141
|
+
restProps = _objectWithoutProperties(props, _excluded3);
|
|
101
142
|
|
|
102
|
-
return AntdModal.
|
|
143
|
+
return AntdModal.info(_objectSpread({
|
|
103
144
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
104
145
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
105
146
|
width: width || DEFAULT_WIDTH,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
147
|
+
className: classNames('ald-modal', className),
|
|
148
|
+
title: ModalTitle({
|
|
149
|
+
icon: /*#__PURE__*/React.createElement(DoubleCircleIcon, {
|
|
150
|
+
type: "info"
|
|
151
|
+
}, /*#__PURE__*/React.createElement(InfoCircleLine, {
|
|
152
|
+
size: 16,
|
|
153
|
+
fill: theme.B40,
|
|
154
|
+
className: "ald-modal-close"
|
|
155
|
+
})),
|
|
156
|
+
title: title,
|
|
157
|
+
subTitle: subTitle
|
|
158
|
+
}),
|
|
159
|
+
okText: okText,
|
|
160
|
+
cancelText: cancelText
|
|
111
161
|
}, restProps));
|
|
112
162
|
};
|
|
113
163
|
|
|
114
164
|
Modal.success = function successFn(props) {
|
|
115
|
-
var
|
|
116
|
-
_props$okButtonProps3 = props.okButtonProps,
|
|
165
|
+
var _props$okButtonProps3 = props.okButtonProps,
|
|
117
166
|
okButtonProps = _props$okButtonProps3 === void 0 ? {} : _props$okButtonProps3,
|
|
118
167
|
_props$cancelButtonPr3 = props.cancelButtonProps,
|
|
119
168
|
cancelButtonProps = _props$cancelButtonPr3 === void 0 ? {} : _props$cancelButtonPr3,
|
|
120
169
|
okType = props.okType,
|
|
121
170
|
width = props.width,
|
|
122
|
-
|
|
171
|
+
title = props.title,
|
|
172
|
+
subTitle = props.subTitle,
|
|
173
|
+
_props$okText3 = props.okText,
|
|
174
|
+
okText = _props$okText3 === void 0 ? '确定' : _props$okText3,
|
|
175
|
+
_props$cancelText3 = props.cancelText,
|
|
176
|
+
cancelText = _props$cancelText3 === void 0 ? '取消' : _props$cancelText3,
|
|
177
|
+
className = props.className,
|
|
178
|
+
restProps = _objectWithoutProperties(props, _excluded4);
|
|
123
179
|
|
|
124
180
|
return AntdModal.success(_objectSpread({
|
|
125
181
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
126
182
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
127
183
|
width: width || DEFAULT_WIDTH,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
184
|
+
className: classNames('ald-modal', className),
|
|
185
|
+
title: ModalTitle({
|
|
186
|
+
icon: /*#__PURE__*/React.createElement(DoubleCircleIcon, {
|
|
187
|
+
type: "success"
|
|
188
|
+
}, /*#__PURE__*/React.createElement(CheckCircleDuotone, {
|
|
189
|
+
fill: [theme.SA40, theme.ND0],
|
|
190
|
+
size: 16,
|
|
191
|
+
theme: "multi-color"
|
|
192
|
+
})),
|
|
193
|
+
title: title,
|
|
194
|
+
subTitle: subTitle
|
|
195
|
+
}),
|
|
196
|
+
okText: okText,
|
|
197
|
+
cancelText: cancelText
|
|
133
198
|
}, restProps));
|
|
134
199
|
};
|
|
135
200
|
|
|
136
201
|
Modal.error = function errorFn(props) {
|
|
137
|
-
var
|
|
138
|
-
_props$okButtonProps4 = props.okButtonProps,
|
|
202
|
+
var _props$okButtonProps4 = props.okButtonProps,
|
|
139
203
|
okButtonProps = _props$okButtonProps4 === void 0 ? {} : _props$okButtonProps4,
|
|
140
204
|
_props$cancelButtonPr4 = props.cancelButtonProps,
|
|
141
205
|
cancelButtonProps = _props$cancelButtonPr4 === void 0 ? {} : _props$cancelButtonPr4,
|
|
142
206
|
okType = props.okType,
|
|
143
207
|
width = props.width,
|
|
144
|
-
|
|
208
|
+
title = props.title,
|
|
209
|
+
subTitle = props.subTitle,
|
|
210
|
+
_props$okText4 = props.okText,
|
|
211
|
+
okText = _props$okText4 === void 0 ? '确定' : _props$okText4,
|
|
212
|
+
_props$cancelText4 = props.cancelText,
|
|
213
|
+
cancelText = _props$cancelText4 === void 0 ? '取消' : _props$cancelText4,
|
|
214
|
+
className = props.className,
|
|
215
|
+
restProps = _objectWithoutProperties(props, _excluded5);
|
|
145
216
|
|
|
146
|
-
return AntdModal.
|
|
217
|
+
return AntdModal.error(_objectSpread({
|
|
147
218
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
148
219
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
149
220
|
width: width || DEFAULT_WIDTH,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
221
|
+
className: classNames('ald-modal', className),
|
|
222
|
+
title: ModalTitle({
|
|
223
|
+
icon: /*#__PURE__*/React.createElement(DoubleCircleIcon, {
|
|
224
|
+
type: "error"
|
|
225
|
+
}, /*#__PURE__*/React.createElement(AlertTriangleDuotone, {
|
|
226
|
+
fill: [theme.SC40, theme.ND0],
|
|
227
|
+
size: 16,
|
|
228
|
+
theme: "multi-color"
|
|
229
|
+
})),
|
|
230
|
+
title: title,
|
|
231
|
+
subTitle: subTitle
|
|
232
|
+
}),
|
|
233
|
+
okText: okText,
|
|
234
|
+
cancelText: cancelText
|
|
155
235
|
}, restProps));
|
|
156
236
|
};
|
|
157
237
|
|
|
158
238
|
Modal.warning = function modalWarn(props) {
|
|
159
|
-
var
|
|
160
|
-
_props$okButtonProps5 = props.okButtonProps,
|
|
239
|
+
var _props$okButtonProps5 = props.okButtonProps,
|
|
161
240
|
okButtonProps = _props$okButtonProps5 === void 0 ? {} : _props$okButtonProps5,
|
|
162
241
|
_props$cancelButtonPr5 = props.cancelButtonProps,
|
|
163
242
|
cancelButtonProps = _props$cancelButtonPr5 === void 0 ? {} : _props$cancelButtonPr5,
|
|
164
243
|
okType = props.okType,
|
|
165
244
|
width = props.width,
|
|
166
|
-
|
|
245
|
+
title = props.title,
|
|
246
|
+
subTitle = props.subTitle,
|
|
247
|
+
_props$okText5 = props.okText,
|
|
248
|
+
okText = _props$okText5 === void 0 ? '确定' : _props$okText5,
|
|
249
|
+
_props$cancelText5 = props.cancelText,
|
|
250
|
+
cancelText = _props$cancelText5 === void 0 ? '取消' : _props$cancelText5,
|
|
251
|
+
className = props.className,
|
|
252
|
+
restProps = _objectWithoutProperties(props, _excluded6);
|
|
167
253
|
|
|
168
|
-
return AntdModal.
|
|
254
|
+
return AntdModal.warning(_objectSpread({
|
|
169
255
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
170
256
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
171
257
|
width: width || DEFAULT_WIDTH,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
258
|
+
// className: classNames('ald-modal-warning', className),
|
|
259
|
+
className: classNames('ald-modal ald-modal-warning', className),
|
|
260
|
+
title: ModalTitle({
|
|
261
|
+
icon: /*#__PURE__*/React.createElement(DoubleCircleIcon, {
|
|
262
|
+
type: "warning"
|
|
263
|
+
}, /*#__PURE__*/React.createElement(AlertTriangleDuotone, {
|
|
264
|
+
fill: [theme.SB40, theme.ND0],
|
|
265
|
+
theme: "multi-color",
|
|
266
|
+
size: 16
|
|
267
|
+
})),
|
|
268
|
+
title: title,
|
|
269
|
+
subTitle: subTitle
|
|
270
|
+
}),
|
|
271
|
+
okText: okText,
|
|
272
|
+
cancelText: cancelText
|
|
177
273
|
}, restProps));
|
|
178
274
|
};
|
|
179
275
|
|
|
180
276
|
Modal.confirm = function confirmFn(props) {
|
|
181
|
-
var
|
|
182
|
-
_props$okButtonProps6 = props.okButtonProps,
|
|
277
|
+
var _props$okButtonProps6 = props.okButtonProps,
|
|
183
278
|
okButtonProps = _props$okButtonProps6 === void 0 ? {} : _props$okButtonProps6,
|
|
184
279
|
_props$cancelButtonPr6 = props.cancelButtonProps,
|
|
185
280
|
cancelButtonProps = _props$cancelButtonPr6 === void 0 ? {} : _props$cancelButtonPr6,
|
|
186
281
|
okType = props.okType,
|
|
187
282
|
width = props.width,
|
|
188
|
-
|
|
283
|
+
title = props.title,
|
|
284
|
+
subTitle = props.subTitle,
|
|
285
|
+
className = props.className,
|
|
286
|
+
_props$okText6 = props.okText,
|
|
287
|
+
okText = _props$okText6 === void 0 ? '确定' : _props$okText6,
|
|
288
|
+
_props$cancelText6 = props.cancelText,
|
|
289
|
+
cancelText = _props$cancelText6 === void 0 ? '取消' : _props$cancelText6,
|
|
290
|
+
restProps = _objectWithoutProperties(props, _excluded7);
|
|
189
291
|
|
|
190
|
-
return AntdModal.
|
|
292
|
+
return AntdModal.confirm(_objectSpread({
|
|
191
293
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
192
294
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
193
295
|
width: width || DEFAULT_WIDTH,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
296
|
+
className: classNames('ald-modal', className),
|
|
297
|
+
title: ModalTitle({
|
|
298
|
+
icon: /*#__PURE__*/React.createElement(DoubleCircleIcon, {
|
|
299
|
+
type: "info"
|
|
300
|
+
}, /*#__PURE__*/React.createElement(InfoCircleLine, {
|
|
301
|
+
size: 16,
|
|
302
|
+
fill: theme.B40,
|
|
303
|
+
className: "ald-modal-close"
|
|
304
|
+
})),
|
|
305
|
+
title: title,
|
|
306
|
+
subTitle: subTitle
|
|
307
|
+
}),
|
|
308
|
+
okText: okText,
|
|
309
|
+
cancelText: cancelText
|
|
199
310
|
}, restProps));
|
|
200
311
|
};
|
|
201
312
|
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
.ald-modal {
|
|
4
4
|
.ant-modal-content {
|
|
5
|
-
padding:
|
|
5
|
+
padding: 15px 23px;
|
|
6
6
|
box-shadow: 0 20px 24px -4px rgb(16 24 40 / 8%),
|
|
7
7
|
0 8px 8px -4px rgb(16 24 40 / 3%);
|
|
8
8
|
border-radius: 4px;
|
|
9
|
+
border:1px solid @BG60;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.ald-modal-close {
|
|
@@ -17,9 +18,10 @@
|
|
|
17
18
|
.ald-modal-title-container {
|
|
18
19
|
display: flex;
|
|
19
20
|
align-items: center;
|
|
21
|
+
gap: 12px;
|
|
20
22
|
|
|
21
23
|
.ald-modal-text-container {
|
|
22
|
-
margin-left: 12px;
|
|
24
|
+
// margin-left: 12px;
|
|
23
25
|
flex: 1;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -61,12 +63,21 @@
|
|
|
61
63
|
font-size: 13px;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
.ant-modal-footer{
|
|
66
|
+
.ant-modal-footer {
|
|
65
67
|
.ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
|
|
66
68
|
margin-bottom: 0;
|
|
67
69
|
margin-inline-start: 12px;
|
|
68
70
|
}
|
|
69
|
-
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ald-modal-padding-less{
|
|
76
|
+
.ant-modal-content {
|
|
77
|
+
.ant-modal-body{
|
|
78
|
+
margin: 0 -24px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
.ant-modal-confirm {
|
|
@@ -75,15 +86,45 @@
|
|
|
75
86
|
flex: 1;
|
|
76
87
|
overflow: initial;
|
|
77
88
|
margin-inline-start: 12px;
|
|
78
|
-
|
|
89
|
+
|
|
79
90
|
& + .ant-modal-confirm-content {
|
|
80
91
|
margin-block-start: 16px;
|
|
81
|
-
margin-left:28px;
|
|
92
|
+
margin-left: 28px;
|
|
82
93
|
}
|
|
83
94
|
}
|
|
95
|
+
|
|
84
96
|
}
|
|
85
97
|
|
|
86
|
-
.ant-modal-confirm-
|
|
98
|
+
.ant-modal-confirm-body{
|
|
99
|
+
display: block;
|
|
100
|
+
|
|
101
|
+
> span.anticon{
|
|
102
|
+
display: none;
|
|
103
|
+
|
|
104
|
+
+.ant-modal-confirm-title+.ant-modal-confirm-content{
|
|
105
|
+
margin-left: 0;
|
|
106
|
+
margin-top: 16px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ant-modal-confirm-btns {
|
|
87
112
|
margin-block-start: 16px;
|
|
88
113
|
}
|
|
89
114
|
}
|
|
115
|
+
|
|
116
|
+
.ald-modal-warning {
|
|
117
|
+
.ant-modal-confirm-btns {
|
|
118
|
+
.ald-btn {
|
|
119
|
+
background-color: @SB40;
|
|
120
|
+
border-color: @SB40;
|
|
121
|
+
|
|
122
|
+
&:hover,
|
|
123
|
+
&:active,
|
|
124
|
+
&:focus {
|
|
125
|
+
background-color: @SB40;
|
|
126
|
+
border-color: @SB40;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -12,9 +12,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
12
12
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
|
|
15
|
-
import React, { createContext, useRef } from 'react';
|
|
16
|
-
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
17
15
|
import classNames from 'classnames';
|
|
16
|
+
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
17
|
+
import React, { createContext, useRef } from 'react';
|
|
18
18
|
export var RadioGroupContext = /*#__PURE__*/createContext({});
|
|
19
19
|
export default function RadioGroup(props) {
|
|
20
20
|
var children = props.children,
|
|
@@ -24,7 +24,9 @@ export default function RadioGroup(props) {
|
|
|
24
24
|
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
25
25
|
_props$type = props.type,
|
|
26
26
|
type = _props$type === void 0 ? 'radio' : _props$type,
|
|
27
|
-
className = props.className
|
|
27
|
+
className = props.className,
|
|
28
|
+
_props$disabled = props.disabled,
|
|
29
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled; // 滑块的ref
|
|
28
30
|
|
|
29
31
|
var sliderRef = useRef(null); // 该hooks与useState相同,但是当props中有value值时,优先使用value的值
|
|
30
32
|
|
|
@@ -63,12 +65,15 @@ export default function RadioGroup(props) {
|
|
|
63
65
|
radioGroupStyle: radioGroupStyle,
|
|
64
66
|
size: size,
|
|
65
67
|
type: type,
|
|
66
|
-
sliderRef: sliderRef
|
|
68
|
+
sliderRef: sliderRef,
|
|
69
|
+
disabled: disabled
|
|
67
70
|
}
|
|
68
71
|
}, /*#__PURE__*/React.createElement("div", {
|
|
69
72
|
className: getWrapperClass()
|
|
70
|
-
}, children, radioGroupStyle === 'filled' && type !== 'radio' ? /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className:
|
|
73
|
+
}, children, (radioGroupStyle === 'filled' || radioGroupStyle === 'filter') && type !== 'radio' ? /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: classNames('ald-radio-filled-slider ', {
|
|
75
|
+
'ald-radio-filled-slider-filter': radioGroupStyle === 'filter'
|
|
76
|
+
}),
|
|
72
77
|
ref: sliderRef
|
|
73
78
|
}) : null));
|
|
74
79
|
}
|
|
@@ -5,10 +5,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
9
8
|
import _ from 'lodash';
|
|
10
|
-
import {
|
|
9
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
11
10
|
import { getUUID } from "../../../_utils/hooks/useId";
|
|
11
|
+
import { RadioGroupContext } from "../Group";
|
|
12
12
|
export default function Radio(props) {
|
|
13
13
|
var groupContext = useContext(RadioGroupContext);
|
|
14
14
|
var labelRef = useRef(null);
|
|
@@ -17,7 +17,7 @@ export default function Radio(props) {
|
|
|
17
17
|
var radioProps = _objectSpread({}, props);
|
|
18
18
|
|
|
19
19
|
if (!_.isEmpty(groupContext)) {
|
|
20
|
-
radioProps.disabled = props.disabled;
|
|
20
|
+
radioProps.disabled = groupContext.disabled || props.disabled;
|
|
21
21
|
radioProps.checked = !props.disabled && groupContext.value === props.value;
|
|
22
22
|
} else {
|
|
23
23
|
radioProps.checked = !('checked' in props) ? props.defaultChecked : radioProps.checked;
|
|
@@ -35,14 +35,22 @@ export default function Radio(props) {
|
|
|
35
35
|
if (groupContext.type === 'button') {
|
|
36
36
|
if (groupContext.radioGroupStyle === 'filled') {
|
|
37
37
|
otherClass = 'ald-radio-button-wrapper-filled';
|
|
38
|
-
} else {
|
|
38
|
+
} else if (groupContext.radioGroupStyle === 'border') {
|
|
39
39
|
otherClass = 'ald-radio-button-wrapper-border';
|
|
40
|
+
} else if (groupContext.radioGroupStyle === 'filter') {
|
|
41
|
+
otherClass = 'ald-radio-button-wrapper-filter';
|
|
42
|
+
} else {
|
|
43
|
+
otherClass = 'ald-radio-button-wrapper-border-primary';
|
|
40
44
|
}
|
|
41
45
|
} else if (groupContext.type === 'iconButton') {
|
|
42
46
|
if (groupContext.radioGroupStyle === 'filled') {
|
|
43
47
|
otherClass = 'ald-radio-icon-button-wrapper-filled';
|
|
44
|
-
} else {
|
|
48
|
+
} else if (groupContext.radioGroupStyle === 'border') {
|
|
45
49
|
otherClass = 'ald-radio-icon-button-wrapper-border';
|
|
50
|
+
} else if (groupContext.radioGroupStyle === 'filter') {
|
|
51
|
+
otherClass = 'ald-radio-icon-button-wrapper-filter';
|
|
52
|
+
} else {
|
|
53
|
+
otherClass = 'ald-radio-icon-button-wrapper-border-primary';
|
|
46
54
|
}
|
|
47
55
|
} else {
|
|
48
56
|
// 当type未设置或者是radio时
|
|
@@ -67,7 +75,6 @@ export default function Radio(props) {
|
|
|
67
75
|
|
|
68
76
|
var onChange = function onChange() {
|
|
69
77
|
if (groupContext !== null && groupContext !== void 0 && groupContext.onChange) {
|
|
70
|
-
// console.log(e);
|
|
71
78
|
// input事件的value会被toString,所以此处进行一个覆盖
|
|
72
79
|
groupContext.onChange(props.value);
|
|
73
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export declare type TRadioGroupStyle = 'border' | 'filled';
|
|
2
|
+
export declare type TRadioGroupStyle = 'border' | 'filled' | 'borderPrimary' | 'filter';
|
|
3
3
|
export declare type TRadioSize = 'large' | 'middle' | 'small' | 'default';
|
|
4
4
|
export declare type TRadioType = 'radio' | 'button' | 'iconButton';
|
|
5
5
|
export interface IRadioGroupProps {
|
|
@@ -13,6 +13,11 @@ export interface IRadioGroupProps {
|
|
|
13
13
|
* @default -
|
|
14
14
|
*/
|
|
15
15
|
defaultValue?: any;
|
|
16
|
+
/**
|
|
17
|
+
* @description 整组禁用
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
16
21
|
/**
|
|
17
22
|
* @description 设置按钮组的大小,有'large' | 'middle'('default') | 'small
|
|
18
23
|
* @default 'middle'
|