@kodaris/krubble-components 1.0.65 → 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.
- package/custom-elements.json +11 -5
- package/dist/krubble-components.bundled.js +17 -14
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +6 -6
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +17 -14
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +1 -1
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.d.ts.map +1 -1
- package/dist/table/table.js +17 -14
- package/dist/table/table.js.map +1 -1
- package/package.json +1 -1
|
@@ -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 => {
|