playbook_ui_docs 15.7.0.pre.alpha.play270013253 → 15.7.0.pre.rc.0
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_background_control_rails.html.erb +5 -11
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +55 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +42 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +55 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +69 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +58 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +14 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +40 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +15 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +48 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +62 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +136 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +17 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +23 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +52 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +86 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +20 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +46 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +22 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +55 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +28 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +26 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +88 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +20 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +44 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +20 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +43 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +5 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +19 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +136 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +152 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +86 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +142 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +14 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +63 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +22 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +37 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +61 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +22 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +41 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +55 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +26 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_contact/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +14 -23
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +5 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -2
- data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +36 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +2 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +2 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +32 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +146 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +30 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +36 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +49 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +62 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +76 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +54 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +27 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +80 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +2 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +38 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +72 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +27 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +26 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +56 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +2 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +3 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +26 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +52 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +26 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +70 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +3 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +15 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +43 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +16 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +49 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +62 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +129 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +14 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +18 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +2 -2
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +2 -3
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
- metadata +113 -70
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +0 -54
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +0 -3
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.html.erb +0 -33
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.jsx +0 -46
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_rails.md +0 -2
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_react.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +0 -24
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +0 -60
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +0 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +0 -71
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +0 -57
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.html.erb +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.html.erb +0 -12
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.md +0 -26
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.html.erb +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.html.erb +0 -30
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md +0 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb +0 -29
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md +0 -13
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +0 -14
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +0 -134
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +0 -101
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +0 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +0 -180
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +0 -122
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +0 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.html.erb +0 -6
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.jsx +0 -25
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.html.erb +0 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.jsx +0 -16
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_24_hour.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.jsx +0 -13
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.html.erb +0 -4
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.jsx +0 -29
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_default_time.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_disabled.html.erb +0 -13
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_disabled.jsx +0 -23
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_error.html.erb +0 -5
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_error.jsx +0 -15
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_input_options.html.erb +0 -14
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_label.html.erb +0 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_label.jsx +0 -15
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.html.erb +0 -42
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.jsx +0 -52
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +0 -45
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.html.erb +0 -3
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.jsx +0 -21
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +0 -24
- data/app/pb_kits/playbook/pb_time_picker/docs/index.js +0 -9
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
|
@@ -20,14 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
%>
|
|
22
22
|
|
|
23
|
-
<%= pb_rails("dropdown", props: {
|
|
23
|
+
<%= pb_rails("dropdown", props: {options: options}) %>
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
26
|
document.addEventListener("pb:dropdown:selected", (e) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
});
|
|
27
|
+
const option = e.detail;
|
|
28
|
+
const dropdown = e.target;
|
|
29
|
+
console.log("Selected option:", option);
|
|
30
|
+
})
|
|
33
31
|
</script>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
%>
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
<%= pb_rails("dropdown", props: {
|
|
50
|
+
<%= pb_rails("dropdown", props: {options: options}) do %>
|
|
51
51
|
<%= pb_rails("dropdown/dropdown_trigger", props: {placeholder: "Select a User", custom_display: custom_display}) %>
|
|
52
52
|
<%= pb_rails("dropdown/dropdown_container") do %>
|
|
53
53
|
<% options.each do |option| %>
|
|
@@ -71,8 +71,6 @@
|
|
|
71
71
|
|
|
72
72
|
<script>
|
|
73
73
|
document.addEventListener("pb:dropdown:selected", (e) => {
|
|
74
|
-
if (e.target.id !== "user-dropdown") return;
|
|
75
|
-
|
|
76
74
|
const option = e.detail;
|
|
77
75
|
const dropdown = e.target;
|
|
78
76
|
|
|
@@ -22,11 +22,6 @@ examples:
|
|
|
22
22
|
- dropdown_multi_select_with_default: Multi Select Default Value
|
|
23
23
|
- dropdown_blank_selection: Blank Selection
|
|
24
24
|
- dropdown_separators_hidden: Separators Hidden
|
|
25
|
-
- dropdown_quickpick_rails: Quick Pick Variant
|
|
26
|
-
- dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
|
|
27
|
-
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
28
|
-
- dropdown_quickpick_with_date_pickers_rails: Quick Pick with Date Pickers
|
|
29
|
-
- dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
|
|
30
25
|
|
|
31
26
|
react:
|
|
32
27
|
- dropdown_default: Default
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
|
|
117
117
|
<%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true } %>
|
|
118
118
|
<%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form-default", tree_data: treeData, margin_bottom: "sm", label: "Example Multi Level Select field" } %>
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
<%= form.actions do |action| %>
|
|
121
121
|
<%= action.submit %>
|
|
122
122
|
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
|
@@ -117,8 +117,7 @@
|
|
|
117
117
|
<%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
|
|
118
118
|
<%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
|
|
119
119
|
<%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form", tree_data: treeData, margin_bottom: "sm", required: true, label: "Example Multi Level Select field" } %>
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
|
|
122
121
|
<%= form.actions do |action| %>
|
|
123
122
|
<%= action.submit %>
|
|
124
123
|
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**Important Note for the React Kit**: In order to leverage this kit, you must install `highcharts` and `highcharts-react-official` into your project as shown below. To then apply Playbook styles to your Highchart, import gaugeTheme.ts from playbook-ui and merge it with your Highchart options. Then, pass the merged value to the options prop. Playbook’s styling will be applied automatically. See the examples in the documentation below.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
|
3
|
+
import Highcharts from "highcharts"
|
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
7
|
+
import colors from '../../tokens/exports/_colors.module.scss'
|
|
8
|
+
|
|
9
|
+
HighchartsMore(Highcharts);
|
|
10
|
+
SolidGauge(Highcharts);
|
|
11
|
+
|
|
12
|
+
const data = [{ name: "Name", y: 67 }]
|
|
13
|
+
|
|
14
|
+
const baseOptions = {
|
|
15
|
+
series: [{ data: data }],
|
|
16
|
+
plotOptions: {
|
|
17
|
+
solidgauge: {
|
|
18
|
+
borderColor: colors.data_7,
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const GaugeColors = () => {
|
|
24
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<HighchartsReact
|
|
29
|
+
highcharts={Highcharts}
|
|
30
|
+
options={options}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default GaugeColors;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Custom data colors allow for color customization to match the needs of business requirements.
|
|
2
|
+
Pass the prop `plotOptions.solidgauge.borderColor` with a Playbook token like `colors.` + `data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8`. Hex colors are also available `eg: #CA0095`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<%= pb_rails("flex", props: {wrap: true, padding: "xl", gap: "sm"}) do %>
|
|
2
|
+
<%= pb_rails("flex/flex_item", props: {flex: 1, grow: true }) do %>
|
|
3
|
+
<%= pb_rails("card", props: {max_width: "xs", padding: "md", }) do %>
|
|
4
|
+
<%= pb_rails("title", props: {padding_bottom: "sm", size: 4, text: "Abandoned Calls" })%>
|
|
5
|
+
<%= pb_rails("flex", props: {align: "stretch"}) do %>
|
|
6
|
+
<%= pb_rails("flex", props: {margin_right: "sm", orientation: "column"}) do %>
|
|
7
|
+
<%= pb_rails("body", props: {color: "light", padding_bottom: "sm",text: "Total Abandoned"}) %>
|
|
8
|
+
<%= pb_rails("flex", props: {align: "baseline", padding_bottom: "sx"}) do %>
|
|
9
|
+
<%= pb_rails("title", props: {size: 1, text: "39"})%>
|
|
10
|
+
<%= pb_rails("title", props: {color: "light", size: 3, text: "calls"}) %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<%= pb_rails("caption", props: {size: "xs", text: "of 390" }) %>
|
|
13
|
+
<%end %>
|
|
14
|
+
<%= pb_rails("section_separator", props: {align_self: "stretch", margin_right: "sm", orientation: "vertical" }) %>
|
|
15
|
+
<%= pb_rails("flex", props: {orientation: "column", wrap: true}) do %>
|
|
16
|
+
<%= pb_rails("body", props: {color: "light", text: "% Abandoned"}) %>
|
|
17
|
+
<%= pb_rails("flex", props: {wrap: true}) do %>
|
|
18
|
+
<%= pb_rails("flex/flex_item", props: {fixed_size: "150px", overflow: "hidden", shrink: true}) do %>
|
|
19
|
+
<%= pb_rails("gauge", props: {
|
|
20
|
+
chart_data: [{ name: "Name", value: 10 }],
|
|
21
|
+
disable_animation: true,
|
|
22
|
+
height: '150',
|
|
23
|
+
id: "gauge-complex",
|
|
24
|
+
suffix: "%"
|
|
25
|
+
}) %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% end %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<%end %>
|
|
30
|
+
<% end %>
|
|
31
|
+
<% end %>
|
|
32
|
+
<% end %>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import Flex from '../../pb_flex/_flex'
|
|
4
|
+
import FlexItem from '../../pb_flex/_flex_item'
|
|
5
|
+
import Card from '../../pb_card/_card'
|
|
6
|
+
import Caption from '../../pb_caption/_caption'
|
|
7
|
+
import Body from '../../pb_body/_body'
|
|
8
|
+
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
|
9
|
+
import Title from '../../pb_title/_title'
|
|
10
|
+
import gaugeTheme from '../gaugeTheme'
|
|
11
|
+
import Highcharts from "highcharts"
|
|
12
|
+
import HighchartsReact from "highcharts-react-official"
|
|
13
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
14
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
15
|
+
import colors from '../../tokens/exports/_colors.module.scss'
|
|
16
|
+
import typography from '../../tokens/exports/_typography.module.scss'
|
|
17
|
+
|
|
18
|
+
HighchartsMore(Highcharts);
|
|
19
|
+
SolidGauge(Highcharts);
|
|
20
|
+
|
|
21
|
+
const data = [{ name: "Name", y: 10 }];
|
|
22
|
+
|
|
23
|
+
const baseOptions = {
|
|
24
|
+
series: [{ data: data }],
|
|
25
|
+
chart: {
|
|
26
|
+
height: "150",
|
|
27
|
+
},
|
|
28
|
+
plotOptions: {
|
|
29
|
+
series: {
|
|
30
|
+
animation: false,
|
|
31
|
+
},
|
|
32
|
+
solidgauge: {
|
|
33
|
+
dataLabels: {
|
|
34
|
+
format:
|
|
35
|
+
`<span class="fix">{y:,f}</span>` +
|
|
36
|
+
`<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
|
43
|
+
|
|
44
|
+
const GaugeComplex = (props) => (
|
|
45
|
+
<Flex
|
|
46
|
+
gap="sm"
|
|
47
|
+
padding="xl"
|
|
48
|
+
wrap
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<FlexItem
|
|
52
|
+
flex={1}
|
|
53
|
+
grow
|
|
54
|
+
{...props}
|
|
55
|
+
>
|
|
56
|
+
<Card
|
|
57
|
+
maxWidth="xs"
|
|
58
|
+
padding="md"
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
<Title
|
|
62
|
+
paddingBottom="sm"
|
|
63
|
+
size={4}
|
|
64
|
+
text="Abandoned Calls"
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
<Flex
|
|
68
|
+
align="stretch"
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
<Flex
|
|
72
|
+
marginRight="sm"
|
|
73
|
+
orientation="column"
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<Body
|
|
77
|
+
color="light"
|
|
78
|
+
paddingBottom="sm"
|
|
79
|
+
text="Total Abandoned"
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
<Flex
|
|
83
|
+
align="baseline"
|
|
84
|
+
paddingBottom="xs"
|
|
85
|
+
{...props}
|
|
86
|
+
>
|
|
87
|
+
<Title
|
|
88
|
+
size={1}
|
|
89
|
+
text="39"
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
<Title
|
|
93
|
+
color="light"
|
|
94
|
+
size={3}
|
|
95
|
+
text="calls"
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
</Flex>
|
|
99
|
+
<Caption
|
|
100
|
+
size="xs"
|
|
101
|
+
text="of 390"
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
</Flex>
|
|
105
|
+
|
|
106
|
+
<SectionSeparator
|
|
107
|
+
alignSelf="stretch"
|
|
108
|
+
marginRight="sm"
|
|
109
|
+
orientation="vertical"
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<Flex
|
|
114
|
+
orientation="column"
|
|
115
|
+
wrap
|
|
116
|
+
{...props}
|
|
117
|
+
>
|
|
118
|
+
<Body
|
|
119
|
+
color="light"
|
|
120
|
+
text="% Abandoned"
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
<Flex
|
|
124
|
+
wrap
|
|
125
|
+
{...props}
|
|
126
|
+
>
|
|
127
|
+
<FlexItem
|
|
128
|
+
fixedSize="150px"
|
|
129
|
+
overflow="hidden"
|
|
130
|
+
shrink
|
|
131
|
+
{...props}
|
|
132
|
+
>
|
|
133
|
+
<HighchartsReact
|
|
134
|
+
highcharts={Highcharts}
|
|
135
|
+
options={options}
|
|
136
|
+
/>
|
|
137
|
+
</FlexItem>
|
|
138
|
+
</Flex>
|
|
139
|
+
</Flex>
|
|
140
|
+
</Flex>
|
|
141
|
+
</Card>
|
|
142
|
+
</FlexItem>
|
|
143
|
+
</Flex>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
export default GaugeComplex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
We are able to wrap our Gauge kits within multiple other Flex and Card components.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
We are able to wrap the Highcharts Gauge kit within Playbook kits (such as Flex and Card components).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
|
3
|
+
import Highcharts from "highcharts"
|
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
7
|
+
|
|
8
|
+
HighchartsMore(Highcharts);
|
|
9
|
+
SolidGauge(Highcharts);
|
|
10
|
+
|
|
11
|
+
const data = [{ name: "Name", y: 45 }]
|
|
12
|
+
|
|
13
|
+
const baseOptions = {
|
|
14
|
+
series: [{ data: data }],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const GaugeDefault = () => {
|
|
18
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
<HighchartsReact
|
|
23
|
+
highcharts={Highcharts}
|
|
24
|
+
options={options}
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default GaugeDefault;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
|
3
|
+
import Highcharts from "highcharts"
|
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
7
|
+
|
|
8
|
+
HighchartsMore(Highcharts);
|
|
9
|
+
SolidGauge(Highcharts);
|
|
10
|
+
|
|
11
|
+
const data = [{ name: "Participants", y: 84 }]
|
|
12
|
+
|
|
13
|
+
const baseOptions = {
|
|
14
|
+
series: [{ data: data }],
|
|
15
|
+
plotOptions: {
|
|
16
|
+
series: {
|
|
17
|
+
animation: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const GaugeDisableAnimation = () => {
|
|
23
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<HighchartsReact
|
|
28
|
+
disableAnimation
|
|
29
|
+
highcharts={Highcharts}
|
|
30
|
+
options={options}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default GaugeDisableAnimation;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
|
3
|
+
import Highcharts from "highcharts"
|
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
7
|
+
import colors from '../../tokens/exports/_colors.module.scss'
|
|
8
|
+
import typography from '../../tokens/exports/_typography.module.scss'
|
|
9
|
+
|
|
10
|
+
HighchartsMore(Highcharts);
|
|
11
|
+
SolidGauge(Highcharts);
|
|
12
|
+
|
|
13
|
+
const data = [{ name: "Capacity", y: 75 }]
|
|
14
|
+
|
|
15
|
+
const baseOptions = {
|
|
16
|
+
title: {
|
|
17
|
+
text: "Seating Capacity",
|
|
18
|
+
},
|
|
19
|
+
series: [{ data: data }],
|
|
20
|
+
pane: {
|
|
21
|
+
startAngle: 0,
|
|
22
|
+
endAngle: 360,
|
|
23
|
+
},
|
|
24
|
+
plotOptions: {
|
|
25
|
+
solidgauge: {
|
|
26
|
+
dataLabels: {
|
|
27
|
+
format:
|
|
28
|
+
`<span class="fix">{y:,f}</span>` +
|
|
29
|
+
`<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const GaugeFullCircle = () => {
|
|
36
|
+
const options = Highcharts.merge({}, gaugeTheme, baseOptions);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
<HighchartsReact
|
|
41
|
+
highcharts={Highcharts}
|
|
42
|
+
id="gauge-full-circle"
|
|
43
|
+
options={options}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default GaugeFullCircle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<%= pb_rails("gauge", props: {
|
|
2
|
+
id: "gauge-height-px",
|
|
3
|
+
chart_data: [{ name: "Pixels", value: 400 }],
|
|
4
|
+
height: '400',
|
|
5
|
+
title: "Fixed Height in Pixels",
|
|
6
|
+
suffix: "px"
|
|
7
|
+
}) %>
|
|
8
|
+
|
|
9
|
+
<%= pb_rails("gauge", props: {
|
|
10
|
+
id: "gauge-height-percent",
|
|
11
|
+
chart_data: [{ name: "Percentage", value: 45 }],
|
|
12
|
+
height: '45%',
|
|
13
|
+
title: "Height as Percentage of Width",
|
|
14
|
+
suffix: "%"
|
|
15
|
+
}) %>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import gaugeTheme from '../gaugeTheme'
|
|
3
|
+
import Highcharts from "highcharts"
|
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
|
5
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
6
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
7
|
+
import colors from '../../tokens/exports/_colors.module.scss'
|
|
8
|
+
import typography from '../../tokens/exports/_typography.module.scss'
|
|
9
|
+
|
|
10
|
+
HighchartsMore(Highcharts);
|
|
11
|
+
SolidGauge(Highcharts);
|
|
12
|
+
|
|
13
|
+
const GaugeHeight = () => {
|
|
14
|
+
return (
|
|
15
|
+
<div>
|
|
16
|
+
<HighchartsReact
|
|
17
|
+
highcharts={Highcharts}
|
|
18
|
+
options={Highcharts.merge({}, gaugeTheme, {
|
|
19
|
+
title: {
|
|
20
|
+
text: "Fixed Height in Pixels",
|
|
21
|
+
},
|
|
22
|
+
chart: {
|
|
23
|
+
height: "400",
|
|
24
|
+
},
|
|
25
|
+
series: [{ data: [{ name: "Pixels", y: 400 }] }],
|
|
26
|
+
plotOptions: {
|
|
27
|
+
solidgauge: {
|
|
28
|
+
dataLabels: {
|
|
29
|
+
format:
|
|
30
|
+
`<span class="fix">{y:,f}</span>` +
|
|
31
|
+
`<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">px</span>`,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
})}
|
|
36
|
+
/>
|
|
37
|
+
<HighchartsReact
|
|
38
|
+
highcharts={Highcharts}
|
|
39
|
+
options={Highcharts.merge({}, gaugeTheme, {
|
|
40
|
+
title: {
|
|
41
|
+
text: "Height as Percentage of Width",
|
|
42
|
+
},
|
|
43
|
+
chart: {
|
|
44
|
+
height: "45%",
|
|
45
|
+
},
|
|
46
|
+
series: [{ data: [{ name: "Percentage", y: 45 }] }],
|
|
47
|
+
plotOptions: {
|
|
48
|
+
solidgauge: {
|
|
49
|
+
dataLabels: {
|
|
50
|
+
format:
|
|
51
|
+
`<span class="fix">{y:,f}</span>` +
|
|
52
|
+
`<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
})}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default GaugeHeight;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useState, useRef } from 'react'
|
|
2
|
+
import Button from '../../pb_button/_button'
|
|
3
|
+
import gaugeTheme from '../gaugeTheme'
|
|
4
|
+
import Highcharts from "highcharts"
|
|
5
|
+
import HighchartsReact from "highcharts-react-official"
|
|
6
|
+
import HighchartsMore from "highcharts/highcharts-more"
|
|
7
|
+
import SolidGauge from "highcharts/modules/solid-gauge"
|
|
8
|
+
|
|
9
|
+
HighchartsMore(Highcharts);
|
|
10
|
+
SolidGauge(Highcharts);
|
|
11
|
+
|
|
12
|
+
const GaugeLiveData = (props) => {
|
|
13
|
+
const [value, setValue] = useState(50)
|
|
14
|
+
const [name, setName] = useState('Name')
|
|
15
|
+
const chartRef = useRef(null)
|
|
16
|
+
|
|
17
|
+
const namesArray = ['Name', 'Windows', 'Doors', 'Roofing', 'Siding', 'Gutters']
|
|
18
|
+
|
|
19
|
+
const updateValue = () => {
|
|
20
|
+
const newValue = Math.floor(Math.random() * 100)
|
|
21
|
+
setValue(newValue)
|
|
22
|
+
|
|
23
|
+
const chart = chartRef.current?.chart
|
|
24
|
+
if (chart) {
|
|
25
|
+
chart.series[0].points[0].update(newValue)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const updateName = () => {
|
|
30
|
+
let index = namesArray.indexOf(name)
|
|
31
|
+
if (namesArray.indexOf(name) == 5) {
|
|
32
|
+
index = 0
|
|
33
|
+
} else {
|
|
34
|
+
index += 1
|
|
35
|
+
}
|
|
36
|
+
setName(namesArray[index])
|
|
37
|
+
|
|
38
|
+
const chart = chartRef.current?.chart
|
|
39
|
+
if (chart) {
|
|
40
|
+
chart.series[0].points[0].update({ name: namesArray[index] })
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const options = Highcharts.merge({}, gaugeTheme,
|
|
45
|
+
{
|
|
46
|
+
title: {
|
|
47
|
+
text: name,
|
|
48
|
+
},
|
|
49
|
+
series: [{
|
|
50
|
+
data: [{ name: name, y: value }]
|
|
51
|
+
}]
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
<Button
|
|
58
|
+
onClick={updateValue}
|
|
59
|
+
text="Update Value"
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
<Button
|
|
63
|
+
onClick={updateName}
|
|
64
|
+
text="Update Name"
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
<HighchartsReact
|
|
68
|
+
highcharts={Highcharts}
|
|
69
|
+
options={options}
|
|
70
|
+
ref={chartRef}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default GaugeLiveData
|