@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.5
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/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +89 -117
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +7 -9
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +242 -330
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +22 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +219 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +66 -74
- package/FormItem/index.js +14 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +905 -796
- package/SelectorPicker/index.js +111 -133
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +25 -26
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +767 -963
- package/Tabs/index.js +102 -102
- package/Tag/index.js +115 -162
- package/TextEditor/index.js +81 -103
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +27 -28
- package/Timeline/index.js +67 -58
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +53 -52
- package/Tooltip/index.js +79 -82
- package/Transfer/index.js +159 -201
- package/Tree/index.js +7 -12
- package/Upload/index.js +523 -758
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
- package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
- package/index.js +21 -22
- package/locale/index.js +6 -6
- package/package.json +1 -1
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-232d890b.js +0 -327
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/toConsumableArray-8f4c9589.js +0 -19
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Progress/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { Circle } from 'rc-progress';
|
|
4
|
-
import
|
|
4
|
+
import SuccessOutlined from '@para-ui/icons/CheckCircleF';
|
|
5
5
|
import CloseCircleF from '@para-ui/icons/CloseCircleF';
|
|
6
6
|
import Check from '@para-ui/icons/Check';
|
|
7
7
|
import CloseIcon from '@para-ui/icons/Close';
|
|
8
|
-
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
percent =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const Steps = props => {
|
|
12
|
+
const {
|
|
13
|
+
steps,
|
|
14
|
+
percent = 0,
|
|
15
|
+
strokeWidth = 8,
|
|
16
|
+
strokeColor,
|
|
17
|
+
trailColor,
|
|
18
|
+
children
|
|
19
|
+
} = props;
|
|
20
20
|
/** 计算出应该高亮多少步 **/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
for (
|
|
21
|
+
const current = typeof percent === 'number' ? Math.round(steps * (percent / 100)) : 1;
|
|
22
|
+
const styledSteps = [];
|
|
23
|
+
for (let i = 0; i < steps; i += 1) {
|
|
24
24
|
styledSteps.push(jsx("div", {
|
|
25
25
|
className: i <= current - 1 ? 'steps-item steps-item-active' : 'steps-item',
|
|
26
26
|
style: {
|
|
@@ -64,11 +64,11 @@ function validProgress(progress) {
|
|
|
64
64
|
* @param gradients 渐变的参数
|
|
65
65
|
* @return {string} 样式值
|
|
66
66
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Object.keys(gradients).forEach(
|
|
67
|
+
const sortGradient = gradients => {
|
|
68
|
+
let tempArr = [];
|
|
69
|
+
Object.keys(gradients).forEach(key => {
|
|
70
70
|
// 拿到百分比的数字
|
|
71
|
-
|
|
71
|
+
const formattedKey = parseFloat(key.replace(/%/g, ''));
|
|
72
72
|
// 进行序列化
|
|
73
73
|
if (!isNaN(formattedKey)) {
|
|
74
74
|
tempArr.push({
|
|
@@ -78,12 +78,12 @@ var sortGradient = function sortGradient(gradients) {
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
// 排序 从小到大
|
|
81
|
-
tempArr = tempArr.sort(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
tempArr = tempArr.sort((a, b) => a.key - b.key);
|
|
82
|
+
return tempArr.map(_ref => {
|
|
83
|
+
let {
|
|
84
|
+
key,
|
|
85
|
+
value
|
|
86
|
+
} = _ref;
|
|
87
87
|
return "".concat(value, " ").concat(key, "%");
|
|
88
88
|
}).join(', ');
|
|
89
89
|
};
|
|
@@ -105,17 +105,16 @@ var sortGradient = function sortGradient(gradients) {
|
|
|
105
105
|
* @param {string} strokeColor 颜色值
|
|
106
106
|
* @return 返回 backgroundImage 的样式值
|
|
107
107
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
direction = _strokeColor$directio === void 0 ? directionConfig === 'rtl' ? 'to left' : 'to right' : _strokeColor$directio,
|
|
108
|
+
const handleGradient = (strokeColor, directionConfig) => {
|
|
109
|
+
const {
|
|
110
|
+
from = '#3D66F8',
|
|
111
|
+
to = '#4F93F0',
|
|
112
|
+
direction = directionConfig === 'rtl' ? 'to left' : 'to right'
|
|
113
|
+
} = strokeColor,
|
|
115
114
|
rest = __rest(strokeColor, ["from", "to", "direction"]);
|
|
116
115
|
// 剩余参数有值说明除了from to direction 还传了 另外的参数
|
|
117
116
|
if (Object.keys(rest).length !== 0) {
|
|
118
|
-
|
|
117
|
+
const sortedGradients = sortGradient(rest);
|
|
119
118
|
return {
|
|
120
119
|
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(sortedGradients, ")")
|
|
121
120
|
};
|
|
@@ -124,23 +123,25 @@ var handleGradient = function handleGradient(strokeColor, directionConfig) {
|
|
|
124
123
|
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(from, ", ").concat(to, ")")
|
|
125
124
|
};
|
|
126
125
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const Line = props => {
|
|
127
|
+
const {
|
|
128
|
+
direction: directionConfig,
|
|
129
|
+
percent,
|
|
130
|
+
strokeWidth,
|
|
131
|
+
strokeColor,
|
|
132
|
+
strokeLinecap,
|
|
133
|
+
trailColor
|
|
134
|
+
} = props;
|
|
134
135
|
/** 进度条高亮部分的颜色样式 **/
|
|
135
|
-
|
|
136
|
+
const backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {
|
|
136
137
|
background: strokeColor
|
|
137
138
|
};
|
|
138
139
|
/** 进度条轨道部分的颜色样式 **/
|
|
139
|
-
|
|
140
|
+
const trailStyle = trailColor ? {
|
|
140
141
|
backgroundColor: trailColor
|
|
141
142
|
} : undefined;
|
|
142
143
|
/** 进度条百分比的样式 **/
|
|
143
|
-
|
|
144
|
+
const percentStyle = Object.assign({
|
|
144
145
|
width: "".concat(validProgress(percent), "%"),
|
|
145
146
|
height: strokeWidth || 8,
|
|
146
147
|
borderRadius: strokeLinecap === 'square' ? 0 : ''
|
|
@@ -175,39 +176,36 @@ var ProgressStatuses;
|
|
|
175
176
|
ProgressStatuses[ProgressStatuses["success"] = 3] = "success";
|
|
176
177
|
})(ProgressStatuses || (ProgressStatuses = {}));
|
|
177
178
|
/** 每个类型对应的进度条默认颜色 **/
|
|
178
|
-
|
|
179
|
+
const strokeColorMap = {
|
|
179
180
|
success: 'rgba(19, 191, 76, 1)',
|
|
180
181
|
exception: 'rgba(244, 66, 66, 1)',
|
|
181
182
|
normal: 'rgba(46, 101, 230, 1)',
|
|
182
183
|
active: 'rgba(46, 101, 230, 1)'
|
|
183
184
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
strokeColor = props.strokeColor,
|
|
202
|
-
_props$gapDegree = props.gapDegree,
|
|
203
|
-
gapDegree = _props$gapDegree === void 0 ? 75 : _props$gapDegree,
|
|
185
|
+
const Progress = props => {
|
|
186
|
+
const {
|
|
187
|
+
type = 'line',
|
|
188
|
+
className,
|
|
189
|
+
style,
|
|
190
|
+
children,
|
|
191
|
+
status,
|
|
192
|
+
width = 132,
|
|
193
|
+
showInfo = true,
|
|
194
|
+
format,
|
|
195
|
+
success,
|
|
196
|
+
percent = 0,
|
|
197
|
+
steps,
|
|
198
|
+
direction,
|
|
199
|
+
strokeColor,
|
|
200
|
+
gapDegree = 75
|
|
201
|
+
} = props,
|
|
204
202
|
otherProps = __rest(props, ["type", "className", "style", "children", "status", "width", "showInfo", "format", "success", "percent", "steps", "direction", "strokeColor", "gapDegree"]);
|
|
205
203
|
/**
|
|
206
204
|
* 处理class
|
|
207
205
|
* @return {string}
|
|
208
206
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
const classString = () => {
|
|
208
|
+
let str = "".concat($prefixCls, "-progress ").concat($prefixCls, "-progress-").concat(type || 'default');
|
|
211
209
|
// 添加成功状态的class
|
|
212
210
|
if (isSuccessStatus) str += " ".concat($prefixCls, "-progress-success-status");
|
|
213
211
|
// 添加错误状态下的class
|
|
@@ -221,7 +219,7 @@ var Progress = function Progress(props) {
|
|
|
221
219
|
* 处理进度条颜色
|
|
222
220
|
* @return {string}
|
|
223
221
|
*/
|
|
224
|
-
|
|
222
|
+
const strokeColorVal = () => {
|
|
225
223
|
// 如果传了成功进度条的配置
|
|
226
224
|
if (strokeColor) return strokeColor;
|
|
227
225
|
if (success && success.percent < percent) {
|
|
@@ -233,16 +231,16 @@ var Progress = function Progress(props) {
|
|
|
233
231
|
* 处理进度条的值
|
|
234
232
|
* @return {string}
|
|
235
233
|
*/
|
|
236
|
-
|
|
234
|
+
const renderPercent = () => {
|
|
237
235
|
if (success && success.percent < percent && typeof percent === 'number') {
|
|
238
236
|
return [success.percent, percent - success.percent];
|
|
239
237
|
}
|
|
240
238
|
return percent;
|
|
241
239
|
};
|
|
242
240
|
/** 标记是不是成功状态 **/
|
|
243
|
-
|
|
241
|
+
const isSuccessStatus = percent && percent === 100 && !status || status === 'success';
|
|
244
242
|
/** style值 **/
|
|
245
|
-
|
|
243
|
+
const renderStyle = type === 'circle' || type === 'dashboard' ? {
|
|
246
244
|
width: width,
|
|
247
245
|
height: width
|
|
248
246
|
} : {};
|
|
@@ -250,11 +248,11 @@ var Progress = function Progress(props) {
|
|
|
250
248
|
* 处理描述信息
|
|
251
249
|
* @return {string | ReactNode}
|
|
252
250
|
*/
|
|
253
|
-
|
|
251
|
+
const renderLabel = () => {
|
|
254
252
|
if (format) return format(percent);
|
|
255
253
|
if (isSuccessStatus) return type === 'circle' ? jsx(Check, {
|
|
256
254
|
className: "success"
|
|
257
|
-
}) : jsx(
|
|
255
|
+
}) : jsx(SuccessOutlined, {
|
|
258
256
|
className: "success"
|
|
259
257
|
});
|
|
260
258
|
if (status === 'exception') return type === 'circle' ? jsx(CloseIcon, {
|
|
@@ -265,7 +263,7 @@ var Progress = function Progress(props) {
|
|
|
265
263
|
return "".concat(validProgress(percent), "%");
|
|
266
264
|
};
|
|
267
265
|
/** 默认进度条 **/
|
|
268
|
-
|
|
266
|
+
const renderLineProgress = steps ? jsx(Steps, Object.assign({
|
|
269
267
|
steps: steps,
|
|
270
268
|
strokeColor: strokeColorVal(),
|
|
271
269
|
percent: renderPercent()
|
|
@@ -283,7 +281,7 @@ var Progress = function Progress(props) {
|
|
|
283
281
|
children: ' '
|
|
284
282
|
}));
|
|
285
283
|
/** 圆形进度条 **/
|
|
286
|
-
|
|
284
|
+
const renderCircleProgress = jsx(Circle, Object.assign({
|
|
287
285
|
strokeWidth: 6,
|
|
288
286
|
trailWidth: 6,
|
|
289
287
|
strokeColor: strokeColorVal(),
|
|
@@ -292,7 +290,7 @@ var Progress = function Progress(props) {
|
|
|
292
290
|
trailColor: 'rgba(234,236,241,1)'
|
|
293
291
|
}, otherProps));
|
|
294
292
|
/** 仪表盘 **/
|
|
295
|
-
|
|
293
|
+
const renderDashboardProgress = jsx(Circle, Object.assign({
|
|
296
294
|
strokeWidth: 6,
|
|
297
295
|
trailWidth: 6,
|
|
298
296
|
gapPosition: "bottom",
|
package/Querying/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
4
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
5
|
-
import { u as useGlobalProps } from '../_verture/useGlobalProps-
|
|
3
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
4
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
5
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
|
|
6
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import '@para-ui/core/GlobalContext';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const LargeSearch = () => {
|
|
11
11
|
return jsx("svg", Object.assign({
|
|
12
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13
13
|
width: "100%",
|
|
@@ -450,7 +450,7 @@ var LargeSearch = function LargeSearch() {
|
|
|
450
450
|
}))
|
|
451
451
|
}));
|
|
452
452
|
};
|
|
453
|
-
|
|
453
|
+
const SmallSearch = () => {
|
|
454
454
|
return jsx("svg", Object.assign({
|
|
455
455
|
xmlns: "http://www.w3.org/2000/svg",
|
|
456
456
|
width: "100%",
|
|
@@ -695,35 +695,34 @@ var zh = {
|
|
|
695
695
|
};
|
|
696
696
|
|
|
697
697
|
var localeJson = {
|
|
698
|
-
zh
|
|
699
|
-
en
|
|
698
|
+
zh,
|
|
699
|
+
en
|
|
700
700
|
};
|
|
701
701
|
|
|
702
702
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/4/2 上午10:55\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-querying {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n}\n.paraui-v4-querying > .querying-image {\n line-height: 0;\n overflow: hidden;\n}\n.paraui-v4-querying > .querying-image img {\n width: 100%;\n}\n.paraui-v4-querying .querying-image-large {\n width: 334px;\n height: 238px;\n}\n.paraui-v4-querying .querying-image-small {\n width: 120px;\n height: 80px;\n}\n.paraui-v4-querying > .querying-description {\n line-height: 17px;\n font-size: 14px;\n font-weight: 400;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-querying.paraui-v4-querying-large > .querying-description {\n margin-top: 20px;\n}\n.paraui-v4-querying.paraui-v4-querying-small > .querying-description {\n margin-top: 10px;\n font-size: 14px;\n}";
|
|
703
703
|
styleInject(css_248z);
|
|
704
704
|
|
|
705
|
-
|
|
705
|
+
const imageMap = {
|
|
706
706
|
large: jsx(LargeSearch, {}),
|
|
707
707
|
small: jsx(SmallSearch, {})
|
|
708
708
|
};
|
|
709
709
|
//Querying 查询中
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
className
|
|
713
|
-
style
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
var des = typeof description !== 'undefined' ? description : intl({
|
|
710
|
+
const Querying = props => {
|
|
711
|
+
const {
|
|
712
|
+
className,
|
|
713
|
+
style,
|
|
714
|
+
size = 'large',
|
|
715
|
+
imageStyle,
|
|
716
|
+
image = imageMap[size],
|
|
717
|
+
description,
|
|
718
|
+
customQuerying
|
|
719
|
+
} = useGlobalProps(props, 'Querying');
|
|
720
|
+
const intl = useFormatMessage('Querying', localeJson);
|
|
721
|
+
const des = typeof description !== 'undefined' ? description : intl({
|
|
723
722
|
id: 'querying'
|
|
724
723
|
});
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
const alt = typeof des === 'string' ? des : 'querying';
|
|
725
|
+
let imageNode = null;
|
|
727
726
|
if (typeof image === 'string') {
|
|
728
727
|
imageNode = jsx("img", {
|
|
729
728
|
src: image,
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
## 版本: 4.0.0-alpha
|
|
2
2
|
para-ui/core@4.0.0-alpha 发布
|
|
3
3
|
【lisq】
|
|
4
|
+
【Upload】添加loading属性
|
|
4
5
|
【确认框-Confirm】修复确认框国际化问题
|
|
5
6
|
【Upload】ImageUpload 文案添加居中
|
|
6
7
|
【表单-FormItem】移除console.log
|
|
@@ -100,4 +101,5 @@
|
|
|
100
101
|
【组织树-Tree】修改组织树icon和title不在同一行的问题
|
|
101
102
|
【表单-Form】表单校验国际化
|
|
102
103
|
【表单-Form】修复当单选框组的的值是boolean的时候,设置默认值为fasle选中不了的问题
|
|
104
|
+
【表单-Form】修改表单校验文案
|
|
103
105
|
|
package/Radio/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useState, useEffect } from 'react';
|
|
4
3
|
import Label from '../Label/index.js';
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
4
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
5
|
import { Tooltip } from '../Tooltip/index.js';
|
|
7
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
9
7
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
10
8
|
import '../Help/index.js';
|
|
11
9
|
import '@para-ui/icons/Help';
|
|
@@ -17,32 +15,27 @@ import '@para-ui/icons/Forbid';
|
|
|
17
15
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-radio {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n line-height: 16px;\n}\n.paraui-v4-radio:hover {\n /*& > .radio-label {\n color: $NP1;\n cursor: pointer;\n\n svg {\n color: $NP1;\n }\n }*/\n /*& > .radio-help {\n & > .radio-label {\n color: $NP1;\n cursor: pointer;\n\n svg {\n color: $NP1;\n }\n }\n }*/\n}\n.paraui-v4-radio:hover > .radio-box > .radio-box-inner {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-radio > .radio-box {\n position: relative;\n}\n.paraui-v4-radio > .radio-box > input {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.paraui-v4-radio > .radio-box > .radio-box-inner {\n position: relative;\n top: 0;\n left: 0;\n display: block;\n background-color: white;\n border: 1px solid rgb(212, 218, 227);\n border-radius: 50%;\n}\n.paraui-v4-radio > .radio-box > .radio-box-inner:after {\n position: absolute;\n display: table;\n content: \" \";\n transform: scale(1) translate(-50%, -50%);\n background-color: white;\n border-radius: 50%;\n left: 50%;\n top: 50%;\n}\n.paraui-v4-radio > .radio-label {\n color: rgb(29, 33, 38);\n padding: 0 8px;\n margin: 0;\n display: inline-flex;\n align-items: flex-start;\n overflow: hidden;\n cursor: pointer;\n}\n.paraui-v4-radio > .radio-label > .radio-help > svg {\n top: 0;\n}\n.paraui-v4-radio .radio-label {\n line-height: 16px;\n}\n.paraui-v4-radio > .radio-help {\n padding: 0 8px;\n position: relative;\n top: -1px;\n overflow: hidden;\n}\n.paraui-v4-radio > .radio-help > .radio-label {\n width: 100%;\n color: rgb(29, 33, 38);\n margin: 0;\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n cursor: pointer;\n}\n.paraui-v4-radio.paraui-v4-radio-checked > .radio-box > .radio-box-inner {\n border-color: transparent;\n background-color: rgb(46, 101, 230);\n}\n.paraui-v4-radio.paraui-v4-radio-checked:hover > .radio-box > .radio-box-inner {\n border-color: transparent;\n background-color: rgb(87, 131, 235);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-radio.paraui-v4-radio-disabled:hover > .radio-box > .radio-box-inner {\n background-color: rgb(234, 236, 241);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-label {\n color: rgb(161, 168, 179);\n cursor: not-allowed;\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-label svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-box > input {\n cursor: not-allowed;\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-box > .radio-box-inner {\n background-color: rgb(234, 236, 241);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-box > .radio-box-inner:after {\n background-color: rgb(234, 236, 241);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled.paraui-v4-radio-checked > .radio-box > .radio-box-inner {\n background-color: rgb(212, 218, 227);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled.paraui-v4-radio-checked > .radio-box > .radio-box-inner:hover > .radio-box > .radio-box-inner {\n background-color: rgb(212, 218, 227);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled.paraui-v4-radio-checked > .radio-box > .radio-box-inner:after {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-help {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-radio.paraui-v4-radio-disabled > .radio-help > .radio-label {\n color: rgb(161, 168, 179);\n cursor: not-allowed;\n}\n.paraui-v4-radio.paraui-v4-radio-small > .radio-box > .radio-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-radio.paraui-v4-radio-small > .radio-box > .radio-box-inner:after {\n width: 4px;\n height: 4px;\n}\n.paraui-v4-radio.paraui-v4-radio-medium > .radio-box > .radio-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-radio.paraui-v4-radio-medium > .radio-box > .radio-box-inner:after {\n width: 4px;\n height: 4px;\n}\n.paraui-v4-radio.paraui-v4-radio-large > .radio-box > .radio-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-radio.paraui-v4-radio-large > .radio-box > .radio-box-inner:after {\n width: 4px;\n height: 4px;\n}";
|
|
18
16
|
styleInject(css_248z);
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className =
|
|
23
|
-
labelTooltip
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _useState = useState(false),
|
|
35
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
-
checkedCom = _useState2[0],
|
|
37
|
-
setCheckedCom = _useState2[1]; // 复选框状态
|
|
38
|
-
useEffect(function () {
|
|
18
|
+
const Radio = props => {
|
|
19
|
+
const {
|
|
20
|
+
className = '',
|
|
21
|
+
labelTooltip,
|
|
22
|
+
label = '',
|
|
23
|
+
size = 'large',
|
|
24
|
+
disabled = false,
|
|
25
|
+
disabledTooltip,
|
|
26
|
+
width,
|
|
27
|
+
onChange,
|
|
28
|
+
style
|
|
29
|
+
} = props;
|
|
30
|
+
const [checkedCom, setCheckedCom] = useState(false); // 复选框状态
|
|
31
|
+
useEffect(() => {
|
|
39
32
|
if (props.defaultChecked !== undefined) setCheckedCom(props.defaultChecked);
|
|
40
33
|
}, []);
|
|
41
|
-
useEffect(
|
|
34
|
+
useEffect(() => {
|
|
42
35
|
if (props.checked !== undefined) setCheckedCom(props.checked);
|
|
43
36
|
}, [props.checked]);
|
|
44
37
|
// 点击选择
|
|
45
|
-
|
|
38
|
+
const clickCheck = e => {
|
|
46
39
|
e.preventDefault();
|
|
47
40
|
if (disabled) return;
|
|
48
41
|
// 不可受控组件
|
|
@@ -51,36 +44,36 @@ var Radio = function Radio(props) {
|
|
|
51
44
|
onChange && onChange(e, !checkedCom);
|
|
52
45
|
};
|
|
53
46
|
// 处理className
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
const handClass = () => {
|
|
48
|
+
let str = "".concat($prefixCls, "-radio");
|
|
56
49
|
if (className) str += " ".concat(className);
|
|
57
50
|
if (size) str += " ".concat($prefixCls, "-radio-").concat(size);
|
|
58
51
|
if (disabled) str += " ".concat($prefixCls, "-radio-disabled");
|
|
59
52
|
if (checkedCom) str += " ".concat($prefixCls, "-radio-checked");
|
|
60
53
|
return str;
|
|
61
54
|
};
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const handLabelClass = () => {
|
|
56
|
+
let str = 'radio-label';
|
|
64
57
|
if (labelTooltip && labelTooltip.className) {
|
|
65
58
|
str += " ".concat(labelTooltip.className);
|
|
66
59
|
}
|
|
67
60
|
return str;
|
|
68
61
|
};
|
|
69
62
|
/** 处理帮组classNaem */
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
const handHelpClassName = () => {
|
|
64
|
+
let str = ' radio-help';
|
|
72
65
|
if (labelTooltip && labelTooltip.helpClassName) {
|
|
73
66
|
str += " ".concat(labelTooltip.helpClassName);
|
|
74
67
|
}
|
|
75
68
|
return str;
|
|
76
69
|
};
|
|
77
70
|
/** 处理样式 */
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
const handStyle = () => {
|
|
72
|
+
const obj = Object.assign({}, style);
|
|
80
73
|
if (width) obj.width = width;
|
|
81
74
|
return obj;
|
|
82
75
|
};
|
|
83
|
-
|
|
76
|
+
const contentRender = () => {
|
|
84
77
|
return jsxs("label", Object.assign({
|
|
85
78
|
className: handClass(),
|
|
86
79
|
style: handStyle(),
|
|
@@ -103,7 +96,7 @@ var Radio = function Radio(props) {
|
|
|
103
96
|
})) : null]
|
|
104
97
|
}));
|
|
105
98
|
};
|
|
106
|
-
|
|
99
|
+
const handleContentRender = () => {
|
|
107
100
|
if (disabledTooltip) {
|
|
108
101
|
return jsx(Tooltip, Object.assign({
|
|
109
102
|
disabled: true
|
package/RadioGroup/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { useState, useEffect } from 'react';
|
|
4
3
|
import { Radio } from '../Radio/index.js';
|
|
5
4
|
import Label from '../Label/index.js';
|
|
6
5
|
import HelperText from '../HelperText/index.js';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
8
7
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
10
8
|
import '../Tooltip/index.js';
|
|
11
9
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
12
10
|
import 'rc-tooltip';
|
|
@@ -19,59 +17,47 @@ import '@para-ui/icons/Help';
|
|
|
19
17
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-radio-group {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 100%;\n}\n.paraui-v4-radio-group > .radio-group-label {\n margin-bottom: 6px;\n}\n.paraui-v4-radio-group > .radio-group-content {\n line-height: 0;\n}\n.paraui-v4-radio-group > .radio-group-content .radio-item-box {\n margin-bottom: 4px;\n}\n.paraui-v4-radio-group > .radio-group-content > .radio-group-content-item {\n margin-bottom: 6px;\n}\n.paraui-v4-radio-group > .radio-group-content > .radio-group-content-item:last-child {\n margin-bottom: 0;\n}\n.paraui-v4-radio-group.paraui-v4-radio-group-column > .radio-group-content {\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-radio-group.paraui-v4-radio-group-column > .radio-group-content > span {\n margin-bottom: 10px;\n}\n.paraui-v4-radio-group.paraui-v4-radio-group-column > .radio-group-content > span:last-child {\n margin-bottom: 0;\n}";
|
|
20
18
|
styleInject(css_248z);
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
className =
|
|
25
|
-
style
|
|
26
|
-
label
|
|
27
|
-
labelTooltip
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_props$id = props.id,
|
|
45
|
-
id = _props$id === void 0 ? 'name' : _props$id,
|
|
46
|
-
value = props.value,
|
|
47
|
-
list = props.list,
|
|
48
|
-
onChange = props.onChange;
|
|
49
|
-
var _useState = useState(),
|
|
50
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
-
valueCom = _useState2[0],
|
|
52
|
-
setValueCom = _useState2[1];
|
|
53
|
-
useEffect(function () {
|
|
20
|
+
const RadioGroup = props => {
|
|
21
|
+
const {
|
|
22
|
+
className = '',
|
|
23
|
+
style,
|
|
24
|
+
label,
|
|
25
|
+
labelTooltip,
|
|
26
|
+
spacing = '32px',
|
|
27
|
+
itemWidth,
|
|
28
|
+
size = 'large',
|
|
29
|
+
row = true,
|
|
30
|
+
disabled = false,
|
|
31
|
+
required = false,
|
|
32
|
+
error = false,
|
|
33
|
+
hideErrorDom,
|
|
34
|
+
helperText = '',
|
|
35
|
+
id = 'name',
|
|
36
|
+
value,
|
|
37
|
+
list,
|
|
38
|
+
onChange
|
|
39
|
+
} = props;
|
|
40
|
+
const [valueCom, setValueCom] = useState();
|
|
41
|
+
useEffect(() => {
|
|
54
42
|
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
55
43
|
}, []);
|
|
56
|
-
useEffect(
|
|
44
|
+
useEffect(() => {
|
|
57
45
|
if (value !== undefined) setValueCom(value);
|
|
58
46
|
}, [value]);
|
|
59
47
|
/**
|
|
60
48
|
* 改变值
|
|
61
49
|
* @param item 点击当前项数据
|
|
62
50
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
onChange && onChange(name, item);
|
|
69
|
-
};
|
|
51
|
+
const onchangeCom = item => () => {
|
|
52
|
+
const name = item[id]; // 值
|
|
53
|
+
if (value === name) return;
|
|
54
|
+
if (props.value === undefined) setValueCom(name);
|
|
55
|
+
onChange && onChange(name, item);
|
|
70
56
|
};
|
|
71
|
-
|
|
57
|
+
const handLabel = () => {
|
|
72
58
|
if (label || required) {
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
const handLabelClass = () => {
|
|
60
|
+
let str = 'radio-group-label';
|
|
75
61
|
if (labelTooltip && labelTooltip.className) {
|
|
76
62
|
str += " ".concat(labelTooltip.className);
|
|
77
63
|
}
|
|
@@ -88,8 +74,8 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
88
74
|
/**
|
|
89
75
|
* @description 处理单选框每一项样式
|
|
90
76
|
* */
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
const handStyleItem = (item, index, arr) => {
|
|
78
|
+
const obj = Object.assign({
|
|
93
79
|
display: 'inline-block'
|
|
94
80
|
}, item.style);
|
|
95
81
|
if (spacing && row && arr.length !== index + 1) {
|
|
@@ -101,8 +87,8 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
101
87
|
return obj;
|
|
102
88
|
};
|
|
103
89
|
// 处理class
|
|
104
|
-
|
|
105
|
-
|
|
90
|
+
const handClass = () => {
|
|
91
|
+
let str = "".concat($prefixCls, "-radio-group");
|
|
106
92
|
if (className) str += " ".concat(className);
|
|
107
93
|
if (size) str += " ".concat($prefixCls, "-radio-group-size");
|
|
108
94
|
if (error) str += " ".concat($prefixCls, "-radio-group-error");
|
|
@@ -117,12 +103,12 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
117
103
|
children: [handLabel(), jsx("div", Object.assign({
|
|
118
104
|
className: "radio-group-content"
|
|
119
105
|
}, {
|
|
120
|
-
children: list.map(
|
|
106
|
+
children: list.map((item, index) => {
|
|
121
107
|
if (Array.isArray(item)) {
|
|
122
108
|
return jsx("div", Object.assign({
|
|
123
109
|
className: "radio-group-content-item"
|
|
124
110
|
}, {
|
|
125
|
-
children: item.map(
|
|
111
|
+
children: item.map((itemChild, inx) => {
|
|
126
112
|
return jsx("span", Object.assign({
|
|
127
113
|
className: 'radio-item-box',
|
|
128
114
|
style: handStyleItem(itemChild, inx, item)
|