tuain-ng-forms-lib 12.0.79 → 12.0.83
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.
- package/bundles/tuain-ng-forms-lib.umd.js +19 -10
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +14 -10
- package/esm2015/lib/components/elements/tables/table.component.js +7 -2
- package/fesm2015/tuain-ng-forms-lib.js +19 -10
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/field.d.ts +0 -1
- package/package.json +1 -1
|
@@ -733,7 +733,12 @@
|
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
735
|
LibTableComponent.prototype.filterHasChanged = function (column, values) {
|
|
736
|
-
|
|
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
|
}());
|
|
@@ -950,7 +955,7 @@
|
|
|
950
955
|
__extends(FieldDescriptor, _super);
|
|
951
956
|
function FieldDescriptor(inputFieldReceived, formConfig) {
|
|
952
957
|
var _this = this;
|
|
953
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
958
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
954
959
|
_this = _super.call(this, inputFieldReceived, formConfig) || this;
|
|
955
960
|
_this._editionFinish = new rxjs.Subject();
|
|
956
961
|
_this._editionPartial = new rxjs.Subject();
|
|
@@ -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
|
-
|
|
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,12 +996,11 @@
|
|
|
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);
|
|
991
1002
|
_this.setFieldOptions(fld.fieldOptions);
|
|
992
|
-
_this.setValue(fld.fieldValue
|
|
1003
|
+
_this.setValue((_o = (_m = fld.fieldValue) !== null && _m !== void 0 ? _m : _this.defaultValue) !== null && _o !== void 0 ? _o : '');
|
|
993
1004
|
return _this;
|
|
994
1005
|
}
|
|
995
1006
|
Object.defineProperty(FieldDescriptor.prototype, "name", {
|
|
@@ -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.
|
|
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) {
|
|
@@ -1252,13 +1260,14 @@
|
|
|
1252
1260
|
};
|
|
1253
1261
|
FieldDescriptor.prototype.setValue = function (newValue, widgetUpdate) {
|
|
1254
1262
|
if (widgetUpdate === void 0) { widgetUpdate = true; }
|
|
1263
|
+
var _a;
|
|
1255
1264
|
if (typeof newValue === UNDEFINED || newValue === null) {
|
|
1256
1265
|
return true;
|
|
1257
1266
|
}
|
|
1258
1267
|
var newFinalValue;
|
|
1259
1268
|
if (this.fieldType === this._formConfig.fieldTypes.boolean
|
|
1260
1269
|
|| this.fieldType === this._formConfig.fieldTypes.check) {
|
|
1261
|
-
newFinalValue = yn__default['default'](newValue);
|
|
1270
|
+
newFinalValue = (_a = yn__default['default'](newValue)) !== null && _a !== void 0 ? _a : false;
|
|
1262
1271
|
}
|
|
1263
1272
|
else if (this.fieldType === this._formConfig.fieldTypes.array
|
|
1264
1273
|
|| this.fieldType === this._formConfig.fieldTypes.map) {
|