playbook_ui_docs 16.12.0.pre.rc.1 → 16.12.0.pre.rc.3
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.md +5 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +6 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb +41 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md +49 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.jsx +69 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb +49 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb +5 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb +40 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_react.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +8 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.html.erb +67 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.jsx +95 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.html.erb +1 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.jsx +16 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.md +1 -0
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +11 -0
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +11 -1
- data/app/pb_kits/playbook/pb_pill/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_pill/docs/index.js +1 -0
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6152f7165b86f19ccbb087bfbdbdd7d05bf991a065712ba62034f1ffe09086a
|
|
4
|
+
data.tar.gz: fdc04402f096f46a29e5f82937554e2fcac1693c56257aaba12643269f05c9c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88825010c500667ac57be7ca4e2a465c6ead2bb49be580757278b3b1ab7ffc1284afde6e7859cd0cf252de75ba74db36160959ff9a3aa0cf20ac884d2ad25d83
|
|
7
|
+
data.tar.gz: c5806106801117e349c6fe5872376568407354b945b900a7aac6b1eab8a0a762ae8cc04b3749a50dac0745f432997dbfba1a284c795e6d0ddb420aaa846ea8a4
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
The `columnStyling` prop is an optional item that can be used within `columnDefinitions` as shown in the code snippet below. It is an object that has several optional key/value pairs, this doc example highlights the following:
|
|
2
2
|
|
|
3
|
-
1
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
3) `fontColor`: This will allow you to control the font color for a given column.
|
|
8
|
-
|
|
9
|
-
4) Column width: optional keys on `columnStyling` are `minWidth`, `width`, and `maxWidth` (numbers = pixels; CSS strings allowed). This example sets `width` on Year for a fixed hierarchy column (see the width doc for `minWidth` and bands).
|
|
3
|
+
1. `headerAlignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
4
|
+
2. `cellAlignment`: This will allow you to control alignment of content within all cells in the given column. This is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
5
|
+
3. `fontColor`: This will allow you to control the font color for a given column.
|
|
6
|
+
4. Column width: optional keys on `columnStyling` are `minWidth`, `width`, and `maxWidth` (numbers = pixels; CSS strings allowed). This example sets `width` on Year for a fixed hierarchy column (see the width doc for `minWidth` and bands).
|
|
10
7
|
|
|
11
8
|
Fixed width: pass `width` only (or TanStack `size` only) and Playbook sets min and max to the same value automatically — you do not need all three for an exact width.
|
|
12
9
|
|
|
13
|
-
See [Column Styling: Width](https://playbook.powerapp.cloud/kits/advanced_table/react#column-styling-width) for the full guide (Playbook ↔ TanStack mapping, floor-only vs bands, and when to use one vs three values).
|
|
10
|
+
See [Column Styling: Width](https://playbook.powerapp.cloud/kits/advanced_table/styling/react#column-styling-width) for the full guide (Playbook ↔ TanStack mapping, floor-only vs bands, and when to use one vs three values).
|
|
14
11
|
|
|
15
12
|
`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.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
The `column_styling` prop is an optional item that can be used within `column_definitions` as shown in the code snippet below. It is an object that has several optional key/value pairs, this doc example highlights the following:
|
|
2
2
|
|
|
3
3
|
1) `header_alignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
4
|
-
|
|
5
4
|
2) `cell_alignment`: This will allow you to control alignment of content within all cells in the given column. This is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
6
|
-
|
|
7
5
|
3) `font_color`: This will allow you to control the font color for a given column.
|
|
6
|
+
4) Column width: optional keys on `column_styling` are `min_width`, `width`, and `max_width` (numbers = pixels; CSS strings allowed). This example sets `width` on Year for a fixed hierarchy column (see the width doc for `min_width` and bands).
|
|
7
|
+
|
|
8
|
+
Fixed width: pass `width` only and Playbook sets min and max to the same value automatically — you do not need all three for an exact width.
|
|
9
|
+
|
|
10
|
+
See [Column Styling: Width](https://playbook.powerapp.cloud/kits/advanced_table/styling/rails#column-styling-width) for the full guide (floor-only vs bands, and when to use one vs three values).
|
|
8
11
|
|
|
9
|
-
`column_styling` can be used within the column_definition of all the columns or some of them, as shown. Each column has its own individual control in this way.
|
|
12
|
+
`column_styling` can be used within the column_definition of all the columns or some of them, as shown. Each column has its own individual control in this way.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
AdvancedTable column width is controlled in two equivalent places on each leaf `columnDefinitions` entry. Playbook maps them to inline styles on header and body cells (and forwards numeric values into TanStack Table’s column model).
|
|
2
2
|
|
|
3
|
-
1) Playbook `columnStyling` and TanStack `ColumnDef` use the same three ideas:
|
|
3
|
+
**1)** Playbook `columnStyling` and TanStack `ColumnDef` use the same three ideas:
|
|
4
4
|
|
|
5
5
|
- Preferred / target width: `columnStyling` `width` maps to TanStack `size` on the same column object.
|
|
6
6
|
- Minimum width (floor): `columnStyling` `minWidth` maps to TanStack `minSize`.
|
|
@@ -10,7 +10,7 @@ Numbers are pixels. You can also pass CSS length strings on `columnStyling` (e.g
|
|
|
10
10
|
|
|
11
11
|
If both APIs set the same axis, `columnStyling` wins for that axis when Playbook builds cell styles.
|
|
12
12
|
|
|
13
|
-
2) Fixed width: set `width` only
|
|
13
|
+
**2)** Fixed width: set `width` only
|
|
14
14
|
|
|
15
15
|
If you pass only `width` (or only `size`) and do not set `minWidth` / `maxWidth` (or `minSize` / `maxSize`), Playbook treats that as a fixed column: it sets all three to the same value under the hood so you do not have to repeat yourself.
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ size: 200
|
|
|
26
26
|
|
|
27
27
|
Use this when the column should stay one width (e.g. a hierarchy column with expand controls).
|
|
28
28
|
|
|
29
|
-
3) Floor only: `minWidth` / `minSize`
|
|
29
|
+
**3)** Floor only: `minWidth` / `minSize`
|
|
30
30
|
|
|
31
31
|
Set only a minimum when the column may grow with the table or content but must not shrink below a baseline (common fix for horizontal “jump” when rows expand):
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ Set only a minimum when the column may grow with the table or content but must n
|
|
|
34
34
|
columnStyling: { minWidth: 160 }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
4) Flexible band: min + preferred + max
|
|
37
|
+
**4)** Flexible band: min + preferred + max
|
|
38
38
|
|
|
39
39
|
Set two or three values when you want a range. CSS uses preferred `width` clamped between `minWidth` and `maxWidth`:
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ Example from the table below (Attendance): `minWidth: 108`, `width: 124`, `maxWi
|
|
|
46
46
|
|
|
47
47
|
You only need all three when you want that band. If min and max are omitted, `width` alone is enough for a fixed column.
|
|
48
48
|
|
|
49
|
-
5) TanStack band without `columnStyling`
|
|
49
|
+
**5)** TanStack band without `columnStyling`
|
|
50
50
|
|
|
51
51
|
The Meetings column uses only TanStack fields:
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ The Meetings column uses only TanStack fields:
|
|
|
56
56
|
|
|
57
57
|
Playbook applies the same min / preferred / max idea to cell styles. Setting only `size: 200` would lock all three to 200, same as `width: 200` in `columnStyling`.
|
|
58
58
|
|
|
59
|
-
6) What the example table shows
|
|
59
|
+
**6)** What the example table shows
|
|
60
60
|
|
|
61
61
|
- Year (fixed): `columnStyling: { width: 128 }` — locked to 128px.
|
|
62
62
|
- Enrollments (floor): `columnStyling: { minWidth: 160 }` — at least 160px; can grow.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<% column_definitions = [
|
|
2
|
+
{
|
|
3
|
+
accessor: "year",
|
|
4
|
+
label: "Year (fixed)",
|
|
5
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
6
|
+
# width alone locks min + max to the same value (128px).
|
|
7
|
+
column_styling: { width: 128 },
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
accessor: "newEnrollments",
|
|
11
|
+
label: "Enrollments (floor)",
|
|
12
|
+
column_styling: { min_width: 160 },
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
accessor: "scheduledMeetings",
|
|
16
|
+
label: "Meetings (preferred)",
|
|
17
|
+
column_styling: { width: 200, min_width: 160, max_width: 240 },
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
accessor: "attendanceRate",
|
|
21
|
+
label: "Attendance (min / pref / max)",
|
|
22
|
+
column_styling: { min_width: 108, width: 124, max_width: 168 },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
accessor: "completedClasses",
|
|
26
|
+
label: "Completed",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
accessor: "classCompletionRate",
|
|
30
|
+
label: "Completion %",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
accessor: "graduatedStudents",
|
|
34
|
+
label: "Graduated",
|
|
35
|
+
},
|
|
36
|
+
] %>
|
|
37
|
+
|
|
38
|
+
<%= pb_rails("advanced_table", props: { id: "column-styling-width", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
39
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling-width", column_definitions: column_definitions }) %>
|
|
40
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling-width", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
41
|
+
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
AdvancedTable column width is controlled on each leaf `column_definitions` entry via `column_styling`. Playbook maps these keys to inline styles on header and body cells.
|
|
2
|
+
|
|
3
|
+
**1)** `column_styling` width keys:
|
|
4
|
+
|
|
5
|
+
- Preferred / target width: `width`
|
|
6
|
+
- Minimum width (floor): `min_width`
|
|
7
|
+
- Maximum width (ceiling): `max_width`
|
|
8
|
+
|
|
9
|
+
Numbers are pixels. You can also pass CSS length strings (e.g. `"12rem"`, `"200px"`).
|
|
10
|
+
|
|
11
|
+
**2)** Fixed width: set `width` only
|
|
12
|
+
|
|
13
|
+
If you pass only `width` and do not set `min_width` / `max_width`, Playbook treats that as a fixed column: it sets all three to the same value under the hood so you do not have to repeat yourself.
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
column_styling: { width: 128 }
|
|
17
|
+
# Applied as width, min-width, and max-width: 128px
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use this when the column should stay one width (e.g. a hierarchy column with expand controls).
|
|
21
|
+
|
|
22
|
+
**3)** Floor only: `min_width`
|
|
23
|
+
|
|
24
|
+
Set only a minimum when the column may grow with the table or content but must not shrink below a baseline (common fix for horizontal “jump” when rows expand):
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
column_styling: { min_width: 160 }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**4)** Flexible band: min + preferred + max
|
|
31
|
+
|
|
32
|
+
Set two or three values when you want a range. CSS uses preferred `width` clamped between `min_width` and `max_width`:
|
|
33
|
+
|
|
34
|
+
- `min_width`: won’t shrink below this.
|
|
35
|
+
- `width`: preferred size when space allows.
|
|
36
|
+
- `max_width`: won’t grow above this.
|
|
37
|
+
|
|
38
|
+
Example from the table below (Attendance): `min_width: 108`, `width: 124`, `max_width: 168` → preferred 124px, allowed between 108 and 168.
|
|
39
|
+
|
|
40
|
+
You only need all three when you want that band. If min and max are omitted, `width` alone is enough for a fixed column.
|
|
41
|
+
|
|
42
|
+
**5)** What the example table shows
|
|
43
|
+
|
|
44
|
+
- Year (fixed): `column_styling: { width: 128 }` — locked to 128px.
|
|
45
|
+
- Enrollments (floor): `column_styling: { min_width: 160 }` — at least 160px; can grow.
|
|
46
|
+
- Meetings (preferred): `width` / `min_width` / `max_width` — preferred 200px, between 160–240.
|
|
47
|
+
- Attendance (min / pref / max): all three — preferred 124px, between 108–168.
|
|
48
|
+
|
|
49
|
+
Grouped columns: put width options on leaf definitions (columns with an `accessor`), not on parent group headers.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
|
+
import Flex from "../../pb_flex/_flex"
|
|
4
|
+
import Badge from "../../pb_badge/_badge"
|
|
5
|
+
import Title from "../../pb_title/_title"
|
|
6
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
7
|
+
|
|
8
|
+
const AdvancedTableFullWidthCell = (props) => {
|
|
9
|
+
const columnDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
accessor: "year",
|
|
12
|
+
label: "Year",
|
|
13
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
14
|
+
customRenderer: (row, value) => (
|
|
15
|
+
<Flex justify="between">
|
|
16
|
+
<Title size={4}
|
|
17
|
+
text={value}
|
|
18
|
+
/>
|
|
19
|
+
<Badge dark
|
|
20
|
+
marginLeft="xxs"
|
|
21
|
+
text={row.original.newEnrollments > 20 ? "High" : "Low"}
|
|
22
|
+
variant="neutral"
|
|
23
|
+
/>
|
|
24
|
+
</Flex>
|
|
25
|
+
),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
accessor: "newEnrollments",
|
|
29
|
+
label: "New Enrollments",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
accessor: "scheduledMeetings",
|
|
33
|
+
label: "Scheduled Meetings",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
accessor: "attendanceRate",
|
|
37
|
+
label: "Attendance Rate",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
accessor: "completedClasses",
|
|
41
|
+
label: "Completed Classes",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
accessor: "classCompletionRate",
|
|
45
|
+
label: "Class Completion Rate",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
accessor: "graduatedStudents",
|
|
49
|
+
label: "Graduated Students",
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div>
|
|
55
|
+
<AdvancedTable
|
|
56
|
+
columnDefinitions={columnDefinitions}
|
|
57
|
+
enableToggleExpansion="all"
|
|
58
|
+
fullWidthCell
|
|
59
|
+
tableData={MOCK_DATA}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
<AdvancedTable.Header enableSorting />
|
|
63
|
+
<AdvancedTable.Body />
|
|
64
|
+
</AdvancedTable>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default AdvancedTableFullWidthCell
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
`fullWidthCell` is an optional boolean prop that defaults to `false`. When set to `true`, the first column's cell content takes up the full available width of the cell.
|
|
2
|
+
|
|
3
|
+
This is especially useful with custom cell renderers that need horizontal space — for example, a `Flex` with `justify="between"` that places content on both the left and right edges of the cell.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<%
|
|
2
|
+
column_definitions = [
|
|
3
|
+
{
|
|
4
|
+
accessor: "year",
|
|
5
|
+
label: "Year",
|
|
6
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
7
|
+
custom_renderer: ->(row, value) {
|
|
8
|
+
capture do
|
|
9
|
+
pb_rails("flex", props: { justify: "between" }) do
|
|
10
|
+
pb_rails("title", props: { text: value, size: 4 }) +
|
|
11
|
+
pb_rails("badge", props: { dark: true, margin_left: "xxs", text: row[:newEnrollments].to_i > 20 ? "High" : "Low", variant: "neutral" })
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
accessor: "newEnrollments",
|
|
18
|
+
label: "New Enrollments",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
accessor: "scheduledMeetings",
|
|
22
|
+
label: "Scheduled Meetings",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
accessor: "attendanceRate",
|
|
26
|
+
label: "Attendance Rate",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
accessor: "completedClasses",
|
|
30
|
+
label: "Completed Classes",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
accessor: "classCompletionRate",
|
|
34
|
+
label: "Class Completion Rate",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
accessor: "graduatedStudents",
|
|
38
|
+
label: "Graduated Students",
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
%>
|
|
42
|
+
|
|
43
|
+
<%= pb_rails("advanced_table", props: {
|
|
44
|
+
id: "full_width_cell",
|
|
45
|
+
table_data: @table_data,
|
|
46
|
+
column_definitions: column_definitions,
|
|
47
|
+
enable_toggle_expansion: "all",
|
|
48
|
+
full_width_cell: true
|
|
49
|
+
}) %>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
`full_width_cell` is an optional boolean prop that defaults to `false`. When set to `true`, the first column's cell content takes up the full available width of the cell.
|
|
2
|
+
|
|
3
|
+
This is especially useful with custom cell renderers that need horizontal space — for example, a `Flex` with `justify: "between"` that places content on both the left and right edges of the cell.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<%# Example sort method for demonstration purposes %>
|
|
2
|
+
<% if params["sort"] %>
|
|
3
|
+
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
|
4
|
+
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
|
5
|
+
<% @table_data_with_id.sort! do |a, b|
|
|
6
|
+
value_a = a[sort_param] || a[sort_param.to_sym]
|
|
7
|
+
value_b = b[sort_param] || b[sort_param.to_sym]
|
|
8
|
+
|
|
9
|
+
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
|
10
|
+
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
|
11
|
+
|
|
12
|
+
sort_direction * (value_a <=> value_b)
|
|
13
|
+
end %>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<% column_definitions = [
|
|
17
|
+
{
|
|
18
|
+
accessor: "year",
|
|
19
|
+
label: "Year",
|
|
20
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
21
|
+
sort_menu: [
|
|
22
|
+
{ item: "Year", link: "?sort=year_asc#pinned_rows_both_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
+
{ item: "Year", link: "?sort=year_desc#pinned_rows_both_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
accessor: "newEnrollments",
|
|
28
|
+
label: "New Enrollments",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
accessor: "scheduledMeetings",
|
|
32
|
+
label: "Scheduled Meetings",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
accessor: "attendanceRate",
|
|
36
|
+
label: "Attendance Rate",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
accessor: "completedClasses",
|
|
40
|
+
label: "Completed Classes",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
accessor: "classCompletionRate",
|
|
44
|
+
label: "Class Completion Rate",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
accessor: "graduatedStudents",
|
|
48
|
+
label: "Graduated Students",
|
|
49
|
+
}
|
|
50
|
+
] %>
|
|
51
|
+
|
|
52
|
+
<% pinned_rows = { top: ["8"], bottom: ["1"] } %>
|
|
53
|
+
|
|
54
|
+
<%= pb_rails("advanced_table", props: { id: "pinned_rows_both_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_both_table", column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_both_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
|
+
<% end %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This code snippet demonstrates `pinned_rows` taking a hash with an array of row ids to both the `top` and `bottom` keys.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<%# Example sort method for demonstration purposes %>
|
|
2
|
+
<% if params["sort"] %>
|
|
3
|
+
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
|
4
|
+
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
|
5
|
+
<% @table_data_with_id.sort! do |a, b|
|
|
6
|
+
value_a = a[sort_param] || a[sort_param.to_sym]
|
|
7
|
+
value_b = b[sort_param] || b[sort_param.to_sym]
|
|
8
|
+
|
|
9
|
+
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
|
10
|
+
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
|
11
|
+
|
|
12
|
+
sort_direction * (value_a <=> value_b)
|
|
13
|
+
end %>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<% column_definitions = [
|
|
17
|
+
{
|
|
18
|
+
accessor: "year",
|
|
19
|
+
label: "Year",
|
|
20
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
21
|
+
sort_menu: [
|
|
22
|
+
{ item: "Year", link: "?sort=year_asc#pinned_rows_bottom_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
+
{ item: "Year", link: "?sort=year_desc#pinned_rows_bottom_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
accessor: "newEnrollments",
|
|
28
|
+
label: "New Enrollments",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
accessor: "scheduledMeetings",
|
|
32
|
+
label: "Scheduled Meetings",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
accessor: "attendanceRate",
|
|
36
|
+
label: "Attendance Rate",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
accessor: "completedClasses",
|
|
40
|
+
label: "Completed Classes",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
accessor: "classCompletionRate",
|
|
44
|
+
label: "Class Completion Rate",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
accessor: "graduatedStudents",
|
|
48
|
+
label: "Graduated Students",
|
|
49
|
+
}
|
|
50
|
+
] %>
|
|
51
|
+
|
|
52
|
+
<% pinned_rows = { bottom: ["8"] } %>
|
|
53
|
+
|
|
54
|
+
<%= pb_rails("advanced_table", props: { id: "pinned_rows_bottom_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_bottom_table", column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_bottom_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
|
+
<% end %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This code snippet demonstrates `pinned_rows` taking a hash with an array of row ids to the `bottom` key.
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
label: "Year",
|
|
20
20
|
cellAccessors: ["quarter", "month", "day"],
|
|
21
21
|
sort_menu: [
|
|
22
|
-
{ item: "Year", link: "?sort=year_asc#
|
|
23
|
-
{ item: "Year", link: "?sort=year_desc#
|
|
22
|
+
{ item: "Year", link: "?sort=year_asc#pinned_rows_top_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
+
{ item: "Year", link: "?sort=year_desc#pinned_rows_top_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
24
|
],
|
|
25
25
|
},
|
|
26
26
|
{
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<% pinned_rows = { top: ["8"] } %>
|
|
53
53
|
|
|
54
|
-
<%= pb_rails("advanced_table", props: { id: "
|
|
55
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "
|
|
56
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "
|
|
54
|
+
<%= pb_rails("advanced_table", props: { id: "pinned_rows_top_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_top_table", column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_top_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
57
|
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Use the `pinned_rows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and will not change position if sorting is used.
|
|
1
|
+
Use the `pinned_rows` prop to pin specific rows to the top or bottom of an Advanced Table. Pinned rows will remain at the top or bottom when scrolling through table data and will not change position if sorting is used.
|
|
2
2
|
|
|
3
3
|
**NOTE:**
|
|
4
4
|
- Sticky header required: Pinned rows must be used with `sticky: true` via `table_props` (works with both responsive and non-responsive tables)
|
|
5
5
|
- Row ids required: Each object within the `table_data` array must contain a unique `id` in order to attach an id to all Rows for this to function.
|
|
6
|
-
- `pinned_rows` takes a hash with a `top` key containing an array of row ids, as shown in the code snippet below.
|
|
7
|
-
- For expandable rows, use the parent id in `pinned_rows[:top]`; all its children will automatically be pinned with it. If a child id is passed without the parent being pinned, nothing will be pinned.
|
|
6
|
+
- `pinned_rows` takes a hash with a `top` and/or `bottom` key containing an array of row ids, as shown in the code snippet below.
|
|
7
|
+
- For expandable rows, use the parent id in `pinned_rows[:top]` or `pinned_rows[:bottom]`; all its children will automatically be pinned with it. If a child id is passed without the parent being pinned, nothing will be pinned.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<%
|
|
2
|
+
column_definitions = [
|
|
3
|
+
{
|
|
4
|
+
accessor: "year",
|
|
5
|
+
label: "Year",
|
|
6
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
accessor: "newEnrollments",
|
|
10
|
+
label: "New Enrollments",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
accessor: "scheduledMeetings",
|
|
14
|
+
label: "Scheduled Meetings",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
accessor: "attendanceRate",
|
|
18
|
+
label: "Attendance Rate",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
accessor: "completedClasses",
|
|
22
|
+
label: "Completed Classes",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
accessor: "classCompletionRate",
|
|
26
|
+
label: "Class Completion Rate",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
accessor: "graduatedStudents",
|
|
30
|
+
label: "Graduated Students",
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
subrow_headers = ["Quarter", "", "Day"]
|
|
35
|
+
%>
|
|
36
|
+
|
|
37
|
+
<%= pb_rails("advanced_table", props: { id: "skipping-subrow-headers", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "skipping-subrow-headers", column_definitions: column_definitions }) %>
|
|
39
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "skipping-subrow-headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
|
40
|
+
<% end %>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const AdvancedTableSkippingSubrowHeaders = (props) => {
|
|
7
|
+
const columnDefinitions = [
|
|
8
|
+
{
|
|
9
|
+
accessor: "year",
|
|
10
|
+
label: "Year",
|
|
11
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
accessor: "newEnrollments",
|
|
15
|
+
label: "New Enrollments",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
accessor: "scheduledMeetings",
|
|
19
|
+
label: "Scheduled Meetings",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
accessor: "attendanceRate",
|
|
23
|
+
label: "Attendance Rate",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
accessor: "completedClasses",
|
|
27
|
+
label: "Completed Classes",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
accessor: "classCompletionRate",
|
|
31
|
+
label: "Class Completion Rate",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
accessor: "graduatedStudents",
|
|
35
|
+
label: "Graduated Students",
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
const subRowHeaders = ["Quarter", "", "Day"]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div>
|
|
44
|
+
<AdvancedTable
|
|
45
|
+
columnDefinitions={columnDefinitions}
|
|
46
|
+
tableData={MOCK_DATA}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
<AdvancedTable.Header />
|
|
50
|
+
<AdvancedTable.Body subRowHeaders={subRowHeaders}/>
|
|
51
|
+
</AdvancedTable>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export default AdvancedTableSkippingSubrowHeaders;
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_rails.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Pass an empty string at any index in `sub_row_headers` to skip the rendering of a subrow header while still nesting the data under it.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_react.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Pass an empty string at any index in `subRowHeaders` to skip the rendering of a subrow header while still nesting the data under it.
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"defaults": {
|
|
10
10
|
"columnGroupBorderColor": "none",
|
|
11
11
|
"enableToggleExpansion": "header",
|
|
12
|
+
"fullWidthCell": false,
|
|
12
13
|
"inlineRowLoading": false,
|
|
13
14
|
"loading": false,
|
|
14
15
|
"responsive": "scroll",
|
|
@@ -92,7 +93,8 @@
|
|
|
92
93
|
"name": "Column Configuration",
|
|
93
94
|
"props": [
|
|
94
95
|
"columnVisibilityControl",
|
|
95
|
-
"columnGroupBorderColor"
|
|
96
|
+
"columnGroupBorderColor",
|
|
97
|
+
"fullWidthCell"
|
|
96
98
|
]
|
|
97
99
|
},
|
|
98
100
|
{
|
|
@@ -3,15 +3,19 @@ examples:
|
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
|
4
4
|
- advanced_table_loading: Loading State
|
|
5
5
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
|
6
|
+
- advanced_table_skipping_subrow_headers: Skipping Subrow Headers
|
|
6
7
|
- advanced_table_enable_toggle_expansion_rails: Enable Toggle Expansion
|
|
7
8
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
|
8
9
|
- advanced_table_table_props: Table Props
|
|
9
10
|
- advanced_table_sticky_header_rails: Sticky Header
|
|
10
11
|
- advanced_table_table_props_sticky_header: Sticky Header for Responsive Table
|
|
11
|
-
- advanced_table_pinned_rows_rails: Pinned Rows
|
|
12
|
+
- advanced_table_pinned_rows_rails: Pinned Rows (Top)
|
|
13
|
+
- advanced_table_pinned_rows_bottom_rails: Pinned Rows (Bottom)
|
|
14
|
+
- advanced_table_pinned_rows_both_rails: Pinned Rows (Both)
|
|
12
15
|
- advanced_table_beta_sort: Enable Sorting
|
|
13
16
|
- advanced_table_responsive: Responsive Tables
|
|
14
17
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
|
18
|
+
- advanced_table_full_width_cell_rails: Full Width Cell
|
|
15
19
|
- advanced_table_with_custom_header_rails: Custom Header Cell
|
|
16
20
|
- advanced_table_with_custom_header_multi_header_rails: Custom Header with Multiple Headers
|
|
17
21
|
- advanced_table_column_headers: Multi-Header Columns
|
|
@@ -26,6 +30,7 @@ examples:
|
|
|
26
30
|
- advanced_table_row_styling: Row Styling
|
|
27
31
|
- advanced_table_padding_control_per_row_rails: Padding Control using Row Styling
|
|
28
32
|
- advanced_table_column_styling_rails: Column Styling
|
|
33
|
+
- advanced_table_column_styling_width_rails: Column Styling Width
|
|
29
34
|
- advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
|
30
35
|
- advanced_table_padding_control_rails: Padding Control using Column Styling
|
|
31
36
|
- advanced_table_background_control_rails: Column Styling Background Color
|
|
@@ -45,6 +50,7 @@ examples:
|
|
|
45
50
|
- advanced_table_expanded_control: Expanded Control
|
|
46
51
|
- advanced_table_expand_by_depth: Expand by Depth
|
|
47
52
|
- advanced_table_subrow_headers: SubRow Headers
|
|
53
|
+
- advanced_table_skipping_subrow_headers: Skipping Subrow Headers
|
|
48
54
|
- advanced_table_cascade_collapse: Cascade Collapse
|
|
49
55
|
- advanced_table_collapsible_trail: Collapsible Trail
|
|
50
56
|
- advanced_table_table_options: Table Options
|
|
@@ -56,6 +62,7 @@ examples:
|
|
|
56
62
|
- advanced_table_sticky_scroll_limitation: Sticky Header and Column Scroll Limitation
|
|
57
63
|
- advanced_table_responsive: Responsive Tables
|
|
58
64
|
- advanced_table_custom_cell: Custom Components for Cells
|
|
65
|
+
- advanced_table_full_width_cell: Full Width Cell
|
|
59
66
|
- advanced_table_with_custom_header: Custom Header Cell
|
|
60
67
|
- advanced_table_with_custom_header_multi_header: Custom Header with Multiple Headers
|
|
61
68
|
- advanced_table_pagination: Pagination
|
|
@@ -10,6 +10,7 @@ export { default as AdvancedTableTableProps } from './_advanced_table_table_prop
|
|
|
10
10
|
export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
|
|
11
11
|
export { default as AdvancedTableResponsive } from './_advanced_table_responsive.jsx'
|
|
12
12
|
export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cell.jsx'
|
|
13
|
+
export { default as AdvancedTableFullWidthCell } from './_advanced_table_full_width_cell.jsx'
|
|
13
14
|
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
|
14
15
|
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
|
15
16
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
|
@@ -53,5 +54,6 @@ export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advance
|
|
|
53
54
|
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
54
55
|
export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
|
|
55
56
|
export { default as AdvancedTableSortParentOnly } from './_advanced_table_sort_parent_only.jsx'
|
|
57
|
+
export { default as AdvancedTableSkippingSubrowHeaders } from './_advanced_table_skipping_subrow_headers.jsx'
|
|
56
58
|
export { default as AdvancedTablePinnedRowsBottom } from './_advanced_table_pinned_rows_bottom.jsx'
|
|
57
59
|
export { default as AdvancedTablePinnedRowsBoth } from './_advanced_table_pinned_rows_both.jsx'
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<%
|
|
2
|
+
sections = [
|
|
3
|
+
{
|
|
4
|
+
title: "Profile",
|
|
5
|
+
items: [
|
|
6
|
+
{ label: "View Profile", value: "profile", id: "profile" },
|
|
7
|
+
{ label: "Account Settings", value: "settings", id: "settings" },
|
|
8
|
+
],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: "Workspace",
|
|
12
|
+
items: [
|
|
13
|
+
{ label: "Projects", value: "projects", id: "projects" },
|
|
14
|
+
{ label: "Billing", value: "billing", id: "billing" },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "Support",
|
|
19
|
+
items: [
|
|
20
|
+
{ label: "Help Center", value: "help", id: "help" },
|
|
21
|
+
{ label: "Contact Support", value: "contact", id: "contact" },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
options = sections.flat_map { |section| section[:items] }
|
|
27
|
+
%>
|
|
28
|
+
|
|
29
|
+
<%= pb_rails("dropdown", props: { label: "Grouped Options", margin_bottom: "md", options: options }) do %>
|
|
30
|
+
<%= pb_rails("dropdown/dropdown_trigger") %>
|
|
31
|
+
<%= pb_rails("dropdown/dropdown_container") do %>
|
|
32
|
+
<% sections.each do |section| %>
|
|
33
|
+
|
|
34
|
+
<%= pb_rails("caption", props: {
|
|
35
|
+
text: section[:title],
|
|
36
|
+
color: "light",
|
|
37
|
+
padding_x: "xs",
|
|
38
|
+
padding_y: "xs"
|
|
39
|
+
}) %>
|
|
40
|
+
|
|
41
|
+
<%= pb_rails("section_separator") %>
|
|
42
|
+
|
|
43
|
+
<% section[:items].each do |option| %>
|
|
44
|
+
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) %>
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<% end %>
|
|
48
|
+
<% end %>
|
|
49
|
+
<% end %>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<%= pb_rails("dropdown", props: { label: "Grouped Options Minimalist", options: options, separators: false }) do %>
|
|
53
|
+
<%= pb_rails("dropdown/dropdown_trigger") %>
|
|
54
|
+
<%= pb_rails("dropdown/dropdown_container") do %>
|
|
55
|
+
<% sections.each do |section| %>
|
|
56
|
+
|
|
57
|
+
<%= pb_rails("section_separator", props: { padding_y: "xs" }) do %>
|
|
58
|
+
<%= pb_rails("caption", props: { text: section[:title], padding_x: "xs" }) %>
|
|
59
|
+
<% end %>
|
|
60
|
+
|
|
61
|
+
<% section[:items].each do |option| %>
|
|
62
|
+
<%= pb_rails("dropdown/dropdown_option", props: { option: option }) %>
|
|
63
|
+
<% end %>
|
|
64
|
+
|
|
65
|
+
<% end %>
|
|
66
|
+
<% end %>
|
|
67
|
+
<% end %>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Dropdown from '../_dropdown'
|
|
3
|
+
import Caption from '../../pb_caption/_caption'
|
|
4
|
+
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
|
5
|
+
|
|
6
|
+
const DropdownGroupedOptions = (props) => {
|
|
7
|
+
|
|
8
|
+
const sections = [
|
|
9
|
+
{
|
|
10
|
+
title: "Profile",
|
|
11
|
+
items: [
|
|
12
|
+
{ label: "View Profile", value: "profile", id: "profile" },
|
|
13
|
+
{ label: "Account Settings", value: "settings", id: "settings" },
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: "Workspace",
|
|
18
|
+
items: [
|
|
19
|
+
{ label: "Projects", value: "projects", id: "projects" },
|
|
20
|
+
{ label: "Billing", value: "billing", id: "billing" },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: "Support",
|
|
25
|
+
items: [
|
|
26
|
+
{ label: "Help Center", value: "help", id: "help" },
|
|
27
|
+
{ label: "Contact Support", value: "support", id: "support" },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
const options = sections.flatMap((section) => section.items)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<Dropdown
|
|
36
|
+
label="Grouped Options"
|
|
37
|
+
marginBottom="md"
|
|
38
|
+
options={options}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
<Dropdown.Trigger />
|
|
42
|
+
<Dropdown.Container>
|
|
43
|
+
{sections.map((section) => (
|
|
44
|
+
<React.Fragment key={section.title}>
|
|
45
|
+
<Caption
|
|
46
|
+
color="light"
|
|
47
|
+
padding="xs"
|
|
48
|
+
>
|
|
49
|
+
{section.title}
|
|
50
|
+
</Caption>
|
|
51
|
+
<SectionSeparator />
|
|
52
|
+
|
|
53
|
+
{section.items.map((option) => (
|
|
54
|
+
<Dropdown.Option
|
|
55
|
+
key={option.id}
|
|
56
|
+
option={option}
|
|
57
|
+
/>
|
|
58
|
+
))}
|
|
59
|
+
</React.Fragment>
|
|
60
|
+
))}
|
|
61
|
+
</Dropdown.Container>
|
|
62
|
+
</Dropdown>
|
|
63
|
+
<Dropdown
|
|
64
|
+
label="Grouped Options Minimalist"
|
|
65
|
+
options={options}
|
|
66
|
+
separators={false}
|
|
67
|
+
{...props}
|
|
68
|
+
>
|
|
69
|
+
<Dropdown.Trigger />
|
|
70
|
+
<Dropdown.Container>
|
|
71
|
+
{sections.map((section) => (
|
|
72
|
+
<React.Fragment key={section.title}>
|
|
73
|
+
<SectionSeparator
|
|
74
|
+
paddingY="xs"
|
|
75
|
+
>
|
|
76
|
+
<Caption paddingX="xs">
|
|
77
|
+
{section.title}
|
|
78
|
+
</Caption>
|
|
79
|
+
</SectionSeparator>
|
|
80
|
+
|
|
81
|
+
{section.items.map((option) => (
|
|
82
|
+
<Dropdown.Option
|
|
83
|
+
key={option.id}
|
|
84
|
+
option={option}
|
|
85
|
+
/>
|
|
86
|
+
))}
|
|
87
|
+
</React.Fragment>
|
|
88
|
+
))}
|
|
89
|
+
</Dropdown.Container>
|
|
90
|
+
</Dropdown>
|
|
91
|
+
</div>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default DropdownGroupedOptions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Customize the Dropdown Container to organize options into distinct, labeled sections.
|
|
@@ -36,6 +36,7 @@ examples:
|
|
|
36
36
|
- dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
|
|
37
37
|
- dropdown_required_indicator: Required Indicator
|
|
38
38
|
- dropdown_disabled: Disabled Input
|
|
39
|
+
- dropdown_grouped_options: Grouped Options
|
|
39
40
|
- dropdown_custom_event_type: Custom Event Type
|
|
40
41
|
|
|
41
42
|
react:
|
|
@@ -77,3 +78,4 @@ examples:
|
|
|
77
78
|
- dropdown_quickpick_with_date_pickers: Quick Pick Variant with Date Pickers
|
|
78
79
|
- dropdown_required_indicator: Required Indicator
|
|
79
80
|
- dropdown_disabled: Disabled Input
|
|
81
|
+
- dropdown_grouped_options: Grouped Options
|
|
@@ -36,3 +36,4 @@ export { default as DropdownRequiredIndicator } from "./_dropdown_required_indic
|
|
|
36
36
|
export { default as DropdownDisabledOption } from "./_dropdown_disabled_option.jsx";
|
|
37
37
|
export { default as DropdownCustomDisplayDisabledOption } from "./_dropdown_custom_display_disabled_option.jsx";
|
|
38
38
|
export { default as DropdownDisabled } from "./_dropdown_disabled.jsx";
|
|
39
|
+
export { default as DropdownGroupedOptions } from "./_dropdown_grouped_options.jsx";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("pill", props: { size: "sm", text: "Small" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Set pill size to small with `size: "sm"` / `size="sm"`.
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"name": "Appearance",
|
|
25
25
|
"props": [
|
|
26
26
|
"variant",
|
|
27
|
+
"size",
|
|
27
28
|
"textTransform"
|
|
28
29
|
]
|
|
29
30
|
}
|
|
@@ -47,6 +48,16 @@
|
|
|
47
48
|
},
|
|
48
49
|
"children": ""
|
|
49
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"name": "Small",
|
|
53
|
+
"props": {
|
|
54
|
+
"text": "small",
|
|
55
|
+
"size": "sm",
|
|
56
|
+
"variant": "neutral",
|
|
57
|
+
"textTransform": "lowercase"
|
|
58
|
+
},
|
|
59
|
+
"children": ""
|
|
60
|
+
},
|
|
50
61
|
{
|
|
51
62
|
"name": "Preserve Casing",
|
|
52
63
|
"props": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"name": "Appearance",
|
|
14
|
-
"props": ["variant", "textTransform"]
|
|
14
|
+
"props": ["variant", "size", "textTransform"]
|
|
15
15
|
}
|
|
16
16
|
],
|
|
17
17
|
"presets": [
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
},
|
|
34
34
|
"children": ""
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"name": "Small",
|
|
38
|
+
"props": {
|
|
39
|
+
"text": "small",
|
|
40
|
+
"size": "sm",
|
|
41
|
+
"variant": "neutral",
|
|
42
|
+
"textTransform": "lowercase"
|
|
43
|
+
},
|
|
44
|
+
"children": ""
|
|
45
|
+
},
|
|
36
46
|
{
|
|
37
47
|
"name": "Preserve Casing",
|
|
38
48
|
"props": {
|
|
@@ -3,6 +3,7 @@ examples:
|
|
|
3
3
|
rails:
|
|
4
4
|
- pill_default: Default
|
|
5
5
|
- pill_variants: Variants
|
|
6
|
+
- pill_size: Size
|
|
6
7
|
- pill_example: Example
|
|
7
8
|
|
|
8
9
|
|
|
@@ -10,6 +11,7 @@ examples:
|
|
|
10
11
|
react:
|
|
11
12
|
- pill_default: Default
|
|
12
13
|
- pill_variants: Variants
|
|
14
|
+
- pill_size: Size
|
|
13
15
|
- pill_example: Example
|
|
14
16
|
|
|
15
17
|
swift:
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playbook_ui_docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 16.12.0.pre.rc.
|
|
4
|
+
version: 16.12.0.pre.rc.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-07-
|
|
12
|
+
date: 2026-07-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: playbook_ui
|
|
@@ -78,6 +78,8 @@ files:
|
|
|
78
78
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md
|
|
79
79
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.jsx
|
|
80
80
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md
|
|
81
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb
|
|
82
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md
|
|
81
83
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility.jsx
|
|
82
84
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility.md
|
|
83
85
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility_custom.jsx
|
|
@@ -100,6 +102,10 @@ files:
|
|
|
100
102
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md
|
|
101
103
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
|
|
102
104
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md
|
|
105
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.jsx
|
|
106
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.md
|
|
107
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb
|
|
108
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.md
|
|
103
109
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_grouped_headers_composition.jsx
|
|
104
110
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_grouped_headers_composition.md
|
|
105
111
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx
|
|
@@ -130,8 +136,12 @@ files:
|
|
|
130
136
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md
|
|
131
137
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx
|
|
132
138
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both.jsx
|
|
139
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb
|
|
140
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.md
|
|
133
141
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_react.md
|
|
134
142
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom.jsx
|
|
143
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb
|
|
144
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.md
|
|
135
145
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_react.md
|
|
136
146
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb
|
|
137
147
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md
|
|
@@ -161,6 +171,10 @@ files:
|
|
|
161
171
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.md
|
|
162
172
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
|
|
163
173
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md
|
|
174
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb
|
|
175
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.jsx
|
|
176
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_rails.md
|
|
177
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_react.md
|
|
164
178
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx
|
|
165
179
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md
|
|
166
180
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx
|
|
@@ -968,6 +982,9 @@ files:
|
|
|
968
982
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.md
|
|
969
983
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb
|
|
970
984
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
|
|
985
|
+
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.html.erb
|
|
986
|
+
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.jsx
|
|
987
|
+
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_grouped_options.md
|
|
971
988
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.jsx
|
|
972
989
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.md
|
|
973
990
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display.jsx
|
|
@@ -2061,6 +2078,9 @@ files:
|
|
|
2061
2078
|
- app/pb_kits/playbook/pb_pill/docs/_pill_example.jsx
|
|
2062
2079
|
- app/pb_kits/playbook/pb_pill/docs/_pill_example.md
|
|
2063
2080
|
- app/pb_kits/playbook/pb_pill/docs/_pill_props_swift.md
|
|
2081
|
+
- app/pb_kits/playbook/pb_pill/docs/_pill_size.html.erb
|
|
2082
|
+
- app/pb_kits/playbook/pb_pill/docs/_pill_size.jsx
|
|
2083
|
+
- app/pb_kits/playbook/pb_pill/docs/_pill_size.md
|
|
2064
2084
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants.html.erb
|
|
2065
2085
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants.jsx
|
|
2066
2086
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants_swift.md
|