datasync-dynamic-form 1.1.15 → 1.1.16

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.
@@ -16,6 +16,7 @@ var _datasyncCore = require("datasync-core");
16
16
  var _datasyncCommonLibrary = require("datasync-common-library");
17
17
  var _datasyncBlob = require("datasync-blob");
18
18
  var _reactstrap = require("reactstrap");
19
+ var _consumers = require("stream/consumers");
19
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
22
  // react plugin that creates an input with badges
@@ -25,7 +26,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
25
26
 
26
27
  // reactstrap components
27
28
 
28
- const debugging = false;
29
+ const debugging = true;
29
30
  const local = true;
30
31
  const production = !local;
31
32
  const globals = {
@@ -98,6 +99,7 @@ class DsDynamicForm extends _react.Component {
98
99
  //Ensure props.foreign_keys is a json object - PMAB on 2025-04-10
99
100
  if (this.props.foreign_keys && typeof this.props.foreign_keys !== "object") throw new Error("foreign_keys must be a json object !");
100
101
  this.local_data_blob.data_tier = Object.assign(this.props.foreign_keys ? this.props.foreign_keys : {}, duplicate_data_tier);
102
+ if (globals.parameters.debugging) console.log("clearForm->this.local_data_blob.data_tier =>", this.local_data_blob.data_tier);
101
103
  };
102
104
  getFieldData = fieldName => {
103
105
  /** Return data value form field object */
@@ -105,7 +107,13 @@ class DsDynamicForm extends _react.Component {
105
107
  return nextFieldData;
106
108
  };
107
109
  setFieldData = (fieldName, value) => {
108
- this.local_data_blob.data_tier[fieldName] = value;
110
+ try {
111
+ if (globals.parameters.debugging) console.log("fieldName ->", fieldName, " value ->", value);
112
+ let duplicate_data_tier = JSON.parse(JSON.stringify(this.local_data_blob.data_tier));
113
+ duplicate_data_tier[fieldName] = value;
114
+ local_data_blob.data_tier = duplicate_data_tier;
115
+ //this.local_data_blob.data_tier[fieldName] = value
116
+ } catch (error) {}
109
117
 
110
118
  //onFormChange handler return current form value to caller - PMAB on 2025-02-03
111
119
  if (this.props.onFormChange) this.props.onFormChange(this.local_data_blob.data_tier);
@@ -114,7 +122,6 @@ class DsDynamicForm extends _react.Component {
114
122
  return pFieldObject.selected_values ? pFieldObject.selected_values : "";
115
123
  };
116
124
  setFieldError = (pFieldObject, value) => {
117
- //make a field copy first to avoid object is not extensible error
118
125
  try {
119
126
  let nextFieldError = this.state.fieldError;
120
127
  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.16",
4
4
  "description": "Datasync Dynamic Form component",
5
5
  "main": "./dist/components/DsDynamicForm",
6
6
  "types": "./dist/components/DsDynamicForm",