eru-grid 0.0.48 → 0.0.49
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/fesm2022/eru-grid.mjs +23 -6
- package/fesm2022/eru-grid.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eru-grid.d.ts +6 -0
package/fesm2022/eru-grid.mjs
CHANGED
|
@@ -12714,7 +12714,7 @@ class EruGridComponent {
|
|
|
12714
12714
|
const heightsMap = new Map();
|
|
12715
12715
|
// Use gridHeight from config — NOT containerHeight — to avoid the ResizeObserver
|
|
12716
12716
|
// feedback loop where larger viewports → taller host → ResizeObserver fires → bigger viewports.
|
|
12717
|
-
const availableViewHeight = Math.max(300, this.
|
|
12717
|
+
const availableViewHeight = Math.max(300, this.layoutGridHeight() - HEADER_BUFFER);
|
|
12718
12718
|
const SCROLLBAR_BUFFER = 30 + freezeHeaderHeight; // Reserve space for horizontal scrollbar so CDK viewport has enough height
|
|
12719
12719
|
groups.forEach(group => {
|
|
12720
12720
|
const rows = groupRows.get(group.id === null || group.id === undefined ? '__NULL_GROUP__' : group.id);
|
|
@@ -12760,6 +12760,12 @@ class EruGridComponent {
|
|
|
12760
12760
|
const config = this.gridStore.configuration();
|
|
12761
12761
|
return config?.config?.gridHeight ?? 400;
|
|
12762
12762
|
}, ...(ngDevMode ? [{ debugName: "gridHeight" }] : []));
|
|
12763
|
+
/**
|
|
12764
|
+
* gridHeight for viewport maths. 0 means "size to content" — it removes the
|
|
12765
|
+
* CSS cap and floor, but the table/pivot viewport sizing still needs a number
|
|
12766
|
+
* to work against, so it falls back to the same default an unset height uses.
|
|
12767
|
+
*/
|
|
12768
|
+
layoutGridHeight = computed(() => this.gridHeight() || 400, ...(ngDevMode ? [{ debugName: "layoutGridHeight" }] : []));
|
|
12763
12769
|
// Gridlines configuration computed properties
|
|
12764
12770
|
showColumnLines = computed(() => {
|
|
12765
12771
|
const config = this.gridStore.configuration();
|
|
@@ -12975,7 +12981,7 @@ class EruGridComponent {
|
|
|
12975
12981
|
if (this.freezeGrandTotal() && this.grandTotalPosition() === 'after') {
|
|
12976
12982
|
grandTotalHeight = this.dataRowHeight() + 10;
|
|
12977
12983
|
}
|
|
12978
|
-
let minHeight = (this.
|
|
12984
|
+
let minHeight = (this.layoutGridHeight() - headerHeight); // Start with 50% of parent
|
|
12979
12985
|
// Ensure minimum usable height
|
|
12980
12986
|
minHeight = Math.min(minHeight, rowHeight);
|
|
12981
12987
|
minHeight = minHeight + 1;
|
|
@@ -12983,7 +12989,7 @@ class EruGridComponent {
|
|
|
12983
12989
|
return minHeight;
|
|
12984
12990
|
}
|
|
12985
12991
|
else {
|
|
12986
|
-
return this.
|
|
12992
|
+
return this.layoutGridHeight();
|
|
12987
12993
|
}
|
|
12988
12994
|
}
|
|
12989
12995
|
adjustScrollWidth() {
|
|
@@ -12994,7 +13000,7 @@ class EruGridComponent {
|
|
|
12994
13000
|
if (this.freezeGrandTotal() && this.grandTotalPosition() === 'before') {
|
|
12995
13001
|
headerHeight = headerHeight + this.dataRowHeight();
|
|
12996
13002
|
}
|
|
12997
|
-
return (this.
|
|
13003
|
+
return (this.layoutGridHeight()) <= this.getInitialMinHeightPx();
|
|
12998
13004
|
}
|
|
12999
13005
|
/**
|
|
13000
13006
|
* Get the rendered range (what's in the DOM including buffer)
|
|
@@ -13215,6 +13221,15 @@ class EruGridComponent {
|
|
|
13215
13221
|
return;
|
|
13216
13222
|
if (gridHeight) {
|
|
13217
13223
|
host.style.setProperty('--grid-height', `${gridHeight}px`, 'important');
|
|
13224
|
+
host.style.removeProperty('--grid-min-height');
|
|
13225
|
+
}
|
|
13226
|
+
else {
|
|
13227
|
+
// Height 0 = size to content: drop both the cap and the floor. The
|
|
13228
|
+
// properties must be removed, not skipped — an earlier pass (config
|
|
13229
|
+
// still null, so gridHeight fell back to its default) already wrote
|
|
13230
|
+
// --grid-height, and leaving it in place is what made 0 a no-op.
|
|
13231
|
+
host.style.removeProperty('--grid-height');
|
|
13232
|
+
host.style.setProperty('--grid-min-height', '0px', 'important');
|
|
13218
13233
|
}
|
|
13219
13234
|
host.style.setProperty('--grid-header-row-height', `${headerH}px`);
|
|
13220
13235
|
host.style.setProperty('--grid-data-row-height', `${dataH}px`);
|
|
@@ -13247,7 +13262,9 @@ class EruGridComponent {
|
|
|
13247
13262
|
// Left unset the track's max stays `1fr` (see the scss fallback), which is
|
|
13248
13263
|
// the stretch-to-fill behaviour boards had before this existed.
|
|
13249
13264
|
setVar('--board-col-max-width', (typeof maxW === 'number' && maxW > 0) ? `${maxW}px` : undefined);
|
|
13250
|
-
|
|
13265
|
+
// 0 = no cap: the column ends after its last card. Undefined leaves the
|
|
13266
|
+
// SCSS fallback in place.
|
|
13267
|
+
setVar('--board-column-height', typeof colH === 'number' ? (colH > 0 ? `${colH}px` : 'none') : undefined);
|
|
13251
13268
|
});
|
|
13252
13269
|
this.breakpointObserver
|
|
13253
13270
|
.observe('(max-width: 767.98px)')
|
|
@@ -13363,7 +13380,7 @@ class EruGridComponent {
|
|
|
13363
13380
|
for (const entry of entries) {
|
|
13364
13381
|
const height = entry.contentRect.height;
|
|
13365
13382
|
// Cap at gridHeight to prevent feedback loop: larger viewports → taller host → loop
|
|
13366
|
-
const capped = Math.min(height, this.
|
|
13383
|
+
const capped = Math.min(height, this.layoutGridHeight());
|
|
13367
13384
|
// Only enter Angular zone when the value actually changes — avoids triggering
|
|
13368
13385
|
// change detection (and the updateViewportSize → checkViewportSize → resize chain)
|
|
13369
13386
|
// on every resize event.
|