ls-pro-common 3.1.53 → 3.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.
@@ -144,8 +144,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
144
144
  if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
145
145
  if (rowKey) {
146
146
  var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
147
- return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey];
147
+ if (record) return record; //直接返回当前记录
148
+ return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]; //返回表格内的表单项。
148
149
  }
150
+
149
151
  return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
150
152
  };
151
153
  /**
@@ -154,13 +156,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
154
156
  * @param formValue
155
157
  */
156
158
  var setFormValue = function setFormValue(formValue) {
159
+ var _prop$onChange;
160
+ (_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
157
161
  if (rowKey) {
158
- var _formRef$current3, _formRef$current3$set, _prop$onChange;
162
+ var _formRef$current3, _formRef$current3$set;
159
163
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
160
- (_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[textNameProp]);
161
164
  } else {
162
- var _prop$onChange2, _formRef$current4, _formRef$current4$set;
163
- (_prop$onChange2 = prop.onChange) === null || _prop$onChange2 === void 0 ? void 0 : _prop$onChange2.call(prop, formValue[name]);
165
+ var _formRef$current4, _formRef$current4$set;
164
166
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, formValue);
165
167
  }
166
168
  };
@@ -144,8 +144,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
144
144
  if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
145
145
  if (rowKey) {
146
146
  var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
147
- return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey];
147
+ if (record) return record; //直接返回当前记录
148
+ return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]; //返回表格内的表单项。
148
149
  }
150
+
149
151
  return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
150
152
  };
151
153
  /**
@@ -154,13 +156,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
154
156
  * @param formValue
155
157
  */
156
158
  var setFormValue = function setFormValue(formValue) {
159
+ var _prop$onChange;
160
+ (_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
157
161
  if (rowKey) {
158
- var _formRef$current3, _formRef$current3$set, _prop$onChange;
162
+ var _formRef$current3, _formRef$current3$set;
159
163
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
160
- (_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[textNameProp]);
161
164
  } else {
162
- var _prop$onChange2, _formRef$current4, _formRef$current4$set;
163
- (_prop$onChange2 = prop.onChange) === null || _prop$onChange2 === void 0 ? void 0 : _prop$onChange2.call(prop, formValue[name]);
165
+ var _formRef$current4, _formRef$current4$set;
164
166
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, formValue);
165
167
  }
166
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.53",
3
+ "version": "3.1.54",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [