datasync-dynamic-form 1.0.25 → 1.0.27
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,7 +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
|
-
function _interopRequireDefault(
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
// react plugin that creates an input with badges
|
|
@@ -70,48 +70,6 @@ class DsDynamicForm extends _react.Component {
|
|
|
70
70
|
this.clearForm();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
clearForm_OBSOLETE = () => {
|
|
74
|
-
console.log("27:ClearForm");
|
|
75
|
-
/** Duplicate props.form */
|
|
76
|
-
let clearObject2 = JSON.parse(JSON.stringify(this.props.form));
|
|
77
|
-
|
|
78
|
-
/** set data_tier with (props.foreign_keys + props.data_tier) */
|
|
79
|
-
if (this.props.data_blob) {
|
|
80
|
-
//Set internal data_tier component property
|
|
81
|
-
//OBSOLETE this.data_tier = this.props.data_blob.data_tier
|
|
82
|
-
if (globals.parameters.debugging) console.log("01:this.props.data_blob ->", this.props.data_blob);
|
|
83
|
-
clearObject2.data_tier = this.props.data_blob.data_tier;
|
|
84
|
-
} else {
|
|
85
|
-
if (globals.parameters.debugging) console.log("01:this.props.data_blob.data_tier unDefined");
|
|
86
|
-
clearObject2.data_tier = {}; //Set empty data_tier
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Override data with foreign keys wne props.foreign_key is available */
|
|
90
|
-
if (this.props.foreign_keys) {
|
|
91
|
-
clearObject2.data_tier = Object.assign(clearObject2.data_tier, this.props.foreign_keys); //Dead code to be checked !!!
|
|
92
|
-
this.local_data_blob.data_tier = Object.assign(clearObject2.data_tier, this.props.foreign_keys); //Dead code to be checked !!!
|
|
93
|
-
}
|
|
94
|
-
if (globals.parameters.debugging) {
|
|
95
|
-
console.log("01:----- clearForm -----");
|
|
96
|
-
console.log("01:clearForm::this.props.form->", this.props.form);
|
|
97
|
-
console.log("01:clearForm::clearObject2 mixed with data_tier ->", clearObject2);
|
|
98
|
-
console.log("01:clearForm::internal this.data_blob ->", this.local_data_blob);
|
|
99
|
-
}
|
|
100
|
-
this.setState({
|
|
101
|
-
fieldError: [],
|
|
102
|
-
form: {},
|
|
103
|
-
captcha1: (0, _datasyncCommonLibrary.Randomize)(0, 5),
|
|
104
|
-
captcha2: (0, _datasyncCommonLibrary.Randomize)(0, 5)
|
|
105
|
-
},
|
|
106
|
-
//Clear forced
|
|
107
|
-
() => {
|
|
108
|
-
if (globals.parameters.debugging) console.log("09/07:DynamicForm3Tiers2 state cleansed 2:", this.state);
|
|
109
|
-
this.setState({
|
|
110
|
-
fieldError: [],
|
|
111
|
-
form: clearObject2
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
73
|
|
|
116
74
|
/**
|
|
117
75
|
* Prototype : clearForm
|
|
@@ -143,6 +101,9 @@ class DsDynamicForm extends _react.Component {
|
|
|
143
101
|
data_tier: {}
|
|
144
102
|
};
|
|
145
103
|
//this.local_data_blob.data_tier = Object.assign({}, duplicate_data_tier);
|
|
104
|
+
|
|
105
|
+
//Ensure props.foreign_keys is a json object - PMAB on 2025-04-10
|
|
106
|
+
if (this.props.foreign_keys && typeof this.props.foreign_keys !== "object") throw new Error("foreign_keys must be a json object !");
|
|
146
107
|
this.local_data_blob.data_tier = Object.assign(this.props.foreign_keys ? this.props.foreign_keys : {}, duplicate_data_tier);
|
|
147
108
|
console.log("28:this.local_data_blob.data_tier ->", this.local_data_blob.data_tier);
|
|
148
109
|
console.log("28:this.props.data_blob.data_tier ->", this.props.data_blob && this.props.data_blob.data_tier ? this.props.data_blob.data_tier : "props data_blob not set");
|
|
@@ -235,8 +196,8 @@ class DsDynamicForm extends _react.Component {
|
|
|
235
196
|
fieldObject: field
|
|
236
197
|
});
|
|
237
198
|
}
|
|
238
|
-
}), fa_symbol && /*#__PURE__*/_react.default.createElement(
|
|
239
|
-
|
|
199
|
+
}), fa_symbol && /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
+
className: "input-group-append"
|
|
240
201
|
}, /*#__PURE__*/_react.default.createElement(_reactstrap.InputGroupText, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
241
202
|
className: `fa ${fa_symbol}`
|
|
242
203
|
})))), this._error_label(field));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datasync-dynamic-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Datasync Dynamic Form component",
|
|
5
5
|
"main": "./dist/components/DsDynamicForm",
|
|
6
6
|
"types": "./dist/components/DsDynamicForm",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"jest-transform-css": "^6.0.1",
|
|
27
27
|
"multiselect-react-dropdown": "^2.0.25",
|
|
28
28
|
"react": "^18.2.0",
|
|
29
|
-
"reactstrap": "^9.2.
|
|
29
|
+
"reactstrap": "^9.2.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"multiselect-react-dropdown": "^2.0.25",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"axios": "^1.7.2",
|
|
45
45
|
"datasync-blob": "^1.0.2",
|
|
46
46
|
"datasync-common-library": "^1.0.5",
|
|
47
|
-
"datasync-core": "^1.0.28"
|
|
47
|
+
"datasync-core": "^1.0.28",
|
|
48
|
+
"universal-cookie": "^7.2.2"
|
|
48
49
|
}
|
|
49
50
|
}
|