ronds-metadata 1.1.52 → 1.1.54
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.
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
/*
|
9
9
|
* @Author: wangxian
|
10
10
|
* @Date: 2021-09-18 14:15:04
|
11
|
-
* @LastEditTime: 2022-
|
11
|
+
* @LastEditTime: 2022-11-03 11:14:58
|
12
12
|
*/
|
13
13
|
import React from 'react';
|
14
14
|
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
@@ -20,7 +20,7 @@ import { tr } from '../../../framework/locale';
|
|
20
20
|
import TableArray from './layout/TableArray';
|
21
21
|
|
22
22
|
function Index(props) {
|
23
|
-
var _fieldRule$, _fieldRule$$value, _fieldRule$2, _fieldRule$2$value;
|
23
|
+
var _fieldRule$, _fieldRule$$value, _fieldRule$2, _fieldRule$2$value, _extraInfo$disabled;
|
24
24
|
|
25
25
|
var id = props.id,
|
26
26
|
items = props.items,
|
@@ -74,6 +74,7 @@ function Index(props) {
|
|
74
74
|
}
|
75
75
|
}, help || (items === null || items === void 0 ? void 0 : items.type))), extraInfo.layout === 'table' && items.type === 'ref' ? /*#__PURE__*/React.createElement(TableArray, {
|
76
76
|
initValue: formContext.initialValues,
|
77
|
+
readonly: (_extraInfo$disabled = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled !== void 0 ? _extraInfo$disabled : disabled,
|
77
78
|
refId: items.refId,
|
78
79
|
form: formContext.form,
|
79
80
|
name: id
|
@@ -92,7 +93,7 @@ function Index(props) {
|
|
92
93
|
var add = _ref.add,
|
93
94
|
remove = _ref.remove;
|
94
95
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, idx) {
|
95
|
-
var _extraInfo$
|
96
|
+
var _extraInfo$disabled2;
|
96
97
|
|
97
98
|
return /*#__PURE__*/React.createElement("div", {
|
98
99
|
key: field.key,
|
@@ -105,7 +106,7 @@ function Index(props) {
|
|
105
106
|
idx: idx,
|
106
107
|
id: id
|
107
108
|
}), {
|
108
|
-
disabled: (_extraInfo$
|
109
|
+
disabled: (_extraInfo$disabled2 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled2 !== void 0 ? _extraInfo$disabled2 : disabled,
|
109
110
|
initEnumValue: initEnumValue,
|
110
111
|
isRefForm: isRefForm,
|
111
112
|
isShowTypeInfo: formContext.isShowTypeInfo,
|
@@ -17,6 +17,7 @@ import { deepClone } from '../../../../utils';
|
|
17
17
|
|
18
18
|
var TableArray = function TableArray(props) {
|
19
19
|
var initValue = props.initValue,
|
20
|
+
readonly = props.readonly,
|
20
21
|
name = props.name,
|
21
22
|
form = props.form,
|
22
23
|
refId = props.refId;
|
@@ -236,6 +237,7 @@ var TableArray = function TableArray(props) {
|
|
236
237
|
}
|
237
238
|
}, /*#__PURE__*/React.createElement(Editable, {
|
238
239
|
type: "multiple",
|
240
|
+
readonly: readonly,
|
239
241
|
defaultValue: defaultValue,
|
240
242
|
addPosition: "bottom",
|
241
243
|
columns: columns,
|
@@ -138,7 +138,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
138
138
|
fields.forEach(function (v, k) {
|
139
139
|
var _v$text;
|
140
140
|
|
141
|
-
if ((v === null || v === void 0 ? void 0 : (_v$text = v.text) === null || _v$text === void 0 ? void 0 : _v$text.type) === 'datePicker' && initialValues[k]) {
|
141
|
+
if (((v === null || v === void 0 ? void 0 : (_v$text = v.text) === null || _v$text === void 0 ? void 0 : _v$text.type) === 'datePicker' || (v === null || v === void 0 ? void 0 : v.type) === 'datePicker') && initialValues[k]) {
|
142
142
|
var _v$text2;
|
143
143
|
|
144
144
|
initialValues[k] = moment(initialValues[k], (v === null || v === void 0 ? void 0 : (_v$text2 = v.text) === null || _v$text2 === void 0 ? void 0 : _v$text2.format) || DEFAULT_DATE_FORMAT);
|
@@ -163,7 +163,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
163
163
|
var key = Object.keys(value);
|
164
164
|
var extra = fields.get(key[0]);
|
165
165
|
|
166
|
-
if ((extra === null || extra === void 0 ? void 0 : (_extra$text = extra.text) === null || _extra$text === void 0 ? void 0 : _extra$text.type) === 'datePicker') {
|
166
|
+
if ((extra === null || extra === void 0 ? void 0 : (_extra$text = extra.text) === null || _extra$text === void 0 ? void 0 : _extra$text.type) === 'datePicker' || (extra === null || extra === void 0 ? void 0 : extra.type) === 'datePicker') {
|
167
167
|
var _extra$text2, _extra$text3;
|
168
168
|
|
169
169
|
value[key[0]] = moment(value[key[0]]).format((extra === null || extra === void 0 ? void 0 : (_extra$text2 = extra.text) === null || _extra$text2 === void 0 ? void 0 : _extra$text2.format) || DEFAULT_DATE_FORMAT);
|
@@ -178,7 +178,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
178
178
|
fields.forEach(function (v, k) {
|
179
179
|
var _v$text3;
|
180
180
|
|
181
|
-
if ((v === null || v === void 0 ? void 0 : (_v$text3 = v.text) === null || _v$text3 === void 0 ? void 0 : _v$text3.type) === 'datePicker' && values[k]) {
|
181
|
+
if (((v === null || v === void 0 ? void 0 : (_v$text3 = v.text) === null || _v$text3 === void 0 ? void 0 : _v$text3.type) === 'datePicker' || (v === null || v === void 0 ? void 0 : v.type) === 'datePicker') && values[k]) {
|
182
182
|
var _v$text4;
|
183
183
|
|
184
184
|
values[k] = moment(values[k]).format((v === null || v === void 0 ? void 0 : (_v$text4 = v.text) === null || _v$text4 === void 0 ? void 0 : _v$text4.format) || DEFAULT_DATE_FORMAT);
|