@truenas/ui-components 0.4.10 → 0.4.11
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.
|
@@ -11296,36 +11296,47 @@ class TnTableComponent {
|
|
|
11296
11296
|
* Cells wrap regardless of this (that is the table's default), so reach for it only when equal
|
|
11297
11297
|
* columns are actually wanted: it gives up the `auto` layout's content-proportional sizing,
|
|
11298
11298
|
* which a table with one long text column among short ones usually wants to keep.
|
|
11299
|
+
*
|
|
11300
|
+
* Changes the layout algorithm only — the table still shrinks with its container, with no floor
|
|
11301
|
+
* unless {@link minColumnWidth} or {@link minWidth} sets one.
|
|
11299
11302
|
*/
|
|
11300
11303
|
fixedLayout = input(false, ...(ngDevMode ? [{ debugName: "fixedLayout" }] : []));
|
|
11301
11304
|
/**
|
|
11302
11305
|
* Smallest width a column is allowed to shrink to before the host scrolls horizontally instead.
|
|
11303
|
-
* Any CSS length.
|
|
11306
|
+
* Any CSS length. Empty (the default) applies no floor.
|
|
11307
|
+
*
|
|
11308
|
+
* `fixedLayout` makes the table fit its container exactly, so past a certain width the columns
|
|
11309
|
+
* keep shrinking and wrap every cell to a couple of characters per line: technically visible,
|
|
11310
|
+
* unreadable, and never scrollable. Set this to scroll instead once a column would go below it.
|
|
11311
|
+
* The floor is derived as this times the column count, so it scales with the table rather than
|
|
11312
|
+
* needing a hand-picked number per page.
|
|
11304
11313
|
*
|
|
11305
|
-
*
|
|
11306
|
-
*
|
|
11307
|
-
*
|
|
11308
|
-
*
|
|
11314
|
+
* Opt-in rather than on by default, because a derived floor cannot know the table's container: a
|
|
11315
|
+
* full-width page table has room for one, while the same table in a dashboard card or beside a
|
|
11316
|
+
* details pane would just scroll at every ordinary window size. Only the consumer knows which it
|
|
11317
|
+
* is — reach for it when the table can actually get narrow enough to matter, typically a
|
|
11318
|
+
* full-width table on a phone.
|
|
11309
11319
|
*
|
|
11310
11320
|
* Only applies with `fixedLayout`. Without it the table lays out `auto`, sizing to its content
|
|
11311
11321
|
* and overflowing the host — which scrolls on its own.
|
|
11312
11322
|
*/
|
|
11313
|
-
minColumnWidth = input('
|
|
11323
|
+
minColumnWidth = input('', ...(ngDevMode ? [{ debugName: "minColumnWidth" }] : []));
|
|
11314
11324
|
/**
|
|
11315
11325
|
* Explicit width floor, overriding the {@link minColumnWidth} derivation. Any CSS length. Reach
|
|
11316
11326
|
* for this only when a specific table needs a floor its column count doesn't imply.
|
|
11317
11327
|
*/
|
|
11318
11328
|
minWidth = input('', ...(ngDevMode ? [{ debugName: "minWidth" }] : []));
|
|
11319
|
-
/** The floor actually applied to the table — explicit if given, else derived. */
|
|
11329
|
+
/** The floor actually applied to the table — explicit if given, else derived, else none. */
|
|
11320
11330
|
resolvedMinWidth = computed(() => {
|
|
11321
11331
|
const explicit = this.minWidth();
|
|
11322
11332
|
if (explicit) {
|
|
11323
11333
|
return explicit;
|
|
11324
11334
|
}
|
|
11325
|
-
|
|
11335
|
+
const perColumn = this.minColumnWidth();
|
|
11336
|
+
if (!perColumn || !this.fixedLayout()) {
|
|
11326
11337
|
return null;
|
|
11327
11338
|
}
|
|
11328
|
-
return `calc(${
|
|
11339
|
+
return `calc(${perColumn} * ${this.effectiveDisplayedColumns().length})`;
|
|
11329
11340
|
}, ...(ngDevMode ? [{ debugName: "resolvedMinWidth" }] : []));
|
|
11330
11341
|
// --- Outputs ---
|
|
11331
11342
|
sortChange = output();
|