datasync-dynamic-form 1.1.15 → 1.1.17

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.
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
25
25
 
26
26
  // reactstrap components
27
27
 
28
- const debugging = false;
28
+ const debugging = true;
29
29
  const local = true;
30
30
  const production = !local;
31
31
  const globals = {
@@ -98,6 +98,7 @@ class DsDynamicForm extends _react.Component {
98
98
  //Ensure props.foreign_keys is a json object - PMAB on 2025-04-10
99
99
  if (this.props.foreign_keys && typeof this.props.foreign_keys !== "object") throw new Error("foreign_keys must be a json object !");
100
100
  this.local_data_blob.data_tier = Object.assign(this.props.foreign_keys ? this.props.foreign_keys : {}, duplicate_data_tier);
101
+ if (globals.parameters.debugging) console.log("clearForm->this.local_data_blob.data_tier =>", this.local_data_blob.data_tier);
101
102
  };
102
103
  getFieldData = fieldName => {
103
104
  /** Return data value form field object */
@@ -105,7 +106,13 @@ class DsDynamicForm extends _react.Component {
105
106
  return nextFieldData;
106
107
  };
107
108
  setFieldData = (fieldName, value) => {
108
- this.local_data_blob.data_tier[fieldName] = value;
109
+ try {
110
+ if (globals.parameters.debugging) console.log("fieldName ->", fieldName, " value ->", value);
111
+ let duplicate_data_tier = JSON.parse(JSON.stringify(this.local_data_blob.data_tier));
112
+ duplicate_data_tier[fieldName] = value;
113
+ local_data_blob.data_tier = duplicate_data_tier;
114
+ //this.local_data_blob.data_tier[fieldName] = value
115
+ } catch (error) {}
109
116
 
110
117
  //onFormChange handler return current form value to caller - PMAB on 2025-02-03
111
118
  if (this.props.onFormChange) this.props.onFormChange(this.local_data_blob.data_tier);
@@ -114,7 +121,6 @@ class DsDynamicForm extends _react.Component {
114
121
  return pFieldObject.selected_values ? pFieldObject.selected_values : "";
115
122
  };
116
123
  setFieldError = (pFieldObject, value) => {
117
- //make a field copy first to avoid object is not extensible error
118
124
  try {
119
125
  let nextFieldError = this.state.fieldError;
120
126
  nextFieldError[pFieldObject.name] = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datasync-dynamic-form",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Datasync Dynamic Form component",
5
5
  "main": "./dist/components/DsDynamicForm",
6
6
  "types": "./dist/components/DsDynamicForm",