tnx-shared 5.3.366 → 5.3.367
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/tnx-shared.umd.js +28 -1
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/data-form-base.d.ts +4 -1
- package/classes/base/data-form-base.d.ts.map +1 -1
- package/esm2015/classes/base/data-form-base.js +28 -3
- package/fesm2015/tnx-shared.js +26 -1
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -19530,7 +19530,7 @@
|
|
|
19530
19530
|
}
|
|
19531
19531
|
}
|
|
19532
19532
|
else {
|
|
19533
|
-
if (oldValue
|
|
19533
|
+
if (!this.areValuesEqual(newValue, oldValue)) {
|
|
19534
19534
|
var _h = __read(this.getLogValueDefault(control, oldValue, newValue), 2), valueBefore = _h[0], valueAfter = _h[1];
|
|
19535
19535
|
this.logSetting.arrValueAfterUpdate.push(new LogColumn({
|
|
19536
19536
|
field: control.field,
|
|
@@ -19558,6 +19558,33 @@
|
|
|
19558
19558
|
console.error('----log data fail----');
|
|
19559
19559
|
}
|
|
19560
19560
|
};
|
|
19561
|
+
DataFormBase.prototype.areValuesEqual = function (value1, value2) {
|
|
19562
|
+
if (value1 === value2)
|
|
19563
|
+
return true;
|
|
19564
|
+
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
19565
|
+
return this.areArraysEqual(value1, value2); // So sánh array
|
|
19566
|
+
}
|
|
19567
|
+
if (typeof value1 === 'object' && typeof value2 === 'object' && value1 !== null && value2 !== null) {
|
|
19568
|
+
return this.areObjectsEqual(value1, value2); // So sánh objects
|
|
19569
|
+
}
|
|
19570
|
+
return false;
|
|
19571
|
+
};
|
|
19572
|
+
DataFormBase.prototype.areArraysEqual = function (arr1, arr2) {
|
|
19573
|
+
var _this = this;
|
|
19574
|
+
if (arr1.length !== arr2.length)
|
|
19575
|
+
return false; // Khác độ dài
|
|
19576
|
+
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
|
|
19577
|
+
};
|
|
19578
|
+
DataFormBase.prototype.areObjectsEqual = function (obj1, obj2) {
|
|
19579
|
+
var _this = this;
|
|
19580
|
+
var keys1 = Object.keys(obj1);
|
|
19581
|
+
var keys2 = Object.keys(obj2);
|
|
19582
|
+
if (keys1.length !== keys2.length)
|
|
19583
|
+
return false; // Khác độ dài
|
|
19584
|
+
return keys1.every(function (key) { return obj2.hasOwnProperty(key) &&
|
|
19585
|
+
_this.areValuesEqual(obj1[key], obj2[key]); } // So sánh trên từng phần tử của object
|
|
19586
|
+
);
|
|
19587
|
+
};
|
|
19561
19588
|
DataFormBase.prototype.isNullOrEmpty = function (input) {
|
|
19562
19589
|
if (input !== undefined && input !== null) {
|
|
19563
19590
|
if (Array.isArray(input)) {
|