playbook_ui_docs 13.18.0 → 13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346
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_collapsible_trail.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading.js +200 -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 +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.html.erb +49 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +68 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +42 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.jsx +83 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_filter/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +5 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +44 -18
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +4 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_div.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_div.jsx +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.md +7 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +20 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_presence_indicator_swift.md +30 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +2 -1
- data/app/pb_kits/playbook/pb_user/docs/example.yml +1 -0
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +9 -9
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97524677912ecc6efe82e5f4509cd3895b24f428e61b1bebbf98f61e052a84be
|
4
|
+
data.tar.gz: 2a7232286e772b85c8adac4fa66627202f55da71dff4cfd66b9e2386827563bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4259fc37cd2bb185c310e75cd2ccd487dfcf76d232926028e642a6fbdfb47ea91a093fb2af006445cb20b63cd6afddf9103893922dddeebed1bb4dc56497e8eb
|
7
|
+
data.tar.gz: 242ca3257198a06c1c04e8e6f99676f6b3e8dab0c970e4c4b942d9c675bf2ffefd232b2eae2c2ba4f948828d8fd80a376e303a28260c764bd7adbeee2d3b5c98
|
@@ -1 +1 @@
|
|
1
|
-
`collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of rows when subRows are toggled open.
|
1
|
+
`collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of the rows when subRows are toggled open.
|
@@ -8,7 +8,7 @@ For a visual of the data structure needed for `tableData`, see [here](https://gi
|
|
8
8
|
|
9
9
|
### columnDefinitions
|
10
10
|
|
11
|
-
`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
|
11
|
+
`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 an array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
|
12
12
|
|
13
13
|
- `accessor`: this is the key from your data for the value you want rendered in that column
|
14
14
|
- `label`: this is what will be rendered as the column header label
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { AdvancedTable } from "../..";
|
3
|
+
import { MOCK_DATA_INLINE_LOADING } from "./_mock_data_inline_loading";
|
4
|
+
|
5
|
+
const AdvancedTableInlineRowLoading = (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
|
+
//Render the subRow header rows
|
39
|
+
const subRowHeaders = ["Quarter", "Month", "Day"]
|
40
|
+
|
41
|
+
|
42
|
+
return (
|
43
|
+
<div>
|
44
|
+
<AdvancedTable
|
45
|
+
columnDefinitions={columnDefinitions}
|
46
|
+
enableToggleExpansion="all"
|
47
|
+
inlineRowLoading
|
48
|
+
tableData={MOCK_DATA_INLINE_LOADING}
|
49
|
+
{...props}
|
50
|
+
>
|
51
|
+
<AdvancedTable.Header />
|
52
|
+
<AdvancedTable.Body subRowHeaders={subRowHeaders}/>
|
53
|
+
</AdvancedTable>
|
54
|
+
</div>
|
55
|
+
);
|
56
|
+
};
|
57
|
+
|
58
|
+
export default AdvancedTableInlineRowLoading;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
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
|
+
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
|
+
This prop is set to `false` by default.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
|
2
2
|
|
3
|
-
By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to
|
3
|
+
By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
`subRowHeaders` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
|
2
2
|
|
3
|
-
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all'
|
3
|
+
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all', 'header" or "none". If set to 'all', the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to 'header' button will only appear in header and NOT in subRow headers. This is set to 'header' by default.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
The Tanstack table consumes the useReactTable hook to create the table. This hook takes an object that can contain any of the functions that the Tanstack table provides. The advancedTable's optional `tableOptions` can be used to pass tanstack options to the kit.
|
2
2
|
|
3
|
-
In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and
|
3
|
+
In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and how to use them, see [here](https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable)
|
@@ -0,0 +1,200 @@
|
|
1
|
+
export const MOCK_DATA_INLINE_LOADING = [
|
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
|
+
year: "2022",
|
29
|
+
quarter: "Q1",
|
30
|
+
month: null,
|
31
|
+
day: null,
|
32
|
+
newEnrollments: "2",
|
33
|
+
scheduledMeetings: "35",
|
34
|
+
attendanceRate: "32%",
|
35
|
+
completedClasses: "15",
|
36
|
+
classCompletionRate: "52%",
|
37
|
+
graduatedStudents: "36",
|
38
|
+
children: [
|
39
|
+
{
|
40
|
+
year: "2022",
|
41
|
+
quarter: "Q1",
|
42
|
+
month: "January",
|
43
|
+
day: null,
|
44
|
+
newEnrollments: "16",
|
45
|
+
scheduledMeetings: "20",
|
46
|
+
attendanceRate: "11%",
|
47
|
+
completedClasses: "13",
|
48
|
+
classCompletionRate: "47%",
|
49
|
+
graduatedStudents: "28",
|
50
|
+
children: [
|
51
|
+
{
|
52
|
+
year: "2022",
|
53
|
+
quarter: "Q1",
|
54
|
+
month: "January",
|
55
|
+
day: "15",
|
56
|
+
newEnrollments: "34",
|
57
|
+
scheduledMeetings: "28",
|
58
|
+
attendanceRate: "97%",
|
59
|
+
completedClasses: "20",
|
60
|
+
classCompletionRate: "15%",
|
61
|
+
graduatedStudents: "17",
|
62
|
+
},
|
63
|
+
{
|
64
|
+
year: "2022",
|
65
|
+
quarter: "Q1",
|
66
|
+
month: "January",
|
67
|
+
day: "25",
|
68
|
+
newEnrollments: "43",
|
69
|
+
scheduledMeetings: "23",
|
70
|
+
attendanceRate: "66%",
|
71
|
+
completedClasses: "26",
|
72
|
+
classCompletionRate: "47%",
|
73
|
+
graduatedStudents: "9",
|
74
|
+
},
|
75
|
+
],
|
76
|
+
},
|
77
|
+
{
|
78
|
+
year: "2022",
|
79
|
+
quarter: "Q1",
|
80
|
+
month: "May",
|
81
|
+
day: null,
|
82
|
+
newEnrollments: "20",
|
83
|
+
scheduledMeetings: "41",
|
84
|
+
attendanceRate: "95%",
|
85
|
+
completedClasses: "26",
|
86
|
+
classCompletionRate: "83%",
|
87
|
+
graduatedStudents: "43",
|
88
|
+
children: [
|
89
|
+
{
|
90
|
+
year: "2011",
|
91
|
+
quarter: "Q1",
|
92
|
+
month: "May",
|
93
|
+
day: "2",
|
94
|
+
newEnrollments: "19",
|
95
|
+
scheduledMeetings: "35",
|
96
|
+
attendanceRate: "69%",
|
97
|
+
completedClasses: "8",
|
98
|
+
classCompletionRate: "75%",
|
99
|
+
graduatedStudents: "23",
|
100
|
+
},
|
101
|
+
],
|
102
|
+
},
|
103
|
+
],
|
104
|
+
},
|
105
|
+
],
|
106
|
+
},
|
107
|
+
{
|
108
|
+
year: "2023",
|
109
|
+
quarter: null,
|
110
|
+
month: null,
|
111
|
+
day: null,
|
112
|
+
newEnrollments: "10",
|
113
|
+
scheduledMeetings: "15",
|
114
|
+
attendanceRate: "65%",
|
115
|
+
completedClasses: "4",
|
116
|
+
classCompletionRate: "49%",
|
117
|
+
graduatedStudents: "29",
|
118
|
+
children: [
|
119
|
+
{
|
120
|
+
year: "2023",
|
121
|
+
quarter: "Q1",
|
122
|
+
month: null,
|
123
|
+
day: null,
|
124
|
+
newEnrollments: "2",
|
125
|
+
scheduledMeetings: "35",
|
126
|
+
attendanceRate: "32%",
|
127
|
+
completedClasses: "15",
|
128
|
+
classCompletionRate: "52%",
|
129
|
+
graduatedStudents: "36",
|
130
|
+
children: [
|
131
|
+
{
|
132
|
+
year: "2023",
|
133
|
+
quarter: "Q1",
|
134
|
+
month: "March",
|
135
|
+
day: null,
|
136
|
+
newEnrollments: "16",
|
137
|
+
scheduledMeetings: "20",
|
138
|
+
attendanceRate: "11%",
|
139
|
+
completedClasses: "13",
|
140
|
+
classCompletionRate: "47%",
|
141
|
+
graduatedStudents: "28",
|
142
|
+
children: [
|
143
|
+
{
|
144
|
+
year: "2023",
|
145
|
+
quarter: "Q1",
|
146
|
+
month: "March",
|
147
|
+
day: "10",
|
148
|
+
newEnrollments: "34",
|
149
|
+
scheduledMeetings: "28",
|
150
|
+
attendanceRate: "97%",
|
151
|
+
completedClasses: "20",
|
152
|
+
classCompletionRate: "15%",
|
153
|
+
graduatedStudents: "17",
|
154
|
+
},
|
155
|
+
{
|
156
|
+
year: "2023",
|
157
|
+
quarter: "Q1",
|
158
|
+
month: "March",
|
159
|
+
day: "11",
|
160
|
+
newEnrollments: "43",
|
161
|
+
scheduledMeetings: "23",
|
162
|
+
attendanceRate: "66%",
|
163
|
+
completedClasses: "26",
|
164
|
+
classCompletionRate: "47%",
|
165
|
+
graduatedStudents: "9",
|
166
|
+
},
|
167
|
+
],
|
168
|
+
},
|
169
|
+
{
|
170
|
+
year: "2023",
|
171
|
+
quarter: "Q1",
|
172
|
+
month: "April",
|
173
|
+
day: null,
|
174
|
+
newEnrollments: "20",
|
175
|
+
scheduledMeetings: "41",
|
176
|
+
attendanceRate: "95%",
|
177
|
+
completedClasses: "26",
|
178
|
+
classCompletionRate: "83%",
|
179
|
+
graduatedStudents: "43",
|
180
|
+
children: [
|
181
|
+
{
|
182
|
+
year: "2023",
|
183
|
+
quarter: "Q1",
|
184
|
+
month: "April",
|
185
|
+
day: "15",
|
186
|
+
newEnrollments: "19",
|
187
|
+
scheduledMeetings: "35",
|
188
|
+
attendanceRate: "69%",
|
189
|
+
completedClasses: "8",
|
190
|
+
classCompletionRate: "75%",
|
191
|
+
graduatedStudents: "23",
|
192
|
+
},
|
193
|
+
],
|
194
|
+
},
|
195
|
+
],
|
196
|
+
},
|
197
|
+
],
|
198
|
+
},
|
199
|
+
];
|
200
|
+
|
@@ -7,3 +7,4 @@ export { default as AdvancedTableSubrowHeaders } from './_advanced_table_subrow_
|
|
7
7
|
export { default as AdvancedTableCollapsibleTrail } from './_advanced_table_collapsible_trail.jsx'
|
8
8
|
export { default as AdvancedTableTableOptions } from './_advanced_table_table_options.jsx'
|
9
9
|
export { default as AdvancedTableTableProps } from './_advanced_table_table_props.jsx'
|
10
|
+
export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<% data = [{
|
2
|
+
name: 'Installation',
|
3
|
+
data: [1475,200,3000,654,656]
|
4
|
+
}, {
|
5
|
+
name: 'Manufacturing',
|
6
|
+
data: [4434,524,2320,440,500]
|
7
|
+
}, {
|
8
|
+
name: 'Sales & Distribution',
|
9
|
+
data: [3387,743,1344,434,440,]
|
10
|
+
}, {
|
11
|
+
name: 'Project Development',
|
12
|
+
data: [3227,878,999,780,1000]
|
13
|
+
}, {
|
14
|
+
name: 'Other',
|
15
|
+
data: [1111,677,3245,500,200]
|
16
|
+
}] %>
|
17
|
+
|
18
|
+
<% custom_options = {
|
19
|
+
customOptions: {
|
20
|
+
subtitle: {
|
21
|
+
text: "Overwritten subtitle",
|
22
|
+
style: {
|
23
|
+
color: "red"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
xAxis: {
|
27
|
+
categories: [
|
28
|
+
'<i class="far fa-apple-whole"></i> Jan',
|
29
|
+
'<i class="far fa-strawberry"></i> Feb',
|
30
|
+
'<i class="far fa-lemon"></i> Mar',
|
31
|
+
'<i class="far fa-pear"></i> Apr',
|
32
|
+
'<i class="far fa-peach"></i> May'
|
33
|
+
],
|
34
|
+
labels: {
|
35
|
+
useHTML: true,
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
} %>
|
40
|
+
|
41
|
+
<%= pb_rails("bar_graph", props: {
|
42
|
+
axis_title: 'Number of Employees',
|
43
|
+
chart_data: data,
|
44
|
+
id: "bar-default",
|
45
|
+
y_axis_min: 0,
|
46
|
+
subtitle: 'Subtitle to replace',
|
47
|
+
title: 'Bar Graph with Custom Overrides',
|
48
|
+
custom_options: custom_options
|
49
|
+
}) %>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import BarGraph from '../_bar_graph'
|
4
|
+
|
5
|
+
const chartData = [{
|
6
|
+
name: 'Installation',
|
7
|
+
data: [1475, 200, 3000, 654, 656],
|
8
|
+
}, {
|
9
|
+
name: 'Manufacturing',
|
10
|
+
data: [4434, 524, 2320, 440, 500],
|
11
|
+
}, {
|
12
|
+
name: 'Sales & Distribution',
|
13
|
+
data: [3387, 743, 1344, 434, 440],
|
14
|
+
}, {
|
15
|
+
name: 'Project Development',
|
16
|
+
data: [3227, 878, 999, 780, 1000],
|
17
|
+
}, {
|
18
|
+
name: 'Other',
|
19
|
+
data: [1111, 677, 3245, 500, 200],
|
20
|
+
}]
|
21
|
+
|
22
|
+
const barGraphOptions = {
|
23
|
+
subtitle: {
|
24
|
+
text: "Overwritten subtitle",
|
25
|
+
style: {
|
26
|
+
color: "red"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
xAxis: {
|
30
|
+
labels: {
|
31
|
+
useHTML: true,
|
32
|
+
formatter: function() {
|
33
|
+
switch (this.value) {
|
34
|
+
case 'Jan':
|
35
|
+
return `<i class="far fa-apple-whole"></i> ${this.value}`
|
36
|
+
case 'Feb':
|
37
|
+
return `<i class="far fa-strawberry"></i> ${this.value}`
|
38
|
+
case 'Mar':
|
39
|
+
return `<i class="far fa-lemon"></i> ${this.value}`
|
40
|
+
case 'Apr':
|
41
|
+
return `<i class="far fa-pear"></i> ${this.value}`
|
42
|
+
case 'May':
|
43
|
+
return `<i class="far fa-peach"></i> ${this.value}`
|
44
|
+
default:
|
45
|
+
return ''
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
const BarGraphCustom = (props) => (
|
53
|
+
<div>
|
54
|
+
<BarGraph
|
55
|
+
axisTitle="Number of Employees"
|
56
|
+
chartData={chartData}
|
57
|
+
customOptions={barGraphOptions}
|
58
|
+
id="bar-custom"
|
59
|
+
subTitle="Subtitle to replace"
|
60
|
+
title="Bar Graph with Custom Overrides"
|
61
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
62
|
+
yAxisMin={0}
|
63
|
+
{...props}
|
64
|
+
/>
|
65
|
+
</div>
|
66
|
+
)
|
67
|
+
|
68
|
+
export default BarGraphCustom
|
@@ -0,0 +1 @@
|
|
1
|
+
See https://api.highcharts.com/highcharts/ for a comprehensive list of available options.
|
@@ -8,6 +8,7 @@ examples:
|
|
8
8
|
- bar_graph_height: Height
|
9
9
|
- bar_graph_spline: Spline
|
10
10
|
- bar_graph_colors: Color Overrides
|
11
|
+
- bar_graph_custom: Custom Overrides
|
11
12
|
|
12
13
|
|
13
14
|
react:
|
@@ -18,3 +19,4 @@ examples:
|
|
18
19
|
- bar_graph_height: Height
|
19
20
|
- bar_graph_spline: Spline
|
20
21
|
- bar_graph_colors: Color Overrides
|
22
|
+
- bar_graph_custom: Custom Overrides
|
@@ -5,3 +5,4 @@ export { default as BarGraphLegendNonClickable } from './_bar_graph_legend_non_c
|
|
5
5
|
export { default as BarGraphHeight } from './_bar_graph_height.jsx'
|
6
6
|
export { default as BarGraphSpline } from './_bar_graph_spline.jsx'
|
7
7
|
export { default as BarGraphColors } from './_bar_graph_colors.jsx'
|
8
|
+
export { default as BarGraphCustom } from './_bar_graph_custom.jsx'
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<%=
|
2
|
+
pb_rails("filter", props: {
|
3
|
+
max_height: "360px",
|
4
|
+
id: "filter_max_height_rails",
|
5
|
+
position: "top",
|
6
|
+
filters: [
|
7
|
+
{ name: "name", value: "John Wick" },
|
8
|
+
{ name: "city", value: "San Francisco"}
|
9
|
+
],
|
10
|
+
sort_menu: [
|
11
|
+
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
12
|
+
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
13
|
+
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
14
|
+
],
|
15
|
+
template: "default",
|
16
|
+
results: 1,
|
17
|
+
}) do
|
18
|
+
%>
|
19
|
+
<%
|
20
|
+
example_collection = [
|
21
|
+
OpenStruct.new(name: "USA", value: 1),
|
22
|
+
OpenStruct.new(name: "Canada", value: 2),
|
23
|
+
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
+
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
+
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
+
]
|
27
|
+
%>
|
28
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
31
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
32
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
33
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
34
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
35
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
36
|
+
|
37
|
+
<%= form.actions do |action| %>
|
38
|
+
<%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
|
39
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, Filter, Flex, Select, TextInput } from '../..'
|
3
|
+
|
4
|
+
const FilterMaxHeight = (props) => {
|
5
|
+
const options = [
|
6
|
+
{ value: 'USA' },
|
7
|
+
{ value: 'Canada' },
|
8
|
+
{ value: 'Brazil' },
|
9
|
+
{ value: 'Philippines' },
|
10
|
+
{ value: 'A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...' },
|
11
|
+
]
|
12
|
+
return (
|
13
|
+
<Filter
|
14
|
+
{...props}
|
15
|
+
double
|
16
|
+
filters={{
|
17
|
+
'Full Name': 'John Wick',
|
18
|
+
'City': 'San Francisco',
|
19
|
+
}}
|
20
|
+
maxHeight="360px"
|
21
|
+
minWidth="360px"
|
22
|
+
results={1}
|
23
|
+
sortOptions={{
|
24
|
+
popularity: 'Popularity',
|
25
|
+
// eslint-disable-next-line
|
26
|
+
manager_title: 'Manager\'s Title',
|
27
|
+
// eslint-disable-next-line
|
28
|
+
manager_name: 'Manager\'s Name',
|
29
|
+
}}
|
30
|
+
sortValue={[{ name: 'popularity', dir: 'desc' }]}
|
31
|
+
>
|
32
|
+
{({ closePopover }) => (
|
33
|
+
<form>
|
34
|
+
<Select
|
35
|
+
blankSelection="Select One..."
|
36
|
+
label="Territory"
|
37
|
+
name="location"
|
38
|
+
options={options}
|
39
|
+
/>
|
40
|
+
<TextInput
|
41
|
+
label="First Name"
|
42
|
+
placeholder="Enter name"
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
<TextInput
|
46
|
+
label="Middle Name"
|
47
|
+
placeholder="Enter name"
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<TextInput
|
51
|
+
label="Last Name"
|
52
|
+
placeholder="Enter name"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
<TextInput
|
56
|
+
label="Email"
|
57
|
+
placeholder="Enter email"
|
58
|
+
{...props}
|
59
|
+
/>
|
60
|
+
<TextInput
|
61
|
+
label="Address"
|
62
|
+
placeholder="Enter address"
|
63
|
+
{...props}
|
64
|
+
/>
|
65
|
+
<Flex
|
66
|
+
spacing="between"
|
67
|
+
>
|
68
|
+
<Button
|
69
|
+
onClick={closePopover}
|
70
|
+
text="Apply"
|
71
|
+
/>
|
72
|
+
<Button
|
73
|
+
text="Clear"
|
74
|
+
variant="secondary"
|
75
|
+
/>
|
76
|
+
</Flex>
|
77
|
+
</form>
|
78
|
+
)}
|
79
|
+
</Filter>
|
80
|
+
)
|
81
|
+
}
|
82
|
+
|
83
|
+
export default FilterMaxHeight
|
@@ -8,6 +8,7 @@ examples:
|
|
8
8
|
- filter_only: Filter Only
|
9
9
|
- sort_only: Sort Only
|
10
10
|
- filter_max_width: Max Width for Popover Inside of Filter
|
11
|
+
- filter_max_height: Max Height for Popover Inside of Filter
|
11
12
|
- filter_placement: Filter Placement
|
12
13
|
|
13
14
|
react:
|
@@ -18,4 +19,5 @@ examples:
|
|
18
19
|
- filter_only: Filter Only
|
19
20
|
- sort_only: Sort Only
|
20
21
|
- filter_max_width: Max Width for Popover Inside of Filter
|
22
|
+
- filter_max_height: Max Height for Popover Inside of Filter
|
21
23
|
- filter_placement: Filter Placement
|
@@ -5,4 +5,5 @@ export { default as FilterNoBackground } from './_filter_no_background.jsx'
|
|
5
5
|
export { default as FilterOnly } from './_filter_only.jsx'
|
6
6
|
export { default as SortOnly } from './_sort_only.jsx'
|
7
7
|
export { default as FilterMaxWidth } from './_filter_max_width.jsx'
|
8
|
+
export { default as FilterMaxHeight } from './_filter_max_height.jsx'
|
8
9
|
export { default as FilterPlacement } from './_filter_placement.jsx'
|
@@ -2,15 +2,9 @@
|
|
2
2
|
<div class="icon-wrapper">
|
3
3
|
|
4
4
|
<% svg_url = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Wrench_font_awesome.svg" %>
|
5
|
-
<p><%= pb_rails("icon", props: {
|
6
|
-
<p><%= pb_rails("icon", props: { rotation: 90,
|
7
|
-
<p><%= pb_rails("icon", props: { spin: true,
|
8
|
-
<p><%= pb_rails("icon", props: { size: "5x",
|
9
|
-
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x",
|
10
|
-
|
11
|
-
<%= pb_rails("body", props: {
|
12
|
-
text: "Custom icons are compatible with other icon props (size, rotation,
|
13
|
-
spin, flip, etc). Their SVG fill colors will be inherited from
|
14
|
-
parent element's css color properties."
|
15
|
-
} ) %>
|
5
|
+
<p><%= pb_rails("icon", props: { icon: svg_url } ) %></p>
|
6
|
+
<p><%= pb_rails("icon", props: { rotation: 90, icon: svg_url, size: "2x" } ) %></p>
|
7
|
+
<p><%= pb_rails("icon", props: { spin: true, icon: svg_url, size: "3x" } ) %></p>
|
8
|
+
<p><%= pb_rails("icon", props: { size: "5x", icon: svg_url } ) %></p>
|
9
|
+
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", icon: svg_url } ) %></p>
|
16
10
|
</div>
|