tuain-ng-forms-lib 12.0.77 → 12.0.81

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.
@@ -733,7 +733,12 @@
733
733
  }
734
734
  };
735
735
  LibTableComponent.prototype.filterHasChanged = function (column, values) {
736
- this.table.addColumnFilter(column.fieldCode, values);
736
+ if (!values || values.length === 0) {
737
+ this.table.removeColumnFilter(column.fieldCode);
738
+ }
739
+ else {
740
+ this.table.addColumnFilter(column.fieldCode, values);
741
+ }
737
742
  };
738
743
  return LibTableComponent;
739
744
  }());
@@ -875,7 +880,7 @@
875
880
  __extends(FormAction, _super);
876
881
  function FormAction(actionDefinition, formConfig) {
877
882
  var _this = this;
878
- var _a;
883
+ var _a, _b;
879
884
  _this = _super.call(this, actionDefinition, formConfig) || this;
880
885
  _this._actionActivated = new rxjs.Subject();
881
886
  _this.inProgress = false;
@@ -888,7 +893,7 @@
888
893
  _this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
889
894
  _this.restrictedOnField = actionDefinition.fieldRestrictedCode ? actionDefinition.fieldRestrictedCode.toString() : '';
890
895
  _this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
891
- _this.restrictedOnValue = actionDefinition.valueRestricted || '';
896
+ _this.restrictedOnValue = (_b = actionDefinition.valueRestricted) !== null && _b !== void 0 ? _b : '';
892
897
  _this.customValidation = function () { return true; };
893
898
  return _this;
894
899
  }
@@ -960,8 +965,15 @@
960
965
  var fld = (inputFieldReceived) ? inputFieldReceived : {};
961
966
  _this.setAttr(fldAttr.code, fld.fieldCode);
962
967
  _this.setAttr(fldAttr.title, (_a = fld.fieldTitle) !== null && _a !== void 0 ? _a : _this.fieldCode);
968
+ _this.setAttr(fldAttr.type, fld.fieldTypeCode);
963
969
  _this.setAttr(fldAttr.captureType, (_b = fld.captureType) !== null && _b !== void 0 ? _b : DEFAULT_CAPTURE_TYPE);
964
- _this.setAttr(fldAttr.defaultValue, (_c = fld.defaultValue) !== null && _c !== void 0 ? _c : null);
970
+ var defaultValue = (_c = fld.defaultValue) !== null && _c !== void 0 ? _c : null;
971
+ if (_this.fieldType === _this._formConfig.fieldTypes.boolean) {
972
+ _this.setAttr(fldAttr.defaultValue, defaultValue !== null && defaultValue !== void 0 ? defaultValue : false);
973
+ }
974
+ else {
975
+ _this.setAttr(fldAttr.defaultValue, defaultValue);
976
+ }
965
977
  var defaultTypeAlignment = (_this._formConfig.tableFieldStyles[_this.fieldType] != null)
966
978
  ? _this._formConfig.tableFieldStyles[_this.fieldType]['text-align'] : DEFAULT_ALIGNMENT;
967
979
  var fieldAlignment = (fld.alignment != null) ? fld.alignment.toLowerCase() : defaultTypeAlignment;
@@ -984,7 +996,6 @@
984
996
  var maxLength = (_h = fld.maxLength) !== null && _h !== void 0 ? _h : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
985
997
  _this.setAttr(fldAttr.maxLength, maxLength);
986
998
  _this.setAttr(fldAttr.intrinsicErrorMessage, (_j = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _j !== void 0 ? _j : _this._formConfig.fieldTypeErrMsg.DEFAULT);
987
- _this.setFieldType(fld.fieldTypeCode);
988
999
  _this.setEditable((_k = fld.editable) !== null && _k !== void 0 ? _k : true);
989
1000
  _this.setVisibleLabel((_l = fld.visibleLabel) !== null && _l !== void 0 ? _l : true);
990
1001
  _this.setVisibility(fld.visible);
@@ -1188,13 +1199,10 @@
1188
1199
  (attrName === this._formConfig.apiFieldAttrs.value) && (this.setValue(fld.fieldValue) && this.setChanged(false));
1189
1200
  (attrName === this._formConfig.apiFieldAttrs.options) && this.setFieldOptions(fld.fieldOptions);
1190
1201
  (attrName === this._formConfig.apiFieldAttrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
1191
- (attrName === this._formConfig.apiFieldAttrs.type) && this.setFieldType(fld.fieldTypeCode);
1202
+ (attrName === this._formConfig.apiFieldAttrs.type) && this.setAttr(fldAttr.type, fld.fieldTypeCode);
1192
1203
  (attrName === this._formConfig.apiFieldAttrs.maxLength) && this.setAttr(fldAttr.maxLength, fld.maxLength);
1193
1204
  }
1194
1205
  };
1195
- FieldDescriptor.prototype.setFieldType = function (inputFieldType) {
1196
- this.setAttr(fldAttr.type, inputFieldType);
1197
- };
1198
1206
  FieldDescriptor.prototype.setMinValue = function (inputMinValue) {
1199
1207
  var minValue = inputMinValue;
1200
1208
  if (this.fieldType === this._formConfig.fieldTypes.date) {
@@ -1218,7 +1226,7 @@
1218
1226
  FieldDescriptor.prototype.setFieldOptions = function (newOptions) {
1219
1227
  var _this = this;
1220
1228
  var _a;
1221
- if ((this.captureType !== 'LIST' && this.captureType !== 'RADIO')
1229
+ if ((!this._formConfig.captureTypesWithOptions.includes(this.captureType))
1222
1230
  || typeof newOptions === UNDEFINED || !newOptions
1223
1231
  || !Array.isArray(newOptions)) {
1224
1232
  return;
@@ -1368,7 +1376,7 @@
1368
1376
 
1369
1377
  var TableAction = /** @class */ (function () {
1370
1378
  function TableAction(actionDefinition) {
1371
- var _a, _b;
1379
+ var _a, _b, _c;
1372
1380
  this.actionCode = actionDefinition.actionCode;
1373
1381
  this.actionTitle = actionDefinition.actionTitle;
1374
1382
  this.iconName = actionDefinition.iconName || this.actionCode;
@@ -1380,9 +1388,9 @@
1380
1388
  this.enabledStates = actionDefinition.enabledStates || [];
1381
1389
  this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
1382
1390
  this.restrictedOnField = actionDefinition.fieldRestrictedCode || '';
1383
- this.restrictedOnValue = actionDefinition.valueRestricted || '';
1391
+ this.restrictedOnValue = (_b = actionDefinition.valueRestricted) !== null && _b !== void 0 ? _b : '';
1384
1392
  this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
1385
- this.customAttributes = (_b = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _b !== void 0 ? _b : {};
1393
+ this.customAttributes = (_c = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _c !== void 0 ? _c : {};
1386
1394
  }
1387
1395
  TableAction.prototype.supportMode = function (state) { return this.viewOnState(state); };
1388
1396
  TableAction.prototype.viewOnState = function (state) { return this.visibleStates.includes(state); };