playbook_ui 14.24.0 → 14.25.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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +34 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
  9. data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
  10. data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
  11. data/app/pb_kits/playbook/pb_date/date.rb +2 -0
  12. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  13. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  14. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  15. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  16. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -1
  18. data/dist/chunks/{_line_graph-BLS62QjW.js → _line_graph-D7DgMqnT.js} +1 -1
  19. data/dist/chunks/_typeahead-BzYZCpJO.js +6 -0
  20. data/dist/chunks/{_weekday_stacked-Cv8-Sf6X.js → _weekday_stacked-CJIFKKe7.js} +2 -2
  21. data/dist/chunks/{lib-DgtxnJqa.js → lib-CY5ZPzic.js} +2 -2
  22. data/dist/chunks/{pb_form_validation-_NsOWfBS.js → pb_form_validation-D3b0JKHH.js} +1 -1
  23. data/dist/chunks/vendor.js +1 -1
  24. data/dist/menu.yml +1 -1
  25. data/dist/playbook-doc.js +1 -1
  26. data/dist/playbook-rails-react-bindings.js +1 -1
  27. data/dist/playbook-rails.js +1 -1
  28. data/dist/playbook.css +1 -1
  29. data/lib/playbook/version.rb +2 -2
  30. metadata +12 -7
  31. data/dist/chunks/_typeahead-CZL6rvfn.js +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 832d1bb3528b4f8e30c8666d5df4788a9a0443beefc5572db270e36ef3b75da5
4
- data.tar.gz: 07b54012ce3975d5a591e55e60ec999a996e2f4639e8457eb2f340630b2a694b
3
+ metadata.gz: 7acc2e53df8398198aa9fed4b39f2dc04a954918e790a904220898da123e15e8
4
+ data.tar.gz: 606391f77a95f67235606bdf5113c7f2fb1c749ff7bb99999fff120f358f7d85
5
5
  SHA512:
6
- metadata.gz: cdae9e16c95c88519d0bc2154b8fbb71a65e3b60e9b15b14c75000734c2dae576b2205553c07f30327bd177ec126a2e1c36341c09a874f71ce703179942256de
7
- data.tar.gz: 035ff972261f9512414dbfd39af82b5b6c73133140f423cb2a0b84ade5e9e0129fb63bab8da06cdf9018b33ea46507140a99aedd74468e99d2ef3a4fe23c5ae8
6
+ metadata.gz: 4f381cbe31526cc2e7fe5c0f90402e169e88d6bca29b6257a200460ca24539db770651df305094d9ac4b0db2ffb39d435308f0b4af4e91ce3a57fa69c51a78a6
7
+ data.tar.gz: b2d994c35bd502f6221e469c7a65da5911222b835672bbfa955d8b12f9612e47dd4bd9b20c4f08e6e57a2c2163e0b4c415f1ac516b62eef772ca9540487cb7fb
@@ -971,6 +971,40 @@
971
971
  }
972
972
  }
973
973
  }
974
+
975
+ // Firefox-specific fix for last-header-cell and last-cell vertical borders
976
+ @-moz-document url-prefix() {
977
+ .pb_advanced_table_header {
978
+ .last-header-cell {
979
+ border-right: none !important;
980
+ box-shadow: 1px 0 0 0 $border_light !important;
981
+ }
982
+ }
983
+
984
+ .pb_advanced_table_body {
985
+ .last-cell {
986
+ border-right: none !important;
987
+ box-shadow: 1px 0 0 0 $border_light !important;
988
+ }
989
+ }
990
+
991
+ // Dark mode Firefox fixes
992
+ &.dark {
993
+ .pb_advanced_table_header {
994
+ .last-header-cell {
995
+ border-right: none !important;
996
+ box-shadow: 1px 0 0 0 $border_dark !important;
997
+ }
998
+ }
999
+
1000
+ .pb_advanced_table_body {
1001
+ .last-cell {
1002
+ border-right: none !important;
1003
+ box-shadow: 1px 0 0 0 $border_dark !important;
1004
+ }
1005
+ }
1006
+ }
1007
+ }
974
1008
  }
975
1009
 
