playbook_ui_docs 16.8.0 → 16.9.0.pre.alpha.PLAY3001updateviewcomponent16983
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_column_styling.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.jsx +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md +66 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_enable_toggle_expansion_rails.html.erb +62 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_enable_toggle_expansion_rails.md +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +12 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +16 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_scroll_limitation.jsx +68 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_scroll_limitation.md +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +16 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +12 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +5 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +5 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_styling.json +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.jsx +15 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +2 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_react.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +2 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_react.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_react.md +3 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +20 -19
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_icon/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.html.erb +90 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.jsx +100 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.md +1 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +9 -11
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +4 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.html.erb +85 -83
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.jsx +88 -86
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.md +3 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.md +1 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.md +3 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.html.erb +24 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler_rails.md +6 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +1 -0
- metadata +18 -7
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.html.erb +0 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.jsx +0 -21
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.md +0 -7
- /data/app/pb_kits/playbook/pb_time_picker/docs/{_time_picker_on_handler.md → _time_picker_on_handler_react.md} +0 -0
|
@@ -5,3 +5,5 @@ Use the `draggable` kit and manage state as shown.
|
|
|
5
5
|
`draggable/draggable_container` kit creates the container within which the cards can be dragged and dropped.
|
|
6
6
|
|
|
7
7
|
The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggable_item` and `drag_id` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `drag_handle` is also available to show the drag handle icon.
|
|
8
|
+
|
|
9
|
+
On touch devices, drag from the grip handle (no long press). Swiping the card body scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -6,4 +6,5 @@ Use `DraggableProvider` and manage state as shown.
|
|
|
6
6
|
|
|
7
7
|
The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggableItem` and `dragId` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `dragHandle` is also available to show the drag handle icon.
|
|
8
8
|
|
|
9
|
+
On touch devices, drag from the grip handle (no long press). Swiping the card body scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
9
10
|
|
|
@@ -3,3 +3,5 @@ For a simplified version of the Draggable API for the List kit, you can do the f
|
|
|
3
3
|
The List kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on List kit with an array of the included items AND `drag_id` prop on ListItems. You will also need to include the `items` prop containing your array of listed items for the Draggable API.
|
|
4
4
|
|
|
5
5
|
An additional optional boolean prop (set to true by default) of `drag_handle` is also available on ListItem kit to show the drag handle icon.
|
|
6
|
+
|
|
7
|
+
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -2,4 +2,6 @@ For a simplified version of the Draggable API for the List kit, you can do the f
|
|
|
2
2
|
|
|
3
3
|
Use `DraggableProvider` and manage state as shown.
|
|
4
4
|
|
|
5
|
-
The List kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on List kit AND `dragId` prop on ListItem. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on
|
|
5
|
+
The List kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on List kit AND `dragId` prop on ListItem. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on ListItem to show the drag handle icon.
|
|
6
|
+
|
|
7
|
+
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
For a simplified version of the Draggable API for the SelectableList kit, you can do the following:
|
|
2
2
|
|
|
3
|
-
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
|
|
3
|
+
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
|
|
4
|
+
|
|
5
|
+
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -2,4 +2,6 @@ For a simplified version of the Draggable API for the SelectableList kit, you ca
|
|
|
2
2
|
|
|
3
3
|
Use `DraggableProvider` and manage state as shown.
|
|
4
4
|
|
|
5
|
-
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on SelectableList kit AND `dragId` prop on SelectableList.Item. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on SelectableList kit to show the drag handle icon.
|
|
5
|
+
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on SelectableList kit AND `dragId` prop on SelectableList.Item. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on SelectableList kit to show the drag handle icon.
|
|
6
|
+
|
|
7
|
+
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -28,7 +28,11 @@
|
|
|
28
28
|
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
|
29
29
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
|
30
30
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
|
31
|
-
|
|
31
|
+
<%= pb_rails("date_picker", props: {
|
|
32
|
+
label: "Start date",
|
|
33
|
+
name: "start_date",
|
|
34
|
+
picker_id: "filter-default",
|
|
35
|
+
}) %>
|
|
32
36
|
<%= form.actions do |action| %>
|
|
33
37
|
<%= action.submit props: {
|
|
34
38
|
text: "Apply",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
|
33
33
|
|
|
34
34
|
<%= form.actions do |action| %>
|
|
35
|
-
<%= action.submit props: { text: "Apply", data: { disable_with: "
|
|
35
|
+
<%= action.submit props: { text: "Apply", data: { disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe },}%>
|
|
36
36
|
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
|
37
37
|
<% end %>
|
|
38
38
|
<% end %>
|
|
@@ -131,23 +131,24 @@
|
|
|
131
131
|
%>
|
|
132
132
|
|
|
133
133
|
<%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
|
|
134
|
-
<%= form.typeahead :
|
|
135
|
-
<%= form.text_field :
|
|
136
|
-
<%= form.text_field :
|
|
137
|
-
<%= form.phone_number_field :
|
|
138
|
-
<%= form.email_field :
|
|
139
|
-
<%= form.number_field :
|
|
140
|
-
<%= form.search_field :
|
|
141
|
-
<%= form.password_field :
|
|
142
|
-
<%= form.url_field :
|
|
143
|
-
<%= form.text_area :
|
|
144
|
-
<%= form.text_area :
|
|
145
|
-
|
|
146
|
-
<%= form.
|
|
147
|
-
<%= form.date_picker :example_date_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
148
|
-
<%= form.date_picker :example_date_picker_required_indicator_custom, props: { label: "Custom Date Picker Label", required: true, required_indicator: true } %>
|
|
134
|
+
<%= form.typeahead :example_typeahead_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
135
|
+
<%= form.text_field :example_text_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
136
|
+
<%= form.text_field :example_text_field_required_indicator_custom, props: { label: "Text Field Custom Label", required: true, required_indicator: true } %>
|
|
137
|
+
<%= form.phone_number_field :example_phone_number_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
138
|
+
<%= form.email_field :example_email_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
139
|
+
<%= form.number_field :example_number_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
140
|
+
<%= form.search_field :example_search_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
141
|
+
<%= form.password_field :example_password_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
142
|
+
<%= form.url_field :example_url_field_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
143
|
+
<%= form.text_area :example_text_area_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
144
|
+
<%= form.text_area :example_text_area_required_indicator_custom, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
|
|
145
|
+
<%= form.dropdown_field :example_dropdown_required_indicator, props: { label: true, options: example_dropdown_options, required: true, required_indicator: true } %>
|
|
146
|
+
<%= form.dropdown_field :example_dropdown_required_indicator_multi, props: { label: "Dropdown Custom Label", options: example_dropdown_options, multi_select: true, required: true, required_indicator: true } %>
|
|
149
147
|
<%= form.select :example_select_required_indicator, [["Yes", 1], ["No", 2]], props: { label: true, required: true, required_indicator: true } %>
|
|
150
|
-
<%= form.select :
|
|
148
|
+
<%= form.select :example_select_required_indicator_custom, [["Yes", 1], ["No", 2]], props: { label: "Example Select Field", required: true, required_indicator: true } %>
|
|
149
|
+
<%# form.check_box :example_checkbox_required_indicator, props: { label: true, text: "Checkbox Label", required: true, required_indicator: true } %>
|
|
150
|
+
<%= form.date_picker :example_date_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
151
|
+
<%= form.date_picker :example_date_picker_required_indicator_custom, props: { label: "Date Picker Custom Label", required: true, required_indicator: true } %>
|
|
151
152
|
<%= form.multi_level_select :example_multi_level_select_required_indicator, props: {
|
|
152
153
|
label: true,
|
|
153
154
|
margin_y: 'sm',
|
|
@@ -156,14 +157,14 @@
|
|
|
156
157
|
tree_data: tree_data
|
|
157
158
|
} %>
|
|
158
159
|
<%= form.multi_level_select :example_multi_level_select_required_indicator_custom, props: {
|
|
159
|
-
label: "
|
|
160
|
+
label: "Multi Level Select Custom Label",
|
|
160
161
|
margin_y: 'sm',
|
|
161
162
|
required: true,
|
|
162
163
|
required_indicator: true,
|
|
163
164
|
tree_data: tree_data
|
|
164
165
|
} %>
|
|
165
|
-
<%= form.
|
|
166
|
-
<%= form.
|
|
166
|
+
<%= form.time_picker :example_time_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
167
|
+
<%= form.time_picker :example_time_picker_required_indicator_custom, props: { label: "Time Picker Custom Label", required: true, required_indicator: true } %>
|
|
167
168
|
|
|
168
169
|
<%= form.actions do |action| %>
|
|
169
170
|
<%= action.submit %>
|
|
@@ -8,7 +8,6 @@ examples:
|
|
|
8
8
|
- icon_border: Icon Border
|
|
9
9
|
- icon_sizes: Icon Sizes
|
|
10
10
|
- icon_custom: Icon Custom
|
|
11
|
-
- icon_fa_kit: Icon with FontAwesome Kit
|
|
12
11
|
- icon_color: Icon Color
|
|
13
12
|
|
|
14
13
|
react:
|
|
@@ -20,7 +19,6 @@ examples:
|
|
|
20
19
|
- icon_border: Icon Border
|
|
21
20
|
- icon_sizes: Icon Sizes
|
|
22
21
|
- icon_custom: Icon Custom
|
|
23
|
-
- icon_fa_kit: Icon with FontAwesome Kit
|
|
24
22
|
- icon_color: Icon Color
|
|
25
23
|
|
|
26
24
|
swift:
|
|
@@ -6,5 +6,4 @@ export { default as IconPull } from './_icon_pull.jsx'
|
|
|
6
6
|
export { default as IconBorder } from './_icon_border.jsx'
|
|
7
7
|
export { default as IconSizes } from './_icon_sizes.jsx'
|
|
8
8
|
export { default as IconCustom } from './_icon_custom.jsx'
|
|
9
|
-
export { default as IconFaKit} from './_icon_fa_kit.jsx'
|
|
10
9
|
export { default as IconColor } from './_icon_color.jsx'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<% data = [
|
|
2
|
+
{
|
|
3
|
+
name: "EV",
|
|
4
|
+
y: 23.9,
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
name: "Hybrids",
|
|
8
|
+
y: 12.6,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "Diesel",
|
|
12
|
+
y: 37.0,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "Petrol",
|
|
16
|
+
y: 26.4,
|
|
17
|
+
},
|
|
18
|
+
] %>
|
|
19
|
+
|
|
20
|
+
<% total = data.sum { |point| point[:y] } %>
|
|
21
|
+
<% subtitle_rows = data.map { |point| "#{point[:name]}: #{point[:y]}%" }.join("<br>") %>
|
|
22
|
+
|
|
23
|
+
<% chart_options = {
|
|
24
|
+
chart: {
|
|
25
|
+
type: "pie",
|
|
26
|
+
},
|
|
27
|
+
accessibility: {
|
|
28
|
+
point: {
|
|
29
|
+
valueSuffix: "%",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
text: "2023 Norway car registrations",
|
|
34
|
+
floating: true,
|
|
35
|
+
align: "center",
|
|
36
|
+
verticalAlign: "top",
|
|
37
|
+
y: 8,
|
|
38
|
+
},
|
|
39
|
+
subtitle: {
|
|
40
|
+
text: "Total<br><strong>#{total.round(1)}</strong><br><br>#{subtitle_rows}",
|
|
41
|
+
useHTML: true,
|
|
42
|
+
floating: true,
|
|
43
|
+
align: "center",
|
|
44
|
+
verticalAlign: "middle",
|
|
45
|
+
y: 8,
|
|
46
|
+
style: {
|
|
47
|
+
textAlign: "center",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
tooltip: {
|
|
51
|
+
pointFormat: "{series.name}: <b>{point.percentage:.0f}%</b>",
|
|
52
|
+
},
|
|
53
|
+
legend: {
|
|
54
|
+
enabled: false,
|
|
55
|
+
},
|
|
56
|
+
plotOptions: {
|
|
57
|
+
series: {
|
|
58
|
+
allowPointSelect: true,
|
|
59
|
+
cursor: "pointer",
|
|
60
|
+
borderRadius: 8,
|
|
61
|
+
dataLabels: [
|
|
62
|
+
{
|
|
63
|
+
enabled: true,
|
|
64
|
+
distance: 20,
|
|
65
|
+
format: "{point.name}",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
enabled: true,
|
|
69
|
+
distance: -15,
|
|
70
|
+
format: "{point.percentage:.0f}%",
|
|
71
|
+
style: {
|
|
72
|
+
fontSize: "0.9em",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
showInLegend: true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
series: [
|
|
80
|
+
{
|
|
81
|
+
name: "Registrations",
|
|
82
|
+
colorByPoint: true,
|
|
83
|
+
center: ["50%", "50%"],
|
|
84
|
+
innerSize: "75%",
|
|
85
|
+
data: data,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
} %>
|
|
89
|
+
|
|
90
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PbCircleChart from "../_pb_circle_chart";
|
|
3
|
+
|
|
4
|
+
const data = [
|
|
5
|
+
{
|
|
6
|
+
name: "EV",
|
|
7
|
+
y: 23.9,
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "Hybrids",
|
|
11
|
+
y: 12.6,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "Diesel",
|
|
15
|
+
y: 37.0,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "Petrol",
|
|
19
|
+
y: 26.4,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const total = data.reduce((sum, point) => sum + point.y, 0);
|
|
24
|
+
const subtitleRows = data.map((point) => `${point.name}: ${point.y}%`).join("<br>");
|
|
25
|
+
|
|
26
|
+
const chartOptions = {
|
|
27
|
+
chart: {
|
|
28
|
+
type: "pie",
|
|
29
|
+
},
|
|
30
|
+
accessibility: {
|
|
31
|
+
point: {
|
|
32
|
+
valueSuffix: "%",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
title: {
|
|
36
|
+
text: "2023 Norway car registrations",
|
|
37
|
+
floating: true,
|
|
38
|
+
align: "center",
|
|
39
|
+
verticalAlign: "top",
|
|
40
|
+
y: 8,
|
|
41
|
+
},
|
|
42
|
+
subtitle: {
|
|
43
|
+
text: `Total<br><strong>${total.toFixed(1)}</strong><br><br>${subtitleRows}`,
|
|
44
|
+
useHTML: true,
|
|
45
|
+
floating: true,
|
|
46
|
+
align: "center",
|
|
47
|
+
verticalAlign: "middle",
|
|
48
|
+
y: 8,
|
|
49
|
+
style: {
|
|
50
|
+
textAlign: "center",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
tooltip: {
|
|
54
|
+
pointFormat: "{series.name}: <b>{point.percentage:.0f}%</b>",
|
|
55
|
+
},
|
|
56
|
+
legend: {
|
|
57
|
+
enabled: false,
|
|
58
|
+
},
|
|
59
|
+
plotOptions: {
|
|
60
|
+
series: {
|
|
61
|
+
allowPointSelect: true,
|
|
62
|
+
cursor: "pointer",
|
|
63
|
+
borderRadius: 8,
|
|
64
|
+
dataLabels: [
|
|
65
|
+
{
|
|
66
|
+
enabled: true,
|
|
67
|
+
distance: 20,
|
|
68
|
+
format: "{point.name}",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
enabled: true,
|
|
72
|
+
distance: -15,
|
|
73
|
+
format: "{point.percentage:.0f}%",
|
|
74
|
+
style: {
|
|
75
|
+
fontSize: "0.9em",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
showInLegend: true,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
series: [
|
|
83
|
+
{
|
|
84
|
+
name: "Registrations",
|
|
85
|
+
colorByPoint: true,
|
|
86
|
+
center: ["50%", "50%"],
|
|
87
|
+
innerSize: "75%",
|
|
88
|
+
data,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const PbCircleChartCenteredData = (props) => (
|
|
94
|
+
<PbCircleChart
|
|
95
|
+
options={chartOptions}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export default PbCircleChartCenteredData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This example shows how to achieve centered data. This data will remain in the center of all screen sizes.
|
|
@@ -11,6 +11,7 @@ examples:
|
|
|
11
11
|
- pb_circle_chart_with_title: With Title
|
|
12
12
|
- pb_circle_chart_inner_sizes: Inner Circle Size Options
|
|
13
13
|
- pb_circle_chart_custom_tooltip: Tooltip Customization
|
|
14
|
+
- pb_circle_chart_centered_data: Centered Data
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
react:
|
|
@@ -25,5 +26,6 @@ examples:
|
|
|
25
26
|
- pb_circle_chart_with_title: With Title
|
|
26
27
|
- pb_circle_chart_inner_sizes: Inner Circle Size Options
|
|
27
28
|
- pb_circle_chart_custom_tooltip: Tooltip Customization
|
|
29
|
+
- pb_circle_chart_centered_data: Centered Data
|
|
28
30
|
|
|
29
31
|
|
|
@@ -8,4 +8,5 @@ export { default as PbCircleChartDataWithLegend } from './_pb_circle_chart_data_
|
|
|
8
8
|
export { default as PbCircleChartDataLegendPosition } from './_pb_circle_chart_data_legend_position.jsx'
|
|
9
9
|
export { default as PbCircleChartWithTitle } from './_pb_circle_chart_with_title.jsx'
|
|
10
10
|
export { default as PbCircleChartInnerSizes } from './_pb_circle_chart_inner_sizes.jsx'
|
|
11
|
-
export { default as PbCircleChartCustomTooltip } from './_pb_circle_chart_custom_tooltip.jsx'
|
|
11
|
+
export { default as PbCircleChartCustomTooltip } from './_pb_circle_chart_custom_tooltip.jsx'
|
|
12
|
+
export { default as PbCircleChartCenteredData } from './_pb_circle_chart_centered_data.jsx'
|
|
@@ -19,18 +19,16 @@ const PopoverWithButton = (props) => {
|
|
|
19
19
|
onClick={handleTogglePopover}
|
|
20
20
|
variant="secondary"
|
|
21
21
|
>
|
|
22
|
-
<Flex
|
|
22
|
+
<Flex
|
|
23
|
+
align="center"
|
|
24
|
+
gap="xxs"
|
|
25
|
+
>
|
|
23
26
|
{"Filter By"}
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
fixedWidth
|
|
30
|
-
icon="angle-down"
|
|
31
|
-
margin-left="xxs"
|
|
32
|
-
/>
|
|
33
|
-
</Flex>
|
|
27
|
+
<Icon
|
|
28
|
+
fixedWidth
|
|
29
|
+
flip={showPopover ? "vertical" : "none"}
|
|
30
|
+
icon="angle-down"
|
|
31
|
+
/>
|
|
34
32
|
</Flex>
|
|
35
33
|
</Button>
|
|
36
34
|
)
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
<div style="max-height: 320px; overflow-y: auto;">
|
|
2
|
+
<%= pb_rails("table", props: { sticky: true }) do %>
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Column 1</th>
|
|
6
|
+
<th>Column 2</th>
|
|
7
|
+
<th>Column 3</th>
|
|
8
|
+
<th>Column 4</th>
|
|
9
|
+
<th>Column 5</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>Value 1</td>
|
|
15
|
+
<td>Value 2</td>
|
|
16
|
+
<td>Value 3</td>
|
|
17
|
+
<td>Value 4</td>
|
|
18
|
+
<td>Value 5</td>
|
|
19
|
+
</tr>
|
|
20
|
+
<tr>
|
|
21
|
+
<td>Value 1</td>
|
|
22
|
+
<td>Value 2</td>
|
|
23
|
+
<td>Value 3</td>
|
|
24
|
+
<td>Value 4</td>
|
|
25
|
+
<td>Value 5</td>
|
|
26
|
+
</tr>
|
|
27
|
+
<tr>
|
|
28
|
+
<td>Value 1</td>
|
|
29
|
+
<td>Value 2</td>
|
|
30
|
+
<td>Value 3</td>
|
|
31
|
+
<td>Value 4</td>
|
|
32
|
+
<td>Value 5</td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td>Value 1</td>
|
|
36
|
+
<td>Value 2</td>
|
|
37
|
+
<td>Value 3</td>
|
|
38
|
+
<td>Value 4</td>
|
|
39
|
+
<td>Value 5</td>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td>Value 1</td>
|
|
43
|
+
<td>Value 2</td>
|
|
44
|
+
<td>Value 3</td>
|
|
45
|
+
<td>Value 4</td>
|
|
46
|
+
<td>Value 5</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td>Value 1</td>
|
|
50
|
+
<td>Value 2</td>
|
|
51
|
+
<td>Value 3</td>
|
|
52
|
+
<td>Value 4</td>
|
|
53
|
+
<td>Value 5</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td>Value 1</td>
|
|
57
|
+
<td>Value 2</td>
|
|
58
|
+
<td>Value 3</td>
|
|
59
|
+
<td>Value 4</td>
|
|
60
|
+
<td>Value 5</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>Value 1</td>
|
|
64
|
+
<td>Value 2</td>
|
|
65
|
+
<td>Value 3</td>
|
|
66
|
+
<td>Value 4</td>
|
|
67
|
+
<td>Value 5</td>
|
|
68
|
+
</tr>
|
|
69
|
+
<tr>
|
|
70
|
+
<td>Value 1</td>
|
|
71
|
+
<td>Value 2</td>
|
|
72
|
+
<td>Value 3</td>
|
|
73
|
+
<td>Value 4</td>
|
|
74
|
+
<td>Value 5</td>
|
|
75
|
+
</tr>
|
|
76
|
+
<tr>
|
|
77
|
+
<td>Value 1</td>
|
|
78
|
+
<td>Value 2</td>
|
|
79
|
+
<td>Value 3</td>
|
|
80
|
+
<td>Value 4</td>
|
|
81
|
+
<td>Value 5</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</tbody>
|
|
84
|
+
<% end %>
|
|
85
|
+
</div>
|