playbook_ui 14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 → 14.11.1.pre.alpha.PBNTR769sticky5359
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.scss +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_responsive.jsx +52 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +3 -17
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +0 -3
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +4 -11
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +0 -3
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +5 -6
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +0 -38
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83c318646e50eb8f4974a79029c4553c98dd90c0c878ec0fdd60fd77045d36a8
|
4
|
+
data.tar.gz: 777f930d187a4815ab702202437cbb96868039c9e115acfd97cee157bbd42d07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8a756512afdc408c56dbcccb9c6660ea746e14a3656f1fef48557bb09c57140f5f069c2160d2a6ac31883fae34861b9f909eb5fb0c05ec9fa4230145db24da9
|
7
|
+
data.tar.gz: 1cbeb5057637f11e479097c70b6e1e59b52abc1bd88d8f4ff0bf329e8ba56c1847eee4b3680c54c7b8cc423c0ad4c052cd77a3e9c5a348c58148a2747d0af1a0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableStickyHeaderResponsive = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "newEnrollments",
|
14
|
+
label: "New Enrollments",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "scheduledMeetings",
|
18
|
+
label: "Scheduled Meetings",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "attendanceRate",
|
22
|
+
label: "Attendance Rate",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "completedClasses",
|
26
|
+
label: "Completed Classes",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "classCompletionRate",
|
30
|
+
label: "Class Completion Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "graduatedStudents",
|
34
|
+
label: "Graduated Students",
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div>
|
41
|
+
<AdvancedTable
|
42
|
+
columnDefinitions={columnDefinitions}
|
43
|
+
htmlOptions={{style: { maxHeight: "100vh" }}}
|
44
|
+
tableData={MOCK_DATA}
|
45
|
+
tableProps={{sticky:true}}
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
)
|
50
|
+
}
|
51
|
+
|
52
|
+
export default AdvancedTableStickyHeaderResponsive
|
@@ -22,6 +22,7 @@ examples:
|
|
22
22
|
- advanced_table_table_props: Table Props
|
23
23
|
- advanced_table_inline_row_loading: Inline Row Loading
|
24
24
|
- advanced_table_responsive: Responsive Tables
|
25
|
+
- advanced_table_sticky_header_responsive: Sticky Header and Responsive
|
25
26
|
- advanced_table_custom_cell: Custom Components for Cells
|
26
27
|
- advanced_table_pagination: Pagination
|
27
28
|
- advanced_table_pagination_with_props: Pagination Props
|
@@ -13,4 +13,5 @@ export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cel
|
|
13
13
|
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
14
14
|
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
15
15
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
|
-
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
16
|
+
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
17
|
+
export { default as AdvancedTableStickyHeaderResponsive } from './_advanced_table_sticky_header_responsive.jsx'
|
@@ -4,23 +4,9 @@
|
|
4
4
|
data: object.data,
|
5
5
|
id: object.id,
|
6
6
|
**combined_html_options) do %>
|
7
|
-
|
8
|
-
|
9
|
-
<%= pb_rails("
|
10
|
-
<%= pb_rails("list", props: {ordered: false}) do %>
|
11
|
-
<% object.items.each do |item| %>
|
12
|
-
<%= pb_rails("draggable/draggable_item", props: {drag_id: item[:drag_id]}) do %>
|
13
|
-
<%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item), drag_id: item[:drag_id]) )%>
|
14
|
-
<% end %>
|
15
|
-
<% end %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
18
|
-
<% end %>
|
19
|
-
<% else %>
|
20
|
-
<%= pb_rails("list") do %>
|
21
|
-
<% object.items.each do |item| %>
|
22
|
-
<%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
|
23
|
-
<% end %>
|
7
|
+
<%= pb_rails("list") do %>
|
8
|
+
<% object.items.each do |item| %>
|
9
|
+
<%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
|
24
10
|
<% end %>
|
25
11
|
<% end %>
|
26
12
|
<% end %>
|
@@ -4,13 +4,6 @@
|
|
4
4
|
data: object.data,
|
5
5
|
id: object.id,
|
6
6
|
**combined_html_options) do %>
|
7
|
-
<% if object.drag_id && object.drag_handle %>
|
8
|
-
<span style="vertical-align: middle;">
|
9
|
-
<%= pb_rails("body") do %>
|
10
|
-
<svg width="auto" height="auto" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
|
11
|
-
<% end %>
|
12
|
-
</span>
|
13
|
-
<% end %>
|
14
7
|
<% if object.variant == "radio"%>
|
15
8
|
<%= pb_rails("radio", props: { text: object.text, checked: object.checked, input_options: object.input_options } ) %>
|
16
9
|
<% if content.present? %>
|
@@ -26,10 +19,10 @@
|
|
26
19
|
<% if object.variant == "checkbox"%>
|
27
20
|
<script>
|
28
21
|
var checkboxElement = document.querySelector("#<%=object.id%> input[type=checkbox]")
|
29
|
-
|
22
|
+
|
30
23
|
checkboxElement.addEventListener("change", (evt) => {
|
31
24
|
var listItemElement = document.querySelector("#<%=object.id%>")
|
32
|
-
|
25
|
+
|
33
26
|
if (evt.target.checked) {
|
34
27
|
listItemElement.classList.add("checked_item");
|
35
28
|
} else {
|
@@ -41,9 +34,9 @@
|
|
41
34
|
<script>
|
42
35
|
var radioElement = document.querySelector("#<%=object.id%> input[type=radio]")
|
43
36
|
|
44
|
-
radioElement.addEventListener("change", () => {
|
37
|
+
radioElement.addEventListener("change", () => {
|
45
38
|
var radios = radioElement.closest("ul").querySelectorAll("input[type=radio]")
|
46
|
-
|
39
|
+
|
47
40
|
radios.forEach((radio) => {
|
48
41
|
if (radio.checked) {
|
49
42
|
radio.closest("li").classList.add("checked_item");
|
@@ -6,9 +6,6 @@ module Playbook
|
|
6
6
|
prop :tabindex
|
7
7
|
prop :checked, type: Playbook::Props::Boolean,
|
8
8
|
default: false
|
9
|
-
prop :drag_handle, type: Playbook::Props::Boolean,
|
10
|
-
default: true
|
11
|
-
prop :drag_id, type: Playbook::Props::String
|
12
9
|
prop :name, type: Playbook::Props::String
|
13
10
|
prop :text, type: Playbook::Props::String
|
14
11
|
prop :value, type: Playbook::Props::String
|
@@ -1,7 +1,7 @@
|
|
1
1
|
@import "../../tokens/screen_sizes";
|
2
|
-
@import "../../tokens/border_radius";
|
3
2
|
|
4
3
|
.table-responsive-scroll {
|
4
|
+
display: block;
|
5
5
|
overflow-x: scroll;
|
6
6
|
|
7
7
|
// hides duplicate scroll bar for those that see two (byproduct of repeated table-responsive-scroll class
|
@@ -27,12 +27,11 @@
|
|
27
27
|
// Responsive Styles
|
28
28
|
@media (max-width: 1600px) {
|
29
29
|
&[class*="table-responsive-scroll"] {
|
30
|
-
|
31
|
-
|
32
|
-
box-shadow: 1px 0 0 0px $border_light,
|
30
|
+
border-radius: 4px;
|
31
|
+
box-shadow: 1px 0 0 0px $border_light,
|
33
32
|
-1px 0 0 0px $border_light
|
34
|
-
|
35
|
-
|
33
|
+
}
|
34
|
+
|
36
35
|
&[class^=pb_table].table-sm.table-card thead tr th:first-child,
|
37
36
|
&[class^=pb_table].table-sm:not(.no-hover).table-card tbody tr td:first-child {
|
38
37
|
border-left-width: 0px;
|