tuain-ng-forms-lib 12.0.82 → 12.0.86

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.
@@ -1162,11 +1162,21 @@
1162
1162
  if (fieldCurrentValue === undefined || fieldCurrentValue === null) {
1163
1163
  return true;
1164
1164
  }
1165
- if ((this.fieldType === this._formConfig.fieldTypes.array || this.fieldType === this._formConfig.fieldTypes.phone)
1165
+ if (this.fieldType === this._formConfig.fieldTypes.array
1166
1166
  && Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0) {
1167
1167
  return true;
1168
1168
  }
1169
1169
  ;
1170
+ if (this.fieldType === this._formConfig.fieldTypes.phone) {
1171
+ if (!Array.isArray(fieldCurrentValue)) {
1172
+ return true;
1173
+ }
1174
+ if (fieldCurrentValue.length !== 2 || !fieldCurrentValue[0] || !fieldCurrentValue[1]) {
1175
+ return true;
1176
+ }
1177
+ return false;
1178
+ }
1179
+ ;
1170
1180
  return fieldCurrentValue === '';
1171
1181
  };
1172
1182
  FieldDescriptor.prototype.getValue = function () {
@@ -1260,13 +1270,14 @@
1260
1270
  };
1261
1271
  FieldDescriptor.prototype.setValue = function (newValue, widgetUpdate) {
1262
1272
  if (widgetUpdate === void 0) { widgetUpdate = true; }
1273
+ var _a;
1263
1274
  if (typeof newValue === UNDEFINED || newValue === null) {
1264
1275
  return true;
1265
1276
  }
1266
1277
  var newFinalValue;
1267
1278
  if (this.fieldType === this._formConfig.fieldTypes.boolean
1268
1279
  || this.fieldType === this._formConfig.fieldTypes.check) {
1269
- newFinalValue = yn__default['default'](newValue);
1280
+ newFinalValue = (_a = yn__default['default'](newValue)) !== null && _a !== void 0 ? _a : false;
1270
1281
  }
1271
1282
  else if (this.fieldType === this._formConfig.fieldTypes.array
1272
1283
  || this.fieldType === this._formConfig.fieldTypes.map) {
@@ -1443,8 +1454,7 @@
1443
1454
  configurable: true
1444
1455
  });
1445
1456
  TableRecordData.prototype.getFieldValue = function (fieldCode) {
1446
- return (fieldCode && this.recordData[fieldCode])
1447
- ? this.recordData[fieldCode] : null;
1457
+ return (fieldCode && this.recordData) ? this.recordData[fieldCode] : null;
1448
1458
  };
1449
1459
  TableRecordData.prototype.hasPattern = function (words) {
1450
1460
  var e_1, _a;