playbook_ui_docs 13.18.0 → 13.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdb50ea187fb51c4568a5a77c1aa1b9281a017ec5f71612910770722f0d95be3
4
- data.tar.gz: 205eacdf9b5e1a691612eae3ebce313d1421cee2a54a176abb648c782164e50e
3
+ metadata.gz: 9eeff004a877b4b2a9c9b62917bf09020bb6132cc1940ba8399079ca07146b35
4
+ data.tar.gz: cb9f138868190020ac845c816f765d920f3609aeed33dbe5d3d87f9ccfb5a080
5
5
  SHA512:
6
- metadata.gz: d32f600e38c86e7874192b00c32edeb9d7f6a4f285ff332a5dacc0da7255e75b7b3da29b02124342cbbc7c90dbd314190907bab829f16e7f75ff9eaf9654e908
7
- data.tar.gz: 55cdde05865ea36538e55d3956230e3fcc7240fa60dd2a265c040de74ccf57f55da378bf5fb6a8a80cfd0c66d8f231f6d37e4611885eab72ad6a4bcaf9ef1121
6
+ metadata.gz: 9fa5d81c3a0bde9c250ae1bcd531a4d145b8ce799c8736328ae618260c5fe7a4ccb3f18ebed003c4b8dc299b0728b15ffe8bba10a3e187dbed33e61c9bccb5bf
7
+ data.tar.gz: 2038b8cb20ba23ef8519dd8588c8a33d622b83c8563ebc6d35861bf28519a823e653fc755b0627ebec35d1c7d1eebc1d469dc0c19c7a9426038ef985a7d52d1b
@@ -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.
@@ -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
+
@@ -9,4 +9,5 @@ examples:
9
9
  - advanced_table_collapsible_trail: Collapsible Trail
10
10
  - advanced_table_table_options: Table Options
11
11
  - advanced_table_table_props: Table Props
12
+ - advanced_table_inline_row_loading: inline Row Loading
12
13
 
@@ -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'
data/dist/menu.yml CHANGED
@@ -55,7 +55,7 @@ kits:
55
55
  - name: "advanced_table"
56
56
  platforms: *react_only
57
57
  description: The Advanced Table can be used to display complex, nested data in a way that allows for expansion and/or sorting.
58
- status: "beta"
58
+ status: "stable"
59
59
  - name: "list"
60
60
  platforms: *web
61
61
  description: Lists display a vertical set of related content.