playbook_ui 14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 → 14.11.1.pre.alpha.PBNTR769sticky5359

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75abb8afb9decb32624e25ec10c037c124119a63db9bd90426a7eff8af0ad732
4
- data.tar.gz: 597025d1e585db6c2e920cc29248178e948f7bb0aef4df1511c06212234455fd
3
+ metadata.gz: 83c318646e50eb8f4974a79029c4553c98dd90c0c878ec0fdd60fd77045d36a8
4
+ data.tar.gz: 777f930d187a4815ab702202437cbb96868039c9e115acfd97cee157bbd42d07
5
5
  SHA512:
6
- metadata.gz: 16426f8a9c9a67eb8fbcac7f63ce42cc7b3cbba6948c3a32656be187861b82f5ed403428bcef3296b973b4440c77f02948973e93e60090d495f2af887b09f046
7
- data.tar.gz: 60a3f74fb3f0ff2bf2afe6a825ff06ee31cef7ed55199d1d25695b47a947c94625591a1a92351bcb6e9a01bca427ffc9e7784955ecb46fafeca40e2648322c09
6
+ metadata.gz: b8a756512afdc408c56dbcccb9c6660ea746e14a3656f1fef48557bb09c57140f5f069c2160d2a6ac31883fae34861b9f909eb5fb0c05ec9fa4230145db24da9
7
+ data.tar.gz: 1cbeb5057637f11e479097c70b6e1e59b52abc1bd88d8f4ff0bf329e8ba56c1847eee4b3680c54c7b8cc423c0ad4c052cd77a3e9c5a348c58148a2747d0af1a0
@@ -15,6 +15,12 @@
15
15
  word-wrap: normal;
16
16
  }
17
17
 
18
+ .sticky-header {
19
+ thead {
20
+ z-index: 3 !important;
21
+ }
22
+ }
23
+
18
24
  .bg-silver {
19
25
  background-color: lighten($silver, $opacity_7);
20
26
  }
@@ -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'
@@ -11,7 +11,6 @@ examples:
11
11
  rails:
12
12
  - draggable_default_rails: Default
13
13
  - draggable_with_list_rails: Draggable with List Kit
14
- - draggable_with_selectable_list_rails: Draggable with SelectableList Kit
15
14
  - draggable_with_cards_rails: Draggable with Cards
16
15
 
17
16
 
@@ -4,23 +4,9 @@
4
4
  data: object.data,
5
5
  id: object.id,
6
6
  **combined_html_options) do %>
7
- <% if enable_drag %>
8
- <%= pb_rails("draggable", props: {initial_items: object.items}) do %>
9
- <%= pb_rails("draggable/draggable_container") do %>
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 %>
@@ -14,9 +14,6 @@ module Playbook
14
14
  prop :items, type: Playbook::Props::Array,
15
15
  default: []
16
16
 
17
- prop :enable_drag, type: Playbook::Props::Boolean,
18
- default: false
19
-
20
17
  def classname
21
18
  generate_classname("pb_selectable_list_kit")
22
19
  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
- &:has(> table.table-card) {
31
- border-radius: $border_rad_light;
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;