tnx-shared 5.3.177 → 5.3.178

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.
@@ -1817,6 +1817,7 @@
1817
1817
  _this.invalidFileTypeMessageDetail = 'định dạng file cho phép: {0}.';
1818
1818
  _this.invalidFileLimitMessageSummary = 'Quá số lượng file cho phép, ';
1819
1819
  _this.invalidFileLimitMessageDetail = 'tối đa {0} file.';
1820
+ _this.hasFile = false;
1820
1821
  for (var key in init) {
1821
1822
  _this[key] = init[key];
1822
1823
  }
@@ -13456,6 +13457,9 @@
13456
13457
  if (!!value && typeof (value) == 'string') {
13457
13458
  value = value.trim();
13458
13459
  }
13460
+ if (control instanceof FileUploadControlSchema && !control.hasFile) {
13461
+ return false;
13462
+ }
13459
13463
  if (control instanceof AddressControlSchema) {
13460
13464
  if (value == null || value === '')
13461
13465
  return false;
@@ -35633,7 +35637,9 @@
35633
35637
  this.hasFile = false;
35634
35638
  }
35635
35639
  _a.label = 2;
35636
- case 2: return [2 /*return*/];
35640
+ case 2:
35641
+ this.control.hasFile = this.hasFile;
35642
+ return [2 /*return*/];
35637
35643
  }
35638
35644
  });
35639
35645
  });
@@ -35683,6 +35689,7 @@
35683
35689
  _this.hasFile = true;
35684
35690
  _this.writeValue(rs.data);
35685
35691
  _this.onChangeBase(rs.data);
35692
+ _this.control.hasFile = _this.hasFile;
35686
35693
  _this.onSelect.emit();
35687
35694
  _this.onChanged.emit();
35688
35695
  }
@@ -35711,12 +35718,14 @@
35711
35718
  }
35712
35719
  };
35713
35720
  FileUploadComponent.prototype.onRemoveFile = function () {
35721
+ this._fileObjectService.deleteById(this.fileId);
35714
35722
  this.fileId = null;
35715
35723
  this.selectedFile = null;
35716
35724
  this.selectedFileName = null;
35717
35725
  this.hasFile = false;
35718
35726
  this.writeValue(null);
35719
35727
  this.onChangeBase(null);
35728
+ this.control.hasFile = this.hasFile;
35720
35729
  this.onRemove.emit();
35721
35730
  this.onChanged.emit();
35722
35731
  };
@@ -36944,6 +36953,7 @@
36944
36953
  this.setFileObject(null);
36945
36954
  _a.label = 3;
36946
36955
  case 3:
36956
+ this.control.hasFile = this.hasFile;
36947
36957
  this.setMenu();
36948
36958
  return [2 /*return*/];
36949
36959
  }
@@ -36965,6 +36975,7 @@
36965
36975
  this.fileId = fileObject.id;
36966
36976
  this.setFileName(fileObject.name);
36967
36977
  this.hasFile = true;
36978
+ this.control.hasFile = this.hasFile;
36968
36979
  this.onChangeBase('has-value');
36969
36980
  this.onInit.emit({ fileId: this.fileId });
36970
36981
  };
@@ -37036,6 +37047,7 @@
37036
37047
  this.onChanged.emit(this.selectedFile);
37037
37048
  }
37038
37049
  }
37050
+ this.control.hasFile = this.hasFile;
37039
37051
  };
37040
37052
  ServiceFileUploadComponent.prototype.handleSaveFile = function () {
37041
37053
  var _this = this;
@@ -37069,6 +37081,7 @@
37069
37081
  _this.selectedFileName = _this.selectedFile.name;
37070
37082
  _this.fileId = rs.data;
37071
37083
  _this.hasFile = true;
37084
+ _this.control.hasFile = _this.hasFile;
37072
37085
  _this.onChanged.emit({ fileId: _this.fileId, selectedFile: _this.selectedFile });
37073
37086
  }
37074
37087
  else {
@@ -37114,6 +37127,7 @@
37114
37127
  this.selectedFile = null;
37115
37128
  this.setFileName(null);
37116
37129
  this.hasFile = false;
37130
+ this.control.hasFile = this.hasFile;
37117
37131
  this.onChangeBase(null);
37118
37132
  this.onRemove.emit(fileData);
37119
37133
  };