@seniorsistemas/angular-components 14.15.0 → 14.15.1

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.
@@ -3772,23 +3772,25 @@ var TableFrozenPositionDirective = /** @class */ (function () {
3772
3772
  this.el = el;
3773
3773
  this.host = host;
3774
3774
  this.sTableFrozenPosition = "left";
3775
+ this.onColumnsChanged = new EventEmitter();
3775
3776
  this.host.onColResize.subscribe(function () {
3776
3777
  _this.handleColResize();
3777
3778
  });
3778
3779
  window.addEventListener("resize", this.handleWindowResize.bind(this));
3779
3780
  var componentId = new Date().getTime();
3781
+ var htmlHead = document.getElementsByTagName("head")[0];
3780
3782
  this.resetRowHeightClassName = "resetTableRowsHeight_" + componentId;
3781
3783
  var styleReset = document.createElement("style");
3782
3784
  styleReset.innerHTML = "." + this.resetRowHeightClassName + " tbody > tr, ." + this.resetRowHeightClassName + " thead > tr { height: auto; }";
3783
- document.getElementsByTagName("head")[0].appendChild(styleReset);
3785
+ htmlHead.appendChild(styleReset);
3784
3786
  this.fixBodyRowClassName = "fixTableBodyRowsHeight_" + componentId;
3785
3787
  this.styleFixBodyRowHeight = document.createElement("style");
3786
3788
  this.styleFixBodyRowHeight.innerHTML = "." + this.fixBodyRowClassName + " tbody > tr { height: auto; }";
3787
- document.getElementsByTagName("head")[0].appendChild(this.styleFixBodyRowHeight);
3789
+ htmlHead.appendChild(this.styleFixBodyRowHeight);
3788
3790
  this.fixHeadRowClassName = "fixTableHeadRowsHeight_" + componentId;
3789
3791
  this.styleFixHeadRowHeight = document.createElement("style");
3790
3792
  this.styleFixHeadRowHeight.innerHTML = "." + this.fixHeadRowClassName + " thead > tr { height: auto; }";
3791
- document.getElementsByTagName("head")[0].appendChild(this.styleFixHeadRowHeight);
3793
+ htmlHead.appendChild(this.styleFixHeadRowHeight);
3792
3794
  }
3793
3795
  Object.defineProperty(TableFrozenPositionDirective.prototype, "sTableFrozenValue", {
3794
3796
  set: function (_) {
@@ -3804,9 +3806,27 @@ var TableFrozenPositionDirective = /** @class */ (function () {
3804
3806
  if (this.sTableFrozenPosition === "left")
3805
3807
  return;
3806
3808
  this.applyStylesForTable();
3809
+ this.setUpColumnMonitoring();
3807
3810
  };
3808
3811
  TableFrozenPositionDirective.prototype.ngOnDestroy = function () {
3809
3812
  window.removeEventListener("resize", this.handleWindowResize.bind(this));
3813
+ if (this.tableHeadObservable) {
3814
+ this.tableHeadObservable.disconnect();
3815
+ }
3816
+ };
3817
+ TableFrozenPositionDirective.prototype.setUpColumnMonitoring = function () {
3818
+ var _this = this;
3819
+ this.tableHeadObservable = new MutationObserver(function () {
3820
+ _this.synchronizeRowHeight();
3821
+ _this.onColumnsChanged.emit(null);
3822
+ });
3823
+ var tableHeads = __spread(this.el.nativeElement.getElementsByTagName("thead"));
3824
+ tableHeads.forEach(function (tableHead) {
3825
+ _this.tableHeadObservable.observe(tableHead, {
3826
+ subtree: true,
3827
+ childList: true
3828
+ });
3829
+ });
3810
3830
  };
3811
3831
  TableFrozenPositionDirective.prototype.applyStylesForTable = function () {
3812
3832
  var scrollWrapper = this.el.nativeElement.querySelector(".ui-table-scrollable-wrapper");