playbook_ui 15.1.0.pre.alpha.typeaheadscss11143 → 15.1.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/_playbook.scss +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +11 -24
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +2 -7
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +13 -67
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_card/_card.scss +4 -12
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -10
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +0 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +0 -8
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +0 -1
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +0 -5
- data/app/pb_kits/playbook/pb_contact/contact.rb +0 -4
- data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -21
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -16
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +0 -15
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +0 -6
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +0 -6
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -6
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +4 -48
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +7 -5
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +65 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.html.erb +16 -16
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx +1 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.html.erb +31 -31
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +3 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +0 -11
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +2 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +21 -15
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -6
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +0 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +3 -11
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +8 -9
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +5 -19
- data/app/pb_kits/playbook/pb_nav/_nav.scss +0 -27
- data/app/pb_kits/playbook/pb_nav/_nav.test.js +0 -16
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +0 -5
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -6
- data/app/pb_kits/playbook/pb_nav/nav.rb +1 -6
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +5 -13
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +0 -23
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +7 -45
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +6 -14
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +4 -8
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +0 -5
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +1 -3
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +0 -6
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +8 -24
- data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +10 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +9 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +17 -3
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +15 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +6 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +7 -29
- data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +4 -69
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -39
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -2
- data/dist/chunks/{_line_graph-B-1uF3pN.js → _line_graph-CnQWoGfx.js} +1 -1
- data/dist/chunks/{_typeahead-C8eN5nhR.js → _typeahead-_Pft9jZd.js} +2 -2
- data/dist/chunks/_weekday_stacked-D_gm5opl.js +37 -0
- data/dist/chunks/{lib-QZuu1ltS.js → lib-CY5ZPzic.js} +1 -1
- data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-D3b0JKHH.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -16
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/engine.rb +1 -0
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -37
- data/lib/playbook/kit_base.rb +2 -23
- data/lib/playbook/version.rb +2 -2
- metadata +28 -112
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb +0 -31
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md +0 -7
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb +0 -21
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.md +0 -7
- data/app/pb_kits/playbook/pb_button/index.js +0 -99
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +0 -5
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.html.erb +0 -6
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.jsx +0 -39
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +0 -49
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +0 -38
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +0 -46
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +0 -47
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +0 -60
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +0 -25
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +0 -36
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +0 -44
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +0 -100
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +0 -126
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +0 -32
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +0 -48
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +0 -68
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +0 -81
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +0 -31
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +0 -42
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +0 -28
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +0 -31
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +0 -3
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +0 -62
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +0 -31
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +0 -81
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +0 -25
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +0 -40
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +0 -5
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +0 -27
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +0 -39
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +0 -5
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +0 -93
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +0 -131
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +0 -42
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +0 -58
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +0 -24
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +0 -38
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +0 -22
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +0 -33
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +0 -118
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +0 -144
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +0 -60
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +0 -24
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +0 -42
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +0 -38
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +0 -52
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +0 -29
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +0 -88
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +0 -28
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +0 -51
- data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +0 -165
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +0 -12
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +0 -25
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +0 -4
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +0 -17
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +0 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +0 -44
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +0 -26
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +0 -41
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +0 -1
- data/dist/chunks/_weekday_stacked-1o7KVL87.js +0 -37
- data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
|
@@ -2,30 +2,18 @@ examples:
|
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
4
|
- timestamp_default: Default
|
|
5
|
-
- timestamp_show_date: Hide Date
|
|
6
|
-
- timestamp_show_time: Hide Time
|
|
7
|
-
- timestamp_show_current_year: Show Current Year
|
|
8
|
-
- timestamp_timezones: Show Timezones
|
|
9
5
|
- timestamp_align: Alignments
|
|
10
|
-
-
|
|
11
|
-
- timestamp_updated: Last Updated by
|
|
12
|
-
-
|
|
13
|
-
- timestamp_updated_show_date: Last Updated by (Updated Variant) - Hide Date
|
|
14
|
-
- timestamp_updated_show_time: Last Updated by (Updated Variant) - Hide Time
|
|
6
|
+
- timestamp_timezones: Timezones
|
|
7
|
+
- timestamp_updated: Last Updated by
|
|
8
|
+
- timestamp_elapsed: Time Ago
|
|
15
9
|
- timestamp_unstyled: Unstyled
|
|
16
10
|
|
|
17
11
|
react:
|
|
18
12
|
- timestamp_default: Default
|
|
19
|
-
- timestamp_show_date: Hide Date
|
|
20
|
-
- timestamp_show_time: Hide Time
|
|
21
|
-
- timestamp_show_current_year: Show Current Year
|
|
22
|
-
- timestamp_timezones: Show Timezones
|
|
23
13
|
- timestamp_align: Alignments
|
|
24
|
-
-
|
|
25
|
-
- timestamp_updated: Last Updated by
|
|
26
|
-
-
|
|
27
|
-
- timestamp_updated_show_date: Last Updated by (Updated Variant) - Hide Date
|
|
28
|
-
- timestamp_updated_show_time: Last Updated by (Updated Variant) - Hide Time
|
|
14
|
+
- timestamp_timezones: Timezones
|
|
15
|
+
- timestamp_updated: Last Updated by
|
|
16
|
+
- timestamp_elapsed: Time Ago
|
|
29
17
|
- timestamp_unstyled: Unstyled
|
|
30
18
|
|
|
31
19
|
swift:
|
|
@@ -4,9 +4,3 @@ export { default as TimestampTimezones } from './_timestamp_timezones.jsx'
|
|
|
4
4
|
export { default as TimestampUpdated } from './_timestamp_updated.jsx'
|
|
5
5
|
export { default as TimestampElapsed } from './_timestamp_elapsed.jsx'
|
|
6
6
|
export { default as TimestampUnstyled } from './_timestamp_unstyled.jsx'
|
|
7
|
-
export { default as TimestampShowDate } from './_timestamp_show_date.jsx'
|
|
8
|
-
export { default as TimestampShowTime } from './_timestamp_show_time.jsx'
|
|
9
|
-
export { default as TimestampShowCurrentYear } from './_timestamp_show_current_year.jsx'
|
|
10
|
-
export { default as TimestampUpdatedShowCurrentYear } from './_timestamp_updated_show_current_year.jsx'
|
|
11
|
-
export { default as TimestampUpdatedShowDate } from './_timestamp_updated_show_date.jsx'
|
|
12
|
-
export { default as TimestampUpdatedShowTime } from './_timestamp_updated_show_time.jsx'
|
|
@@ -14,12 +14,8 @@ module Playbook
|
|
|
14
14
|
default: "left"
|
|
15
15
|
prop :hide_updated, type: Playbook::Props::Boolean,
|
|
16
16
|
default: false
|
|
17
|
-
prop :show_current_year, type: Playbook::Props::Boolean,
|
|
18
|
-
default: false
|
|
19
17
|
prop :show_date, type: Playbook::Props::Boolean,
|
|
20
18
|
default: true
|
|
21
|
-
prop :show_time, type: Playbook::Props::Boolean,
|
|
22
|
-
default: true
|
|
23
19
|
prop :show_timezone, type: Playbook::Props::Boolean,
|
|
24
20
|
default: false
|
|
25
21
|
prop :show_user, type: Playbook::Props::Boolean,
|
|
@@ -54,22 +50,14 @@ module Playbook
|
|
|
54
50
|
when "elapsed"
|
|
55
51
|
format_elapsed_string
|
|
56
52
|
else
|
|
57
|
-
|
|
58
|
-
datetime_or_text
|
|
59
|
-
elsif show_date && !show_time
|
|
60
|
-
timestamp ? format_date_string : text
|
|
61
|
-
elsif !show_date && show_time
|
|
62
|
-
format_time_string
|
|
63
|
-
else
|
|
64
|
-
text
|
|
65
|
-
end
|
|
53
|
+
show_date ? datetime_or_text : format_time_string
|
|
66
54
|
end
|
|
67
55
|
end
|
|
68
56
|
|
|
69
57
|
private
|
|
70
58
|
|
|
71
59
|
def format_year_string
|
|
72
|
-
pb_date_time.to_year != DateTime.now.year.to_s
|
|
60
|
+
pb_date_time.to_year != DateTime.now.year.to_s ? ", #{pb_date_time.to_year}" : ""
|
|
73
61
|
end
|
|
74
62
|
|
|
75
63
|
def format_time_string
|
|
@@ -85,24 +73,14 @@ module Playbook
|
|
|
85
73
|
end
|
|
86
74
|
|
|
87
75
|
def format_datetime_string
|
|
88
|
-
|
|
89
|
-
"#{format_date_string} · #{format_time_string}".html_safe
|
|
90
|
-
else
|
|
91
|
-
format_date_string
|
|
92
|
-
end
|
|
76
|
+
"#{format_date_string} · #{format_time_string}".html_safe
|
|
93
77
|
end
|
|
94
78
|
|
|
95
79
|
def format_updated_string
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
elsif show_date && show_time
|
|
101
|
-
final_updated_string << "on #{format_date_string} at #{format_time_string}"
|
|
102
|
-
elsif show_time && !show_date
|
|
103
|
-
final_updated_string << "at #{format_time_string}"
|
|
104
|
-
end
|
|
105
|
-
"Last updated #{final_updated_string.join(' ')}"
|
|
80
|
+
user_string = show_user ? " by #{text}" : ""
|
|
81
|
+
datetime_string = " on #{format_date_string} at #{format_time_string}"
|
|
82
|
+
|
|
83
|
+
"Last updated#{user_string}#{datetime_string}"
|
|
106
84
|
end
|
|
107
85
|
|
|
108
86
|
def format_elapsed_string
|
|
@@ -102,6 +102,7 @@ describe("Timestamp Kit", () => {
|
|
|
102
102
|
render(
|
|
103
103
|
<Timestamp
|
|
104
104
|
data={{ testid: testId }}
|
|
105
|
+
showDate={false}
|
|
105
106
|
showUser
|
|
106
107
|
text="Maricris Nonato"
|
|
107
108
|
timestamp={new Date()}
|
|
@@ -111,7 +112,7 @@ describe("Timestamp Kit", () => {
|
|
|
111
112
|
const kit = screen.getByTestId(testId);
|
|
112
113
|
const text = kit.querySelector(".pb_caption_kit_xs");
|
|
113
114
|
expect(text.textContent).toEqual(
|
|
114
|
-
"Last updated
|
|
115
|
+
"Last updated by Maricris Nonato on Jan 1 at 12:00a"
|
|
115
116
|
);
|
|
116
117
|
});
|
|
117
118
|
|
|
@@ -119,13 +120,14 @@ describe("Timestamp Kit", () => {
|
|
|
119
120
|
render(
|
|
120
121
|
<Timestamp
|
|
121
122
|
data={{ testid: testId }}
|
|
123
|
+
showDate={false}
|
|
122
124
|
timestamp={new Date()}
|
|
123
125
|
variant="updated"
|
|
124
126
|
/>
|
|
125
127
|
);
|
|
126
128
|
const kit = screen.getByTestId(testId);
|
|
127
129
|
const text = kit.querySelector(".pb_caption_kit_xs");
|
|
128
|
-
expect(text.textContent).toEqual("Last updated
|
|
130
|
+
expect(text.textContent).toEqual("Last updated on Jan 1 at 12:00a");
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
test("renders Timestamp elapsed variant with user", () => {
|
|
@@ -160,70 +162,3 @@ describe("Timestamp Kit", () => {
|
|
|
160
162
|
expect(text.textContent).toEqual(" a few seconds ago");
|
|
161
163
|
});
|
|
162
164
|
});
|
|
163
|
-
|
|
164
|
-
test("default variant: time only when showDate=false", () => {
|
|
165
|
-
render(
|
|
166
|
-
<Timestamp
|
|
167
|
-
data={{ testid: testId }}
|
|
168
|
-
showDate={false}
|
|
169
|
-
showTime
|
|
170
|
-
timestamp={new Date()}
|
|
171
|
-
/>
|
|
172
|
-
)
|
|
173
|
-
const text = screen.getByTestId(testId).querySelector(".pb_caption_kit_xs")
|
|
174
|
-
expect(text?.textContent).toEqual("12:00a")
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
test("default variant: date only when showTime=false (no year for current year)", () => {
|
|
178
|
-
render(
|
|
179
|
-
<Timestamp
|
|
180
|
-
data={{ testid: testId }}
|
|
181
|
-
showTime={false}
|
|
182
|
-
timestamp={new Date()}
|
|
183
|
-
/>
|
|
184
|
-
)
|
|
185
|
-
const text = screen.getByTestId(testId).querySelector(".pb_caption_kit_xs")
|
|
186
|
-
expect(text?.textContent).toEqual("Jan 1")
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
test("default variant: date only with showCurrentYear=true forces year", () => {
|
|
190
|
-
render(
|
|
191
|
-
<Timestamp
|
|
192
|
-
data={{ testid: testId }}
|
|
193
|
-
showCurrentYear
|
|
194
|
-
showTime={false}
|
|
195
|
-
timestamp={new Date()}
|
|
196
|
-
/>
|
|
197
|
-
)
|
|
198
|
-
const text = screen.getByTestId(testId).querySelector(".pb_caption_kit_xs")
|
|
199
|
-
expect(text?.textContent).toEqual("Jan 1, 2020")
|
|
200
|
-
})
|
|
201
|
-
|
|
202
|
-
test('updated variant: "by user" + date only when showDate=true and showTime=false', () => {
|
|
203
|
-
render(
|
|
204
|
-
<Timestamp
|
|
205
|
-
data={{ testid: testId }}
|
|
206
|
-
showTime={false}
|
|
207
|
-
showUser
|
|
208
|
-
text="Maricris Nonato"
|
|
209
|
-
timestamp={new Date()}
|
|
210
|
-
variant="updated"
|
|
211
|
-
/>
|
|
212
|
-
)
|
|
213
|
-
const text = screen.getByTestId(testId).querySelector(".pb_caption_kit_xs")
|
|
214
|
-
expect(text?.textContent).toEqual("Last updated by Maricris Nonato on Jan 1")
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
test('updated variant: "at time" only when showDate=false and showTime=true', () => {
|
|
218
|
-
render(
|
|
219
|
-
<Timestamp
|
|
220
|
-
data={{ testid: testId }}
|
|
221
|
-
showDate={false}
|
|
222
|
-
timestamp={new Date()}
|
|
223
|
-
variant="updated"
|
|
224
|
-
/>
|
|
225
|
-
)
|
|
226
|
-
const text = screen.getByTestId(testId).querySelector(".pb_caption_kit_xs")
|
|
227
|
-
expect(text?.textContent).toEqual("Last updated at 12:00a")
|
|
228
|
-
})
|
|
229
|
-
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@import "../tokens/shadows";
|
|
5
5
|
@import "../tokens/positioning";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[class^=pb_typeahead_kit] {
|
|
8
8
|
.typeahead-kit-select__option {
|
|
9
9
|
cursor: pointer;
|
|
10
10
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
transition: opacity .15s ease-in-out;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
[class^=pb_text_input_kit] {
|
|
32
32
|
.text_input_wrapper {
|
|
33
33
|
.text_input {
|
|
34
34
|
max-height: none;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
[class^=pb_list_kit] {
|
|
51
51
|
max-height: 18em;
|
|
52
52
|
overflow-y: auto;
|
|
53
53
|
overscroll-behavior: contain;
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
border-radius: $border_rad_heavier;
|
|
61
61
|
transition: opacity .25s ease-in-out;
|
|
62
62
|
}
|
|
63
|
-
&:focus-within
|
|
63
|
+
&:focus-within [class^=pb_list_kit] {
|
|
64
64
|
display: block;
|
|
65
65
|
opacity: 1;
|
|
66
66
|
}
|
|
67
|
-
&:not(:focus-within)
|
|
67
|
+
&:not(:focus-within) [class^=pb_list_kit] {
|
|
68
68
|
display: none;
|
|
69
69
|
opacity: 0;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
[class^=pb_list_kit] {
|
|
72
72
|
li {
|
|
73
73
|
transition: background-color .25s ease-in-out;
|
|
74
74
|
}
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
.typeahead-plus-icon {
|
|
162
162
|
color: $text_lt_lighter;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
[class^=pb_badge_kit] span {
|
|
165
165
|
line-height: 16.5px;
|
|
166
166
|
letter-spacing: normal;
|
|
167
167
|
}
|
|
@@ -176,14 +176,14 @@
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
&[class*=dark] {
|
|
180
180
|
.pb_typeahead_wrapper .pb_typeahead_loading_indicator {
|
|
181
181
|
color: $text_dk_light;
|
|
182
182
|
}
|
|
183
183
|
.pb_text_input_kit_label {
|
|
184
184
|
color: $text_dk_light;
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
[class^=pb_text_input_kit].dark .text_input_wrapper .text_input {
|
|
187
187
|
display: inherit !important;
|
|
188
188
|
}
|
|
189
189
|
.typeahead-kit-select__menu {
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
.typeahead-kit-select__option--is-focused {
|
|
228
228
|
background-color: $active_dark;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
[class^=pb_list_kit] {
|
|
231
231
|
background-color: $bg_dark;
|
|
232
232
|
}
|
|
233
233
|
.pb_item_kit {
|
|
@@ -53,8 +53,6 @@ type TypeaheadProps = {
|
|
|
53
53
|
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
|
54
54
|
onChange?: any,
|
|
55
55
|
optionsByContext?: Record<string, Array<{ label: string; value?: string }>>
|
|
56
|
-
required?: boolean,
|
|
57
|
-
validation?: { message: string },
|
|
58
56
|
searchContextSelector?: string,
|
|
59
57
|
clearOnContextChange?: boolean,
|
|
60
58
|
preserveSearchInput?: boolean,
|
|
@@ -96,16 +94,12 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
96
94
|
onChange,
|
|
97
95
|
optionsByContext = {},
|
|
98
96
|
searchContextSelector,
|
|
99
|
-
required = false,
|
|
100
|
-
validation,
|
|
101
97
|
clearOnContextChange = false,
|
|
102
98
|
preserveSearchInput = false, // Default to false to maintain backward compatibility
|
|
103
99
|
...props
|
|
104
100
|
}: TypeaheadProps) => {
|
|
105
101
|
// State to manage the input value when preserveSearchInput is true
|
|
106
102
|
const [inputValue, setInputValue] = useState("")
|
|
107
|
-
// State to track if form has been submitted to control validation display for react rendered rails kit
|
|
108
|
-
const [formSubmitted, setFormSubmitted] = useState(false)
|
|
109
103
|
|
|
110
104
|
// If preserveSearchInput is true, we need to control the input value
|
|
111
105
|
const handleInputChange = preserveSearchInput
|
|
@@ -141,7 +135,6 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
141
135
|
|
|
142
136
|
const selectProps = {
|
|
143
137
|
cacheOptions: true,
|
|
144
|
-
required,
|
|
145
138
|
components: {
|
|
146
139
|
Control,
|
|
147
140
|
ClearIndicator,
|
|
@@ -177,27 +170,6 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
177
170
|
|
|
178
171
|
const [contextValue, setContextValue] = useState("")
|
|
179
172
|
|
|
180
|
-
// Add listener for form validation to track when validation should be shown (needed for react rendered rails kit)
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
const handleInvalid = (event: Event) => {
|
|
183
|
-
const target = event.target as HTMLInputElement
|
|
184
|
-
const typeaheadContainer = target.closest('[data-pb-react-component="Typeahead"]')
|
|
185
|
-
|
|
186
|
-
if (typeaheadContainer) {
|
|
187
|
-
// Check if this invalid event is specifically for our typeahead by comparing names so we do not have to require ids
|
|
188
|
-
const invalidInputName = target.name || target.getAttribute('name')
|
|
189
|
-
if (invalidInputName === name) {
|
|
190
|
-
setFormSubmitted(true)
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
document.addEventListener('invalid', handleInvalid, true)
|
|
195
|
-
|
|
196
|
-
return () => {
|
|
197
|
-
document.removeEventListener('invalid', handleInvalid, true)
|
|
198
|
-
}
|
|
199
|
-
}, [name])
|
|
200
|
-
|
|
201
173
|
// Add listener for clearing
|
|
202
174
|
useEffect(() => {
|
|
203
175
|
const handleClear = () => {
|
|
@@ -258,11 +230,6 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
258
230
|
}
|
|
259
231
|
}
|
|
260
232
|
|
|
261
|
-
// Reset form submitted state when a selection is made (this is all for react rendered rails kit)
|
|
262
|
-
if (action === 'select-option') {
|
|
263
|
-
setFormSubmitted(false)
|
|
264
|
-
}
|
|
265
|
-
|
|
266
233
|
// If a value is selected and we're preserving input on blur, clear the input
|
|
267
234
|
if (action === 'select-option' && preserveSearchInput) {
|
|
268
235
|
setInputValue('')
|
|
@@ -301,11 +268,6 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
301
268
|
|
|
302
269
|
const inlineClass = selectProps.inline ? 'inline' : null
|
|
303
270
|
|
|
304
|
-
const shouldShowValidationError = required &&
|
|
305
|
-
formSubmitted
|
|
306
|
-
|
|
307
|
-
const errorDisplay = error || (shouldShowValidationError ? validation?.message || "Please fill out this field." : "")
|
|
308
|
-
|
|
309
271
|
return (
|
|
310
272
|
<div
|
|
311
273
|
{...dataProps}
|
|
@@ -314,7 +276,7 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
|
314
276
|
>
|
|
315
277
|
<Tag
|
|
316
278
|
classNamePrefix="typeahead-kit-select"
|
|
317
|
-
error={
|
|
279
|
+
error={error}
|
|
318
280
|
isDisabled={disabled}
|
|
319
281
|
onChange={handleOnChange}
|
|
320
282
|
{...selectProps}
|
|
@@ -101,8 +101,6 @@ module Playbook
|
|
|
101
101
|
plusIcon: plus_icon,
|
|
102
102
|
truncate: truncate,
|
|
103
103
|
wrapped: wrapped,
|
|
104
|
-
required: required,
|
|
105
|
-
validation: validation,
|
|
106
104
|
searchContextSelector: search_context_selector,
|
|
107
105
|
optionsByContext: options_by_context,
|
|
108
106
|
clearOnContextChange: clear_on_context_change,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx,Fragment,jsxs}from"react/jsx-runtime";import{useState,useEffect}from"react";import{d as buildAriaProps,e as buildDataProps,f as buildHtmlProps,H as HighchartsReact,g as Highcharts,h as classnames,i as globalProps,j as HighchartsMore,S as SolidGauge,k as buildCss}from"./_typeahead-C8eN5nhR.js";import{c as colors,h as highchartsTheme,m as merge,a as highchartsDarkTheme,t as typography}from"./lib-QZuu1ltS.js";const mapColors=array=>{const regex=/(data)\-[1-8]/;const newArray=array.map((item=>regex.test(item)?`${colors[`data_${item[item.length-1]}`]}`:item));return newArray};const BarGraph=({aria:aria={},data:data={},align:align="center",axisTitle:axisTitle,dark:dark=false,chartData:chartData,className:className="pb_bar_graph",colors:colors2,htmlOptions:htmlOptions={},customOptions:customOptions={},axisFormat:axisFormat,id:id,pointStart:pointStart,stacking:stacking,subTitle:subTitle,type:type="column",title:title="Title",xAxisCategories:xAxisCategories,yAxisMin:yAxisMin,yAxisMax:yAxisMax,legend:legend=false,toggleLegendClick:toggleLegendClick=true,height:height,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();const staticOptions={title:{text:title},chart:{height:height,type:type},subtitle:{text:subTitle},yAxis:[{labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat&&axisFormat[0]?axisFormat[0].format:""},min:yAxisMin,max:yAxisMax,opposite:false,title:{text:Array.isArray(axisTitle)?axisTitle.length>0?axisTitle[0].name:null:axisTitle},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]}],xAxis:{categories:xAxisCategories},legend:{enabled:legend,align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},colors:colors2!==void 0&&colors2.length>0?mapColors(colors2):highchartsTheme.colors,plotOptions:{series:{stacking:stacking,pointStart:pointStart,borderWidth:stacking?0:"",events:{},dataLabels:{enabled:false}}},series:chartData,credits:false};if(Array.isArray(axisTitle)&&axisTitle.length>1&&axisTitle[1].name){staticOptions.yAxis.push({labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat[1].format},min:yAxisMin,max:yAxisMax,opposite:true,title:{text:axisTitle[1].name},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]})}if(!toggleLegendClick){staticOptions.plotOptions.series.events={legendItemClick:()=>false}}const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(globalProps(filteredProps),className),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};const alignBlockElement=event=>{const itemToMove=document.querySelector(`#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`);const chartContainer=document.querySelector(`#${event.target.renderTo.id}`);if(itemToMove!==null&&chartContainer!==null){itemToMove.style.height=`${event.target.chartHeight}px`;itemToMove.style.width=`${event.target.chartWidth}px`;if(chartContainer.firstChild!==null){chartContainer.firstChild.before(itemToMove)}}};const CircleChart=({align:align="center",aria:aria={},rounded:rounded=false,borderColor:borderColor=(rounded?null:""),borderWidth:borderWidth=(rounded?20:null),chartData:chartData,children:children,className:className,colors:colors2=[],customOptions:customOptions={},dark:dark=false,data:data={},dataLabelHtml:dataLabelHtml="<div>{point.name}</div>",dataLabels:dataLabels=false,height:height,htmlOptions:htmlOptions={},id:id,innerSize:innerSize="md",legend:legend=false,maxPointSize:maxPointSize=null,minPointSize:minPointSize=null,startAngle:startAngle=null,style:style="pie",title:title,tooltipHtml:tooltipHtml,useHtml:useHtml=false,zMin:zMin=null,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);HighchartsMore(Highcharts);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();Highcharts.setOptions({tooltip:{headerFormat:null,pointFormat:tooltipHtml?tooltipHtml:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',useHTML:useHtml}});const innerSizes={sm:"35%",md:"50%",lg:"85%",none:"0%"};const innerSizeFormat=size=>innerSizes[size];const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{const formattedChartData=chartData.map((obj=>{obj.y=obj.value;delete obj.value;return obj}));const staticOptions={title:{text:title},chart:{height:height,type:style,events:{render:event=>alignBlockElement(event),redraw:event=>alignBlockElement(event)}},legend:{align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},plotOptions:{pie:{colors:colors2.length>0?mapColors(colors2):highchartsTheme.colors,dataLabels:{enabled:dataLabels,connectorShape:"straight",connectorWidth:3,format:dataLabelHtml},showInLegend:legend}},series:[{minPointSize:minPointSize,maxPointSize:maxPointSize,innerSize:borderWidth==20?"100%":innerSizeFormat(innerSize),data:formattedChartData,zMin:zMin,startAngle:startAngle,borderWidth:borderWidth,borderColor:borderColor}],credits:false};setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(Fragment,{children:children?jsxs("div",{id:`wrapper-circle-chart-${id}`,children:[jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options}),jsx("div",{className:"pb-circle-chart-block",children:children})]}):jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})})};const Gauge=({aria:aria={},chartData:chartData,customOptions:customOptions={},dark:dark=false,data:data={},disableAnimation:disableAnimation=false,fullCircle:fullCircle=false,height:height=null,htmlOptions:htmlOptions={},id:id,max:max=100,min:min=0,prefix:prefix="",showLabels:showLabels=false,style:style="solidgauge",suffix:suffix="",title:title="",tooltipHtml:tooltipHtml='<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',colors:colors$1=[],minorTickInterval:minorTickInterval=null,circumference:circumference=(fullCircle?[0,360]:[-100,100]),...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);HighchartsMore(Highcharts);SolidGauge(Highcharts);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();Highcharts.setOptions({tooltip:{pointFormat:tooltipHtml,followPointer:true}});const css=buildCss({pb_gauge_kit:true});const[options,setOptions]=useState({});useEffect((()=>{const formattedChartData=chartData.map((obj=>{obj.y=obj.value;delete obj.value;return obj}));const staticOptions={chart:{events:{load(){setTimeout(this.reflow.bind(this),0)}},type:style,height:height},title:{text:title},yAxis:{min:min,max:max,lineWidth:0,tickWidth:0,minorTickInterval:minorTickInterval,tickAmount:2,tickPositions:[min,max],labels:{y:26,enabled:showLabels}},credits:false,series:[{data:formattedChartData}],pane:{center:["50%","50%"],size:"90%",startAngle:circumference[0],endAngle:circumference[1],background:{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane"}},colors:colors$1!==void 0&&colors$1.length>0?mapColors(colors$1):highchartsTheme.colors,plotOptions:{series:{animation:!disableAnimation},solidgauge:{borderColor:colors$1!==void 0&&colors$1.length===1?mapColors(colors$1).join():highchartsTheme.colors[0],borderWidth:20,radius:90,innerRadius:"90%",dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:`<span class="prefix${dark?" dark":""}">${prefix}</span><span class="fix${dark?" dark":""}">{y:,f}</span><span class="suffix${dark?" dark":""}">${suffix}</span>`,style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}}};setOptions(merge(staticOptions,customOptions));if(document.querySelector(".prefix")){document.querySelectorAll(".prefix").forEach((prefix2=>{prefix2.setAttribute("y","28")}));document.querySelectorAll(".fix").forEach((fix=>fix.setAttribute("y","38")))}}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(css,globalProps(props)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};const LineGraph=({aria:aria={},data:data={},align:align="center",className:className="pb_bar_graph",customOptions:customOptions={},dark:dark=false,gradient:gradient=false,type:type="line",htmlOptions:htmlOptions={},id:id,legend:legend=false,toggleLegendClick:toggleLegendClick=true,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,axisTitle:axisTitle,xAxisCategories:xAxisCategories,yAxisMin:yAxisMin,yAxisMax:yAxisMax,chartData:chartData,pointStart:pointStart,subTitle:subTitle,title:title,height:height,colors:colors2=[],...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();const staticOptions={title:{text:title},chart:{height:height,type:type},subtitle:{text:subTitle},yAxis:{min:yAxisMin,max:yAxisMax,title:{text:axisTitle}},xAxis:{categories:xAxisCategories},legend:{enabled:legend,align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},colors:colors2!==void 0&&colors2.length>0?mapColors(colors2):highchartsTheme.colors,plotOptions:{series:{pointStart:pointStart,events:{},dataLabels:{enabled:false}}},series:chartData,credits:false};if(!toggleLegendClick){staticOptions.plotOptions.series.events={legendItemClick:()=>false}}const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(globalProps(filteredProps),className),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};export{BarGraph as B,CircleChart as C,Gauge as G,LineGraph as L};
|
|
1
|
+
import{jsx,Fragment,jsxs}from"react/jsx-runtime";import{useState,useEffect}from"react";import{b as buildAriaProps,c as buildDataProps,d as buildHtmlProps,H as HighchartsReact,e as Highcharts,f as classnames,g as globalProps,h as HighchartsMore,S as SolidGauge,i as buildCss}from"./_typeahead-_Pft9jZd.js";import{c as colors,h as highchartsTheme,m as merge,a as highchartsDarkTheme,t as typography}from"./lib-CY5ZPzic.js";const mapColors=array=>{const regex=/(data)\-[1-8]/;const newArray=array.map((item=>regex.test(item)?`${colors[`data_${item[item.length-1]}`]}`:item));return newArray};const BarGraph=({aria:aria={},data:data={},align:align="center",axisTitle:axisTitle,dark:dark=false,chartData:chartData,className:className="pb_bar_graph",colors:colors2,htmlOptions:htmlOptions={},customOptions:customOptions={},axisFormat:axisFormat,id:id,pointStart:pointStart,stacking:stacking,subTitle:subTitle,type:type="column",title:title="Title",xAxisCategories:xAxisCategories,yAxisMin:yAxisMin,yAxisMax:yAxisMax,legend:legend=false,toggleLegendClick:toggleLegendClick=true,height:height,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();const staticOptions={title:{text:title},chart:{height:height,type:type},subtitle:{text:subTitle},yAxis:[{labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat&&axisFormat[0]?axisFormat[0].format:""},min:yAxisMin,max:yAxisMax,opposite:false,title:{text:Array.isArray(axisTitle)?axisTitle.length>0?axisTitle[0].name:null:axisTitle},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]}],xAxis:{categories:xAxisCategories},legend:{enabled:legend,align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},colors:colors2!==void 0&&colors2.length>0?mapColors(colors2):highchartsTheme.colors,plotOptions:{series:{stacking:stacking,pointStart:pointStart,borderWidth:stacking?0:"",events:{},dataLabels:{enabled:false}}},series:chartData,credits:false};if(Array.isArray(axisTitle)&&axisTitle.length>1&&axisTitle[1].name){staticOptions.yAxis.push({labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat[1].format},min:yAxisMin,max:yAxisMax,opposite:true,title:{text:axisTitle[1].name},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]})}if(!toggleLegendClick){staticOptions.plotOptions.series.events={legendItemClick:()=>false}}const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(globalProps(filteredProps),className),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};const alignBlockElement=event=>{const itemToMove=document.querySelector(`#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`);const chartContainer=document.querySelector(`#${event.target.renderTo.id}`);if(itemToMove!==null&&chartContainer!==null){itemToMove.style.height=`${event.target.chartHeight}px`;itemToMove.style.width=`${event.target.chartWidth}px`;if(chartContainer.firstChild!==null){chartContainer.firstChild.before(itemToMove)}}};const CircleChart=({align:align="center",aria:aria={},rounded:rounded=false,borderColor:borderColor=(rounded?null:""),borderWidth:borderWidth=(rounded?20:null),chartData:chartData,children:children,className:className,colors:colors2=[],customOptions:customOptions={},dark:dark=false,data:data={},dataLabelHtml:dataLabelHtml="<div>{point.name}</div>",dataLabels:dataLabels=false,height:height,htmlOptions:htmlOptions={},id:id,innerSize:innerSize="md",legend:legend=false,maxPointSize:maxPointSize=null,minPointSize:minPointSize=null,startAngle:startAngle=null,style:style="pie",title:title,tooltipHtml:tooltipHtml,useHtml:useHtml=false,zMin:zMin=null,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);HighchartsMore(Highcharts);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();Highcharts.setOptions({tooltip:{headerFormat:null,pointFormat:tooltipHtml?tooltipHtml:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',useHTML:useHtml}});const innerSizes={sm:"35%",md:"50%",lg:"85%",none:"0%"};const innerSizeFormat=size=>innerSizes[size];const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{const formattedChartData=chartData.map((obj=>{obj.y=obj.value;delete obj.value;return obj}));const staticOptions={title:{text:title},chart:{height:height,type:style,events:{render:event=>alignBlockElement(event),redraw:event=>alignBlockElement(event)}},legend:{align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},plotOptions:{pie:{colors:colors2.length>0?mapColors(colors2):highchartsTheme.colors,dataLabels:{enabled:dataLabels,connectorShape:"straight",connectorWidth:3,format:dataLabelHtml},showInLegend:legend}},series:[{minPointSize:minPointSize,maxPointSize:maxPointSize,innerSize:borderWidth==20?"100%":innerSizeFormat(innerSize),data:formattedChartData,zMin:zMin,startAngle:startAngle,borderWidth:borderWidth,borderColor:borderColor}],credits:false};setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(Fragment,{children:children?jsxs("div",{id:`wrapper-circle-chart-${id}`,children:[jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options}),jsx("div",{className:"pb-circle-chart-block",children:children})]}):jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})})};const Gauge=({aria:aria={},chartData:chartData,customOptions:customOptions={},dark:dark=false,data:data={},disableAnimation:disableAnimation=false,fullCircle:fullCircle=false,height:height=null,htmlOptions:htmlOptions={},id:id,max:max=100,min:min=0,prefix:prefix="",showLabels:showLabels=false,style:style="solidgauge",suffix:suffix="",title:title="",tooltipHtml:tooltipHtml='<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',colors:colors$1=[],minorTickInterval:minorTickInterval=null,circumference:circumference=(fullCircle?[0,360]:[-100,100]),...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);HighchartsMore(Highcharts);SolidGauge(Highcharts);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();Highcharts.setOptions({tooltip:{pointFormat:tooltipHtml,followPointer:true}});const css=buildCss({pb_gauge_kit:true});const[options,setOptions]=useState({});useEffect((()=>{const formattedChartData=chartData.map((obj=>{obj.y=obj.value;delete obj.value;return obj}));const staticOptions={chart:{events:{load(){setTimeout(this.reflow.bind(this),0)}},type:style,height:height},title:{text:title},yAxis:{min:min,max:max,lineWidth:0,tickWidth:0,minorTickInterval:minorTickInterval,tickAmount:2,tickPositions:[min,max],labels:{y:26,enabled:showLabels}},credits:false,series:[{data:formattedChartData}],pane:{center:["50%","50%"],size:"90%",startAngle:circumference[0],endAngle:circumference[1],background:{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane"}},colors:colors$1!==void 0&&colors$1.length>0?mapColors(colors$1):highchartsTheme.colors,plotOptions:{series:{animation:!disableAnimation},solidgauge:{borderColor:colors$1!==void 0&&colors$1.length===1?mapColors(colors$1).join():highchartsTheme.colors[0],borderWidth:20,radius:90,innerRadius:"90%",dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:`<span class="prefix${dark?" dark":""}">${prefix}</span><span class="fix${dark?" dark":""}">{y:,f}</span><span class="suffix${dark?" dark":""}">${suffix}</span>`,style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}}};setOptions(merge(staticOptions,customOptions));if(document.querySelector(".prefix")){document.querySelectorAll(".prefix").forEach((prefix2=>{prefix2.setAttribute("y","28")}));document.querySelectorAll(".fix").forEach((fix=>fix.setAttribute("y","38")))}}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(css,globalProps(props)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};const LineGraph=({aria:aria={},data:data={},align:align="center",className:className="pb_bar_graph",customOptions:customOptions={},dark:dark=false,gradient:gradient=false,type:type="line",htmlOptions:htmlOptions={},id:id,legend:legend=false,toggleLegendClick:toggleLegendClick=true,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,axisTitle:axisTitle,xAxisCategories:xAxisCategories,yAxisMin:yAxisMin,yAxisMax:yAxisMax,chartData:chartData,pointStart:pointStart,subTitle:subTitle,title:title,height:height,colors:colors2=[],...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();const staticOptions={title:{text:title},chart:{height:height,type:type},subtitle:{text:subTitle},yAxis:{min:yAxisMin,max:yAxisMax,title:{text:axisTitle}},xAxis:{categories:xAxisCategories},legend:{enabled:legend,align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},colors:colors2!==void 0&&colors2.length>0?mapColors(colors2):highchartsTheme.colors,plotOptions:{series:{pointStart:pointStart,events:{},dataLabels:{enabled:false}}},series:chartData,credits:false};if(!toggleLegendClick){staticOptions.plotOptions.series.events={legendItemClick:()=>false}}const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(globalProps(filteredProps),className),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};export{BarGraph as B,CircleChart as C,Gauge as G,LineGraph as L};
|