976
1010
  // Outside of the pb_advanced_table class for popover
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ label: "Enrollment Data",
9
+ columns: [
10
+ {
11
+ accessor: "newEnrollments",
12
+ label: "New Enrollments",
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ label: "Performance Data",
22
+ columns: [
23
+ {
24
+ accessor: "attendanceRate",
25
+ label: "Attendance Rate",
26
+ },
27
+ {
28
+ accessor: "completedClasses",
29
+ label: "Completed Classes",
30
+ },
31
+ {
32
+ accessor: "classCompletionRate",
33
+ label: "Class Completion Rate",
34
+ },
35
+ {
36
+ accessor: "graduatedStudents",
37
+ label: "Graduated Students",
38
+ },
39
+ ],
40
+ },
41
+ ] %>
42
+
43
+ <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true } }) %>
@@ -0,0 +1,64 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableColumnHeadersVerticalBorder = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ accessor: "newEnrollments",
17
+ label: "New Enrollments",
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ label: "Performance Data",
27
+ columns: [
28
+ {
29
+ accessor: "attendanceRate",
30
+ label: "Attendance Rate",
31
+ },
32
+ {
33
+ accessor: "completedClasses",
34
+ label: "Completed Classes",
35
+ },
36
+ {
37
+ accessor: "classCompletionRate",
38
+ label: "Class Completion Rate",
39
+ },
40
+ {
41
+ accessor: "graduatedStudents",
42
+ label: "Graduated Students",
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+
48
+ const tableProps = {
49
+ verticalBorder: true
50
+ }
51
+
52
+ return (
53
+ <>
54
+ <AdvancedTable
55
+ columnDefinitions={columnDefinitions}
56
+ tableData={MOCK_DATA}
57
+ tableProps={tableProps}
58
+ {...props}
59
+ />
60
+ </>
61
+ )
62
+ }
63
+
64
+ export default AdvancedTableColumnHeadersVerticalBorder
@@ -13,6 +13,7 @@ examples:
13
13
  - advanced_table_with_custom_header_rails: Custom Header Cell
14
14
  - advanced_table_column_headers: Multi-Header Columns
15
15
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
16
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
16
17
  - advanced_table_no_subrows: Table with No Subrows or Expansion
17
18
  - advanced_table_selectable_rows_rails: Selectable Rows
18
19
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
@@ -53,6 +54,7 @@ examples:
53
54
  - advanced_table_column_headers: Multi-Header Columns
54
55
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
55
56
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
57
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
56
58
  - advanced_table_no_subrows: Table with No Subrows or Expansion
57
59
  - advanced_table_pinned_rows: Pinned Rows
58
60
  - advanced_table_selectable_rows: Selectable Rows
@@ -21,6 +21,7 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
+ export { default as AdvancedTableColumnHeadersVerticalBorder } from './_advanced_table_column_headers_vertical_border.jsx'
24
25
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
26
  export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
26
27
  export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
@@ -43,7 +43,7 @@ module Playbook
43
43
  end
44
44
 
45
45
  def td_classname(column, index)
46
- classes = %w[id-cell chrome-styles]
46
+ classes = %w[id-cell]
47
47
  classes << "last-cell" if column[:is_last_in_group]
48
48
  classes << "pinned-left" if index.zero? && is_pinned_left && responsive == "scroll"
49
49
  classes.join(" ")
@@ -29,7 +29,7 @@ module Playbook
29
29
  end
30
30
 
31
31
  def td_classname(index)
32
- classes = %w[id-cell chrome-styles]
32
+ classes = %w[id-cell]
33
33
  classes << "pinned-left" if index.zero? && responsive == "scroll"
34
34
  classes.join(" ")
35
35
  end
@@ -19,6 +19,7 @@ type PbDateProps = {
19
19
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
20
20
  id?: string;
21
21
  showDayOfWeek?: boolean;
22
+ showCurrentYear?: boolean;
22
23
  showIcon?: boolean;
23
24
  size?: "sm" | "md" | "lg";
24
25
  unstyled?: boolean;
@@ -35,6 +36,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
35
36
  htmlOptions = {},
36
37
  id,
37
38
  showDayOfWeek = false,
39
+ showCurrentYear = false,
38
40
  showIcon = false,
39
41
  size = "md",
40
42
  unstyled = false,
@@ -90,7 +92,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
90
92
  {month} {day}
91
93
  </span>
92
94
 
93
- {currentYear != year && <span>{`, ${year}`}</span>}
95
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
94
96
  </span>
95
97
  </>
96
98
  : size == "md" || size == "lg"
@@ -124,7 +126,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
124
126
  <span>
125
127
  {month} {day}
126
128
  </span>
127
- {currentYear != year && <span>{`, ${year}`}</span>}
129
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
128
130
  </Title>
129
131
  )
130
132
  : (
@@ -158,7 +160,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
158
160
  <Caption dark={dark}
159
161
  tag="span">
160
162
  {month} {day}
161
- {currentYear != year && <>{`, ${year}`}</>}
163
+ {(currentYear !== year || showCurrentYear) && <>{`, ${year}`}</>}
162
164
  </Caption>
163
165
  </>
164
166
  )}
@@ -13,8 +13,8 @@
13
13
  <% end %>
14
14
 
15
15
  <!-- month day, year -->
16
- <%# if not current year %>
17
- <% if object.year.to_s == DateTime.now.year.to_s %>
16
+ <%# if not current year or show_current_year is false %>
17
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
18
18
  <span><%= "#{object.month} #{object.day}" %></span>
19
19
  <%# if is current year %>
20
20
  <% else %>
@@ -44,8 +44,8 @@
44
44
 
45
45
  <!-- month day, year -->
46
46
 
