ngx-aur-mat-table 12.2.32 → 12.2.35

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.
@@ -1040,6 +1040,21 @@
1040
1040
  return TotalRowProviderDummy;
1041
1041
  }(TotalRowProvider));
1042
1042
 
1043
+ var OffsetUtil = /** @class */ (function () {
1044
+ function OffsetUtil() {
1045
+ }
1046
+ OffsetUtil.areNotEqual = function (offsets1, offsets2) {
1047
+ if (offsets1.length !== offsets2.length) {
1048
+ return true;
1049
+ }
1050
+ return offsets1.some(function (offset, index) {
1051
+ var otherOffset = offsets2[index];
1052
+ return offset.left !== otherOffset.left || offset.width !== otherOffset.width || offset.key !== otherOffset.key;
1053
+ });
1054
+ };
1055
+ return OffsetUtil;
1056
+ }());
1057
+
1043
1058
  var ColumnViewComponent = /** @class */ (function () {
1044
1059
  function ColumnViewComponent() {
1045
1060
  }
@@ -1104,6 +1119,7 @@
1104
1119
  */
1105
1120
  this.onFilter = new i0.EventEmitter();
1106
1121
  this.columnOffsets = new i0.EventEmitter();
1122
+ this.prevColumnOffsets = [];
1107
1123
  // @ts-ignore
1108
1124
  this.resizeColumnOffsetsObserver = EmptyValue.RESIZE_OBSERVER;
1109
1125
  this.selectionProvider = new SelectionProviderDummy();
@@ -1128,7 +1144,6 @@
1128
1144
  if ((changes['tableData'] && this.tableData) || (changes['displayColumns'] && this._displayColumns)) {
1129
1145
  this.tableData = this.tableData || [];
1130
1146
  this.prepareTableData();
1131
- this.updateColumnOffsets();
1132
1147
  }
1133
1148
  if (changes['highlight'] && this.highlight) {
1134
1149
  this.handleHighlightChange(this.highlight);
@@ -1162,10 +1177,13 @@
1162
1177
  var _this = this;
1163
1178
  this.initPaginator();
1164
1179
  this.initSortingDataAccessor();
1165
- this.updateColumnOffsets();
1166
1180
  this.resizeColumnOffsetsObserver = new ResizeObserver(function () { return _this.updateColumnOffsets(); });
1167
1181
  this.resizeColumnOffsetsObserver.observe(this.table.nativeElement);
1168
1182
  };
1183
+ NgxAurMatTableComponent.prototype.ngAfterViewChecked = function () {
1184
+ console.log('!!!! CHECK ngAfterViewChecked');
1185
+ this.updateColumnOffsets();
1186
+ };
1169
1187
  NgxAurMatTableComponent.prototype.initPaginator = function () {
1170
1188
  if (this.tableDataSource) {
1171
1189
  this.tableDataSource.paginator = this.matPaginator;
@@ -1192,7 +1210,14 @@
1192
1210
  width: c.offsetWidth,
1193
1211
  key: _this._displayColumns[index]
1194
1212
  }); });
1195
- this.columnOffsets.emit(offsets);
1213
+ if (OffsetUtil.areNotEqual(this.prevColumnOffsets, offsets)) {
1214
+ console.log('!!! EMIT OFFSET', this.prevColumnOffsets, offsets);
1215
+ this.prevColumnOffsets = offsets;
1216
+ this.columnOffsets.emit(offsets);
1217
+ }
1218
+ else {
1219
+ console.log('!!! IGNORE EMIT');
1220
+ }
1196
1221
  }
1197
1222
  };
1198
1223
  NgxAurMatTableComponent.prototype.prepareTableData = function () {