tuain-form-manager 1.1.23 → 1.1.30

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.
Files changed (2) hide show
  1. package/lib/form.js +18 -0
  2. package/package.json +1 -1
package/lib/form.js CHANGED
@@ -22,6 +22,13 @@ const ROWSELECTION = 'ROWSELECTION';
22
22
  const DEFAULT_RECORDS_PAGE = 10;
23
23
  const RESTRICTED_ATTRIBUTES = ['actions', 'fields', 'recordTables', 'cookiesToSet', 'immutableData', 'returnedFile'];
24
24
 
25
+ const FIELD_ASSIGN_ATTRIBUTES = [
26
+ 'defaultEditable', 'defaultValue', 'alignment', 'required', 'errorCode', 'errorMessage', 'errorType',
27
+ 'tooltip', 'info', 'format', 'intrinsicErrorMessage', 'outputOnly', 'captureType', 'title', 'type',
28
+ 'maxLength', 'maxValue', 'minLength', 'minValue', 'validateOnServer', 'serverAction', 'visibleLabel',
29
+ 'options',
30
+ ];
31
+
25
32
  const SESSION_ATTRIBUTES = {
26
33
  sessionCode: 'sessionCode',
27
34
  profileCode: 'profileCode',
@@ -236,6 +243,17 @@ class Form {
236
243
  return inputField;
237
244
  }
238
245
 
246
+ setFieldAttributes(code, attrObj) {
247
+ const field = this.getField(code);
248
+ if (field) {
249
+ Object.entries(attrObj ?? {}).forEach(([attr, value]) => {
250
+ if (FIELD_ASSIGN_ATTRIBUTES.includes(attr)) {
251
+ field[attr] = value;
252
+ }
253
+ });
254
+ }
255
+ }
256
+
239
257
  setFieldAttribute(fieldCode, attr, value) {
240
258
  const fieldObject = this.getField(fieldCode);
241
259
  if (fieldObject) { fieldObject[attr] = value; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuain-form-manager",
3
- "version": "1.1.23",
3
+ "version": "1.1.30",
4
4
  "description": "Component library to perform operations on Tuain Development Framework forms to interchange information on web or mobile applications based on the data interchange of abstract forms making trnasformation on the data upon actions required on both sides (front and back)",
5
5
  "main": "index.js",
6
6
  "scripts": {