@kodaris/krubble-components 1.0.64 → 1.0.66

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.
@@ -4799,6 +4799,23 @@ let KRTable = class KRTable extends i$2 {
4799
4799
  this.classList.toggle('kr-table--card', this.variant === 'card');
4800
4800
  this._updateScrollFlags();
4801
4801
  this._syncSlottedContent();
4802
+ this._lockColumnWidths();
4803
+ }
4804
+ /** Measures header cell widths and locks them to prevent column shift on subsequent data changes. */
4805
+ _lockColumnWidths() {
4806
+ if (this._columnWidthsLocked || this._data.length === 0)
4807
+ return;
4808
+ const headerCells = this.shadowRoot?.querySelectorAll('.header-row > .header-cell');
4809
+ if (!headerCells)
4810
+ return;
4811
+ const cols = this.getDisplayedColumns();
4812
+ headerCells.forEach((cell, i) => {
4813
+ const cellWidth = cell.offsetWidth;
4814
+ if (i < cols.length && !cols[i].width && cols[i].type !== 'actions' && cellWidth > 0) {
4815
+ cols[i].width = `${cellWidth}px`;
4816
+ this._columnWidthsLocked = true;
4817
+ }
4818
+ });
4802
4819
  }
4803
4820
  /** Syncs light DOM content for cells with custom render functions */
4804
4821
  _syncSlottedContent() {
@@ -4972,20 +4989,6 @@ let KRTable = class KRTable extends i$2 {
4972
4989
  }
4973
4990
  }
4974
4991
  this._dataState = 'success';
4975
- if (!this._columnWidthsLocked) {
4976
- requestAnimationFrame(() => {
4977
- const headerCells = this.shadowRoot?.querySelectorAll('.header-row > .header-cell');
4978
- if (headerCells) {
4979
- const cols = this.getDisplayedColumns();
4980
- headerCells.forEach((cell, i) => {
4981
- if (i < cols.length && !cols[i].width && cols[i].type !== 'actions') {
4982
- cols[i].width = `${cell.offsetWidth}px`;
4983
- }
4984
- });
4985
- }
4986
- this._columnWidthsLocked = true;
4987
- });
4988
- }
4989
4992
  this._updateSearchPosition();
4990
4993
  })
4991
4994
  .catch(err => {
@@ -5976,13 +5979,8 @@ let KRTable = class KRTable extends i$2 {
5976
5979
  }
5977
5980
  /** Renders the scrollable data grid with column headers and rows. */
5978
5981
  _renderTable() {
5979
- const wrapperStyle = {};
5980
- if (this.variant === 'card') {
5981
- // Reserve space for header row + pageSize data rows to prevent layout shift
5982
- wrapperStyle['min-height'] = `${48 + (this._pageSize * 48)}px`;
5983
- }
5984
5982
  return b `
5985
- <div class="wrapper" style=${o$1(wrapperStyle)}>
5983
+ <div class="wrapper">
5986
5984
  <div class="overlay-left"></div>
5987
5985
  <div class="overlay-right"></div>
5988
5986
  ${this._renderStatus()}
@@ -6954,6 +6952,7 @@ KRTable.styles = [krBaseCSS, i$5 `
6954
6952
  :host(.kr-table--card) .wrapper {
6955
6953
  flex: none;
6956
6954
  overflow: visible;
6955
+ min-height: 200px;
6957
6956
  }
6958
6957
 
6959
6958
  :host(.kr-table--card) .content {