playbook_ui 14.19.0.pre.alpha.PLAY2033atactionbarrails7751 → 14.19.0.pre.alpha.PLAY2145fixhtmloptionsstyle7775
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/advanced_table.html.erb +8 -16
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/index.js +52 -355
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +19 -12
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +13 -7
- data/app/pb_kits/playbook/pb_person/_person.tsx +12 -2
- data/dist/chunks/{_weekday_stacked-DAixNLfd.js → _weekday_stacked-CaTzIguf.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/kit_base.rb +3 -3
- data/lib/playbook/version.rb +1 -1
- metadata +3 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb +0 -138
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +0 -40
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_action_bar.html.erb +0 -23
- data/app/pb_kits/playbook/pb_advanced_table/table_action_bar.rb +0 -19
data/lib/playbook/kit_base.rb
CHANGED
@@ -129,9 +129,9 @@ module Playbook
|
|
129
129
|
end
|
130
130
|
|
131
131
|
inline_styles = dynamic_inline_props
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
if inline_styles.present?
|
133
|
+
merged[:style] = merged[:style].present? ? "#{merged[:style]}; #{inline_styles}" : inline_styles
|
134
|
+
end
|
135
135
|
|
136
136
|
merged.deep_merge(data_attributes)
|
137
137
|
end
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 14.19.0.pre.alpha.
|
4
|
+
version: 14.19.0.pre.alpha.PLAY2145fixhtmloptionsstyle7775
|
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: 2025-05-
|
12
|
+
date: 2025-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -347,12 +347,8 @@ files:
|
|
347
347
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md
|
348
348
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx
|
349
349
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md
|
350
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb
|
351
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.md
|
352
350
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx
|
353
351
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md
|
354
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb
|
355
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.md
|
356
352
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.html.erb
|
357
353
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
|
358
354
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.jsx
|
@@ -397,8 +393,6 @@ files:
|
|
397
393
|
- app/pb_kits/playbook/pb_advanced_table/scss_partials/_loading.scss
|
398
394
|
- app/pb_kits/playbook/pb_advanced_table/scss_partials/_pseudo_states.scss
|
399
395
|
- app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss
|
400
|
-
- app/pb_kits/playbook/pb_advanced_table/table_action_bar.html.erb
|
401
|
-
- app/pb_kits/playbook/pb_advanced_table/table_action_bar.rb
|
402
396
|
- app/pb_kits/playbook/pb_advanced_table/table_body.html.erb
|
403
397
|
- app/pb_kits/playbook/pb_advanced_table/table_body.rb
|
404
398
|
- app/pb_kits/playbook/pb_advanced_table/table_header.html.erb
|
@@ -3574,7 +3568,7 @@ files:
|
|
3574
3568
|
- app/pb_kits/playbook/utilities/text.ts
|
3575
3569
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3576
3570
|
- dist/chunks/_typeahead-BPSIWtFT.js
|
3577
|
-
- dist/chunks/_weekday_stacked-
|
3571
|
+
- dist/chunks/_weekday_stacked-CaTzIguf.js
|
3578
3572
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3579
3573
|
- dist/chunks/lib-B20MXZcW.js
|
3580
3574
|
- dist/chunks/pb_form_validation-WWvUXPKD.js
|
@@ -1,138 +0,0 @@
|
|
1
|
-
<% column_definitions = [
|
2
|
-
{
|
3
|
-
accessor: "year",
|
4
|
-
label: "Year",
|
5
|
-
cellAccessors: ["quarter", "month", "day"],
|
6
|
-
},
|
7
|
-
{
|
8
|
-
accessor: "newEnrollments",
|
9
|
-
label: "New Enrollments",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
accessor: "scheduledMeetings",
|
13
|
-
label: "Scheduled Meetings",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
accessor: "attendanceRate",
|
17
|
-
label: "Attendance Rate",
|
18
|
-
},
|
19
|
-
{
|
20
|
-
accessor: "completedClasses",
|
21
|
-
label: "Completed Classes",
|
22
|
-
},
|
23
|
-
{
|
24
|
-
accessor: "classCompletionRate",
|
25
|
-
label: "Class Completion Rate",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
accessor: "graduatedStudents",
|
29
|
-
label: "Graduated Students",
|
30
|
-
}
|
31
|
-
]
|
32
|
-
|
33
|
-
actions = [
|
34
|
-
pb_rails("circle_icon_button", props: {
|
35
|
-
icon: "file-csv",
|
36
|
-
variant: "link",
|
37
|
-
id: "export-selected-rows-btn",
|
38
|
-
data: {
|
39
|
-
action_type: "export"
|
40
|
-
}
|
41
|
-
}),
|
42
|
-
pb_rails("circle_icon_button", props: {
|
43
|
-
icon: "trash-alt",
|
44
|
-
variant: "link",
|
45
|
-
id: "delete-selected-rows-btn",
|
46
|
-
data: {
|
47
|
-
action_type: "delete"
|
48
|
-
}
|
49
|
-
})
|
50
|
-
]
|
51
|
-
%>
|
52
|
-
|
53
|
-
<%= pb_rails("advanced_table", props: {
|
54
|
-
id: "selectable_rows_with_actions",
|
55
|
-
table_data: @table_data_no_subrows,
|
56
|
-
column_definitions: column_definitions,
|
57
|
-
selectable_rows: true,
|
58
|
-
enable_toggle_expansion: "none",
|
59
|
-
actions: actions,
|
60
|
-
show_actions_bar: true
|
61
|
-
}) %>
|
62
|
-
|
63
|
-
<script>
|
64
|
-
// Handle action clicks using the data-selected-rows attribute
|
65
|
-
window.handleActionClick = function(actionType) {
|
66
|
-
const tableContainer = document.getElementById('selectable_rows_with_actions');
|
67
|
-
if (!tableContainer) return;
|
68
|
-
|
69
|
-
// Get selected rows from the data attribute
|
70
|
-
const selectedRowsJSON = tableContainer.getAttribute('data-selected-rows');
|
71
|
-
let selectedRowIds = [];
|
72
|
-
|
73
|
-
try {
|
74
|
-
// Parse the JSON string from the data attribute
|
75
|
-
if (selectedRowsJSON) {
|
76
|
-
selectedRowIds = JSON.parse(selectedRowsJSON);
|
77
|
-
}
|
78
|
-
} catch (e) {
|
79
|
-
// Fallback if JSON parsing fails
|
80
|
-
const checkboxes = tableContainer.querySelectorAll('input[type="checkbox"]:checked');
|
81
|
-
const selectedCheckboxes = Array.from(checkboxes).filter(checkbox =>
|
82
|
-
checkbox.id !== 'select-all-rows' &&
|
83
|
-
!checkbox.closest('#select-all-rows')
|
84
|
-
);
|
85
|
-
selectedRowIds = selectedCheckboxes.map(checkbox => checkbox.id);
|
86
|
-
}
|
87
|
-
|
88
|
-
// Show appropriate message
|
89
|
-
if (!selectedRowIds || selectedRowIds.length === 0) {
|
90
|
-
alert('No Selection Made');
|
91
|
-
} else {
|
92
|
-
if (actionType === 'export') {
|
93
|
-
alert(`Row ids ${selectedRowIds.join(', ')} will be exported!`);
|
94
|
-
} else if (actionType === 'delete') {
|
95
|
-
alert(`Row ids ${selectedRowIds.join(', ')} will be deleted!`);
|
96
|
-
}
|
97
|
-
}
|
98
|
-
};
|
99
|
-
|
100
|
-
// Add event listeners when the DOM is ready
|
101
|
-
document.addEventListener('DOMContentLoaded', function() {
|
102
|
-
// Get the buttons
|
103
|
-
const exportBtn = document.getElementById('export-selected-rows-btn');
|
104
|
-
const deleteBtn = document.getElementById('delete-selected-rows-btn');
|
105
|
-
|
106
|
-
// Add click event listeners
|
107
|
-
if (exportBtn) {
|
108
|
-
exportBtn.addEventListener('click', function(e) {
|
109
|
-
e.preventDefault();
|
110
|
-
window.handleActionClick('export');
|
111
|
-
});
|
112
|
-
}
|
113
|
-
|
114
|
-
if (deleteBtn) {
|
115
|
-
deleteBtn.addEventListener('click', function(e) {
|
116
|
-
e.preventDefault();
|
117
|
-
window.handleActionClick('delete');
|
118
|
-
});
|
119
|
-
}
|
120
|
-
|
121
|
-
// Optional: Event delegation through the action bar
|
122
|
-
const actionBar = document.querySelector('.row-selection-actions-card');
|
123
|
-
if (actionBar) {
|
124
|
-
actionBar.addEventListener('click', function(e) {
|
125
|
-
const exportButton = e.target.closest('#export-selected-rows-btn');
|
126
|
-
const deleteButton = e.target.closest('#delete-selected-rows-btn');
|
127
|
-
|
128
|
-
if (exportButton) {
|
129
|
-
e.preventDefault();
|
130
|
-
window.handleActionClick('export');
|
131
|
-
} else if (deleteButton) {
|
132
|
-
e.preventDefault();
|
133
|
-
window.handleActionClick('delete');
|
134
|
-
}
|
135
|
-
});
|
136
|
-
}
|
137
|
-
});
|
138
|
-
</script>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.md
DELETED
@@ -1,3 +0,0 @@
|
|
1
|
-
Custom actions content can be rendered within the Actions Bar as shown in this doc example. The component passed to `actions` will be rendered on the right of the actionsBar.
|
2
|
-
|
3
|
-
You can utilize script tags with your actions to provide your buttons with any clickable events needed.
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<% column_definitions = [
|
2
|
-
{
|
3
|
-
accessor: "year",
|
4
|
-
label: "Year",
|
5
|
-
cellAccessors: ["quarter", "month", "day"],
|
6
|
-
},
|
7
|
-
{
|
8
|
-
accessor: "newEnrollments",
|
9
|
-
label: "New Enrollments",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
accessor: "scheduledMeetings",
|
13
|
-
label: "Scheduled Meetings",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
accessor: "attendanceRate",
|
17
|
-
label: "Attendance Rate",
|
18
|
-
},
|
19
|
-
{
|
20
|
-
accessor: "completedClasses",
|
21
|
-
label: "Completed Classes",
|
22
|
-
},
|
23
|
-
{
|
24
|
-
accessor: "classCompletionRate",
|
25
|
-
label: "Class Completion Rate",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
accessor: "graduatedStudents",
|
29
|
-
label: "Graduated Students",
|
30
|
-
}
|
31
|
-
] %>
|
32
|
-
|
33
|
-
<%= pb_rails("advanced_table", props: {
|
34
|
-
id: "selectable_rows_with_actions",
|
35
|
-
table_data: @table_data_no_subrows,
|
36
|
-
column_definitions: column_definitions,
|
37
|
-
selectable_rows: true,
|
38
|
-
enable_toggle_expansion: "none",
|
39
|
-
show_actions_bar: false
|
40
|
-
}) %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
`show_actions_bar` is an optional prop that renders the header at the top showing the row count. This is set to `true` by default but can be toggled off by setting it to `false`
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<%= pb_rails("card", props: {
|
2
|
-
border_none: object.is_visible,
|
3
|
-
classname: object.classname,
|
4
|
-
padding: object.is_visible ? "xs" : "none",
|
5
|
-
data: {
|
6
|
-
action_bar: true
|
7
|
-
}
|
8
|
-
}) do %>
|
9
|
-
<%= pb_rails("flex", props: { align_items: "center", justify: "between" }) do %>
|
10
|
-
<%= pb_rails("caption", props: { color: "light", padding_left: "xs", size: "xs" }) do %>
|
11
|
-
<span class="selected-count"><%= object.selected_count %> Selected</span>
|
12
|
-
<% end %>
|
13
|
-
<%= pb_rails("flex/flex_item") do %>
|
14
|
-
<%= pb_rails("flex") do %>
|
15
|
-
<% if object.actions.present? %>
|
16
|
-
<% object.actions.each do |action| %>
|
17
|
-
<%= action %>
|
18
|
-
<% end %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
22
|
-
<% end %>
|
23
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbAdvancedTable
|
5
|
-
class TableActionBar < Playbook::KitBase
|
6
|
-
prop :actions, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :is_visible, type: Playbook::Props::Boolean,
|
9
|
-
default: false
|
10
|
-
prop :selected_count, type: Playbook::Props::Number,
|
11
|
-
default: 0
|
12
|
-
|
13
|
-
def classname
|
14
|
-
# Just use row-selection-actions-card as the base class
|
15
|
-
generate_classname("row-selection-actions-card", separator: " ")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|