playbook_ui_docs 16.4.0.pre.alpha.displaybreakpoints15091 → 16.4.0.pre.alpha.play2838formcustomvalidationsconsistency15140

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: 4d76349497c9aed9fbdb3db641ffc35173b5b359a82e3002169c22dac3bd7bd5
4
- data.tar.gz: 93ac2b9d7fb72999554b19883582e24168ec8e00ebc57cc6a4a01aefeb81b1e0
3
+ metadata.gz: ea89601064dc057d0c600657f8007f8d6286aeed4b330071b59c7f13554423a6
4
+ data.tar.gz: b6ef98d802e2abc915bd805678199f1791f31cc9c7a0444ff1b781517436ae4d
5
5
  SHA512:
6
- metadata.gz: 5f7a324c2d795c8f7950252bc26fda991c90b20a71620f53646fcae7dea1e12c3f2e3fe777f51dae18f6b82cb74a9ef5483a4fd355847b51305353d96a8698a2
7
- data.tar.gz: ac4f91556a586902d24d8a647dee141c1501dea08671ac8791ec2decb7b5942bf2949f8220f774dd38d46854c6cce8c9ca511cdb8e5d8d31426a69fe1e32ba16
6
+ metadata.gz: 5047c890181149a5fa62a9bf11bd3d2837a6a8ddc2defe79cd26edb91d0f5fc5ca6172b109100ddb828959993bd0368f215a899db8caa31cd749f7cc312fd709
7
+ data.tar.gz: fc37ce86e841a6b45a02e030fb14ccbfd71d12ecc20c381ebc0d958d1e8d350c83a0ad3b935775b066ceb92cb00af0ab18e83bdf31028e1b29b8677a582d28fb
@@ -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
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.pre.alpha.displaybreakpoints15091
4
+ version: 16.4.0.pre.alpha.play2838formcustomvalidationsconsistency15140
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-18 00:00:00.000000000 Z
12
+ date: 2026-03-19 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