playbook_ui 14.22.0.pre.alpha.customheaderat8564 → 14.22.0.pre.alpha.play2253rowlevelcoloringadvancedtablerails8971

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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +6 -7
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +32 -11
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +6 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +65 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +5 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +46 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +7 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +11 -8
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +3 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +13 -4
  15. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
  16. data/app/pb_kits/playbook/pb_badge/_badge.scss +5 -6
  17. data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +106 -0
  18. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +33 -15
  19. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +33 -15
  20. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +52 -22
  21. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +3 -0
  22. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +12 -16
  23. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +31 -15
  24. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +39 -16
  25. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +86 -38
  26. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +32 -15
  27. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +72 -22
  28. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +1 -1
  29. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +31 -15
  30. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +37 -16
  31. data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +1 -3
  32. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -3
  33. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -2
  34. data/app/pb_kits/playbook/pb_body/docs/_body_truncate.jsx +3 -3
  35. data/app/pb_kits/playbook/pb_body/docs/_body_truncate_react.md +4 -0
  36. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +36 -1
  37. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +71 -26
  38. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -16
  39. data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors.md → _circle_chart_colors_rails.md} +1 -1
  40. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +2 -0
  41. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +28 -16
  42. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +4 -2
  43. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +23 -15
  44. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +81 -51
  45. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +103 -75
  46. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +3 -6
  47. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +19 -13
  48. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -17
  49. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +34 -20
  50. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +29 -20
  51. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +28 -20
  52. data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +1 -0
  53. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -1
  54. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -1
  55. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +12 -4
  56. data/app/pb_kits/playbook/pb_draggable/context/types.ts +5 -2
  57. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +27 -17
  58. data/app/pb_kits/playbook/pb_table/_table.tsx +4 -4
  59. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
  60. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
  61. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
  62. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +3 -3
  63. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
  64. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
  65. data/app/pb_kits/playbook/pb_title/docs/_title_truncate.jsx +3 -3
  66. data/app/pb_kits/playbook/pb_title/docs/_title_truncate_react.md +4 -0
  67. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +14 -0
  68. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +1 -0
  69. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -0
  70. data/app/pb_kits/playbook/pb_tooltip/index.js +59 -36
  71. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +9 -2
  72. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +18 -0
  73. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +1 -0
  74. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +1 -0
  75. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -0
  76. data/dist/chunks/_circle_chart-BZmlhBs2.js +1 -0
  77. data/dist/chunks/{_typeahead-B7FRYVtS.js → _typeahead-B1tu_vWi.js} +3 -3
  78. data/dist/chunks/_weekday_stacked-CKk0dR5s.js +45 -0
  79. data/dist/chunks/{lib-Carqm8Ip.js → lib-DYpq0k8j.js} +1 -1
  80. data/dist/chunks/{pb_form_validation-DqRmTS8m.js → pb_form_validation-BUOKwfvW.js} +1 -1
  81. data/dist/chunks/vendor.js +1 -1
  82. data/dist/menu.yml +68 -8
  83. data/dist/playbook-doc.js +2 -2
  84. data/dist/playbook-rails-react-bindings.js +1 -1
  85. data/dist/playbook-rails.js +1 -1
  86. data/dist/playbook.css +1 -1
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +27 -18
  89. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +0 -72
  90. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +0 -6
  91. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +0 -64
  92. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +0 -1
  93. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
  94. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
  95. data/dist/chunks/_weekday_stacked-CEJcIpjK.js +0 -45
  96. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_row_styling.md → _advanced_table_row_styling_react.md} +0 -0
  97. /data/app/pb_kits/playbook/pb_body/docs/{_body_truncate.md → _body_truncate_rails.md} +0 -0
  98. /data/app/pb_kits/playbook/pb_title/docs/{_title_truncate.md → _title_truncate_rails.md} +0 -0
  99. /data/app/pb_kits/playbook/pb_tooltip/docs/{_tooltip_click_open.md → _tooltip_click_open_react.md} +0 -0
  100. /data/app/pb_kits/playbook/pb_typeahead/docs/{_typeahead_preserve_input.md → _typeahead_preserve_input_react.md} +0 -0
@@ -19,60 +19,75 @@ export default class PbTooltip extends PbEnhancedElement {
19
19
  }
20
20
 
