tuain-ng-forms-lib 12.0.80 → 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.
- package/bundles/tuain-ng-forms-lib.umd.js +9 -6
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +10 -7
- package/fesm2015/tuain-ng-forms-lib.js +9 -6
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/field.d.ts +0 -1
- package/package.json +1 -1
|
@@ -965,8 +965,15 @@
|
|
|
965
965
|
var fld = (inputFieldReceived) ? inputFieldReceived : {};
|
|
966
966
|
_this.setAttr(fldAttr.code, fld.fieldCode);
|
|
967
967
|
_this.setAttr(fldAttr.title, (_a = fld.fieldTitle) !== null && _a !== void 0 ? _a : _this.fieldCode);
|
|
968
|
+
_this.setAttr(fldAttr.type, fld.fieldTypeCode);
|
|
968
969
|
_this.setAttr(fldAttr.captureType, (_b = fld.captureType) !== null && _b !== void 0 ? _b : DEFAULT_CAPTURE_TYPE);
|
|
969
|
-
|
|
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
|
+
}
|
|
970
977
|
var defaultTypeAlignment = (_this._formConfig.tableFieldStyles[_this.fieldType] != null)
|
|
971
978
|
? _this._formConfig.tableFieldStyles[_this.fieldType]['text-align'] : DEFAULT_ALIGNMENT;
|
|
972
979
|
var fieldAlignment = (fld.alignment != null) ? fld.alignment.toLowerCase() : defaultTypeAlignment;
|
|
@@ -989,7 +996,6 @@
|
|
|
989
996
|
var maxLength = (_h = fld.maxLength) !== null && _h !== void 0 ? _h : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
|
|
990
997
|
_this.setAttr(fldAttr.maxLength, maxLength);
|
|
991
998
|
_this.setAttr(fldAttr.intrinsicErrorMessage, (_j = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _j !== void 0 ? _j : _this._formConfig.fieldTypeErrMsg.DEFAULT);
|
|
992
|
-
_this.setFieldType(fld.fieldTypeCode);
|
|
993
999
|
_this.setEditable((_k = fld.editable) !== null && _k !== void 0 ? _k : true);
|
|
994
1000
|
_this.setVisibleLabel((_l = fld.visibleLabel) !== null && _l !== void 0 ? _l : true);
|
|
995
1001
|
_this.setVisibility(fld.visible);
|
|
@@ -1193,13 +1199,10 @@
|
|
|
1193
1199
|
(attrName === this._formConfig.apiFieldAttrs.value) && (this.setValue(fld.fieldValue) && this.setChanged(false));
|
|
1194
1200
|
(attrName === this._formConfig.apiFieldAttrs.options) && this.setFieldOptions(fld.fieldOptions);
|
|
1195
1201
|
(attrName === this._formConfig.apiFieldAttrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
|
|
1196
|
-
(attrName === this._formConfig.apiFieldAttrs.type) && this.
|
|
1202
|
+
(attrName === this._formConfig.apiFieldAttrs.type) && this.setAttr(fldAttr.type, fld.fieldTypeCode);
|
|
1197
1203
|
(attrName === this._formConfig.apiFieldAttrs.maxLength) && this.setAttr(fldAttr.maxLength, fld.maxLength);
|
|
1198
1204
|
}
|
|
1199
1205
|
};
|
|
1200
|
-
FieldDescriptor.prototype.setFieldType = function (inputFieldType) {
|
|
1201
|
-
this.setAttr(fldAttr.type, inputFieldType);
|
|
1202
|
-
};
|
|
1203
1206
|
FieldDescriptor.prototype.setMinValue = function (inputMinValue) {
|
|
1204
1207
|
var minValue = inputMinValue;
|
|
1205
1208
|
if (this.fieldType === this._formConfig.fieldTypes.date) {
|