@acorex/components 22.4.22 → 22.4.23
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/acorex-components-data-table.mjs +38 -7
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +2 -2
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/package.json +3 -3
- package/types/acorex-components-data-table.d.ts +11 -0
|
@@ -2375,6 +2375,8 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
2375
2375
|
*/
|
|
2376
2376
|
this.treeFillResolvedWidths = signal(new Map(), /* @ts-ignore */
|
|
2377
2377
|
...(ngDevMode ? [{ debugName: "treeFillResolvedWidths" }] : /* istanbul ignore next */ []));
|
|
2378
|
+
/** Coalesces tree remeasure until expanded rows are in the DOM. */
|
|
2379
|
+
this.treeFillAfterExpandTimer = null;
|
|
2378
2380
|
/** @ignore */
|
|
2379
2381
|
this.resizeObserver = null;
|
|
2380
2382
|
/**
|
|
@@ -2758,6 +2760,13 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
2758
2760
|
this.displayedRows.update((prev) => this.toggleExpanded(prev, expandedItem, children));
|
|
2759
2761
|
}
|
|
2760
2762
|
this.scheduleTextHighlight();
|
|
2763
|
+
this.scheduleTreeFillAfterExpand();
|
|
2764
|
+
});
|
|
2765
|
+
this.destroyRef.onDestroy(() => {
|
|
2766
|
+
if (this.treeFillAfterExpandTimer != null) {
|
|
2767
|
+
clearTimeout(this.treeFillAfterExpandTimer);
|
|
2768
|
+
this.treeFillAfterExpandTimer = null;
|
|
2769
|
+
}
|
|
2761
2770
|
});
|
|
2762
2771
|
this.dataSource.onItemRefreshChildren.pipe(this._unsubscriber.takeUntilDestroy).subscribe((data) => {
|
|
2763
2772
|
const { id } = data;
|
|
@@ -2837,9 +2846,10 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
2837
2846
|
}
|
|
2838
2847
|
/**
|
|
2839
2848
|
* Tree expand columns keep a content minimum and grow into leftover table space for nested indent.
|
|
2849
|
+
* `expandHandler` opts any column in, including hosts that extend the base column instead of `ax-text-column`.
|
|
2840
2850
|
*/
|
|
2841
2851
|
isTreeFillColumn(column) {
|
|
2842
|
-
return column
|
|
2852
|
+
return column.expandHandler === true;
|
|
2843
2853
|
}
|
|
2844
2854
|
/**
|
|
2845
2855
|
* Tree fill columns must never keep a pixel width from auto-fit; they absorb remaining table width.
|
|
@@ -3315,9 +3325,7 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
3315
3325
|
console.error(`Failed to auto-fit column ${index}:`, error);
|
|
3316
3326
|
}
|
|
3317
3327
|
});
|
|
3318
|
-
this.
|
|
3319
|
-
this.enforceTreeFillColumnWidths();
|
|
3320
|
-
this.updateColumnLayoutWidths();
|
|
3328
|
+
this.refreshTreeFillLayout(headerOnly);
|
|
3321
3329
|
}
|
|
3322
3330
|
/**
|
|
3323
3331
|
* Auto-fits all resizable columns to their content width.
|
|
@@ -3350,9 +3358,7 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
3350
3358
|
console.error(`Failed to auto-fit column ${index}:`, error);
|
|
3351
3359
|
}
|
|
3352
3360
|
});
|
|
3353
|
-
this.
|
|
3354
|
-
this.enforceTreeFillColumnWidths();
|
|
3355
|
-
this.updateColumnLayoutWidths();
|
|
3361
|
+
this.refreshTreeFillLayout(false);
|
|
3356
3362
|
}
|
|
3357
3363
|
/**
|
|
3358
3364
|
* Auto-fits a single column to its content width.
|
|
@@ -3371,6 +3377,8 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
3371
3377
|
return;
|
|
3372
3378
|
}
|
|
3373
3379
|
if (this.isTreeFillColumn(column)) {
|
|
3380
|
+
// Keep `width: 'auto'` and do not emit a resize. Hosts persist pixel widths from that event.
|
|
3381
|
+
this.refreshTreeFillLayout(options.headerOnly ?? false);
|
|
3374
3382
|
return;
|
|
3375
3383
|
}
|
|
3376
3384
|
const finalWidth = this.measureColumnContentWidth(columnIndex, options);
|
|
@@ -3586,6 +3594,28 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
3586
3594
|
el.style.flex = '0 0 auto';
|
|
3587
3595
|
});
|
|
3588
3596
|
}
|
|
3597
|
+
/**
|
|
3598
|
+
* Re-measures tree-expander columns and assigns leftover wrapper width.
|
|
3599
|
+
* Does not write a pixel `column.width` or emit `onColumnSizeChanged`.
|
|
3600
|
+
*/
|
|
3601
|
+
refreshTreeFillLayout(headerOnly) {
|
|
3602
|
+
this.measureTreeFillColumns(headerOnly);
|
|
3603
|
+
this.enforceTreeFillColumnWidths();
|
|
3604
|
+
this.updateColumnLayoutWidths();
|
|
3605
|
+
}
|
|
3606
|
+
/** Nested rows paint after `onItemExpanded`; measure indent once they are in the DOM. */
|
|
3607
|
+
scheduleTreeFillAfterExpand() {
|
|
3608
|
+
if (!isPlatformBrowser(this.platformID) || !this.columnsList().some((column) => this.isTreeFillColumn(column))) {
|
|
3609
|
+
return;
|
|
3610
|
+
}
|
|
3611
|
+
if (this.treeFillAfterExpandTimer != null) {
|
|
3612
|
+
clearTimeout(this.treeFillAfterExpandTimer);
|
|
3613
|
+
}
|
|
3614
|
+
this.treeFillAfterExpandTimer = setTimeout(() => {
|
|
3615
|
+
this.treeFillAfterExpandTimer = null;
|
|
3616
|
+
this.refreshTreeFillLayout(false);
|
|
3617
|
+
}, 0);
|
|
3618
|
+
}
|
|
3589
3619
|
/**
|
|
3590
3620
|
* Stores the content width of tree-expander columns, including visible nested indent.
|
|
3591
3621
|
*/
|
|
@@ -3716,6 +3746,7 @@ class AXDataTableComponent extends AXBaseDataTable {
|
|
|
3716
3746
|
/**
|
|
3717
3747
|
* Auto-fits a single column by its `name` / data field.
|
|
3718
3748
|
* Call after async cell content has rendered when `width` is `'auto'`.
|
|
3749
|
+
* A tree expand column keeps `width: 'auto'` and refreshes the shared tree layout instead of pinning a pixel width.
|
|
3719
3750
|
*
|
|
3720
3751
|
* @param columnName - Column `name` / data field.
|
|
3721
3752
|
* @param options - Measurement options; programmatic calls default to `isUserInteraction: false`.
|