tuain-ng-forms-lib 12.0.85 → 12.0.88

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.
@@ -1168,14 +1168,13 @@
1168
1168
  }
1169
1169
  ;
1170
1170
  if (this.fieldType === this._formConfig.fieldTypes.phone) {
1171
- if (Array.isArray(fieldCurrentValue) && fieldCurrentValue.length < 2) {
1171
+ if (!Array.isArray(fieldCurrentValue)) {
1172
1172
  return true;
1173
1173
  }
1174
- if (Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 2
1175
- && (!fieldCurrentValue[1] || fieldCurrentValue[1].length === 0)) {
1174
+ if (fieldCurrentValue.length !== 2 || !fieldCurrentValue[0] || !fieldCurrentValue[1]) {
1176
1175
  return true;
1177
1176
  }
1178
- return true;
1177
+ return false;
1179
1178
  }
1180
1179
  ;
1181
1180
  return fieldCurrentValue === '';
@@ -3434,17 +3433,18 @@
3434
3433
  return (name) ? ((_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null) : null;
3435
3434
  };
3436
3435
  BasicFormComponent.prototype.preocessInputParams = function (params) {
3437
- var _a, _b, _c;
3436
+ var _a, _b, _c, _d;
3438
3437
  this._controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
3439
- var _j = this.formManagerService.getFormInfo(this._controlToken), token = _j.token, subject = _j.subject, state = _j.state, fields = _j.fields, extra = _j.extra, originToken = _j.originToken;
3440
- if (!this._controlToken || this._controlToken !== token) {
3441
- return null;
3438
+ this.formSubject = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : null;
3439
+ var tokenInfo = (this._controlToken) ? this.formManagerService.getFormInfo(this._controlToken) : {};
3440
+ var token = tokenInfo.token, subject = tokenInfo.subject, state = tokenInfo.state, fields = tokenInfo.fields, extra = tokenInfo.extra, originToken = tokenInfo.originToken;
3441
+ if (token && this._controlToken === token) {
3442
+ this.formSubject = (_d = (_c = this.formSubject) !== null && _c !== void 0 ? _c : subject) !== null && _d !== void 0 ? _d : null;
3443
+ this.inputDataFields = fields;
3444
+ this.extraData = extra;
3445
+ this._originToken = originToken;
3446
+ return state;
3442
3447
  }
3443
- this.formSubject = (_c = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : subject) !== null && _c !== void 0 ? _c : null;
3444
- this.inputDataFields = fields;
3445
- this.extraData = extra;
3446
- this._originToken = originToken;
3447
- return state;
3448
3448
  };
3449
3449
  BasicFormComponent.prototype.subscribeSectionActivation = function () {
3450
3450
  var _this = this;
@@ -3497,6 +3497,7 @@
3497
3497
  }
3498
3498
  };
3499
3499
  BasicFormComponent.prototype.formInit = function (params) {
3500
+ var _a;
3500
3501
  return __awaiter(this, void 0, void 0, function () {
3501
3502
  var initialState, formDefinition, inputFieldNames, index, fieldCode, fieldValue, recordResponse;
3502
3503
  return __generator(this, function (_j) {
@@ -3537,6 +3538,7 @@
3537
3538
  recordResponse = _j.sent();
3538
3539
  this.checkErrorRecordReceived(recordResponse);
3539
3540
  this.visible = true;
3541
+ this.enabledSections = (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.visibleSections;
3540
3542
  this.subscribeSectionActivation();
3541
3543
  this.subscribeFieldsSubjects();
3542
3544
  this.subscribeActionSubjects();