playbook_ui_docs 15.3.0 → 15.4.0.pre.rc.0

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: 8b84e38edadc939fcac4328a3a39b4ad8ad306b42258e9fd24a134e722170703
4
- data.tar.gz: 2c39ee75f2f845e337acd26dec84aa2d2addd9417e148876317be70bec1b20a0
3
+ metadata.gz: cd551831023d6461df0dceafbcbd6a58bdc862f4f98252ec7f58a40bcd709781
4
+ data.tar.gz: 235b73c843621ff5890230cbdea09bfea94314bcf33fb5febae8f6d380f8a363
5
5
  SHA512:
6
- metadata.gz: 9a35a8e4114c7e68d6bafc2ae54afd0c96ec2858dcfe4afc6e2fdf2340ba8a15ce838f1884bd7c4d928c8be3a95a79f7521eabfc9ae6aa01c1d51034d8caec74
7
- data.tar.gz: f729399cb442a3322bcf87fa615af30459c6dc90cb02710379ae6b1af3610d0f9becbd87af6d15fc650539b7655eca7c883b4e7a8df971ad45532a25902b6877
6
+ metadata.gz: d8b5586a5c0637c76f0e17880a57e71ba6bb3db2abedf58ed49c57775d5bdaa1eec985bff876552f2cc0424c3727cef41a0b94be630d519c25ca5365f2099da4
7
+ data.tar.gz: 23aa7a066d364419e2eeed5ac4723d259e2d7b71d1fd31f8a677f2d3546844a6a89f58728c168c817fd005710b16a7e31958739cab3b77031ef504acd6a850b8
@@ -1,6 +1,8 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import Caption from '../../pb_caption/_caption'
3
4
  import { MOCK_DATA_INLINE_LOADING } from "./_mock_data_inline_loading"
5
+ import { MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN } from "./_mock_data_inline_loading_empty_children"
4
6
 
5
7
  const AdvancedTableInlineRowLoading = (props) => {
6
8
  const columnDefinitions = [
@@ -41,16 +43,42 @@ const AdvancedTableInlineRowLoading = (props) => {
41
43
 
42
44
  return (
43
45
  <div>
46
+ <Caption text="Inline Row Loading - Demonstrated in Row 1 (Rows 2 and 3 have data)" />
44
47
  <AdvancedTable
45
48
  columnDefinitions={columnDefinitions}
46
49
  enableToggleExpansion="all"
47
50
  inlineRowLoading
51
+ marginBottom="md"
48
52
  tableData={MOCK_DATA_INLINE_LOADING}
49
53
  {...props}
50
54
  >
51
55
  <AdvancedTable.Header />
52
56
  <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
53
57
  </AdvancedTable>
58
+ <Caption text="Inline Row Loading with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is not rendered" />
59
+ <AdvancedTable
60
+ columnDefinitions={columnDefinitions}
61
+ enableToggleExpansion="all"
62
+ inlineRowLoading
63
+ marginBottom="md"
64
+ tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
65
+ {...props}
66
+ >
67
+ <AdvancedTable.Header />
68
+ <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
69
+ </AdvancedTable>
70
+ <Caption text="Inline Row Loading and Persist Toggle Expansion Button with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is rendered" />
71
+ <AdvancedTable
72
+ columnDefinitions={columnDefinitions}
73
+ enableToggleExpansion="all"
74
+ inlineRowLoading
75
+ persistToggleExpansionButton
76
+ tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
77
+ {...props}
78
+ >
79
+ <AdvancedTable.Header />
80
+ <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
81
+ </AdvancedTable>
54
82
  </div>
55
83
  )
56
84
  }
@@ -1,5 +1,14 @@
1
+ ### inlineRowLoading
1
2
  As a default, the kit assumes that the initial dataset is complete, and it renders all expansion buttons/controls based on that data; if no children are present, no expansion controls are rendered. If, however, you want to change the initial dataset to omit some or all of its children (to improve load times of a complex dataset, perhaps), and you implement a querying logic that loads children only when its parent is expanded, then you must use the `inlineRowLoading` prop to ensure your expansion controls are rendered even though your child data is not yet loaded. You must also pass an empty `children` array to any node that will have children to ensure its parent maintains its ability to expand. If this prop is called AND your data contains empty `children` arrays, the kit will render expansion controls on any row with empty children, and then add an inline loading state within the expanded subrow until those child row(s) are returned to the page [by your query logic].
2
3
 
3
- In this code example, 2021 has an empty children array. Toggle it open to see the inline loading state. Once the correct data loads, this state will be replaced with the correct data rows.
4
+ In the first Advanced Table in this code example, 2021 has an empty children array. Toggle it open to see the inline loading state. Once the correct data loads, this state will be replaced with the correct data rows.
4
5
 
5
- This prop is set to `false` by default.
6
+ This prop is set to `false` by default.
7
+
8
+
9
+ ### persistToggleExpansion
10
+ The `persistToggleExpansionButton` is a boolean prop that renders the toggle-all icon in the top left header cell for complex datasets with empty `children` arrays and advanced querying logic explained in the preceeding doc example. Your logic may require an additional query helper file to update data specifically from requerying via toggle all buttons.
11
+
12
+ In the second and third Advanced Tables in this code example, all 3 rows have empty children arrays. The second Advanced Table demonstrates that the toggle all button does not render (prior to an initial row expansion) without `persistToggleExpansionButton` in place. The third Advanced Table shows the toggle all button due to `persistToggleExpansionButton`.
13
+
14
+ This prop is set to false by default and should only be used in conjunction with `inlineRowLoading`.
@@ -0,0 +1,42 @@
1
+ export const MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN = [
2
+ {
3
+ year: "2021",
4
+ quarter: null,
5
+ month: null,
6
+ day: null,
7
+ newEnrollments: "20",
8
+ scheduledMeetings: "10",
9
+ attendanceRate: "51%",
10
+ completedClasses: "3",
11
+ classCompletionRate: "33%",
12
+ graduatedStudents: "19",
13
+ children: [],
14
+ },
15
+ {
16
+ year: "2022",
17
+ quarter: null,
18
+ month: null,
19
+ day: null,
20
+ newEnrollments: "25",
21
+ scheduledMeetings: "17",
22
+ attendanceRate: "75%",
23
+ completedClasses: "5",
24
+ classCompletionRate: "45%",
25
+ graduatedStudents: "32",
26
+ children: [],
27
+ },
28
+ {
29
+ year: "2023",
30
+ quarter: null,
31
+ month: null,
32
+ day: null,
33
+ newEnrollments: "10",
34
+ scheduledMeetings: "15",
35
+ attendanceRate: "65%",
36
+ completedClasses: "4",
37
+ classCompletionRate: "49%",
38
+ graduatedStudents: "29",
39
+ children: [],
40
+ },
41
+ ]
42
+
@@ -18,7 +18,7 @@
18
18
 
19
19
  if (submitButton) {
20
20
  let currentClass = submitButton.className;
21
- let newClass = currentClass.replace("_disabled_loading", "_enabled");
21
+ let newClass = currentClass.replace("pb_button_disabled pb_button_loading", "pb_button_enabled");
22
22
 
23
23
  let cancelClass = cancelButton ? cancelButton.className : "";
24
24
  let newCancelClass = cancelClass.replace("_disabled", "_enabled");