playbook_ui_docs 16.7.0.pre.alpha.play295616404 → 16.7.0.pre.alpha.tablewidths16409
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +10 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +7 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_styling.json +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e96d568eaa72edcacd44bc4c10050ba5081eeb87cd69897f39a2a0905c3ce482
|
|
4
|
+
data.tar.gz: 95fdf5ecd9dc483ed5c19840e2239eff5a1ba4563ae50bdc7531828656410557
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d951a81873cbaf285dfb6ee687564bb987d742f01490b8c9e1db8236bcbe76857e711667f4c1f50912cc163988a3c48e149f693ccea7bd2db4fbacd08a429e0d
|
|
7
|
+
data.tar.gz: ace0a0d9a220c24b525bef7c8d4c69f95988136af3fae52cc5d5c18d65f41ae446c6d75e4ad1394bb7a0783be0f0905fe074c8f14abb660e38179cad993ba2e6
|
|
@@ -10,6 +10,8 @@ const AdvancedTableColumnStyling = (props) => {
|
|
|
10
10
|
accessor: "year",
|
|
11
11
|
label: "Year",
|
|
12
12
|
cellAccessors: ["quarter", "month", "day"],
|
|
13
|
+
// Keeps the hierarchy column narrow and stable when rows expand (see kit docs).
|
|
14
|
+
columnStyling: { minWidth: 108, width: 124, maxWidth: 168 },
|
|
13
15
|
},
|
|
14
16
|
{
|
|
15
17
|
accessor: "newEnrollments",
|
|
@@ -6,4 +6,14 @@ The `columnStyling` prop is an optional item that can be used within `columnDefi
|
|
|
6
6
|
|
|
7
7
|
3) `fontColor`: This will allow you to control the font color for a given column.
|
|
8
8
|
|
|
9
|
+
4) **Column width (layout stability)** — optional keys on `columnStyling` (numbers are treated as **pixels**; you may also use CSS length strings such as `"12rem"` or `"200px"`):
|
|
10
|
+
|
|
11
|
+
- `minWidth`: minimum width for the column’s header and body cells (helps prevent horizontal “jump” when row content or expansion depth changes on tables using fixed layout).
|
|
12
|
+
- `width`: preferred column width.
|
|
13
|
+
- `maxWidth`: maximum column width.
|
|
14
|
+
|
|
15
|
+
The live example below narrows the **Year** column (`minWidth` / `width` / `maxWidth`) so the first column stays compact while leaving room for expand and sort controls.
|
|
16
|
+
|
|
17
|
+
The same sizing can be expressed with TanStack `ColumnDef` fields on each column definition object (merged into the underlying table model): `size` (width), `minSize`, and `maxSize` (numbers, pixels). If both are present for the same axis, **`columnStyling` string values take precedence**; otherwise `columnStyling` numeric/string values override TanStack numbers when only one source sets that axis. **Grouped columns:** apply width controls on **leaf** column definitions (the columns that have an `accessor`).
|
|
18
|
+
|
|
9
19
|
`columnStyling` can be used within the columnDefinition of all the columns or some of them, as shown. Each column has its own individual control in this way.
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
},
|
|
314
314
|
"column_styling_info": {
|
|
315
315
|
"presetName": "Column Styling",
|
|
316
|
-
"message": "This sample uses columnStyling on column definitions.
|
|
316
|
+
"message": "This sample uses columnStyling on column definitions. The Year column uses minWidth, width, and maxWidth for a compact, stable first column; other columns show background colors on headers and cells.",
|
|
317
317
|
"type": "info"
|
|
318
318
|
}
|
|
319
319
|
},
|
|
@@ -2628,7 +2628,12 @@
|
|
|
2628
2628
|
"quarter",
|
|
2629
2629
|
"month",
|
|
2630
2630
|
"day"
|
|
2631
|
-
]
|
|
2631
|
+
],
|
|
2632
|
+
"columnStyling": {
|
|
2633
|
+
"minWidth": 108,
|
|
2634
|
+
"width": 124,
|
|
2635
|
+
"maxWidth": 168
|
|
2636
|
+
}
|
|
2632
2637
|
},
|
|
2633
2638
|
{
|
|
2634
2639
|
"accessor": "newEnrollments",
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
},
|
|
372
372
|
"column_styling_info": {
|
|
373
373
|
"presetName": "Column Styling",
|
|
374
|
-
"message": "This sample uses columnStyling on column definitions.
|
|
374
|
+
"message": "This sample uses columnStyling on column definitions. The Year column uses minWidth, width, and maxWidth for a compact, stable first column; other columns show background colors on headers and cells.",
|
|
375
375
|
"type": "info"
|
|
376
376
|
}
|
|
377
377
|
}
|
data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_styling.json
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
{
|
|
3
3
|
"accessor": "year",
|
|
4
4
|
"label": "Year",
|
|
5
|
-
"cellAccessors": ["quarter", "month", "day"]
|
|
5
|
+
"cellAccessors": ["quarter", "month", "day"],
|
|
6
|
+
"columnStyling": {
|
|
7
|
+
"minWidth": 108,
|
|
8
|
+
"width": 124,
|
|
9
|
+
"maxWidth": 168
|
|
10
|
+
}
|
|
6
11
|
},
|
|
7
12
|
{
|
|
8
13
|
"accessor": "newEnrollments",
|