playbook_ui_docs 14.20.0.pre.alpha.PLAY21817891 → 14.20.0.pre.alpha.revert4453PBNTR933reactdraggablebugdragbtwnexamples7854
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_beta.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/dist/playbook-doc.js +1 -1
- metadata +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb +0 -137
- 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
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: 14.20.0.pre.alpha.
|
4
|
+
version: 14.20.0.pre.alpha.revert4453PBNTR933reactdraggablebugdragbtwnexamples7854
|
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-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: playbook_ui
|
@@ -95,12 +95,8 @@ files:
|
|
95
95
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md
|
96
96
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx
|
97
97
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md
|
98
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb
|
99
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.md
|
100
98
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx
|
101
99
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md
|
102
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb
|
103
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.md
|
104
100
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.html.erb
|
105
101
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
|
106
102
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.jsx
|
@@ -1,137 +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
|
-
}) %>
|
61
|
-
|
62
|
-
<script>
|
63
|
-
// Handle action clicks using the data-selected-rows attribute
|
64
|
-
window.handleActionClick = function(actionType) {
|
65
|
-
const tableContainer = document.getElementById('selectable_rows_with_actions');
|
66
|
-
if (!tableContainer) return;
|
67
|
-
|
68
|
-
// Get selected rows from the data attribute
|
69
|
-
const selectedRowsJSON = tableContainer.getAttribute('data-selected-rows');
|
70
|
-
let selectedRowIds = [];
|
71
|
-
|
72
|
-
try {
|
73
|
-
// Parse the JSON string from the data attribute
|
74
|
-
if (selectedRowsJSON) {
|
75
|
-
selectedRowIds = JSON.parse(selectedRowsJSON);
|
76
|
-
}
|
77
|
-
} catch (e) {
|
78
|
-
// Fallback if JSON parsing fails
|
79
|
-
const checkboxes = tableContainer.querySelectorAll('input[type="checkbox"]:checked');
|
80
|
-
const selectedCheckboxes = Array.from(checkboxes).filter(checkbox =>
|
81
|
-
checkbox.id !== 'select-all-rows' &&
|
82
|
-
!checkbox.closest('#select-all-rows')
|
83
|
-
);
|
84
|
-
selectedRowIds = selectedCheckboxes.map(checkbox => checkbox.id);
|
85
|
-
}
|
86
|
-
|
87
|
-
// Show appropriate message
|
88
|
-
if (!selectedRowIds || selectedRowIds.length === 0) {
|
89
|
-
alert('No Selection Made');
|
90
|
-
} else {
|
91
|
-
if (actionType === 'export') {
|
92
|
-
alert(`Row ids ${selectedRowIds.join(', ')} will be exported!`);
|
93
|
-
} else if (actionType === 'delete') {
|
94
|
-
alert(`Row ids ${selectedRowIds.join(', ')} will be deleted!`);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
};
|
98
|
-
|
99
|
-
// Add event listeners when the DOM is ready
|
100
|
-
document.addEventListener('DOMContentLoaded', function() {
|
101
|
-
// Get the buttons
|
102
|
-
const exportBtn = document.getElementById('export-selected-rows-btn');
|
103
|
-
const deleteBtn = document.getElementById('delete-selected-rows-btn');
|
104
|
-
|
105
|
-
// Add click event listeners
|
106
|
-
if (exportBtn) {
|
107
|
-
exportBtn.addEventListener('click', function(e) {
|
108
|
-
e.preventDefault();
|
109
|
-
window.handleActionClick('export');
|
110
|
-
});
|
111
|
-
}
|
112
|
-
|
113
|
-
if (deleteBtn) {
|
114
|
-
deleteBtn.addEventListener('click', function(e) {
|
115
|
-
e.preventDefault();
|
116
|
-
window.handleActionClick('delete');
|
117
|
-
});
|
118
|
-
}
|
119
|
-
|
120
|
-
// Optional: Event delegation through the action bar
|
121
|
-
const actionBar = document.querySelector('.row-selection-actions-card');
|
122
|
-
if (actionBar) {
|
123
|
-
actionBar.addEventListener('click', function(e) {
|
124
|
-
const exportButton = e.target.closest('#export-selected-rows-btn');
|
125
|
-
const deleteButton = e.target.closest('#delete-selected-rows-btn');
|
126
|
-
|
127
|
-
if (exportButton) {
|
128
|
-
e.preventDefault();
|
129
|
-
window.handleActionClick('export');
|
130
|
-
} else if (deleteButton) {
|
131
|
-
e.preventDefault();
|
132
|
-
window.handleActionClick('delete');
|
133
|
-
}
|
134
|
-
});
|
135
|
-
}
|
136
|
-
});
|
137
|
-
</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`
|