47
- <%# if not current year %>
48
- <% if object.year.to_s == DateTime.now.year.to_s %>
47
+ <%# if not current year or show_current_year is false %>
48
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
49
49
  <%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}", size: 4 }) %>
50
50
  <%# if is current year %>
51
51
  <% else %>
@@ -74,8 +74,8 @@
74
74
 
75
75
  <!-- month day, year -->
76
76
 
77
- <%# if not current year %>
78
- <% if object.year.to_s == DateTime.now.year.to_s %>
77
+ <%# if not current year or show_current_year is false %>
78
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
79
79
  <%= pb_rails("caption", props: { tag: "span", text: "#{object.month} #{object.day}" }) %>
80
80
  <%# if is current year %>
81
81
  <% else %>
@@ -11,6 +11,8 @@ module Playbook
11
11
  default: false
12
12
  prop :show_day_of_week, type: Playbook::Props::Boolean,
13
13
  default: false
14
+ prop :show_current_year, type: Playbook::Props::Boolean,
15
+ default: false
14
16
  prop :size, type: Playbook::Props::Enum,
15
17
  values: %w[lg md sm xs],
16
18
  default: "md"
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date", props: {
2
+ date: Date.today,
3
+ show_current_year: true
4
+ }) %>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ import FormattedDate from '../../pb_date/_date'
4
+
5
+ const DateWithShowCurrentYear = (props) => {
6
+ return (
7
+ <>
8
+ <FormattedDate
9
+ showCurrentYear
10
+ value={new Date()}
11
+ {...props}
12
+ />
13
+ </>
14
+ )
15
+ }
16
+
17
+ export default DateWithShowCurrentYear
@@ -0,0 +1 @@
1
+ By default, the Date kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
@@ -5,12 +5,14 @@ examples:
5
5
  - date_variants: Variants
6
6
  - date_alignment: Alignment
7
7
  - date_timezone: Timezones
8
+ - date_with_show_current_year: Show Current Year
8
9
  - date_unstyled: Unstyled
9
10
 
10
11
  react:
11
12
  - date_default: Default
12
13
  - date_variants: Variants
13
14
  - date_alignment: Alignment
15
+ - date_with_show_current_year: Show Current Year
14
16
  - date_unstyled: Unstyled
15
17
 
16
18
  swift:
@@ -2,3 +2,4 @@ export { default as DateDefault } from './_date_default.jsx'
2
2
  export { default as DateVariants } from './_date_variants.jsx'
3
3
  export { default as DateAlignment } from './_date_alignment.jsx'
4
4
  export { default as DateUnstyled } from './_date_unstyled.jsx'
5
+ export { default as DateWithShowCurrentYear } from './_date_with_show_current_year.jsx'
@@ -7,7 +7,7 @@
7
7
  thead tr:not(:first-child) th {
8
8
  border-right: 1px solid $border_light !important;
9
9
  }
10
-
10
+
11
11
  @media screen and (min-width: $screen-xs-min) {
12
12
  tr:hover, .pb_table_tr:hover {
13
13
  td:last-child, .pb_table_td:last-child {
@@ -15,5 +15,53 @@
15
15
  }
16
16
  }
17
17
  }
18
+
19
+ // Firefox-specific fix for sticky elements
20
+ @-moz-document url-prefix() {
21
+ // Target sticky headers
22
+ &.sticky-header {
23
+ th:not(:last-child) {
24
+ border-right: none !important;
25
+ box-shadow: 1px 0 0 0 $border_light !important;
26
+ }
27
+
28
+ .pb_advanced_table_body {
29
+ .pinned-row {
30
+ td:not(:first-child):not(:last-child) {
31
+ border-right: none !important;
32
+ box-shadow: 1px 0 0 0 $border_light !important;
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ // Target sticky left columns
39
+ &.sticky-left-column {
40
+ td[style="left"], th[style="left"] {
41
+ border-right: none !important;
42
+ box-shadow: 1px 0 0 0 $border_light !important;
43
+ }
44
+ }
45
+
46
+ // Target sticky right columns
47
+ &.sticky-right-column {
48
+ td[style="right"], th[style="right"] {
49
+ border-right: none !important;
50
+ box-shadow: 1px 0 0 0 $border_light !important;
51
+ }
52
+ }
53
+
54
+ // Handle hover states in Firefox
55
+ @media screen and (min-width: $screen-xs-min) {
56
+ tr:hover, .pb_table_tr:hover {
57
+ td:last-child, .pb_table_td:last-child {
58
+ &[style="left"], &[style="right"] {
59
+ border-right: none !important;
60
+ box-shadow: 1px 0 0 0 darken($border_light, 10%) !important;
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
18
66
  }
19
67
  }
@@ -1 +1 @@
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-CZL6rvfn.js";import{c as colors,h as highchartsTheme,m as merge,a as highchartsDarkTheme,t as typography}from"./lib-DgtxnJqa.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-BzYZCpJO.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};