21
21
  this.triggerElements.forEach((trigger) => {
22
- const method = this.triggerMethod
22
+ const method = this.effectiveTriggerMethod
23
23
  const interactionEnabled = this.tooltipInteraction
24
24
 
25
25
  if (method === 'click') {
26
- trigger.addEventListener('click', () => {
27
- this.showTooltip(trigger)
28
- })
29
- } else {
30
- trigger.addEventListener('mouseenter', () => {
31
- clearSafeZoneListener(this)
32
- clearTimeout(this.mouseleaveTimeout)
33
- this.currentTrigger = trigger
34
- const delayOpen = this.delayOpen ? parseInt(this.delayOpen) : TOOLTIP_TIMEOUT
35
- this.mouseenterTimeout = setTimeout(() => {
36
- this.showTooltip(trigger)
37
- if (interactionEnabled) {
38
- this.checkCloseTooltip(trigger)
26
+ trigger.addEventListener('click', (e) => {
27
+ if (this.useClickToOpen) {
28
+ e.preventDefault()
29
+ if (this.isTooltipVisible()) {
30
+ this.hideTooltip()
31
+ } else {
32
+ this.showTooltip(trigger)
39
33
  }
40
- }, delayOpen)
34
+ } else {
35
+ this.showTooltip(trigger)
36
+ }
41
37
  })
38
+ } else {
39
+ if (!this.useClickToOpen) {
40
+ trigger.addEventListener('mouseenter', () => {
41
+ clearSafeZoneListener(this)
42
+ clearTimeout(this.mouseleaveTimeout)
43
+ this.currentTrigger = trigger
44
+ const delayOpen = this.delayOpen ? parseInt(this.delayOpen) : TOOLTIP_TIMEOUT
45
+ this.mouseenterTimeout = setTimeout(() => {
46
+ this.showTooltip(trigger)
47
+ if (interactionEnabled) {
48
+ this.checkCloseTooltip(trigger)
49
+ }
50
+ }, delayOpen)
51
+ })
42
52
 
43
- trigger.addEventListener('mouseleave', () => {
44
- clearTimeout(this.mouseenterTimeout)
45
- if (this.delayClose) {
46
- const delayClose = parseInt(this.delayClose)
47
- this.mouseleaveTimeout = setTimeout(() => {
53
+ trigger.addEventListener('mouseleave', () => {
54
+ clearTimeout(this.mouseenterTimeout)
55
+ if (this.delayClose) {
56
+ const delayClose = parseInt(this.delayClose)
57
+ this.mouseleaveTimeout = setTimeout(() => {
58
+ if (interactionEnabled) {
59
+ this.attachSafeZoneListener()
60
+ } else {
61
+ this.hideTooltip()
62
+ }
63
+ }, delayClose)
64
+ } else {
48
65
  if (interactionEnabled) {
49
66
  this.attachSafeZoneListener()
50
67
  } else {
51
68
  this.hideTooltip()
52
69
  }
53
- }, delayClose)
54
- } else {
55
- if (interactionEnabled) {
56
- this.attachSafeZoneListener()
57
- } else {
58
- this.hideTooltip()
59
70
  }
60
- }
61
- })
62
-
63
- if (interactionEnabled) {
64
- this.tooltip.addEventListener('mouseenter', () => {
65
- clearSafeZoneListener(this)
66
71
  })
67
72
 
68
- this.tooltip.addEventListener('mouseleave', () => {
69
- this.attachSafeZoneListener()
70
- })
73
+ if (interactionEnabled) {
74
+ this.tooltip.addEventListener('mouseenter', () => {
75
+ clearSafeZoneListener(this)
76
+ })
77
+
78
+ this.tooltip.addEventListener('mouseleave', () => {
79
+ this.attachSafeZoneListener()
80
+ })
81
+ }
71
82
  }
72
83
  }
73
84
  })
74
85
  }
75
86
 
87
+ isTooltipVisible() {
88
+ return this.tooltip && this.tooltip.classList.contains('show')
89
+ }
90
+
76
91
  attachSafeZoneListener() {
77
92
  clearSafeZoneListener(this)
78
93
  this.safeZoneHandler = (e) => {
@@ -145,7 +160,7 @@ export default class PbTooltip extends PbEnhancedElement {
145
160
 
146
161
  this.tooltip.classList.add('show')
147
162
 
148
- if (this.triggerMethod === 'click') {
163
+ if (this.effectiveTriggerMethod === 'click' && !this.useClickToOpen) {
149
164
  clearTimeout(this.autoHideTimeout)
150
165
  this.autoHideTimeout = setTimeout(() => {
151
166
  this.hideTooltip()
@@ -224,6 +239,14 @@ export default class PbTooltip extends PbEnhancedElement {
224
239
  return this.element.dataset.pbTooltipTriggerMethod || 'hover'
225
240
  }
226
241
 
242
+ get useClickToOpen() {
243
+ return this.element.dataset.pbTooltipUseClickToOpen === 'true'
244
+ }
245
+
246
+ get effectiveTriggerMethod() {
247
+ return this.useClickToOpen ? 'click' : this.triggerMethod
248
+ }
249
+
227
250
  get tooltipInteraction() {
228
251
  return this.element.dataset.pbTooltipInteraction === 'true'
229
252
  }
@@ -21,6 +21,8 @@ module Playbook
21
21
  prop :trigger_method, type: Playbook::Props::Enum,
22
22
  values: %w[hover click],
23
23
  default: "hover"
24
+ prop :use_click_to_open, type: Playbook::Props::Boolean,
25
+ default: false
24
26
  prop :width
25
27
 
26
28
  def classname
@@ -46,6 +48,10 @@ module Playbook
46
48
  out
47
49
  end
48
50
 
51
+ def effective_trigger_method
52
+ use_click_to_open ? "click" : (trigger_method || "hover")
53
+ end
54
+
49
55
  def data
50
56
  data = Hash(values[:data]).merge(
51
57
  pb_tooltip_kit: true,
@@ -54,8 +60,9 @@ module Playbook
54
60
  pb_tooltip_trigger_element_id: trigger_element_id,
55
61
  pb_tooltip_tooltip_id: tooltip_id,
56
62
  pb_tooltip_show_tooltip: true,
57
- pb_tooltip_trigger_method: trigger_method,
58
- pb_tooltip_interaction: interaction
63
+ pb_tooltip_trigger_method: effective_trigger_method,
64
+ pb_tooltip_interaction: interaction,
65
+ pb_tooltip_use_click_to_open: use_click_to_open
59
66
  )
60
67
  data = data.merge(pb_tooltip_delay_open: delay_open) if delay_open
61
68
  data = data.merge(pb_tooltip_delay_close: delay_close) if delay_close
@@ -0,0 +1,18 @@
1
+ <%
2
+ options = [
3
+ { label: 'Orange', value: '#FFA500' },
4
+ { label: 'Red', value: '#FF0000' },
5
+ { label: 'Green', value: '#00FF00' },
6
+ { label: 'Blue', value: '#0000FF' },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("typeahead", props: {
11
+ id: "typeahead-preserve-search-input",
12
+ is_multi: false,
13
+ label: "Colors",
14
+ options: options,
15
+ placeholder: "Select...",
16
+ preserve_search_input: true,
17
+ })
18
+ %>
@@ -0,0 +1 @@
1
+ By default, text is not preserved in the typeahead kit when you click off of the input field. You can utilize the `preserve_search_input` prop in order to prevent text from being cleared when the field loses focus
@@ -15,6 +15,7 @@ examples:
15
15
  - typeahead_dynamic_options: Dynamic Options
16
16
  - typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
17
17
  - typeahead_disabled: Disabled
18
+ - typeahead_preserve_input: Preserve Search Input
18
19
 
19
20
  react:
20
21
  - typeahead_default: Default
@@ -54,6 +54,8 @@ module Playbook
54
54
  default: nil
55
55
  prop :disabled, type: Playbook::Props::Boolean,
56
56
  default: false
57
+ prop :preserve_search_input, type: Playbook::Props::Boolean,
58
+ default: false
57
59
 
58
60
  def classname
59
61
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -103,6 +105,7 @@ module Playbook
103
105
  optionsByContext: options_by_context,
104
106
  clearOnContextChange: clear_on_context_change,
105
107
  disabled: disabled,
108
+ preserveSearchInput: preserve_search_input,
106
109
  }
107
110
 
108
111
  base_options[:getOptionLabel] = get_option_label if get_option_label.present?
@@ -0,0 +1 @@
1
+ import{jsx,Fragment,jsxs}from"react/jsx-runtime";import{useState,useEffect}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,m as mapColors,H as HighchartsReact,d as Highcharts,e as classnames,g as globalProps,f as HighchartsMore}from"./_typeahead-B1tu_vWi.js";import{h as highchartsTheme,m as merge,a as highchartsDarkTheme}from"./lib-DYpq0k8j.js";const BarGraph=({aria:aria={},data:data={},align:align="center",axisTitle:axisTitle,dark:dark=false,chartData:chartData,className:className="pb_bar_graph",colors:colors,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:colors!==void 0&&colors.length>0?mapColors(colors):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:colors=[],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:colors.length>0?mapColors(colors):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})})};export{BarGraph as B,CircleChart as C};