playbook_ui_docs 16.4.0 → 16.5.0.pre.rc.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d75941f7f1cb8007566e28c430baaee9882fed47bb4ac81e68962ce8355edf6d
4
- data.tar.gz: df099e190d6c86ddcc19811aba14f0b347b5cee4f6d34828ade8d4a044bac51f
3
+ metadata.gz: 592879980ba0c230f0fe46ab6b8791243fd3b2031ab8763ec11e39591dfebed9
4
+ data.tar.gz: 8d74d963de155921371e5d3c92a74f805c1919996e82ea7aa37f6b70666777e5
5
5
  SHA512:
6
- metadata.gz: ee1f847879b0fea73374b12a9b6504a406db13deab901edeb3f1c34fb60b25b80bf630b31dcc74d82c3a59fa5ef9e18ae3d6f9907cd80f6aec8895592cdaf0fc
7
- data.tar.gz: 6a4d4074147c4150f0536117b80bc0b9578dc48c3e0b5e3c9c63325d929be8f982d84d71d181114ec5f728afc156ef365377a3e2eb04172d00d8bb7962beb792
6
+ metadata.gz: 1d7120fe9b6f1aadd3d8681423f2812457f9d25e3f577c10c4bb137ea96def85c69257c75aa0e250ff23a8895839b70059cfc9f77b55f4c66230266f7b1daccd
7
+ data.tar.gz: cc2b37a049c2d429d8b4191a36efb1fddf17d91d4ec909fe309c80c63dbf0e93d8a669fea834930b1c73603efc68aaf1cb8d27e54235871aa5dcda09942aa640
@@ -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_table", active: params["sort"] == "year_asc", direction: "asc" },
23
+ { item: "Year", link: "?sort=year_desc#pinned_rows_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"] } %>
53
+
54
+ <%= pb_rails("advanced_table", props: { id: "pinned_rows_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_table", column_definitions: column_definitions }) %>
56
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
57
+ <% end %>
@@ -0,0 +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.
2
+
3
+ **NOTE:**
4
+ - Sticky header required: Pinned rows must be used with `sticky: true` via `table_props` (works with both responsive and non-responsive tables)
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.
@@ -7,6 +7,7 @@ examples:
7
7
  - advanced_table_table_props: Table Props
8
8
  - advanced_table_sticky_header_rails: Sticky Header
9
9
  - advanced_table_table_props_sticky_header: Sticky Header for Responsive Table
10
+ - advanced_table_pinned_rows_rails: Pinned Rows
10
11
  - advanced_table_beta_sort: Enable Sorting
11
12
  - advanced_table_responsive: Responsive Tables
12
13
  - advanced_table_custom_cell_rails: Custom Components for Cells
@@ -1,20 +1,11 @@
1
1
  <%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-1"} }) %>
2
2
 
3
- <%= pb_rails("dialog", props: {
4
- id:"dialog-1",
5
- size: "md",
6
- title: "Header Title is the Title Prop"
7
- }) do %>
8
- <%= pb_rails("dialog/dialog_body") do %>
9
- <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg", text: "Button Primary" }) %>
10
- <div style="height: 800px; background-color: lightgray;"></div>
11
- <%= pb_rails("button", props: { loading: true, text: "Loading..." }) %>
12
- <% end %>
13
-
14
- <%= pb_rails("dialog/dialog_footer") do %>
15
- <%= pb_rails("flex", props: { spacing: "between", padding_x: "md", padding_bottom: "md", padding: "sm" }) do %>
16
- <%= pb_rails("button", props: { loading: true, text: "Send My Issue" }) %>
17
- <%= pb_rails("button", props: { text: "Back", variant: "link", data: {"close-dialog": "dialog-1"} }) %>
18
- <% end %>
19
- <% end %>
20
- <% end %>
3
+ <%= pb_rails("dialog", props: {
4
+ id:"dialog-1",
5
+ size: "sm",
6
+ title: "Header Title is the Title Prop",
7
+ text: "Hello Body Text, Nice to meet ya.",
8
+ cancel_button: "Cancel Button",
9
+ confirm_button: "Okay",
10
+ confirm_button_id: "confirm-button-1"
11
+ }) %>
@@ -12,35 +12,16 @@ const DialogDefault = () => {
12
12
  <>
13
13
  <Button onClick={open}>{'Open Dialog'}</Button>
14
14
  <Dialog
15
+ cancelButton="Cancel Button"
16
+ confirmButton="Okay"
15
17
  onCancel={close}
16
18
  onClose={close}
17
19
  onConfirm={close}
18
20
  opened={isOpen}
19
- size="md"
21
+ size="sm"
22
+ text="Hello Body Text, Nice to meet ya."
20
23
  title="Header Title is the Title Prop"
21
- >
22
- <Dialog.Body>
23
- <Button
24
- aria={{ label: 'Loading' }}
25
- loading
26
- text="Button Primary"
27
- />
28
- <div style={{height: '800px', backgroundColor: 'lightgray'}} />
29
- <Button
30
- loading
31
- text="Loading..."
32
- />
33
- </Dialog.Body>
34
- <Dialog.Footer>
35
- <Button
36
- loading
37
- text="Send My Issue"
38
- />
39
- <Button variant="link">
40
- {"Back"}
41
- </Button>
42
- </Dialog.Footer>
43
- </Dialog>
24
+ />
44
25
  </>
45
26
  )
46
27
  }
@@ -1,2 +1,2 @@
1
- <%= pb_rails("pagination", props: { model: @users, view: self}) %>
1
+ <%= pb_rails("pagination", props: { model: @extra_users, view: self }) %>
2
2
 
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.4.0
4
+ version: 16.5.0.pre.rc.0
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-03-17 00:00:00.000000000 Z
12
+ date: 2026-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -125,6 +125,8 @@ files:
125
125
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx
126
126
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md
127
127
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx
128
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb
129
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md
128
130
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md
129
131
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb
130
132
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.jsx