playbook_ui_docs 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2010 → 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2023
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +2 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +13 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js +39 -39
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +3 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00c1929111233e767ace99abaffa4b4f401e2097e821abe3a238bb2f5fe0accd
|
4
|
+
data.tar.gz: 70fc62aa3dc5a347625184c7470a6316dea635808103186c204faa79e4f2f172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37bb751dfddf5a51fd801df9b0baa0f03960568095f25939ffc2d86b1e6388767e685e3f805615b934838e2514fa081359f53164bbba3b7fd7024c850732121c
|
7
|
+
data.tar.gz: e93b6dcda9f10e3d9602f269014170e63bc6b256c2d32895e338f56bfd8705ed3260c9eb1104358d24e4ca94e7c04d6dea76253f6831682745bf8f7eaea7d3a2
|
@@ -27,7 +27,7 @@ const AdvancedTableDefault = (props) => {
|
|
27
27
|
},
|
28
28
|
{
|
29
29
|
accessor: "classCompletionRate",
|
30
|
-
label: "
|
30
|
+
label: "Class Completion Rate",
|
31
31
|
},
|
32
32
|
{
|
33
33
|
accessor: "graduatedStudents",
|
@@ -41,10 +41,7 @@ const AdvancedTableDefault = (props) => {
|
|
41
41
|
columnDefinitions={columnDefinitions}
|
42
42
|
tableData={MOCK_DATA}
|
43
43
|
{...props}
|
44
|
-
|
45
|
-
<AdvancedTable.Header/>
|
46
|
-
<AdvancedTable.Body/>
|
47
|
-
</AdvancedTable>
|
44
|
+
/>
|
48
45
|
</div>
|
49
46
|
);
|
50
47
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
The AdvancedTable kit takes the table data and automatically renders expandable subrows for nested items to any depth needed. In it's simplest form, the kit has two required props:
|
2
|
+
|
3
|
+
`tableData` is the data that the kit needs to consume to render the table. This data will take the structure of an array of objects where each object will be rendered as a row with the key/value pairs being the column values. If an object within that data has children, the kit will automatically create subRows with icon buttons on the parent rows to toggle the subRows open or closed. The toggleExpansionAll button in the first column header can also be used to toggle expansion for the top level parent rows. For a visual of the data structure needed for `tableData`, see [here](https://github.com/powerhome/playbook/blob/1b2481c06137d2bc63031a1120c1bd4d01bfd9ec/playbook/app/pb_kits/playbook/pb_advanced_table/README.md).
|
4
|
+
|
5
|
+
|
6
|
+
`columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is a array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
|
7
|
+
|
8
|
+
- `accessor`: this is the key from your data for the value you want rendered in that column
|
9
|
+
- `label`: this is what will be rendered as the column header label
|
10
|
+
|
11
|
+
There is also one optional item that is only required if the table has nested data:
|
12
|
+
|
13
|
+
- `cellAccessors`: This is an array of strings that represent keys from your data object. This is only required for the first column in case of nested data. If you have nested data, the AdvancedTable needs to know what to render in that first column for nested items. This array represents the nested data in the order you want it rendered.
|
@@ -0,0 +1 @@
|
|
1
|
+
The AdvancedTable kit uses the [Tanstack Table v8](https://tanstack.com/table/v8/docs/introduction) under the hood to render advanced tables that allow for complex, nested data structures with expansion and sort options.
|
@@ -12,7 +12,7 @@ export const MOCK_DATA = [
|
|
12
12
|
graduatedStudents: "19",
|
13
13
|
children: [
|
14
14
|
{
|
15
|
-
year: "
|
15
|
+
year: "2021",
|
16
16
|
quarter: "Q1",
|
17
17
|
month: null,
|
18
18
|
day: null,
|
@@ -24,7 +24,7 @@ export const MOCK_DATA = [
|
|
24
24
|
graduatedStudents: "36",
|
25
25
|
children: [
|
26
26
|
{
|
27
|
-
year: "
|
27
|
+
year: "2021",
|
28
28
|
quarter: "Q1",
|
29
29
|
month: "January",
|
30
30
|
day: null,
|
@@ -36,7 +36,7 @@ export const MOCK_DATA = [
|
|
36
36
|
graduatedStudents: "28",
|
37
37
|
children: [
|
38
38
|
{
|
39
|
-
year: "
|
39
|
+
year: "2021",
|
40
40
|
quarter: "Q1",
|
41
41
|
month: "January",
|
42
42
|
day: "10",
|
@@ -48,7 +48,7 @@ export const MOCK_DATA = [
|
|
48
48
|
graduatedStudents: "17",
|
49
49
|
},
|
50
50
|
{
|
51
|
-
year: "
|
51
|
+
year: "2021",
|
52
52
|
quarter: "Q1",
|
53
53
|
month: "January",
|
54
54
|
day: "20",
|
@@ -62,7 +62,7 @@ export const MOCK_DATA = [
|
|
62
62
|
],
|
63
63
|
},
|
64
64
|
{
|
65
|
-
year: "
|
65
|
+
year: "2021",
|
66
66
|
quarter: "Q1",
|
67
67
|
month: "February",
|
68
68
|
day: null,
|
@@ -96,15 +96,15 @@ export const MOCK_DATA = [
|
|
96
96
|
quarter: null,
|
97
97
|
month: null,
|
98
98
|
day: null,
|
99
|
-
newEnrollments: "
|
100
|
-
scheduledMeetings: "
|
101
|
-
attendanceRate: "
|
102
|
-
completedClasses: "
|
103
|
-
classCompletionRate: "
|
104
|
-
graduatedStudents: "
|
99
|
+
newEnrollments: "25",
|
100
|
+
scheduledMeetings: "17",
|
101
|
+
attendanceRate: "75%",
|
102
|
+
completedClasses: "5",
|
103
|
+
classCompletionRate: "45%",
|
104
|
+
graduatedStudents: "32",
|
105
105
|
children: [
|
106
106
|
{
|
107
|
-
year: "
|
107
|
+
year: "2022",
|
108
108
|
quarter: "Q1",
|
109
109
|
month: null,
|
110
110
|
day: null,
|
@@ -116,7 +116,7 @@ export const MOCK_DATA = [
|
|
116
116
|
graduatedStudents: "36",
|
117
117
|
children: [
|
118
118
|
{
|
119
|
-
year: "
|
119
|
+
year: "2022",
|
120
120
|
quarter: "Q1",
|
121
121
|
month: "January",
|
122
122
|
day: null,
|
@@ -128,10 +128,10 @@ export const MOCK_DATA = [
|
|
128
128
|
graduatedStudents: "28",
|
129
129
|
children: [
|
130
130
|
{
|
131
|
-
year: "
|
131
|
+
year: "2022",
|
132
132
|
quarter: "Q1",
|
133
133
|
month: "January",
|
134
|
-
day: "
|
134
|
+
day: "15",
|
135
135
|
newEnrollments: "34",
|
136
136
|
scheduledMeetings: "28",
|
137
137
|
attendanceRate: "97%",
|
@@ -140,10 +140,10 @@ export const MOCK_DATA = [
|
|
140
140
|
graduatedStudents: "17",
|
141
141
|
},
|
142
142
|
{
|
143
|
-
year: "
|
143
|
+
year: "2022",
|
144
144
|
quarter: "Q1",
|
145
145
|
month: "January",
|
146
|
-
day: "
|
146
|
+
day: "25",
|
147
147
|
newEnrollments: "43",
|
148
148
|
scheduledMeetings: "23",
|
149
149
|
attendanceRate: "66%",
|
@@ -154,9 +154,9 @@ export const MOCK_DATA = [
|
|
154
154
|
],
|
155
155
|
},
|
156
156
|
{
|
157
|
-
year: "
|
157
|
+
year: "2022",
|
158
158
|
quarter: "Q1",
|
159
|
-
month: "
|
159
|
+
month: "May",
|
160
160
|
day: null,
|
161
161
|
newEnrollments: "20",
|
162
162
|
scheduledMeetings: "41",
|
@@ -168,8 +168,8 @@ export const MOCK_DATA = [
|
|
168
168
|
{
|
169
169
|
year: "2011",
|
170
170
|
quarter: "Q1",
|
171
|
-
month: "
|
172
|
-
day: "
|
171
|
+
month: "May",
|
172
|
+
day: "2",
|
173
173
|
newEnrollments: "19",
|
174
174
|
scheduledMeetings: "35",
|
175
175
|
attendanceRate: "69%",
|
@@ -188,15 +188,15 @@ export const MOCK_DATA = [
|
|
188
188
|
quarter: null,
|
189
189
|
month: null,
|
190
190
|
day: null,
|
191
|
-
newEnrollments: "
|
192
|
-
scheduledMeetings: "
|
193
|
-
attendanceRate: "
|
194
|
-
completedClasses: "
|
195
|
-
classCompletionRate: "
|
196
|
-
graduatedStudents: "
|
191
|
+
newEnrollments: "10",
|
192
|
+
scheduledMeetings: "15",
|
193
|
+
attendanceRate: "65%",
|
194
|
+
completedClasses: "4",
|
195
|
+
classCompletionRate: "49%",
|
196
|
+
graduatedStudents: "29",
|
197
197
|
children: [
|
198
198
|
{
|
199
|
-
year: "
|
199
|
+
year: "2023",
|
200
200
|
quarter: "Q1",
|
201
201
|
month: null,
|
202
202
|
day: null,
|
@@ -208,9 +208,9 @@ export const MOCK_DATA = [
|
|
208
208
|
graduatedStudents: "36",
|
209
209
|
children: [
|
210
210
|
{
|
211
|
-
year: "
|
211
|
+
year: "2023",
|
212
212
|
quarter: "Q1",
|
213
|
-
month: "
|
213
|
+
month: "March",
|
214
214
|
day: null,
|
215
215
|
newEnrollments: "16",
|
216
216
|
scheduledMeetings: "20",
|
@@ -220,9 +220,9 @@ export const MOCK_DATA = [
|
|
220
220
|
graduatedStudents: "28",
|
221
221
|
children: [
|
222
222
|
{
|
223
|
-
year: "
|
223
|
+
year: "2023",
|
224
224
|
quarter: "Q1",
|
225
|
-
month: "
|
225
|
+
month: "March",
|
226
226
|
day: "10",
|
227
227
|
newEnrollments: "34",
|
228
228
|
scheduledMeetings: "28",
|
@@ -232,10 +232,10 @@ export const MOCK_DATA = [
|
|
232
232
|
graduatedStudents: "17",
|
233
233
|
},
|
234
234
|
{
|
235
|
-
year: "
|
235
|
+
year: "2023",
|
236
236
|
quarter: "Q1",
|
237
|
-
month: "
|
238
|
-
day: "
|
237
|
+
month: "March",
|
238
|
+
day: "11",
|
239
239
|
newEnrollments: "43",
|
240
240
|
scheduledMeetings: "23",
|
241
241
|
attendanceRate: "66%",
|
@@ -246,9 +246,9 @@ export const MOCK_DATA = [
|
|
246
246
|
],
|
247
247
|
},
|
248
248
|
{
|
249
|
-
year: "
|
249
|
+
year: "2023",
|
250
250
|
quarter: "Q1",
|
251
|
-
month: "
|
251
|
+
month: "April",
|
252
252
|
day: null,
|
253
253
|
newEnrollments: "20",
|
254
254
|
scheduledMeetings: "41",
|
@@ -258,9 +258,9 @@ export const MOCK_DATA = [
|
|
258
258
|
graduatedStudents: "43",
|
259
259
|
children: [
|
260
260
|
{
|
261
|
-
year: "
|
261
|
+
year: "2023",
|
262
262
|
quarter: "Q1",
|
263
|
-
month: "
|
263
|
+
month: "April",
|
264
264
|
day: "15",
|
265
265
|
newEnrollments: "19",
|
266
266
|
scheduledMeetings: "35",
|
data/dist/menu.yml
CHANGED
@@ -45,7 +45,7 @@ kits:
|
|
45
45
|
description: Tables display a collection of structured data and typically have the ability to sort, filter, and paginate data.
|
46
46
|
- name: "advanced_table"
|
47
47
|
platforms: *react_only
|
48
|
-
description:
|
48
|
+
description: The Advanced Table can be used to display complex, nested data in a way that allows for expansion and/or sorting.
|
49
49
|
- name: "list"
|
50
50
|
platforms: *web
|
51
51
|
description: Lists display a vertical set of related content.
|