@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
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
import { TextFieldProps, SelectProps, SwitchProps, InputNumberProps, InputLangProps, ComboSelectProps, DatePickerProps } from '@para-ui/core';
|
|
8
8
|
import { LabelProps } from "../Label";
|
|
9
|
+
import { TooltipProps } from "../Tooltip";
|
|
9
10
|
/**组件类型:输入框,下拉框,开关,数字输入框,国际化输入框,日期框,时间选择框,组合选择器,自定义组件*/
|
|
10
11
|
export type IInputType = 'TextField' | 'Select' | 'Switch' | 'InputNumber' | 'InputLang' | 'ComboSelect' | 'DatePicker' | 'custom';
|
|
11
12
|
/** 配置项*/
|
|
@@ -30,6 +31,8 @@ export type IConfig = {
|
|
|
30
31
|
style?: React.CSSProperties;
|
|
31
32
|
/** 标题样式 */
|
|
32
33
|
labelProps?: LabelProps;
|
|
34
|
+
/** 组件其他样式,返回每个组件的样式 */
|
|
35
|
+
otherProps?: (rowIndex: number, name: string, valueList?: IValueList) => any;
|
|
33
36
|
/** 其他*/
|
|
34
37
|
[name: string]: any;
|
|
35
38
|
} & (TextFieldProps | SelectProps | SwitchProps | InputNumberProps | InputLangProps | ComboSelectProps | DatePickerProps);
|
|
@@ -137,6 +140,10 @@ export interface IMultiValueProps {
|
|
|
137
140
|
* 禁用新增标识
|
|
138
141
|
*/
|
|
139
142
|
disabledAdd?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* 禁用提示
|
|
145
|
+
*/
|
|
146
|
+
disabledAddTooltip?: TooltipProps;
|
|
140
147
|
/**
|
|
141
148
|
* 列之间icon
|
|
142
149
|
* */
|
package/Empty/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 { u as useGlobalProps } from '../_verture/useGlobalProps-
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
3
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
4
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
|
|
5
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.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 LargeNull = () => {
|
|
11
11
|
return jsx("svg", Object.assign({
|
|
12
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13
13
|
width: "100%",
|
|
@@ -462,7 +462,7 @@ var LargeNull = function LargeNull() {
|
|
|
462
462
|
}))
|
|
463
463
|
}));
|
|
464
464
|
};
|
|
465
|
-
|
|
465
|
+
const SmallNull = () => {
|
|
466
466
|
return jsx("svg", Object.assign({
|
|
467
467
|
xmlns: "http://www.w3.org/2000/svg",
|
|
468
468
|
width: "100%",
|
|
@@ -562,42 +562,40 @@ var zh = {
|
|
|
562
562
|
};
|
|
563
563
|
|
|
564
564
|
var localeJson = {
|
|
565
|
-
zh
|
|
566
|
-
en
|
|
565
|
+
zh,
|
|
566
|
+
en
|
|
567
567
|
};
|
|
568
568
|
|
|
569
569
|
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-empty {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n}\n.paraui-v4-empty > .empty-image {\n line-height: 0;\n overflow: hidden;\n}\n.paraui-v4-empty > .empty-image img {\n width: 100%;\n}\n.paraui-v4-empty .empty-image-large {\n width: 334px;\n height: 238px;\n}\n.paraui-v4-empty .empty-image-small {\n width: 120px;\n height: 120px;\n}\n.paraui-v4-empty > .empty-description {\n line-height: 17px;\n font-size: 14px;\n font-weight: 400;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-empty > .empty-description > .empty-description-refresh {\n display: inline-block;\n}\n.paraui-v4-empty > .empty-description > .empty-description-refresh span {\n color: rgb(46, 101, 230);\n cursor: pointer;\n}\n.paraui-v4-empty > .empty-description > .empty-description-refresh span:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-empty.paraui-v4-empty-large > .empty-description {\n margin-top: 20px;\n}\n.paraui-v4-empty.paraui-v4-empty-small > .empty-description {\n margin-top: 10px;\n font-size: 14px;\n}";
|
|
570
570
|
styleInject(css_248z);
|
|
571
571
|
|
|
572
|
-
|
|
572
|
+
const imageMap = {
|
|
573
573
|
large: jsx(LargeNull, {}),
|
|
574
574
|
small: jsx(SmallNull, {})
|
|
575
575
|
};
|
|
576
576
|
//empty空状态
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
className
|
|
580
|
-
style
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
var intl = useFormatMessage('Empty', localeJson);
|
|
592
|
-
var handleClick = function handleClick(e) {
|
|
577
|
+
const Empty = props => {
|
|
578
|
+
const {
|
|
579
|
+
className,
|
|
580
|
+
style,
|
|
581
|
+
size = 'large',
|
|
582
|
+
imageStyle,
|
|
583
|
+
image = imageMap[size],
|
|
584
|
+
description,
|
|
585
|
+
showRefresh = false,
|
|
586
|
+
onRefresh,
|
|
587
|
+
customEmpty
|
|
588
|
+
} = useGlobalProps(props, 'Empty');
|
|
589
|
+
const intl = useFormatMessage('Empty', localeJson);
|
|
590
|
+
const handleClick = e => {
|
|
593
591
|
onRefresh === null || onRefresh === void 0 ? void 0 : onRefresh(e);
|
|
594
592
|
};
|
|
595
|
-
|
|
593
|
+
const des = typeof description !== 'undefined' ? description : intl({
|
|
596
594
|
id: 'noData'
|
|
597
595
|
});
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
596
|
+
const alt = typeof des === 'string' ? des : 'empty';
|
|
597
|
+
let imageNode = null;
|
|
598
|
+
const refreshNode = showRefresh ? jsxs("span", Object.assign({
|
|
601
599
|
className: 'empty-description-refresh'
|
|
602
600
|
}, {
|
|
603
601
|
children: [intl({
|
package/Form/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { DeepClone } from '@paraview/lib';
|
|
5
3
|
import React__default from 'react';
|
|
6
|
-
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
9
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
4
|
+
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-ef1235fb.js';
|
|
5
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
10
7
|
import '../TextField/index.js';
|
|
11
|
-
import '../_verture/typeof-adeedc13.js';
|
|
12
8
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
13
9
|
import '../Label/index.js';
|
|
14
10
|
import '../Help/index.js';
|
|
@@ -26,16 +22,16 @@ import '../AutoTips/index.js';
|
|
|
26
22
|
import '../Loading/index.js';
|
|
27
23
|
import '@para-ui/icons/LoadingF';
|
|
28
24
|
import '../HelperText/index.js';
|
|
29
|
-
import '../_verture/useGlobalProps-
|
|
25
|
+
import '../_verture/useGlobalProps-1e416658.js';
|
|
30
26
|
import '@para-ui/core/GlobalContext';
|
|
31
|
-
import '../_verture/index-
|
|
27
|
+
import '../_verture/index-da9097d3.js';
|
|
32
28
|
import 'rc-dropdown';
|
|
33
|
-
import '../_verture/usePopupContainer-
|
|
29
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
34
30
|
import 'dayjs';
|
|
31
|
+
import '../_verture/slicedToArray-8223a2ef.js';
|
|
35
32
|
import '../RadioGroup/index.js';
|
|
36
33
|
import '../Radio/index.js';
|
|
37
34
|
import '../Select/index.js';
|
|
38
|
-
import '../_verture/defineProperty-1d116156.js';
|
|
39
35
|
import '../Empty/index.js';
|
|
40
36
|
import '@para-ui/icons/Close';
|
|
41
37
|
import '@para-ui/icons/Down';
|
|
@@ -54,8 +50,6 @@ import '../InputNumber/index.js';
|
|
|
54
50
|
import 'rc-input-number';
|
|
55
51
|
import '@para-ui/icons/Up';
|
|
56
52
|
import '../ComboSelect/index.js';
|
|
57
|
-
import '../_verture/index-232d890b.js';
|
|
58
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
59
53
|
import '../Table/index.js';
|
|
60
54
|
import '@para-ui/icons/ScreenF';
|
|
61
55
|
import '@para-ui/icons/UpTriangleF';
|
|
@@ -63,6 +57,10 @@ import '@para-ui/icons/DownTriangleF';
|
|
|
63
57
|
import '@para-ui/icons/Panel';
|
|
64
58
|
import '../OperateBtn/index.js';
|
|
65
59
|
import '@para-ui/icons/More';
|
|
60
|
+
import '../PopConfirm/index.js';
|
|
61
|
+
import '@para-ui/icons/CheckCircleF';
|
|
62
|
+
import '@para-ui/icons/WarningCircle';
|
|
63
|
+
import '@para-ui/icons/WarningCircleF';
|
|
66
64
|
import '@para-ui/icons/Refresh';
|
|
67
65
|
import '../Pagination/index.js';
|
|
68
66
|
import '@para-ui/icons/Left';
|
|
@@ -70,14 +68,15 @@ import 'rc-pagination';
|
|
|
70
68
|
import '@para-ui/icons/Right';
|
|
71
69
|
import '@para-ui/icons/DoubleLeft';
|
|
72
70
|
import '@para-ui/icons/DoubleRight';
|
|
73
|
-
import '../_verture/index-
|
|
71
|
+
import '../_verture/index-f186b5e8.js';
|
|
74
72
|
import 'rc-tree';
|
|
73
|
+
import '../_verture/typeof-adeedc13.js';
|
|
75
74
|
import '@para-ui/icons/Document';
|
|
76
75
|
import 'react-dom';
|
|
77
76
|
import '@para-ui/icons/EditFile';
|
|
78
77
|
import '@para-ui/icons/PlusCircle';
|
|
79
78
|
import '@para-ui/icons/MoreCircle';
|
|
80
|
-
import '../_verture/utils-
|
|
79
|
+
import '../_verture/utils-46e99c9a.js';
|
|
81
80
|
import '../Search/index.js';
|
|
82
81
|
|
|
83
82
|
/**
|
|
@@ -90,47 +89,40 @@ import '../Search/index.js';
|
|
|
90
89
|
* @param {string} type 表单形态 竖布局 或 横布局,默认横
|
|
91
90
|
* @description 用于根据配置自动生成表单
|
|
92
91
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
className =
|
|
97
|
-
FormProps
|
|
98
|
-
requiredElement
|
|
99
|
-
disRequiredElement
|
|
100
|
-
configList
|
|
101
|
-
type
|
|
102
|
-
getCheckForm
|
|
103
|
-
backData
|
|
104
|
-
disabled
|
|
105
|
-
onChange
|
|
106
|
-
getForcedRefresh
|
|
107
|
-
labelProps
|
|
108
|
-
helperTextProps
|
|
109
|
-
form
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var firstConfigList = React__default.useRef(configList);
|
|
92
|
+
const Form = props => {
|
|
93
|
+
const intl = useFormatMessage('FormItem', localeJson);
|
|
94
|
+
const {
|
|
95
|
+
className = '',
|
|
96
|
+
FormProps,
|
|
97
|
+
requiredElement,
|
|
98
|
+
disRequiredElement,
|
|
99
|
+
configList,
|
|
100
|
+
type,
|
|
101
|
+
getCheckForm,
|
|
102
|
+
backData,
|
|
103
|
+
disabled,
|
|
104
|
+
onChange,
|
|
105
|
+
getForcedRefresh,
|
|
106
|
+
labelProps,
|
|
107
|
+
helperTextProps,
|
|
108
|
+
form,
|
|
109
|
+
labelWidth = 60,
|
|
110
|
+
disOnlySpace = true
|
|
111
|
+
} = props;
|
|
112
|
+
const frstBackData = React__default.useRef(backData && DeepClone(backData) || {});
|
|
113
|
+
const firstConfigList = React__default.useRef(configList);
|
|
116
114
|
/**
|
|
117
115
|
* item配置项目
|
|
118
116
|
*/
|
|
119
|
-
|
|
120
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
121
|
-
itemsConfig = _React$useState2[0],
|
|
122
|
-
setItemsConfig = _React$useState2[1];
|
|
117
|
+
const [itemsConfig, setItemsConfig] = React__default.useState(configList);
|
|
123
118
|
/**
|
|
124
119
|
* 更新表单项
|
|
125
120
|
*/
|
|
126
|
-
|
|
127
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
128
|
-
refresh = _React$useState4[0],
|
|
129
|
-
setRefresh = _React$useState4[1];
|
|
121
|
+
const [refresh, setRefresh] = React__default.useState(Math.random());
|
|
130
122
|
/**
|
|
131
123
|
* 用于存储所有常用数据
|
|
132
124
|
*/
|
|
133
|
-
|
|
125
|
+
const refData = React__default.useRef({
|
|
134
126
|
allItems: {},
|
|
135
127
|
itemsCheckStatus: {},
|
|
136
128
|
itemsCheckMessage: {},
|
|
@@ -142,11 +134,11 @@ var Form = function Form(props) {
|
|
|
142
134
|
* @param {Array<FormItemProps>} list 表单项配置
|
|
143
135
|
* @param { [name: string]: any } bData 回填数据
|
|
144
136
|
*/
|
|
145
|
-
|
|
146
|
-
if (bData) for (
|
|
137
|
+
const refreshForm = (list, bData) => {
|
|
138
|
+
if (bData) for (const key in bData) {
|
|
147
139
|
refData.current.allValues[key] = bData[key];
|
|
148
140
|
}
|
|
149
|
-
setItemsConfig(list || itemsConfig &&
|
|
141
|
+
setItemsConfig(list || itemsConfig && [...itemsConfig]);
|
|
150
142
|
};
|
|
151
143
|
/**
|
|
152
144
|
* 保存值 和 最后的 item 对象
|
|
@@ -154,7 +146,7 @@ var Form = function Form(props) {
|
|
|
154
146
|
* @param {string} type 需要设置值的类型 value | item | status | initValue | message
|
|
155
147
|
* @param {any} value 需要设置的值
|
|
156
148
|
*/
|
|
157
|
-
|
|
149
|
+
const setValue = (name, type, value) => {
|
|
158
150
|
switch (type) {
|
|
159
151
|
// 设置校验状态,自定义类型的表格设置,如果有一个是false,最终校验都不会通过
|
|
160
152
|
case 'status':
|
|
@@ -183,18 +175,18 @@ var Form = function Form(props) {
|
|
|
183
175
|
* 校验表单校验状态
|
|
184
176
|
* @return {boolean | { [name: string]: any }} 返回 校验错误false,如果校验通过则返回表单所有值
|
|
185
177
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
for (
|
|
189
|
-
|
|
190
|
-
|
|
178
|
+
const checkFrom = () => {
|
|
179
|
+
let errorCount = 0;
|
|
180
|
+
for (let i = 0; i < refData.current.configList.length; i++) {
|
|
181
|
+
const key = refData.current.configList[i].name;
|
|
182
|
+
const tItem = refData.current.allItems[key];
|
|
191
183
|
// 判断是否已经校验过了 或是 不需要校验,直接跳过
|
|
192
184
|
if (tItem.disabled || tItem.hide || refData.current.itemsCheckStatus[key] === true) continue;
|
|
193
185
|
if (refData.current.itemsCheckStatus[key] === false) {
|
|
194
186
|
errorCount++;
|
|
195
187
|
continue;
|
|
196
188
|
}
|
|
197
|
-
|
|
189
|
+
const msg = validate(tItem, refData.current.allValues[key], intl);
|
|
198
190
|
if (msg) {
|
|
199
191
|
errorCount++;
|
|
200
192
|
if (typeof msg === 'string') refData.current.itemsCheckMessage[key] = msg;
|
|
@@ -206,10 +198,10 @@ var Form = function Form(props) {
|
|
|
206
198
|
/**
|
|
207
199
|
* 过滤有效值
|
|
208
200
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
for (
|
|
212
|
-
|
|
201
|
+
const getValidValues = () => {
|
|
202
|
+
const tObj = {};
|
|
203
|
+
for (let i = 0; i < refData.current.configList.length; i++) {
|
|
204
|
+
const item = refData.current.configList[i];
|
|
213
205
|
if (!item.hide && refData.current.allValues[item.name]) {
|
|
214
206
|
tObj[item.name] = refData.current.allValues[item.name];
|
|
215
207
|
}
|
|
@@ -219,9 +211,9 @@ var Form = function Form(props) {
|
|
|
219
211
|
/**
|
|
220
212
|
* 重置表单
|
|
221
213
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
214
|
+
const resetForm = function () {
|
|
215
|
+
let isClear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
216
|
+
let name = arguments.length > 1 ? arguments[1] : undefined;
|
|
225
217
|
if (!isClear || !name) {
|
|
226
218
|
refData.current = {
|
|
227
219
|
allItems: {},
|
|
@@ -230,7 +222,7 @@ var Form = function Form(props) {
|
|
|
230
222
|
configList: firstConfigList.current || [],
|
|
231
223
|
allValues: {}
|
|
232
224
|
};
|
|
233
|
-
if (frstBackData.current && !isClear) for (
|
|
225
|
+
if (frstBackData.current && !isClear) for (const key in frstBackData.current) {
|
|
234
226
|
refData.current.allValues[key] = frstBackData.current[key];
|
|
235
227
|
}
|
|
236
228
|
} else {
|
|
@@ -239,7 +231,7 @@ var Form = function Form(props) {
|
|
|
239
231
|
setValue(name, 'message', '');
|
|
240
232
|
setValue(name, 'initValue', undefined);
|
|
241
233
|
} else {
|
|
242
|
-
name.forEach(
|
|
234
|
+
name.forEach(key => {
|
|
243
235
|
setValue(key, 'status', undefined);
|
|
244
236
|
setValue(key, 'message', '');
|
|
245
237
|
setValue(key, 'initValue', undefined);
|
|
@@ -252,7 +244,7 @@ var Form = function Form(props) {
|
|
|
252
244
|
/**
|
|
253
245
|
* 传出校验方法
|
|
254
246
|
*/
|
|
255
|
-
React__default.useEffect(
|
|
247
|
+
React__default.useEffect(() => {
|
|
256
248
|
getCheckForm && getCheckForm(checkFrom);
|
|
257
249
|
getForcedRefresh && getForcedRefresh(refreshForm);
|
|
258
250
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -260,8 +252,8 @@ var Form = function Form(props) {
|
|
|
260
252
|
/**
|
|
261
253
|
* 更新值
|
|
262
254
|
*/
|
|
263
|
-
React__default.useEffect(
|
|
264
|
-
if (backData) for (
|
|
255
|
+
React__default.useEffect(() => {
|
|
256
|
+
if (backData) for (const key in backData) {
|
|
265
257
|
refData.current.allValues[key] = backData[key];
|
|
266
258
|
}
|
|
267
259
|
setRefresh(Math.random());
|
|
@@ -269,19 +261,19 @@ var Form = function Form(props) {
|
|
|
269
261
|
/**
|
|
270
262
|
* 更新配置
|
|
271
263
|
*/
|
|
272
|
-
React__default.useEffect(
|
|
264
|
+
React__default.useEffect(() => {
|
|
273
265
|
setItemsConfig(configList);
|
|
274
266
|
}, [configList]);
|
|
275
267
|
/**
|
|
276
268
|
* 更新表单最新配置
|
|
277
269
|
*/
|
|
278
|
-
React__default.useEffect(
|
|
270
|
+
React__default.useEffect(() => {
|
|
279
271
|
refData.current.configList = itemsConfig || [];
|
|
280
272
|
}, [itemsConfig]);
|
|
281
273
|
/**
|
|
282
274
|
* 表单对象赋值
|
|
283
275
|
*/
|
|
284
|
-
React__default.useEffect(
|
|
276
|
+
React__default.useEffect(() => {
|
|
285
277
|
if (form) {
|
|
286
278
|
form.current = {
|
|
287
279
|
get refreshForm() {
|
|
@@ -306,7 +298,7 @@ var Form = function Form(props) {
|
|
|
306
298
|
return resetForm;
|
|
307
299
|
},
|
|
308
300
|
get clear() {
|
|
309
|
-
return
|
|
301
|
+
return name => {
|
|
310
302
|
resetForm(true, name);
|
|
311
303
|
};
|
|
312
304
|
}
|
|
@@ -319,7 +311,7 @@ var Form = function Form(props) {
|
|
|
319
311
|
children: jsx("div", Object.assign({
|
|
320
312
|
className: "form-content ".concat(className)
|
|
321
313
|
}, {
|
|
322
|
-
children: itemsConfig && itemsConfig.length > 0 && itemsConfig.map(
|
|
314
|
+
children: itemsConfig && itemsConfig.length > 0 && itemsConfig.map((item, idx) => {
|
|
323
315
|
// 不显示则提前保存最后值
|
|
324
316
|
item.hide && setValue(item.name, 'item', item);
|
|
325
317
|
return !item.hide && jsx(FormItem, Object.assign({
|
package/FormItem/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { F as default } from '../_verture/index-
|
|
3
|
+
export { F as default } from '../_verture/index-ef1235fb.js';
|
|
4
4
|
import 'clsx';
|
|
5
5
|
import '../Label/index.js';
|
|
6
|
-
import '../_verture/constant-
|
|
7
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
8
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
6
|
+
import '../_verture/constant-5317fc89.js';
|
|
9
7
|
import '../TextField/index.js';
|
|
10
|
-
import '../_verture/typeof-adeedc13.js';
|
|
11
8
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
12
9
|
import '@paraview/lib';
|
|
13
10
|
import '@para-ui/icons/PreviewClose';
|
|
@@ -22,21 +19,20 @@ import '../_verture/style-inject.es-300983ab.js';
|
|
|
22
19
|
import '../Loading/index.js';
|
|
23
20
|
import '@para-ui/icons/LoadingF';
|
|
24
21
|
import '../HelperText/index.js';
|
|
25
|
-
import '../_verture/useGlobalProps-
|
|
22
|
+
import '../_verture/useGlobalProps-1e416658.js';
|
|
26
23
|
import '@para-ui/core/GlobalContext';
|
|
27
|
-
import '../_verture/index-
|
|
24
|
+
import '../_verture/index-da9097d3.js';
|
|
28
25
|
import 'rc-dropdown';
|
|
29
|
-
import '../_verture/usePopupContainer-
|
|
26
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
30
27
|
import 'dayjs';
|
|
31
28
|
import '../Help/index.js';
|
|
32
29
|
import '@para-ui/icons/Help';
|
|
30
|
+
import '../_verture/slicedToArray-8223a2ef.js';
|
|
33
31
|
import '../RadioGroup/index.js';
|
|
34
32
|
import '../Radio/index.js';
|
|
35
33
|
import '../Select/index.js';
|
|
36
|
-
import '../_verture/defineProperty-1d116156.js';
|
|
37
|
-
import '../_verture/toConsumableArray-8f4c9589.js';
|
|
38
34
|
import '../Empty/index.js';
|
|
39
|
-
import '../_verture/useFormatMessage-
|
|
35
|
+
import '../_verture/useFormatMessage-eb13cf56.js';
|
|
40
36
|
import '@para-ui/icons/Close';
|
|
41
37
|
import '@para-ui/icons/Down';
|
|
42
38
|
import '@para-ui/icons/Check';
|
|
@@ -54,8 +50,6 @@ import '../InputNumber/index.js';
|
|
|
54
50
|
import 'rc-input-number';
|
|
55
51
|
import '@para-ui/icons/Up';
|
|
56
52
|
import '../ComboSelect/index.js';
|
|
57
|
-
import '../_verture/index-232d890b.js';
|
|
58
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
59
53
|
import '../Table/index.js';
|
|
60
54
|
import '@para-ui/icons/ScreenF';
|
|
61
55
|
import '@para-ui/icons/UpTriangleF';
|
|
@@ -63,6 +57,10 @@ import '@para-ui/icons/DownTriangleF';
|
|
|
63
57
|
import '@para-ui/icons/Panel';
|
|
64
58
|
import '../OperateBtn/index.js';
|
|
65
59
|
import '@para-ui/icons/More';
|
|
60
|
+
import '../PopConfirm/index.js';
|
|
61
|
+
import '@para-ui/icons/CheckCircleF';
|
|
62
|
+
import '@para-ui/icons/WarningCircle';
|
|
63
|
+
import '@para-ui/icons/WarningCircleF';
|
|
66
64
|
import '@para-ui/icons/Refresh';
|
|
67
65
|
import '../Pagination/index.js';
|
|
68
66
|
import '@para-ui/icons/Left';
|
|
@@ -70,12 +68,13 @@ import 'rc-pagination';
|
|
|
70
68
|
import '@para-ui/icons/Right';
|
|
71
69
|
import '@para-ui/icons/DoubleLeft';
|
|
72
70
|
import '@para-ui/icons/DoubleRight';
|
|
73
|
-
import '../_verture/index-
|
|
71
|
+
import '../_verture/index-f186b5e8.js';
|
|
74
72
|
import 'rc-tree';
|
|
73
|
+
import '../_verture/typeof-adeedc13.js';
|
|
75
74
|
import '@para-ui/icons/Document';
|
|
76
75
|
import 'react-dom';
|
|
77
76
|
import '@para-ui/icons/EditFile';
|
|
78
77
|
import '@para-ui/icons/PlusCircle';
|
|
79
78
|
import '@para-ui/icons/MoreCircle';
|
|
80
|
-
import '../_verture/utils-
|
|
79
|
+
import '../_verture/utils-46e99c9a.js';
|
|
81
80
|
import '../Search/index.js';
|
package/FunctionModal/index.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { u as useModal } from '../_verture/modalContext-
|
|
2
|
-
export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-
|
|
3
|
-
import '../_verture/toConsumableArray-8f4c9589.js';
|
|
4
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
5
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
6
|
-
import '../_verture/index-232d890b.js';
|
|
7
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
1
|
+
import { u as useModal } from '../_verture/modalContext-5df08980.js';
|
|
2
|
+
export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-5df08980.js';
|
|
8
3
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
9
4
|
import 'react/jsx-runtime';
|
|
10
5
|
import 'react';
|
|
11
6
|
import '../Modal/index.js';
|
|
12
|
-
import '../_verture/defineProperty-1d116156.js';
|
|
13
|
-
import '../_verture/typeof-adeedc13.js';
|
|
14
7
|
import 'rc-dialog';
|
|
15
8
|
import '../Button/index.js';
|
|
16
9
|
import 'clsx';
|
|
@@ -18,20 +11,20 @@ import '@para-ui/icons/LoadingF';
|
|
|
18
11
|
import '../Tooltip/index.js';
|
|
19
12
|
import 'rc-tooltip';
|
|
20
13
|
import 'rc-tooltip/lib/placements';
|
|
21
|
-
import '../_verture/constant-
|
|
14
|
+
import '../_verture/constant-5317fc89.js';
|
|
22
15
|
import '@para-ui/icons/Forbid';
|
|
23
16
|
import '../_verture/style-inject.es-300983ab.js';
|
|
24
17
|
import '@para-ui/icons/Down';
|
|
25
|
-
import '../_verture/index-
|
|
18
|
+
import '../_verture/index-da9097d3.js';
|
|
26
19
|
import 'rc-dropdown';
|
|
27
|
-
import '../_verture/usePopupContainer-
|
|
20
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
28
21
|
import 'dayjs';
|
|
29
22
|
import '@paraview/lib';
|
|
30
|
-
import '../_verture/useFormatMessage-
|
|
23
|
+
import '../_verture/useFormatMessage-eb13cf56.js';
|
|
31
24
|
import '@para-ui/core/GlobalContext';
|
|
32
25
|
import '../AutoTips/index.js';
|
|
33
26
|
import '@para-ui/icons/Close';
|
|
34
|
-
import '../_verture/index-
|
|
27
|
+
import '../_verture/index-c568f272.js';
|
|
35
28
|
import 'react-dom';
|
|
36
29
|
import '@para-ui/icons/CheckCircleF';
|
|
37
30
|
import '@para-ui/icons/WarningCircleF';
|
package/GlobalContext/index.js
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { i as i18nIntl } from '../_verture/intl-
|
|
2
|
+
import { i as i18nIntl } from '../_verture/intl-f2f27722.js';
|
|
3
3
|
import { GetLanguage } from '@paraview/lib';
|
|
4
|
-
import { d as defaultModalLocale } from '../_verture/index-
|
|
5
|
-
import '../_verture/typeof-adeedc13.js';
|
|
4
|
+
import { d as defaultModalLocale } from '../_verture/index-c568f272.js';
|
|
6
5
|
|
|
7
6
|
//confirm 默认中文
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
let confirmRuntimeLocale = Object.assign({}, defaultModalLocale['zh']);
|
|
8
|
+
const changeConfirmLocale = newLocale => {
|
|
9
|
+
const confirmLocale = newLocale['Confirm'];
|
|
11
10
|
if (confirmLocale) {
|
|
12
11
|
confirmRuntimeLocale = Object.assign(Object.assign({}, confirmRuntimeLocale), confirmLocale);
|
|
13
12
|
} else {
|
|
14
13
|
confirmRuntimeLocale = Object.assign({}, defaultModalLocale['zh']);
|
|
15
14
|
}
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const getConfirmLocale = () => {
|
|
17
|
+
const lang = GetLanguage();
|
|
19
18
|
return (defaultModalLocale === null || defaultModalLocale === void 0 ? void 0 : defaultModalLocale[lang]) || defaultModalLocale['zh'];
|
|
20
19
|
};
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
const GlobalContext = /*#__PURE__*/React__default.createContext({
|
|
23
22
|
language: GetLanguage(),
|
|
24
23
|
// 防止不包provider,有国际化组件报错
|
|
25
|
-
intlFormat:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
};
|
|
24
|
+
intlFormat: (comName, defI18nData) => (ops, params) => {
|
|
25
|
+
const lang = GetLanguage();
|
|
26
|
+
return i18nIntl({
|
|
27
|
+
ops,
|
|
28
|
+
i18nData: {},
|
|
29
|
+
lang,
|
|
30
|
+
params,
|
|
31
|
+
defI18nData
|
|
32
|
+
});
|
|
36
33
|
},
|
|
37
34
|
// 每个组件的默认props
|
|
38
35
|
componentsProps: {}
|
package/Help/index.js
CHANGED
|
@@ -3,10 +3,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Tooltip } from '../Tooltip/index.js';
|
|
4
4
|
import HelpIcon from '@para-ui/icons/Help';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
7
7
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
9
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
10
8
|
import 'react';
|
|
11
9
|
import 'rc-tooltip';
|
|
12
10
|
import 'rc-tooltip/lib/placements';
|
|
@@ -16,15 +14,14 @@ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/12/2 下
|
|
|
16
14
|
styleInject(css_248z);
|
|
17
15
|
|
|
18
16
|
//help
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
placement = _props$placement === void 0 ? 'top-start' : _props$placement,
|
|
17
|
+
const Help = props => {
|
|
18
|
+
const {
|
|
19
|
+
title = '',
|
|
20
|
+
children,
|
|
21
|
+
arrow = true,
|
|
22
|
+
className,
|
|
23
|
+
placement = 'top-start'
|
|
24
|
+
} = props,
|
|
28
25
|
restProps = __rest(props, ["title", "children", "arrow", "className", "placement"]);
|
|
29
26
|
return jsx(Tooltip, Object.assign({
|
|
30
27
|
title: title,
|