playbook_ui_docs 14.13.0.pre.rc.10 → 14.14.0.pre.rc.0
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_table_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -5
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +1 -1
- data/dist/playbook-doc.js +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0d81a53450650425fbc7bc79460a97352dbfd3f40e4844ff2324b41645ed630
|
4
|
+
data.tar.gz: 0210bb89e993d788b9af2e34c42f5584a923bee5f7f3e54bc406245e2a7aa47e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68c8452f17464c13f872508f5de13e2b483b84c8a07c449f04fb02c17d5e175afa35c9541f39cc69a12c2ab84392725306d82655e167ce2b691ec93029270493
|
7
|
+
data.tar.gz: caa577b1005502508916355eee08dba13c7172a6476e233a4d51d9e345ea3917d825334996daa2603d5784102f44e16e5ee4ae69258dcaea00099c709bd1e410
|
@@ -1 +1,3 @@
|
|
1
|
-
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
|
1
|
+
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
|
2
|
+
|
3
|
+
This doc example showcases how to set a sticky header for a nonresponsive table. To achieve sticky header AND responsive functionality, see the ["Table Props Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props-sticky-header) doc example below.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableTablePropsStickyHeader = (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
|
+
const tableProps = {
|
39
|
+
sticky: true
|
40
|
+
}
|
41
|
+
|
42
|
+
return (
|
43
|
+
<div>
|
44
|
+
<AdvancedTable
|
45
|
+
columnDefinitions={columnDefinitions}
|
46
|
+
maxHeight="xs"
|
47
|
+
tableData={MOCK_DATA}
|
48
|
+
tableProps={tableProps}
|
49
|
+
{...props}
|
50
|
+
/>
|
51
|
+
</div>
|
52
|
+
)
|
53
|
+
}
|
54
|
+
|
55
|
+
export default AdvancedTableTablePropsStickyHeader
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
|
2
|
+
|
3
|
+
A sticky header on a nonresponsive table is demonstrated in the ["Table Props"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props) doc example above.
|
@@ -22,6 +22,7 @@ examples:
|
|
22
22
|
- advanced_table_collapsible_trail: Collapsible Trail
|
23
23
|
- advanced_table_table_options: Table Options
|
24
24
|
- advanced_table_table_props: Table Props
|
25
|
+
- advanced_table_table_props_sticky_header: Table Props Sticky Header
|
25
26
|
- advanced_table_inline_row_loading: Inline Row Loading
|
26
27
|
- advanced_table_responsive: Responsive Tables
|
27
28
|
- advanced_table_custom_cell: Custom Components for Cells
|
@@ -18,4 +18,5 @@ export { default as AdvancedTableSelectableRows } from './_advanced_table_select
|
|
18
18
|
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
19
|
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
20
|
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
|
-
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
21
|
+
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
22
|
+
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<% containers = [
|
2
|
+
"To Do",
|
3
|
+
"In Progress",
|
4
|
+
"Done"
|
5
|
+
] %>
|
6
|
+
|
7
|
+
<% items_data = [
|
8
|
+
{
|
9
|
+
id: "11",
|
10
|
+
container: "To Do",
|
11
|
+
title: "Task 1",
|
12
|
+
description: "Bug fixes",
|
13
|
+
assignee_name: "Terry Miles",
|
14
|
+
assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
id: "12",
|
18
|
+
container: "To Do",
|
19
|
+
title: "Task 2",
|
20
|
+
description: "Documentation",
|
21
|
+
assignee_name: "Sophia Miles",
|
22
|
+
assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
id: "13",
|
26
|
+
container: "In Progress",
|
27
|
+
title: "Task 3",
|
28
|
+
description: "Add a variant",
|
29
|
+
assignee_name: "Alice Jones",
|
30
|
+
assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
id: "14",
|
34
|
+
container: "To Do",
|
35
|
+
title: "Task 4",
|
36
|
+
description: "Add jest tests",
|
37
|
+
assignee_name: "Mike James",
|
38
|
+
assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
|
39
|
+
},
|
40
|
+
{
|
41
|
+
id: "15",
|
42
|
+
container: "Done",
|
43
|
+
title: "Task 5",
|
44
|
+
description: "Alpha testing",
|
45
|
+
assignee_name: "James Guy",
|
46
|
+
assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
|
47
|
+
},
|
48
|
+
{
|
49
|
+
id: "16",
|
50
|
+
container: "In Progress",
|
51
|
+
title: "Task 6",
|
52
|
+
description: "Release",
|
53
|
+
assignee_name: "Sally Jones",
|
54
|
+
assignee_img: "https://randomuser.me/api/portraits/women/28.jpg",
|
55
|
+
},
|
56
|
+
] %>
|
57
|
+
|
58
|
+
<%= pb_rails("draggable", props: { initial_items: items_data }) do %>
|
59
|
+
<%= pb_rails("flex", props: { justify_content: "center" }) do %>
|
60
|
+
<% containers.each do |container| %>
|
61
|
+
<%= pb_rails("draggable/draggable_container", props: {
|
62
|
+
container: container,
|
63
|
+
width: "xs",
|
64
|
+
padding: "sm",
|
65
|
+
data: { container: container }
|
66
|
+
}) do %>
|
67
|
+
<%= pb_rails("caption", props: { text_align: "center" }) do %><%= container %><% end %>
|
68
|
+
<%= pb_rails("flex", props: {align_items: "stretch", orientation: "column"}) do %>
|
69
|
+
<% items_data.select { |item| item[:container] == container }.each do |item| %>
|
70
|
+
<%= pb_rails("draggable/draggable_item", props: {
|
71
|
+
container: container,
|
72
|
+
drag_id: item[:id]
|
73
|
+
}) do %>
|
74
|
+
<%= pb_rails("card", props: { margin_bottom: "sm", padding: "sm"}) do %>
|
75
|
+
<%= pb_rails("flex", props: { justify: "between" }) do %>
|
76
|
+
<%= pb_rails("flex/flex_item") do %>
|
77
|
+
<%= pb_rails("flex") do %>
|
78
|
+
<%= pb_rails("avatar", props: {
|
79
|
+
image_url: item[:assignee_img],
|
80
|
+
name: item[:assignee_name],
|
81
|
+
size: "xxs"
|
82
|
+
}) %>
|
83
|
+
<%= pb_rails("title", props: {
|
84
|
+
padding_left: "xs",
|
85
|
+
size: 4,
|
86
|
+
text: item[:title]
|
87
|
+
}) %>
|
88
|
+
<% end %>
|
89
|
+
<% end %>
|
90
|
+
<% end %>
|
91
|
+
<%= pb_rails("body", props: { padding_top: "xs", text: item[:description] }) %>
|
92
|
+
<% end %>
|
93
|
+
<% end %>
|
94
|
+
<% end %>
|
95
|
+
<% end %>
|
96
|
+
<% end %>
|
97
|
+
<% end %>
|
98
|
+
<% end %>
|
99
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<% initial_items = [
|
2
|
+
{
|
3
|
+
id: "1",
|
4
|
+
title: "Task 1",
|
5
|
+
assignee_name: "Terry Miles",
|
6
|
+
assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
|
7
|
+
},
|
8
|
+
{
|
9
|
+
id: "2",
|
10
|
+
title: "Task 2",
|
11
|
+
assignee_name: "Sophia Miles",
|
12
|
+
assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
|
13
|
+
},
|
14
|
+
{
|
15
|
+
id: "3",
|
16
|
+
title: "Task 3",
|
17
|
+
assignee_name: "Alice Jones",
|
18
|
+
assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
id: "4",
|
22
|
+
title: "Task 4",
|
23
|
+
assignee_name: "Mike James",
|
24
|
+
assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
|
25
|
+
},
|
26
|
+
{
|
27
|
+
id: "5",
|
28
|
+
title: "Task 5",
|
29
|
+
assignee_name: "James Guy",
|
30
|
+
assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
|
31
|
+
}
|
32
|
+
] %>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
<%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
|
37
|
+
<%= pb_rails("table", props: { size: "sm", responsive:"none" }) do %>
|
38
|
+
<%= pb_rails("table/table_head") do %>
|
39
|
+
<%= pb_rails("table/table_row") do %>
|
40
|
+
<%= pb_rails("table/table_header", props: { text: "id"}) %>
|
41
|
+
<%= pb_rails("table/table_header", props: { text: "name"}) %>
|
42
|
+
<%= pb_rails("table/table_header", props: { text: "task number"}) %>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<%= pb_rails("draggable/draggable_container", props: {tag:"tbody"}) do %>
|
47
|
+
<% initial_items.each do |item| %>
|
48
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], tag:"tr"}) do %>
|
49
|
+
<%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
|
50
|
+
<%= pb_rails("table/table_cell") do %>
|
51
|
+
<%= pb_rails("flex", props:{align:"center"}) do %>
|
52
|
+
<%= pb_rails("avatar", props: {size: "xs", image_url: item[:assignee_img]}) %>
|
53
|
+
<%= pb_rails("body", props: {text: item[:assignee_name], padding_left:"sm"}) %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
<%= pb_rails("table/table_cell", props: { text: item[:title]}) %>
|
57
|
+
<% end %>
|
58
|
+
<% end %>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
61
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this, make use of the `tag` prop on the draggable_container to set it to 'tbody' and the same prop on the draggable_item to set that to 'tr'. This will create the functionality seen here.
|
@@ -1,18 +1,15 @@
|
|
1
1
|
examples:
|
2
|
-
|
3
|
-
|
4
2
|
react:
|
5
3
|
- draggable_default: Default
|
6
4
|
- draggable_with_list: Draggable with List Kit
|
7
5
|
- draggable_with_selectable_list: Draggable with SelectableList Kit
|
8
6
|
- draggable_with_cards: Draggable with Cards
|
9
7
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
10
|
-
|
11
8
|
rails:
|
12
9
|
- draggable_default_rails: Default
|
13
10
|
- draggable_with_list_rails: Draggable with List Kit
|
14
11
|
- draggable_with_selectable_list_rails: Draggable with SelectableList Kit
|
15
12
|
- draggable_with_cards_rails: Draggable with Cards
|
13
|
+
- draggable_with_table: Draggable with Table
|
14
|
+
- draggable_multiple_containers_rails: Dragging Across Multiple Containers
|
16
15
|
|
17
|
-
|
18
|
-
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= pb_rails("home_address_street", props: {
|
2
|
+
address: "70 pRoSpEcT ave",
|
3
|
+
address_cont: "Apt M18",
|
4
|
+
city: "West Chester",
|
5
|
+
home_id: 8250263,
|
6
|
+
home_url: "https://powerhrg.com/",
|
7
|
+
preserve_case: true,
|
8
|
+
state: "pa",
|
9
|
+
zipcode: "19382",
|
10
|
+
territory: "PHL",
|
11
|
+
}) %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import HomeAddressStreet from '../_home_address_street'
|
4
|
+
|
5
|
+
const HomeAddressStreetFormatting = (props) => {
|
6
|
+
return (
|
7
|
+
<HomeAddressStreet
|
8
|
+
address="70 pRoSpEcT ave"
|
9
|
+
addressCont="Apt M18"
|
10
|
+
city="West Chester"
|
11
|
+
homeId="8250263"
|
12
|
+
homeUrl="https://powerhrg.com/"
|
13
|
+
preserveCase
|
14
|
+
state="pa"
|
15
|
+
territory="PHL"
|
16
|
+
zipcode="19382"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
)
|
20
|
+
}
|
21
|
+
|
22
|
+
export default HomeAddressStreetFormatting
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserve_case: true`, the street address will be rendered exactly as entered, without automatic title capitalization.
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserveCase`, the street address will be rendered exactly as entered, without automatic title capitalization.
|
@@ -5,12 +5,14 @@ examples:
|
|
5
5
|
- home_address_street_emphasis: Emphasis
|
6
6
|
- home_address_street_modified: Modified
|
7
7
|
- home_address_street_link: Link
|
8
|
+
- home_address_street_formatting: Formatting
|
8
9
|
|
9
10
|
react:
|
10
11
|
- home_address_street_default: Default
|
11
12
|
- home_address_street_emphasis: Emphasis
|
12
13
|
- home_address_street_modified: Modified
|
13
14
|
- home_address_street_link: Link
|
15
|
+
- home_address_street_formatting: Formatting
|
14
16
|
|
15
17
|
swift:
|
16
18
|
- home_address_street_default_swift: Default
|
@@ -2,3 +2,4 @@ export { default as HomeAddressStreetDefault } from './_home_address_street_defa
|
|
2
2
|
export { default as HomeAddressStreetEmphasis } from './_home_address_street_emphasis.jsx'
|
3
3
|
export { default as HomeAddressStreetModified } from './_home_address_street_modified.jsx'
|
4
4
|
export { default as HomeAddressStreetLink } from './_home_address_street_link.jsx'
|
5
|
+
export { default as HomeAddressStreetFormatting } from './_home_address_street_formatting.jsx'
|