ronds-metadata 1.0.20 → 1.0.24
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.
@@ -2,6 +2,8 @@ import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
5
|
+
import "antd/es/date-picker/style";
|
6
|
+
import _DatePicker from "antd/es/date-picker";
|
5
7
|
import "antd/es/popover/style";
|
6
8
|
import _Popover from "antd/es/popover";
|
7
9
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
@@ -31,6 +33,12 @@ function Index(props) {
|
|
31
33
|
color = _React$useState2[0],
|
32
34
|
setColor = _React$useState2[1];
|
33
35
|
|
36
|
+
React.useEffect(function () {
|
37
|
+
if ((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) === 'colorPicker') {
|
38
|
+
setColor(formContext.form.getFieldValue(id));
|
39
|
+
}
|
40
|
+
}, [extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type, formContext.form]);
|
41
|
+
|
34
42
|
var onColorChange = function onColorChange(e) {
|
35
43
|
formContext.form.setFieldsValue(_defineProperty({}, id, e.hex));
|
36
44
|
setColor(e.hex);
|
@@ -42,7 +50,7 @@ function Index(props) {
|
|
42
50
|
});
|
43
51
|
|
44
52
|
var processInputType = function processInputType(_type) {
|
45
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4;
|
53
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5;
|
46
54
|
|
47
55
|
switch (_type) {
|
48
56
|
case 'password':
|
@@ -76,9 +84,17 @@ function Index(props) {
|
|
76
84
|
content: colorPicker
|
77
85
|
}, /*#__PURE__*/React.createElement(BgColorsOutlined, null))));
|
78
86
|
|
87
|
+
case 'datePicker':
|
88
|
+
return /*#__PURE__*/React.createElement(_DatePicker, {
|
89
|
+
showTime: true,
|
90
|
+
format: "YYYY-MM-DD HH:mm:ss",
|
91
|
+
disabled: (_extraInfo$disabled4 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled4 !== void 0 ? _extraInfo$disabled4 : disabled,
|
92
|
+
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder
|
93
|
+
});
|
94
|
+
|
79
95
|
default:
|
80
96
|
return /*#__PURE__*/React.createElement(_Input, {
|
81
|
-
disabled: (_extraInfo$
|
97
|
+
disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
|
82
98
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
|
83
99
|
allowClear: true
|
84
100
|
});
|
@@ -14,7 +14,8 @@ function Index(props) {
|
|
14
14
|
var id = props.id,
|
15
15
|
name = props.name,
|
16
16
|
isRefForm = props.isRefForm,
|
17
|
-
initEnumValue = props.initEnumValue,
|
17
|
+
_props$initEnumValue = props.initEnumValue,
|
18
|
+
initEnumValue = _props$initEnumValue === void 0 ? {} : _props$initEnumValue,
|
18
19
|
disabled = props.disabled,
|
19
20
|
field = props.field,
|
20
21
|
isObj = props.isObj;
|
@@ -24,7 +25,7 @@ function Index(props) {
|
|
24
25
|
var options = React.useMemo(function () {
|
25
26
|
var _options = [];
|
26
27
|
|
27
|
-
if (!initEnumValue && props.enum && props.enum.length > 0) {
|
28
|
+
if (!initEnumValue[id] && props.enum && props.enum.length > 0) {
|
28
29
|
props.enum.forEach(function (_enum) {
|
29
30
|
var obj = {
|
30
31
|
label: _enum.value,
|
@@ -36,7 +37,7 @@ function Index(props) {
|
|
36
37
|
} // 目前是更具那么的id判断的,暂未考虑重名问题
|
37
38
|
|
38
39
|
|
39
|
-
if (initEnumValue) {
|
40
|
+
if (initEnumValue[id]) {
|
40
41
|
initEnumValue[id].forEach(function (_enum) {
|
41
42
|
var obj = {
|
42
43
|
label: _enum.value,
|