playbook_ui_docs 16.3.0 → 16.4.0.pre.alpha.PLAY2718containerfalseborderradiusresponsiveonly15164
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_cascade_collapse.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.jsx +175 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +31 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +93 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +6 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +6 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.html.erb +16 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.html.erb +224 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.md +7 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.html.erb +46 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.jsx +42 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_rails.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_react.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_placement.jsx +81 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_placement_react.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_position.html.erb +128 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_position_rails.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_popover/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +56 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +13 -21
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -10
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.jsx +152 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.html.erb +121 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- metadata +25 -24
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +0 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +0 -15
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +0 -17
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +0 -6
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +0 -16
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +0 -28
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +0 -35
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +0 -45
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +0 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -22
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +0 -13
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +0 -15
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +0 -115
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +0 -42
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +0 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 955221598614b89a5ea56915a4147b016ee929378a372502fb05ba1f677dbd45
|
|
4
|
+
data.tar.gz: 5f0ecab16e7a07dfb66e3ec91397e33c0348123911a658506c8b318e2d0579fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 864cb97ebc2cb3ca94fd2460eb755f929993e773e7867d7a7a78e8d943ba2798c80a0d3ba933583fde99c705d6bc467fcc7872774bbda20aa32a9c5b52928b70
|
|
7
|
+
data.tar.gz: 99782531502ddde43861858ece6e9a911936d4554b6e40aae0357fe502ff900ec8de962e03c7a35a722dec5ababec18de3e6b6183a81a6d82b0ffefc489785b2
|
|
@@ -0,0 +1,50 @@
|
|
|
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 AdvancedTableCascadeCollapse = (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
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
<AdvancedTable
|
|
41
|
+
cascadeCollapse
|
|
42
|
+
columnDefinitions={columnDefinitions}
|
|
43
|
+
tableData={MOCK_DATA}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default AdvancedTableCascadeCollapse
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`cascadeCollapse` is an optional prop that is set to 'false' by default. If set to 'true', collapsing any parent row itself or by using the toggle exapansion buttons in any header or subheader row also collapses all descendants and clears their expansion state. Re-expanding then shows only direct children until the user expands deeper levels again.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<%# Example sort method for demonstration purposes %>
|
|
2
|
+
<% if params["sort"] %>
|
|
3
|
+
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
|
4
|
+
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
|
5
|
+
<% @table_data_with_id.sort! do |a, b|
|
|
6
|
+
value_a = a[sort_param] || a[sort_param.to_sym]
|
|
7
|
+
value_b = b[sort_param] || b[sort_param.to_sym]
|
|
8
|
+
|
|
9
|
+
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
|
10
|
+
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
|
11
|
+
|
|
12
|
+
sort_direction * (value_a <=> value_b)
|
|
13
|
+
end %>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<% column_definitions = [
|
|
17
|
+
{
|
|
18
|
+
accessor: "year",
|
|
19
|
+
label: "Year",
|
|
20
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
21
|
+
sort_menu: [
|
|
22
|
+
{ item: "Year", link: "?sort=year_asc#pinned_rows_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
+
{ item: "Year", link: "?sort=year_desc#pinned_rows_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
accessor: "newEnrollments",
|
|
28
|
+
label: "New Enrollments",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
accessor: "scheduledMeetings",
|
|
32
|
+
label: "Scheduled Meetings",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
accessor: "attendanceRate",
|
|
36
|
+
label: "Attendance Rate",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
accessor: "completedClasses",
|
|
40
|
+
label: "Completed Classes",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
accessor: "classCompletionRate",
|
|
44
|
+
label: "Class Completion Rate",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
accessor: "graduatedStudents",
|
|
48
|
+
label: "Graduated Students",
|
|
49
|
+
}
|
|
50
|
+
] %>
|
|
51
|
+
|
|
52
|
+
<% pinned_rows = { top: ["8"] } %>
|
|
53
|
+
|
|
54
|
+
<%= pb_rails("advanced_table", props: { id: "pinned_rows_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_table", column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
|
+
<% end %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Use the `pinned_rows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and will not change position if sorting is used.
|
|
2
|
+
|
|
3
|
+
**NOTE:**
|
|
4
|
+
- Sticky header required: Pinned rows must be used with `sticky: true` via `table_props` (works with both responsive and non-responsive tables)
|
|
5
|
+
- Row ids required: Each object within the `table_data` array must contain a unique `id` in order to attach an id to all Rows for this to function.
|
|
6
|
+
- `pinned_rows` takes a hash with a `top` key containing an array of row ids, as shown in the code snippet below.
|
|
7
|
+
- For expandable rows, use the parent id in `pinned_rows[:top]`; all its children will automatically be pinned with it. If a child id is passed without the parent being pinned, nothing will be pinned.
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
import Caption from "../../pb_caption/_caption"
|
|
6
|
+
|
|
7
|
+
const sharedColumnDefinitions = [
|
|
8
|
+
{
|
|
9
|
+
accessor: "year",
|
|
10
|
+
label: "Year",
|
|
11
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
accessor: "newEnrollments",
|
|
15
|
+
label: "New Enrollments",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
accessor: "scheduledMeetings",
|
|
19
|
+
label: "Scheduled Meetings",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
accessor: "attendanceRate",
|
|
23
|
+
label: "Attendance Rate",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
accessor: "completedClasses",
|
|
27
|
+
label: "Completed Classes",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
accessor: "classCompletionRate",
|
|
31
|
+
label: "Class Completion Rate",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
accessor: "graduatedStudents",
|
|
35
|
+
label: "Graduated Students",
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
const sortByColumnDefinitions = [
|
|
40
|
+
{
|
|
41
|
+
accessor: "year",
|
|
42
|
+
label: "Year",
|
|
43
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
accessor: "newEnrollments",
|
|
47
|
+
label: "New Enrollments",
|
|
48
|
+
enableSort: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
accessor: "scheduledMeetings",
|
|
52
|
+
label: "Scheduled Meetings",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
accessor: "attendanceRate",
|
|
56
|
+
label: "Attendance Rate",
|
|
57
|
+
enableSort: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
accessor: "completedClasses",
|
|
61
|
+
label: "Completed Classes",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
accessor: "classCompletionRate",
|
|
65
|
+
label: "Class Completion Rate",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
accessor: "graduatedStudents",
|
|
69
|
+
label: "Graduated Students",
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
const sortByColumnMultiDefinitions = [
|
|
74
|
+
{
|
|
75
|
+
accessor: "year",
|
|
76
|
+
label: "Year",
|
|
77
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: "Enrollment Data",
|
|
81
|
+
columns: [
|
|
82
|
+
{
|
|
83
|
+
label: "Enrollment Stats",
|
|
84
|
+
columns: [
|
|
85
|
+
{
|
|
86
|
+
accessor: "newEnrollments",
|
|
87
|
+
label: "New Enrollments",
|
|
88
|
+
enableSort: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
accessor: "scheduledMeetings",
|
|
92
|
+
label: "Scheduled Meetings",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: "Performance Data",
|
|
100
|
+
columns: [
|
|
101
|
+
{
|
|
102
|
+
label: "Completion Metrics",
|
|
103
|
+
columns: [
|
|
104
|
+
{
|
|
105
|
+
accessor: "completedClasses",
|
|
106
|
+
label: "Completed Classes",
|
|
107
|
+
enableSort: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
accessor: "classCompletionRate",
|
|
111
|
+
label: "Class Completion Rate",
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: "Attendance",
|
|
117
|
+
columns: [
|
|
118
|
+
{
|
|
119
|
+
accessor: "attendanceRate",
|
|
120
|
+
label: "Attendance Rate",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
accessor: "scheduledMeetings",
|
|
124
|
+
label: "Scheduled Meetings",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
const AdvancedTableSortParentOnly = (props) => {
|
|
133
|
+
return (
|
|
134
|
+
<div>
|
|
135
|
+
<Caption text="Enable Sorting (first column) + sortParentOnly" />
|
|
136
|
+
<AdvancedTable
|
|
137
|
+
columnDefinitions={sharedColumnDefinitions}
|
|
138
|
+
sortParentOnly
|
|
139
|
+
tableData={MOCK_DATA}
|
|
140
|
+
{...props}
|
|
141
|
+
>
|
|
142
|
+
<AdvancedTable.Header enableSorting />
|
|
143
|
+
<AdvancedTable.Body />
|
|
144
|
+
</AdvancedTable>
|
|
145
|
+
<Caption marginTop="md"
|
|
146
|
+
text="Sort by column + sortParentOnly"
|
|
147
|
+
/>
|
|
148
|
+
<AdvancedTable
|
|
149
|
+
columnDefinitions={sortByColumnDefinitions}
|
|
150
|
+
enableSortingRemoval
|
|
151
|
+
sortParentOnly
|
|
152
|
+
tableData={MOCK_DATA}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<AdvancedTable.Header />
|
|
156
|
+
<AdvancedTable.Body />
|
|
157
|
+
</AdvancedTable>
|
|
158
|
+
<Caption marginTop="md"
|
|
159
|
+
text="Sort by column (multi-column) + sortParentOnly"
|
|
160
|
+
/>
|
|
161
|
+
<AdvancedTable
|
|
162
|
+
columnDefinitions={sortByColumnMultiDefinitions}
|
|
163
|
+
enableSortingRemoval
|
|
164
|
+
sortParentOnly
|
|
165
|
+
tableData={MOCK_DATA}
|
|
166
|
+
{...props}
|
|
167
|
+
>
|
|
168
|
+
<AdvancedTable.Header enableSorting />
|
|
169
|
+
<AdvancedTable.Body />
|
|
170
|
+
</AdvancedTable>
|
|
171
|
+
</div>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export default AdvancedTableSortParentOnly
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
The `sortParentOnly` prop is a boolean set to `false` by default. When set to `true`, only parent (depth-0) rows are re-ordered when sorting; children and grandchildren stay grouped under their parent and keep their original order.
|
|
2
|
+
|
|
3
|
+
`sortParentOnly` works with every sorting mode: `enableSorting` on the header, per-column `enableSort: true`, and sortable leaf columns in the multi-header variant. Sort indicators behave as usual.
|
|
4
|
+
|
|
5
|
+
When omitted or `false`, sorting applies to all levels.
|
|
@@ -30,4 +30,34 @@
|
|
|
30
30
|
}
|
|
31
31
|
] %>
|
|
32
32
|
|
|
33
|
-
<%= pb_rails("
|
|
33
|
+
<%= pb_rails("caption", props: { text: "Default Advanced Table Table Props Doc Example" }) %>
|
|
34
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
|
|
35
|
+
|
|
36
|
+
<%= pb_rails("caption", props: { text: "Advanced Table with just container: false" }) %>
|
|
37
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table_2", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false }}) %>
|
|
38
|
+
|
|
39
|
+
<%= pb_rails("caption", props: { text: "Typical set up: Card and Flex around Filter, SectionSeparator, and AdvancedTable with container: false" }) %>
|
|
40
|
+
<%= pb_rails("card", props: { padding: "none", margin_bottom: "xl" }) do %>
|
|
41
|
+
<%= pb_rails("flex", props: { align: "stretch", orientation: "column", gap: "none" }) do %>
|
|
42
|
+
<%= pb_rails("filter", props: {
|
|
43
|
+
background: false,
|
|
44
|
+
max_height: (@table_data.to_a.size < 10) ? "50vh" : "none",
|
|
45
|
+
min_width: "xs",
|
|
46
|
+
popover_props: { width: "350px" },
|
|
47
|
+
id: "rails-table-props-filter-with-data",
|
|
48
|
+
template: "single",
|
|
49
|
+
results: @table_data.to_a.size,
|
|
50
|
+
}) do %>
|
|
51
|
+
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
|
52
|
+
<%= form.number_field :new_leads_eq, props: { label: "New Leads" } %>
|
|
53
|
+
<%= form.text_field :conversion_rate_eq, props: { label: "Conversion Rate" } %>
|
|
54
|
+
<%= form.actions do |action| %>
|
|
55
|
+
<%= action.submit props: { text: "Filter" } %>
|
|
56
|
+
<%= action.button props: { type: "reset", text: "Defaults", variant: "secondary" } %>
|
|
57
|
+
<% end %>
|
|
58
|
+
<% end %>
|
|
59
|
+
<% end %>
|
|
60
|
+
<%= pb_rails("section_separator") %>
|
|
61
|
+
<%= pb_rails("advanced_table", props: { id: "rails_template_advanced_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false } }) %>
|
|
62
|
+
<% end %>
|
|
63
|
+
<% end %>
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
3
|
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
4
|
+
import Button from "../../pb_button/_button"
|
|
5
|
+
import Caption from "../../pb_caption/_caption"
|
|
6
|
+
import Card from "../../pb_card/_card"
|
|
7
|
+
import Filter from "../../pb_filter/_filter"
|
|
8
|
+
import Flex from "../../pb_flex/_flex"
|
|
9
|
+
import SectionSeparator from "../../pb_section_separator/_section_separator"
|
|
10
|
+
import TextInput from "../../pb_text_input/_text_input"
|
|
4
11
|
|
|
5
12
|
const AdvancedTableTableProps = (props) => {
|
|
6
13
|
const columnDefinitions = [
|
|
@@ -40,14 +47,100 @@ const AdvancedTableTableProps = (props) => {
|
|
|
40
47
|
verticalBorder: true
|
|
41
48
|
}
|
|
42
49
|
|
|
50
|
+
const filterPopoverProps = { width: "350px" }
|
|
51
|
+
|
|
52
|
+
const filterForm = (closePopover) => (
|
|
53
|
+
<form>
|
|
54
|
+
<TextInput
|
|
55
|
+
label="New Leads"
|
|
56
|
+
name="new_leads_eq"
|
|
57
|
+
placeholder="0"
|
|
58
|
+
type="number"
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
<TextInput
|
|
62
|
+
label="Conversion Rate"
|
|
63
|
+
name="conversion_rate_eq"
|
|
64
|
+
placeholder="e.g. 12%"
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
<Flex
|
|
68
|
+
spacing="between"
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
<Button
|
|
72
|
+
onClick={closePopover}
|
|
73
|
+
text="Filter"
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
<Button
|
|
77
|
+
text="Defaults"
|
|
78
|
+
type="reset"
|
|
79
|
+
variant="secondary"
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
</Flex>
|
|
83
|
+
</form>
|
|
84
|
+
)
|
|
85
|
+
|
|
43
86
|
return (
|
|
44
87
|
<div>
|
|
88
|
+
<Caption
|
|
89
|
+
text="Default Advanced Table Table Props Doc Example"
|
|
90
|
+
/>
|
|
45
91
|
<AdvancedTable
|
|
46
92
|
columnDefinitions={columnDefinitions}
|
|
93
|
+
marginBottom="md"
|
|
47
94
|
tableData={MOCK_DATA}
|
|
48
95
|
tableProps={tableProps}
|
|
49
96
|
{...props}
|
|
50
97
|
/>
|
|
98
|
+
<Caption
|
|
99
|
+
text="Advanced Table with just container: false"
|
|
100
|
+
/>
|
|
101
|
+
<AdvancedTable
|
|
102
|
+
columnDefinitions={columnDefinitions}
|
|
103
|
+
marginBottom="md"
|
|
104
|
+
tableData={MOCK_DATA}
|
|
105
|
+
tableProps={{container: false}}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<Caption
|
|
110
|
+
text="Typical set up: Card and Flex around Filter, SectionSeparator, and AdvancedTable with container: false"
|
|
111
|
+
/>
|
|
112
|
+
<Card
|
|
113
|
+
marginBottom="xl"
|
|
114
|
+
padding="none"
|
|
115
|
+
{...props}
|
|
116
|
+
>
|
|
117
|
+
<Flex
|
|
118
|
+
align="stretch"
|
|
119
|
+
gap="none"
|
|
120
|
+
orientation="column"
|
|
121
|
+
{...props}
|
|
122
|
+
>
|
|
123
|
+
<Filter
|
|
124
|
+
background={false}
|
|
125
|
+
id="react-table-props-filter-with-data"
|
|
126
|
+
maxHeight={MOCK_DATA.length < 10 ? "50vh" : "none"}
|
|
127
|
+
minWidth="xs"
|
|
128
|
+
popoverProps={filterPopoverProps}
|
|
129
|
+
results={MOCK_DATA.length}
|
|
130
|
+
{...props}
|
|
131
|
+
>
|
|
132
|
+
{({ closePopover }) => filterForm(closePopover)}
|
|
133
|
+
</Filter>
|
|
134
|
+
<SectionSeparator {...props} />
|
|
135
|
+
<AdvancedTable
|
|
136
|
+
columnDefinitions={columnDefinitions}
|
|
137
|
+
id="react_template_advanced_table"
|
|
138
|
+
tableData={MOCK_DATA}
|
|
139
|
+
tableProps={{container: false}}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
</Flex>
|
|
143
|
+
</Card>
|
|
51
144
|
</div>
|
|
52
145
|
)
|
|
53
146
|
}
|
|
@@ -7,6 +7,7 @@ examples:
|
|
|
7
7
|
- advanced_table_table_props: Table Props
|
|
8
8
|
- advanced_table_sticky_header_rails: Sticky Header
|
|
9
9
|
- advanced_table_table_props_sticky_header: Sticky Header for Responsive Table
|
|
10
|
+
- advanced_table_pinned_rows_rails: Pinned Rows
|
|
10
11
|
- advanced_table_beta_sort: Enable Sorting
|
|
11
12
|
- advanced_table_responsive: Responsive Tables
|
|
12
13
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
|
@@ -39,9 +40,11 @@ examples:
|
|
|
39
40
|
- advanced_table_sort_per_column: Enable Sort By Column
|
|
40
41
|
- advanced_table_sort_per_column_for_multi_column: Enable Sort By Column (Multi-Column)
|
|
41
42
|
- advanced_table_custom_sort: Custom Sort
|
|
43
|
+
- advanced_table_sort_parent_only: Sort Parent Only
|
|
42
44
|
- advanced_table_expanded_control: Expanded Control
|
|
43
45
|
- advanced_table_expand_by_depth: Expand by Depth
|
|
44
46
|
- advanced_table_subrow_headers: SubRow Headers
|
|
47
|
+
- advanced_table_cascade_collapse: Cascade Collapse
|
|
45
48
|
- advanced_table_collapsible_trail: Collapsible Trail
|
|
46
49
|
- advanced_table_table_options: Table Options
|
|
47
50
|
- advanced_table_table_props: Table Props
|
|
@@ -48,4 +48,6 @@ export { default as AdvancedTablePaddingControl } from './_advanced_table_paddin
|
|
|
48
48
|
export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
|
|
49
49
|
export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
|
|
50
50
|
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
51
|
-
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
51
|
+
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
52
|
+
export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
|
|
53
|
+
export { default as AdvancedTableSortParentOnly } from './_advanced_table_sort_parent_only.jsx'
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<% end %>
|
|
29
29
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
30
30
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
31
|
-
<%= pb_rails("
|
|
31
|
+
<%= pb_rails("textarea", props: {id: "default"}) %>
|
|
32
32
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
33
33
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
34
34
|
<%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
|
|
@@ -4,7 +4,7 @@ import Body from '../../pb_body/_body'
|
|
|
4
4
|
import Button from '../../pb_button/_button'
|
|
5
5
|
import Caption from '../../pb_caption/_caption'
|
|
6
6
|
import Dialog from '../../pb_dialog/_dialog'
|
|
7
|
-
import
|
|
7
|
+
import Textarea from '../../pb_textarea/_textarea'
|
|
8
8
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
9
9
|
|
|
10
10
|
const DialogCompound = () => {
|
|
@@ -25,8 +25,11 @@ const DialogCompound = () => {
|
|
|
25
25
|
<Body>{'What do you need us to take care of?'}</Body>
|
|
26
26
|
</Dialog.Header>
|
|
27
27
|
<Dialog.Body>
|
|
28
|
-
<
|
|
29
|
-
|
|
28
|
+
<Textarea
|
|
29
|
+
id="default-example-1"
|
|
30
|
+
label="Description"
|
|
31
|
+
rows={4}
|
|
32
|
+
/>
|
|
30
33
|
<br />
|
|
31
34
|
<Caption>
|
|
32
35
|
{
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
14
14
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
15
|
-
<%= pb_rails("
|
|
15
|
+
<%= pb_rails("textarea", props: {id: "default-7"}) %>
|
|
16
16
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
17
17
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
18
18
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<% end %>
|
|
32
32
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
33
33
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
34
|
-
<%= pb_rails("
|
|
34
|
+
<%= pb_rails("textarea", props: {id: "default-8"}) %>
|
|
35
35
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
36
36
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
37
37
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<% end %>
|
|
50
50
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
51
51
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
52
|
-
<%= pb_rails("
|
|
52
|
+
<%= pb_rails("textarea", props: {id: "default-9"}) %>
|
|
53
53
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
54
54
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
55
55
|
|
|
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
|
|
|
5
5
|
import Dialog from '../../pb_dialog/_dialog'
|
|
6
6
|
import Flex from '../../pb_flex/_flex'
|
|
7
7
|
import Caption from '../../pb_caption/_caption'
|
|
8
|
-
import
|
|
8
|
+
import Textarea from '../../pb_textarea/_textarea'
|
|
9
9
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
10
10
|
|
|
11
11
|
const useDialog = (visible = false) => {
|
|
@@ -77,8 +77,11 @@ const DialogFullHeight = () => {
|
|
|
77
77
|
<Body>{title}</Body>
|
|
78
78
|
</Dialog.Header>
|
|
79
79
|
<Dialog.Body>
|
|
80
|
-
<
|
|
81
|
-
|
|
80
|
+
<Textarea
|
|
81
|
+
id="default-example-1"
|
|
82
|
+
label="Description"
|
|
83
|
+
rows={4}
|
|
84
|
+
/>
|
|
82
85
|
<br />
|
|
83
86
|
<Caption>
|
|
84
87
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<% end %>
|
|
14
14
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
15
15
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
16
|
-
<%= pb_rails("
|
|
16
|
+
<%= pb_rails("textarea", props: {id: "default-2"}) %>
|
|
17
17
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
18
18
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
19
19
|
<% end %>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<% end %>
|
|
33
33
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
34
34
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
35
|
-
<%= pb_rails("
|
|
35
|
+
<%= pb_rails("textarea", props: {id: "default-3"}) %>
|
|
36
36
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
37
37
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
38
38
|
<% end %>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<% end %>
|
|
51
51
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
52
52
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
53
|
-
<%= pb_rails("
|
|
53
|
+
<%= pb_rails("textarea", props: {id: "default-4"}) %>
|
|
54
54
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
55
55
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
56
56
|
<% end %>
|
|
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
|
|
|
5
5
|
import Dialog from '../../pb_dialog/_dialog'
|
|
6
6
|
import Flex from '../../pb_flex/_flex'
|
|
7
7
|
import Caption from '../../pb_caption/_caption'
|
|
8
|
-
import
|
|
8
|
+
import Textarea from "../../pb_textarea/_textarea";
|
|
9
9
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
10
10
|
|
|
11
11
|
const useDialog = (visible = false) => {
|
|
@@ -76,8 +76,11 @@ const DialogFullHeightPlacement = () => {
|
|
|
76
76
|
<Body>{title}</Body>
|
|
77
77
|
</Dialog.Header>
|
|
78
78
|
<Dialog.Body>
|
|
79
|
-
<
|
|
80
|
-
|
|
79
|
+
<Textarea
|
|
80
|
+
id={`default-example-2-${index}`}
|
|
81
|
+
label="Description"
|
|
82
|
+
rows={4}
|
|
83
|
+
/>
|
|
81
84
|
<br />
|
|
82
85
|
<Caption>
|
|
83
86
|
{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = [
|
|
3
|
+
{ label: "United States", value: "unitedStates", id: "us" },
|
|
4
|
+
{ label: "Canada", value: "canada", id: "ca" },
|
|
5
|
+
{ label: "Pakistan", value: "pakistan", id: "pk" },
|
|
6
|
+
]
|
|
7
|
+
%>
|
|
8
|
+
|
|
9
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Any" }) %>
|
|
10
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "any", margin_bottom: "md" }) %>
|
|
11
|
+
|
|
12
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outside" }) %>
|
|
13
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "outside", margin_bottom: "md" }) %>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("caption", props: { margin_bottom: "xs", text: "Inside" }) %>
|
|
16
|
+
<%= pb_rails("dropdown", props: { options: options, close_on_click: "inside" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The `close_on_click` prop allows you to control when the Dropdown closes in response to click interactions. The value `any` reflects the default behavior, where the dropdown will close after any click. Set it to `outside` to ensure interactive elements as dropdown options are able to be interacted with or modified. Set it to `inside` for a dropdown that only closes when the input or dropdown menu is clicked.
|