playbook_ui_docs 14.24.0.pre.rc.5 → 14.24.0.pre.rc.6
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/docs/_advanced_table_selectable_rows_header_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +80 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.html.erb +75 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx +94 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -1
- data/dist/playbook-doc.js +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd832d17e4242874ee18b73cb11bbe573054e8ebaace3cad31904ce48cbc05a4
|
4
|
+
data.tar.gz: 2c18cdd478d7c09d38076223c94365d5a9e1e9e01c029f1dc06966818afbebeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02799b0d6650e5d6a913ca2038ab31ef1519e4f69b9286757bf3c5dd8ea3fb1033bdbc67e4c0562ac7723aa882b986c069accdeab2c0eb63f87c4e5ec63e8484'
|
7
|
+
data.tar.gz: 11246123eb948827f45d76b69b1d091a3ea1e2642635af178baced14d7a32d4befa437d2ebff7c78f69b894c5d34c43b6b88e8d74770a19d1546361863c7882f
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
CHANGED
@@ -34,6 +34,6 @@
|
|
34
34
|
%>
|
35
35
|
|
36
36
|
<%= pb_rails("advanced_table", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, selectable_rows: true }) do %>
|
37
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions, selectable_rows: true }) %>
|
37
|
+
<%= pb_rails("advanced_table/table_header", props: { id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
|
38
38
|
<%= pb_rails("advanced_table/table_body", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
|
39
39
|
<% end %>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableSortPerColumn = (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
|
+
enableSort: true,
|
16
|
+
},
|
17
|
+
{
|
18
|
+
accessor: "scheduledMeetings",
|
19
|
+
label: "Scheduled Meetings",
|
20
|
+
},
|
21
|
+
{
|
22
|
+
accessor: "attendanceRate",
|
23
|
+
label: "Attendance Rate",
|
24
|
+
enableSort: true,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
accessor: "completedClasses",
|
28
|
+
label: "Completed Classes",
|
29
|
+
},
|
30
|
+
{
|
31
|
+
accessor: "classCompletionRate",
|
32
|
+
label: "Class Completion Rate",
|
33
|
+
},
|
34
|
+
{
|
35
|
+
accessor: "graduatedStudents",
|
36
|
+
label: "Graduated Students",
|
37
|
+
},
|
38
|
+
]
|
39
|
+
|
40
|
+
return (
|
41
|
+
<div>
|
42
|
+
<AdvancedTable
|
43
|
+
columnDefinitions={columnDefinitions}
|
44
|
+
enableSortingRemoval
|
45
|
+
tableData={MOCK_DATA}
|
46
|
+
{...props}
|
47
|
+
>
|
48
|
+
<AdvancedTable.Header />
|
49
|
+
<AdvancedTable.Body />
|
50
|
+
</AdvancedTable>
|
51
|
+
</div>
|
52
|
+
)
|
53
|
+
}
|
54
|
+
|
55
|
+
export default AdvancedTableSortPerColumn;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Sorting can now be enabled on any of the columns. To do this, add `enableSort:true` to the columnDefinition of the column you want sorting enabled on. Once enabled, clicking on the header will toggle sort between ascending and descending.
|
2
|
+
|
3
|
+
The optional `enableSortingRemoval` prop can also be used in conjunction with sorting functionality. This prop is set to 'false' by default but if set to 'true' sorting order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ...
|
4
|
+
It is recommended that `enableSortingRemoval` be set to 'true' when sort is enabled on mutiple columns so that sorting direction is always clear via the sort icon.
|
5
|
+
|
6
|
+
__NOTE:__ For sort on the first column, continue to use the separate `enableSorting` prop on AdvancedTable.Header as [shown here](https://playbook.powerapp.cloud/kits/advanced_table/sorting/react#enable-sorting).
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableSortPerColumnForMultiColumn = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
label: "Enrollment Data",
|
14
|
+
columns: [
|
15
|
+
{
|
16
|
+
label: "Enrollment Stats",
|
17
|
+
columns: [
|
18
|
+
{
|
19
|
+
accessor: "newEnrollments",
|
20
|
+
label: "New Enrollments",
|
21
|
+
enableSort: true,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "scheduledMeetings",
|
25
|
+
label: "Scheduled Meetings",
|
26
|
+
},
|
27
|
+
],
|
28
|
+
},
|
29
|
+
],
|
30
|
+
},
|
31
|
+
{
|
32
|
+
label: "Performance Data",
|
33
|
+
columns: [
|
34
|
+
{
|
35
|
+
label: "Completion Metrics",
|
36
|
+
columns: [
|
37
|
+
{
|
38
|
+
accessor: "completedClasses",
|
39
|
+
label: "Completed Classes",
|
40
|
+
enableSort: true,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
accessor: "classCompletionRate",
|
44
|
+
label: "Class Completion Rate",
|
45
|
+
},
|
46
|
+
],
|
47
|
+
},
|
48
|
+
{
|
49
|
+
label: "Attendance",
|
50
|
+
columns: [
|
51
|
+
{
|
52
|
+
accessor: "attendanceRate",
|
53
|
+
label: "Attendance Rate",
|
54
|
+
},
|
55
|
+
{
|
56
|
+
accessor: "scheduledMeetings",
|
57
|
+
label: "Scheduled Meetings",
|
58
|
+
},
|
59
|
+
],
|
60
|
+
},
|
61
|
+
],
|
62
|
+
},
|
63
|
+
];
|
64
|
+
|
65
|
+
return (
|
66
|
+
<div>
|
67
|
+
<AdvancedTable
|
68
|
+
columnDefinitions={columnDefinitions}
|
69
|
+
enableSortingRemoval
|
70
|
+
tableData={MOCK_DATA}
|
71
|
+
{...props}
|
72
|
+
>
|
73
|
+
<AdvancedTable.Header enableSorting />
|
74
|
+
<AdvancedTable.Body />
|
75
|
+
</AdvancedTable>
|
76
|
+
</div>
|
77
|
+
)
|
78
|
+
}
|
79
|
+
|
80
|
+
export default AdvancedTableSortPerColumnForMultiColumn;
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Sorting on columns can also be applied to columns when using the multi-header variant, however in this case sorting can only be set on leaf columns NOT on parent columns.
|
@@ -29,6 +29,8 @@ examples:
|
|
29
29
|
- advanced_table_default: Default (Required Props)
|
30
30
|
- advanced_table_sort: Enable Sorting
|
31
31
|
- advanced_table_sort_control: Sort Control
|
32
|
+
- advanced_table_sort_per_column: Enable Sort By Column
|
33
|
+
- advanced_table_sort_per_column_for_multi_column: Enable Sort By Column (Multi-Column)
|
32
34
|
- advanced_table_custom_sort: Custom Sort
|
33
35
|
- advanced_table_expanded_control: Expanded Control
|
34
36
|
- advanced_table_expand_by_depth: Expand by Depth
|
@@ -40,4 +40,6 @@ export { default as AdvancedTableColumnStylingColumnHeaders } from './_advanced_
|
|
40
40
|
export { default as AdvancedTableInfiniteScroll} from './_advanced_table_infinite_scroll.jsx'
|
41
41
|
export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_custom_header.jsx'
|
42
42
|
export { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
|
43
|
-
export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced_table_with_custom_header_multi_header.jsx'
|
43
|
+
export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced_table_with_custom_header_multi_header.jsx'
|
44
|
+
export { default as AdvancedTableSortPerColumn } from './_advanced_table_sort_per_column.jsx'
|
45
|
+
export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<% treeData = [{
|
2
|
+
label: "Power Home Remodeling",
|
3
|
+
value: "powerHomeRemodeling",
|
4
|
+
id: "100",
|
5
|
+
expanded: true,
|
6
|
+
children: [
|
7
|
+
{
|
8
|
+
label: "People",
|
9
|
+
value: "people",
|
10
|
+
id: "101",
|
11
|
+
children: [
|
12
|
+
{
|
13
|
+
label: "Talent Acquisition",
|
14
|
+
value: "talentAcquisition",
|
15
|
+
id: "102",
|
16
|
+
},
|
17
|
+
{
|
18
|
+
label: "Business Affairs",
|
19
|
+
value: "businessAffairs",
|
20
|
+
id: "103",
|
21
|
+
children: [
|
22
|
+
{
|
23
|
+
label: "Initiatives",
|
24
|
+
value: "initiatives",
|
25
|
+
id: "104",
|
26
|
+
},
|
27
|
+
{
|
28
|
+
label: "Learning & Development",
|
29
|
+
value: "learningAndDevelopment",
|
30
|
+
id: "105",
|
31
|
+
},
|
32
|
+
],
|
33
|
+
},
|
34
|
+
{
|
35
|
+
label: "People Experience",
|
36
|
+
value: "peopleExperience",
|
37
|
+
id: "106",
|
38
|
+
},
|
39
|
+
],
|
40
|
+
},
|
41
|
+
{
|
42
|
+
label: "Contact Center",
|
43
|
+
value: "contactCenter",
|
44
|
+
id: "107",
|
45
|
+
children: [
|
46
|
+
{
|
47
|
+
label: "Appointment Management",
|
48
|
+
value: "appointmentManagement",
|
49
|
+
id: "108",
|
50
|
+
},
|
51
|
+
{
|
52
|
+
label: "Customer Service",
|
53
|
+
value: "customerService",
|
54
|
+
id: "109",
|
55
|
+
},
|
56
|
+
{
|
57
|
+
label: "Energy",
|
58
|
+
value: "energy",
|
59
|
+
id: "110",
|
60
|
+
},
|
61
|
+
],
|
62
|
+
},
|
63
|
+
],
|
64
|
+
}] %>
|
65
|
+
|
66
|
+
<% # Pre-selected node IDs to demonstrate the functionality %>
|
67
|
+
<% preSelectedIds = ["102", "104", "109"] %>
|
68
|
+
|
69
|
+
<%= pb_rails("multi_level_select", props: {
|
70
|
+
id: "multi-level-select-show-checked-children-rails",
|
71
|
+
name: "my_array",
|
72
|
+
tree_data: treeData,
|
73
|
+
selected_ids: preSelectedIds,
|
74
|
+
show_checked_children: false
|
75
|
+
}) %>
|
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import MultiLevelSelect from "../_multi_level_select";
|
3
|
+
|
4
|
+
const treeData = [
|
5
|
+
{
|
6
|
+
label: "Power Home Remodeling",
|
7
|
+
value: "powerHomeRemodeling",
|
8
|
+
id: "powerhome1",
|
9
|
+
expanded: true,
|
10
|
+
children: [
|
11
|
+
{
|
12
|
+
label: "People",
|
13
|
+
value: "people",
|
14
|
+
id: "people1",
|
15
|
+
children: [
|
16
|
+
{
|
17
|
+
label: "Talent Acquisition",
|
18
|
+
value: "talentAcquisition",
|
19
|
+
id: "talent1",
|
20
|
+
},
|
21
|
+
{
|
22
|
+
label: "Business Affairs",
|
23
|
+
value: "businessAffairs",
|
24
|
+
id: "business1",
|
25
|
+
children: [
|
26
|
+
{
|
27
|
+
label: "Initiatives",
|
28
|
+
value: "initiatives",
|
29
|
+
id: "initiative1",
|
30
|
+
},
|
31
|
+
{
|
32
|
+
label: "Learning & Development",
|
33
|
+
value: "learningAndDevelopment",
|
34
|
+
id: "development1",
|
35
|
+
},
|
36
|
+
],
|
37
|
+
},
|
38
|
+
{
|
39
|
+
label: "People Experience",
|
40
|
+
value: "peopleExperience",
|
41
|
+
id: "experience1",
|
42
|
+
},
|
43
|
+
],
|
44
|
+
},
|
45
|
+
{
|
46
|
+
label: "Contact Center",
|
47
|
+
value: "contactCenter",
|
48
|
+
id: "contact1",
|
49
|
+
children: [
|
50
|
+
{
|
51
|
+
label: "Appointment Management",
|
52
|
+
value: "appointmentManagement",
|
53
|
+
id: "appointment1",
|
54
|
+
},
|
55
|
+
{
|
56
|
+
label: "Customer Service",
|
57
|
+
value: "customerService",
|
58
|
+
id: "customer1",
|
59
|
+
},
|
60
|
+
{
|
61
|
+
label: "Energy",
|
62
|
+
value: "energy",
|
63
|
+
id: "energy1",
|
64
|
+
},
|
65
|
+
],
|
66
|
+
},
|
67
|
+
],
|
68
|
+
},
|
69
|
+
];
|
70
|
+
|
71
|
+
// Pre-selected node IDs to demonstrate the functionality
|
72
|
+
const preSelectedIds = ["talent1", "initiative1", "customer1"];
|
73
|
+
|
74
|
+
const MultiLevelSelectShowCheckedChildren = (props) => {
|
75
|
+
return (
|
76
|
+
<div>
|
77
|
+
<MultiLevelSelect
|
78
|
+
id='multiselect-checked-children'
|
79
|
+
onSelect={(selectedNodes) =>
|
80
|
+
console.log(
|
81
|
+
"Selected Items",
|
82
|
+
selectedNodes
|
83
|
+
)
|
84
|
+
}
|
85
|
+
selectedIds={preSelectedIds}
|
86
|
+
showCheckedChildren={false}
|
87
|
+
treeData={treeData}
|
88
|
+
{...props}
|
89
|
+
/>
|
90
|
+
</div>
|
91
|
+
)
|
92
|
+
};
|
93
|
+
|
94
|
+
export default MultiLevelSelectShowCheckedChildren;
|
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
If you wish to control the auto-expansion of nodes with selected descendants in your multi-level select, you can utilize `showCheckedChildren/show_checked_children`. This prop (set to 'true' by default) controls whether items will be expanded on first render. When set to true, a node with selected descendants will automatically render as expanded so the selected nodes are visible. If you do NOT wish for this to be the case, you can set this prop to false.
|
2
|
+
|
3
|
+
The prop will still honor any `expanded` attribute set up within your tree data.
|
@@ -13,4 +13,4 @@ export { default as MultiLevelSelectDisabledOptions } from './_multi_level_selec
|
|
13
13
|
export { default as MultiLevelSelectDisabledOptionsParent } from './_multi_level_select_disabled_options_parent.jsx'
|
14
14
|
export { default as MultiLevelSelectDisabledOptionsParentDefault } from './_multi_level_select_disabled_options_parent_default.jsx'
|
15
15
|
export { default as MultiLevelSelectDisabledOptionsDefault } from './_multi_level_select_disabled_options_default.jsx'
|
16
|
-
export { default as MultiLevelSelectLabel } from './_multi_level_select_label.jsx'
|
16
|
+
export { default as MultiLevelSelectLabel } from './_multi_level_select_label.jsx'
|