playbook_ui 14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10a0e4cb9340097b9e793ab5a4c3cf062ccb0f33df36fc321495215cbcdf89ce
4
- data.tar.gz: 63b345af0b4b60033d485c080600f2c57bccc4de2eeb3259f2ce68bf9fe28b79
3
+ metadata.gz: 83c318646e50eb8f4974a79029c4553c98dd90c0c878ec0fdd60fd77045d36a8
4
+ data.tar.gz: 777f930d187a4815ab702202437cbb96868039c9e115acfd97cee157bbd42d07
5
5
  SHA512:
6
- metadata.gz: cafe574e0d494c8a4466dcbf01e2c7502701bf3be1cf19f3419505fa6812b6613eddd2a60d6d092a30c4ca489bf67dc32a75a3c53975d32dbd01375745f634d7
7
- data.tar.gz: b3a6601c23e7426a97a5c28b9d613c500ce905dc49b381769714419c6ae6478ad78bba36243d489ea666a38b03e7d23c3871cf894b19622cfa4f6b44bffa1224
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'
@@ -68,7 +68,7 @@
68
68
  </div>
69
69
 
70
70
  <%= javascript_tag do %>
71
- const loadDatePicker = () => {
71
+ window.addEventListener("DOMContentLoaded", () => {
72
72
  datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
73
73
 
74
74
  if (<%= object.selection_type == "quickpick" %>) {
@@ -80,17 +80,6 @@
80
80
  endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
81
81
  })
82
82
  }
83
- }
84
-
85
- window.addEventListener("DOMContentLoaded", () => {
86
- loadDatePicker();
87
- });
88
-
89
- if (<%= !object.custom_event_listener.empty? %>) {
90
- window.addEventListener("<%= object.custom_event_listener %>", () => {
91
- console.log("Custom Event listener fired");
92
- loadDatePicker();
93
- })
94
- }
83
+ })
95
84
  <% end %>
96
85
  <% end %>
@@ -73,8 +73,6 @@ module Playbook
73
73
  default: false
74
74
  prop :year_range, type: Playbook::Props::Array,
75
75
  default: [1900, 2100]
76
- prop :custom_event_listener, type: Playbook::Props::String,
77
- default: ""
78
76
 
79
77
  def classname
80
78
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -1,12 +1 @@
1
- <%= pb_rails("date_picker", props: { picker_id: "date-picker-default", custom_event_listener: "datePickerLoader" }) %>
2
- <%= pb_rails("button", props: { id: "date-picker-loader", text: "Load Custom Event" }) %>
3
-
4
- <script>
5
- document.getElementById("date-picker-loader").addEventListener("click", () => {
6
- window.document.dispatchEvent(
7
- new CustomEvent("datePickerLoader", {
8
- bubbles: true,
9
- })
10
- );
11
- });
12
- </script>
1
+ <%= pb_rails("date_picker", props: { picker_id: "date-picker-default"}) %>