tnx-shared 5.3.366 → 5.3.368

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.
@@ -3433,7 +3433,7 @@
3433
3433
  return this.showError(message, '', header);
3434
3434
  }
3435
3435
  };
3436
- NotifierService.prototype.showConfirm = function (message, header, icon, acceptVisible, rejectLabel, rejectIcon, acceptLabel, acceptIcon, accept, rejectFunc, acceptButtonStyleClass, rejectButtonStyleClass) {
3436
+ NotifierService.prototype.showConfirm = function (message, header, icon, acceptVisible, rejectLabel, rejectIcon, acceptLabel, acceptIcon, accept, rejectFunc, acceptButtonStyleClass, rejectButtonStyleClass, rejectVisible) {
3437
3437
  var _this = this;
3438
3438
  if (header === void 0) { header = 'Xác nhận'; }
3439
3439
  if (icon === void 0) { icon = 'pi pi-exclamation-triangle'; }
@@ -3446,12 +3446,14 @@
3446
3446
  if (rejectFunc === void 0) { rejectFunc = null; }
3447
3447
  if (acceptButtonStyleClass === void 0) { acceptButtonStyleClass = 'p-button-rounded p-button-text'; }
3448
3448
  if (rejectButtonStyleClass === void 0) { rejectButtonStyleClass = '"p-button-rounded p-button-text p-button-secondary'; }
3449
+ if (rejectVisible === void 0) { rejectVisible = true; }
3449
3450
  return new Promise(function (resolve, reject) {
3450
3451
  _this._confirmService.confirm({
3451
3452
  message: message,
3452
3453
  header: header,
3453
3454
  icon: icon,
3454
3455
  acceptVisible: acceptVisible,
3456
+ rejectVisible: rejectVisible,
3455
3457
  acceptIcon: acceptIcon,
3456
3458
  acceptLabel: acceptLabel,
3457
3459
  rejectLabel: rejectLabel,
@@ -19530,7 +19532,7 @@
19530
19532
  }
19531
19533
  }
19532
19534
  else {
19533
- if (oldValue != newValue) {
19535
+ if (!this.areValuesEqual(newValue, oldValue)) {
19534
19536
  var _h = __read(this.getLogValueDefault(control, oldValue, newValue), 2), valueBefore = _h[0], valueAfter = _h[1];
19535
19537
  this.logSetting.arrValueAfterUpdate.push(new LogColumn({
19536
19538
  field: control.field,
@@ -19558,6 +19560,33 @@
19558
19560
  console.error('----log data fail----');
19559
19561
  }
19560
19562
  };
19563
+ DataFormBase.prototype.areValuesEqual = function (value1, value2) {
19564
+ if (value1 === value2)
19565
+ return true;
19566
+ if (Array.isArray(value1) && Array.isArray(value2)) {
19567
+ return this.areArraysEqual(value1, value2); // So sánh array
19568
+ }
19569
+ if (typeof value1 === 'object' && typeof value2 === 'object' && value1 !== null && value2 !== null) {
19570
+ return this.areObjectsEqual(value1, value2); // So sánh objects
19571
+ }
19572
+ return false;
19573
+ };
19574
+ DataFormBase.prototype.areArraysEqual = function (arr1, arr2) {
19575
+ var _this = this;
19576
+ if (arr1.length !== arr2.length)
19577
+ return false; // Khác độ dài
19578
+ return arr1.every(function (item, index) { return _this.areValuesEqual(item, arr2[index]); }); // So sánh trên từng phần tử của array
19579
+ };
19580
+ DataFormBase.prototype.areObjectsEqual = function (obj1, obj2) {
19581
+ var _this = this;
19582
+ var keys1 = Object.keys(obj1);
19583
+ var keys2 = Object.keys(obj2);
19584
+ if (keys1.length !== keys2.length)
19585
+ return false; // Khác độ dài
19586
+ return keys1.every(function (key) { return obj2.hasOwnProperty(key) &&
19587
+ _this.areValuesEqual(obj1[key], obj2[key]); } // So sánh trên từng phần tử của object
19588
+ );
19589
+ };
19561
19590
  DataFormBase.prototype.isNullOrEmpty = function (input) {
19562
19591
  if (input !== undefined && input !== null) {
19563
19592
  if (Array.isArray(input)) {