playbook_ui 14.19.0.pre.alpha.PLAY1973formpillinternalsizing7728 → 14.19.0.pre.alpha.PLAY2033atactionbarrails7730

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: eb03eeb6d4f6845e9a28ad2d458559cb1f0efc49c982e66a49e9c94dde91a5d3
4
- data.tar.gz: 5c8d3da2bcce5b6ee616e1ce946ed8c2cb38357c18d99fdb373a9f1d2dd84d1f
3
+ metadata.gz: 654590a50901aacde66d35bd4be201e411e132b400b2914cc5e037d3429caded
4
+ data.tar.gz: 8d0e41a47e517cf306c76815921ff9aa1f994491a7596b3f259fedd4e0d6e865
5
5
  SHA512:
6
- metadata.gz: 9d9c9d3367dc7b29172ae603ede775506ce76e2285547e769be6348e4e59185ba316e78ffccc1377a5baf79a73b1c4212596098498683c370a9405aaa89afffc
7
- data.tar.gz: 70a2d58d2832f1a98f0652b980b9b3bc396eada7fd1cee732e848096c17db18cae3637bf6f218c927c839c543cad4c8a13b9f6aa63febd0669ab8543c19becc8
6
+ metadata.gz: e2016cd384a81cd7d9f3d4f93e474f4bb5843d3f199b9e1989dfefd41eaa2cd943aee4823e70fde27d2c503f2e4c90e7a3503f176b5d7d5e07f0fa194d866454
7
+ data.tar.gz: 7be919bf509875aeb4beb91b4f25f6b163c2b2c5a20a7a510df6204216592e33c6d512991c2c73eec9a5c462b40bd29417c335c497269b13b582db3938445a52
@@ -1,10 +1,21 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark, classname: object.loading ? "content-loading" : "" }.merge(object.table_props)) do %>
3
- <% if content.present? %>
4
- <% content.presence %>
5
- <% else %>
6
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows }) %>
7
- <%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion }) %>
8
- <% end %>
9
- <% end %>
2
+ <% table_id = object.id || "table-#{SecureRandom.hex(8)}" %>
3
+ <div id="<%= table_id %>" class="<%= object.classname %>">
4
+ <% if object.selectable_rows && object.show_actions_bar %>
5
+ <%= pb_rails("advanced_table/table_action_bar", props: {
6
+ actions: object.actions,
7
+ is_visible: false,
8
+ selected_count: 0
9
+ }) %>
10
+ <% end %>
11
+
12
+ <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark, classname: object.loading ? "content-loading" : "" }.merge(object.table_props)) do %>
13
+ <% if content.present? %>
14
+ <% content.presence %>
15
+ <% else %>
16
+ <%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows }) %>
17
+ <%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion }) %>
18
+ <% end %>
19
+ <% end %>
20
+ </div>
10
21
  <% end %>
@@ -25,6 +25,10 @@ module Playbook
25
25
  default: "auto"
26
26
  prop :selectable_rows, type: Playbook::Props::Boolean,
27
27
  default: false
28
+ prop :show_actions_bar, type: Playbook::Props::Boolean,
29
+ default: false
30
+ prop :actions, type: Playbook::Props::Array,
31
+ default: []
28
32
 
29
33
  def classname
30
34
  additional_classes = [responsive_classname, max_height_classname]
@@ -47,6 +51,11 @@ module Playbook
47
51
  def selected_rows_length
48
52
  selected_rows.length
49
53
  end
54
+
55
+ def is_action_bar_visible
56
+ # Action bar visibility is controlled by JS based on selection
57
+ false
58
+ end
50
59
  end
51
60
  end
52
61
  end
@@ -0,0 +1,56 @@
1
+ <%
2
+ # Define column definitions
3
+ column_definitions = [
4
+ {
5
+ accessor: "year",
6
+ label: "Year",
7
+ cellAccessors: ["quarter", "month", "day"],
8
+ },
9
+ {
10
+ accessor: "newEnrollments",
11
+ label: "New Enrollments",
12
+ },
13
+ {
14
+ accessor: "scheduledMeetings",
15
+ label: "Scheduled Meetings",
16
+ },
17
+ {
18
+ accessor: "attendanceRate",
19
+ label: "Attendance Rate",
20
+ },
21
+ {
22
+ accessor: "completedClasses",
23
+ label: "Completed Classes",
24
+ },
25
+ {
26
+ accessor: "classCompletionRate",
27
+ label: "Class Completion Rate",
28
+ },
29
+ {
30
+ accessor: "graduatedStudents",
31
+ label: "Graduated Students",
32
+ }
33
+ ]
34
+
35
+ # Define actions for the selection bar
36
+ actions = [
37
+ pb_rails("circle_icon_button", props: {
38
+ icon: "file-csv",
39
+ variant: "link"
40
+ }),
41
+ pb_rails("circle_icon_button", props: {
42
+ icon: "trash-alt",
43
+ variant: "link"
44
+ })
45
+ ]
46
+ %>
47
+
48
+ <%= pb_rails("advanced_table", props: {
49
+ id: "selectable_rows_with_actions",
50
+ table_data: @table_data_no_subrows,
51
+ column_definitions: column_definitions,
52
+ selectable_rows: true,
53
+ enable_toggle_expansion: "none",
54
+ actions: actions,
55
+ show_actions_bar: true
56
+ }) %>
@@ -15,6 +15,7 @@ examples:
15
15
  - advanced_table_column_border_color_rails: Column Group Border Color
16
16
  - advanced_table_selectable_rows_rails: Selectable Rows
17
17
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
18
+ - advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
18
19
 
19
20
  react:
20
21
  - advanced_table_default: Default (Required Props)