playbook_ui 14.25.0.pre.alpha.testingcss9700 → 14.25.0.pre.alpha.testingcss9713
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 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +60 -65
- data/app/pb_kits/playbook/pb_background/_background.scss +3 -3
- data/app/pb_kits/playbook/pb_badge/_badge.scss +30 -32
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -1
- data/app/pb_kits/playbook/pb_button/_button.scss +13 -13
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +19 -19
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_dark.scss +15 -15
- data/app/pb_kits/playbook/pb_caption/_caption.scss +1 -1
- data/app/pb_kits/playbook/pb_card/_card.scss +79 -68
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +4 -4
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +5 -5
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +3 -3
- data/app/pb_kits/playbook/pb_currency/_currency.scss +30 -30
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss +1 -1
- data/app/pb_kits/playbook/pb_date/_date.scss +5 -5
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +19 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +2 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +2 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_time_selection_styles.scss +5 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +13 -13
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.scss +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.scss +13 -13
- data/app/pb_kits/playbook/pb_date_time/_date_time.scss +6 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +6 -6
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.scss +7 -7
- data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +61 -252
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.scss +3 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -1
- data/app/pb_kits/playbook/pb_filter/_filter.scss +7 -7
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex.scss +106 -100
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +38 -28
- data/app/pb_kits/playbook/pb_flex/_flex_item.scss +146 -51
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +19 -8
- data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.html.erb +12 -1
- data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.jsx +26 -1
- data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_rails.md +11 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_react.md +11 -0
- data/app/pb_kits/playbook/pb_flex/flex.rb +73 -39
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +51 -6
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +47 -47
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +5 -5
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +5 -5
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.scss +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.scss +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.scss +4 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +2 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +15 -15
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.scss +6 -6
- data/app/pb_kits/playbook/pb_image/_image.scss +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.scss +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -2
- data/app/pb_kits/playbook/pb_layout/_layout.scss +330 -305
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +14 -11
- data/app/pb_kits/playbook/pb_layout/body.rb +1 -1
- data/app/pb_kits/playbook/pb_layout/footer.rb +1 -1
- data/app/pb_kits/playbook/pb_layout/header.rb +1 -1
- data/app/pb_kits/playbook/pb_layout/item.rb +1 -7
- data/app/pb_kits/playbook/pb_layout/layout.rb +16 -25
- data/app/pb_kits/playbook/pb_layout/layout.test.js +3 -3
- data/app/pb_kits/playbook/pb_layout/sidebar.rb +1 -1
- data/app/pb_kits/playbook/pb_legend/_legend.scss +1 -1
- data/app/pb_kits/playbook/pb_link/_link.scss +4 -4
- data/app/pb_kits/playbook/pb_list/_list.scss +8 -8
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.scss +4 -4
- data/app/pb_kits/playbook/pb_message/_message.scss +4 -4
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +2 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +2 -2
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +2 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +9 -9
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +8 -8
- data/app/pb_kits/playbook/pb_online_status/_online_status.scss +2 -2
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +2 -2
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +1 -1
- data/app/pb_kits/playbook/pb_person/_person.scss +1 -1
- data/app/pb_kits/playbook/pb_pill/_pill.scss +3 -3
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +7 -7
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +10 -10
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +36 -36
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +4 -4
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +12 -12
- data/app/pb_kits/playbook/pb_select/_select.scss +3 -3
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +7 -7
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +2 -2
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.scss +5 -5
- data/app/pb_kits/playbook/pb_source/_source.scss +7 -7
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +1 -1
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_alignment.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_content.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_hover.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_reset.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +12 -12
- data/app/pb_kits/playbook/pb_table/styles/_side_highlight.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_structure.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_table_header.scss +4 -4
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +15 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +3 -3
- data/app/pb_kits/playbook/pb_time/_time.scss +5 -5
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +13 -13
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.scss +3 -3
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +41 -41
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.scss +4 -4
- data/app/pb_kits/playbook/pb_title/_title.scss +14 -14
- data/app/pb_kits/playbook/pb_title_count/_title_count.scss +3 -3
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.scss +7 -7
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
- data/app/pb_kits/playbook/pb_user/_user.scss +13 -13
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.scss +1 -1
- data/app/pb_kits/playbook/utilities/_gap.scss +12 -24
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +2 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +28 -4
- data/dist/chunks/_line_graph-0Y0wuiB9.js +1 -0
- data/dist/chunks/_typeahead-B2gV75O0.js +6 -0
- data/dist/chunks/_weekday_stacked-Dblcf2V8.js +37 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/lib-CY5ZPzic.js +29 -0
- data/dist/chunks/pb_form_validation-D3b0JKHH.js +1 -0
- data/dist/chunks/vendor.js +1 -11
- data/dist/menu.yml +0 -6
- data/dist/playbook-doc.js +3 -67243
- data/dist/playbook-rails-react-bindings.js +1 -112
- data/dist/playbook-rails.js +1 -2464
- data/dist/playbook.css +2 -92354
- data/dist/reset.css +1 -89
- data/lib/playbook/classnames.rb +2 -0
- data/lib/playbook/spacing.rb +53 -1
- data/lib/playbook/version.rb +1 -1
- metadata +10 -38
- data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +0 -25
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +0 -381
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +0 -231
- data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +0 -3
- data/app/pb_kits/playbook/pb_drawer/context.ts +0 -11
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -41
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +0 -78
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -26
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +0 -20
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +0 -59
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +0 -61
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +0 -24
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +0 -54
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +0 -99
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -20
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -7
- data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +0 -20
- data/app/pb_kits/playbook/pb_drawer/drawer.rb +0 -56
- data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +0 -81
- data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +0 -60
- data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +0 -21
- data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
- data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.md +0 -9
- data/dist/chunks/_line_graph-DPTwfQR-.js +0 -544
- data/dist/chunks/_typeahead-CEqlHw0H.js +0 -30978
- data/dist/chunks/_weekday_stacked-D3dG14OB.js +0 -20894
- data/dist/chunks/lazysizes-BUUj27EF.js +0 -611
- data/dist/chunks/lib-CIetbXpr.js +0 -9609
- data/dist/chunks/pb_form_validation-D_g9rOE9.js +0 -60
@@ -1,544 +0,0 @@
|
|
1
|
-
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
2
|
-
import { useState, useEffect } from "react";
|
3
|
-
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-CEqlHw0H.js";
|
4
|
-
import { c as colors, h as highchartsTheme, m as merge, a as highchartsDarkTheme, t as typography } from "./lib-CIetbXpr.js";
|
5
|
-
const mapColors = (array) => {
|
6
|
-
const regex = /(data)\-[1-8]/;
|
7
|
-
const newArray = array.map((item) => {
|
8
|
-
return regex.test(item) ? `${colors[`data_${item[item.length - 1]}`]}` : item;
|
9
|
-
});
|
10
|
-
return newArray;
|
11
|
-
};
|
12
|
-
const BarGraph = ({
|
13
|
-
aria = {},
|
14
|
-
data = {},
|
15
|
-
align = "center",
|
16
|
-
axisTitle,
|
17
|
-
dark = false,
|
18
|
-
chartData,
|
19
|
-
className = "pb_bar_graph",
|
20
|
-
colors: colors2,
|
21
|
-
htmlOptions = {},
|
22
|
-
customOptions = {},
|
23
|
-
axisFormat,
|
24
|
-
id,
|
25
|
-
pointStart,
|
26
|
-
stacking,
|
27
|
-
subTitle,
|
28
|
-
type = "column",
|
29
|
-
title = "Title",
|
30
|
-
xAxisCategories,
|
31
|
-
yAxisMin,
|
32
|
-
yAxisMax,
|
33
|
-
legend = false,
|
34
|
-
toggleLegendClick = true,
|
35
|
-
height,
|
36
|
-
layout = "horizontal",
|
37
|
-
verticalAlign = "bottom",
|
38
|
-
x = 0,
|
39
|
-
y = 0,
|
40
|
-
...props
|
41
|
-
}) => {
|
42
|
-
const ariaProps = buildAriaProps(aria);
|
43
|
-
const dataProps = buildDataProps(data);
|
44
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
45
|
-
const setupTheme = () => {
|
46
|
-
dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
|
47
|
-
};
|
48
|
-
setupTheme();
|
49
|
-
const staticOptions = {
|
50
|
-
title: {
|
51
|
-
text: title
|
52
|
-
},
|
53
|
-
chart: {
|
54
|
-
height,
|
55
|
-
type
|
56
|
-
},
|
57
|
-
subtitle: {
|
58
|
-
text: subTitle
|
59
|
-
},
|
60
|
-
yAxis: [{
|
61
|
-
labels: {
|
62
|
-
format: typeof axisFormat === "string" ? axisFormat : axisFormat && axisFormat[0] ? axisFormat[0].format : ""
|
63
|
-
},
|
64
|
-
min: yAxisMin,
|
65
|
-
max: yAxisMax,
|
66
|
-
opposite: false,
|
67
|
-
title: {
|
68
|
-
text: Array.isArray(axisTitle) ? axisTitle.length > 0 ? axisTitle[0].name : null : axisTitle
|
69
|
-
},
|
70
|
-
plotLines: typeof yAxisMin !== "undefined" && yAxisMin !== null ? [] : [{
|
71
|
-
value: 0,
|
72
|
-
zIndex: 10,
|
73
|
-
color: "#E4E8F0"
|
74
|
-
}]
|
75
|
-
}],
|
76
|
-
xAxis: {
|
77
|
-
categories: xAxisCategories
|
78
|
-
},
|
79
|
-
legend: {
|
80
|
-
enabled: legend,
|
81
|
-
align,
|
82
|
-
verticalAlign,
|
83
|
-
layout,
|
84
|
-
x,
|
85
|
-
y
|
86
|
-
},
|
87
|
-
colors: colors2 !== void 0 && colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
|
88
|
-
plotOptions: {
|
89
|
-
series: {
|
90
|
-
stacking,
|
91
|
-
pointStart,
|
92
|
-
borderWidth: stacking ? 0 : "",
|
93
|
-
events: {},
|
94
|
-
dataLabels: {
|
95
|
-
enabled: false
|
96
|
-
}
|
97
|
-
}
|
98
|
-
},
|
99
|
-
series: chartData,
|
100
|
-
credits: false
|
101
|
-
};
|
102
|
-
if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
|
103
|
-
staticOptions.yAxis.push({
|
104
|
-
labels: {
|
105
|
-
format: typeof axisFormat === "string" ? axisFormat : axisFormat[1].format
|
106
|
-
},
|
107
|
-
min: yAxisMin,
|
108
|
-
max: yAxisMax,
|
109
|
-
opposite: true,
|
110
|
-
title: {
|
111
|
-
text: axisTitle[1].name
|
112
|
-
},
|
113
|
-
plotLines: typeof yAxisMin !== "undefined" && yAxisMin !== null ? [] : [{
|
114
|
-
value: 0,
|
115
|
-
zIndex: 10,
|
116
|
-
color: "#E4E8F0"
|
117
|
-
}]
|
118
|
-
});
|
119
|
-
}
|
120
|
-
if (!toggleLegendClick) {
|
121
|
-
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
122
|
-
}
|
123
|
-
const filteredProps = { ...props };
|
124
|
-
delete filteredProps.verticalAlign;
|
125
|
-
const [options, setOptions] = useState({});
|
126
|
-
useEffect(() => {
|
127
|
-
setOptions(merge(staticOptions, customOptions));
|
128
|
-
}, [chartData]);
|
129
|
-
return /* @__PURE__ */ jsx(
|
130
|
-
HighchartsReact,
|
131
|
-
{
|
132
|
-
containerProps: {
|
133
|
-
className: classnames(globalProps(filteredProps), className),
|
134
|
-
id,
|
135
|
-
...ariaProps,
|
136
|
-
...dataProps,
|
137
|
-
...htmlProps
|
138
|
-
},
|
139
|
-
highcharts: Highcharts,
|
140
|
-
options
|
141
|
-
}
|
142
|
-
);
|
143
|
-
};
|
144
|
-
const alignBlockElement = (event) => {
|
145
|
-
const itemToMove = document.querySelector(
|
146
|
-
`#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`
|
147
|
-
);
|
148
|
-
const chartContainer = document.querySelector(`#${event.target.renderTo.id}`);
|
149
|
-
if (itemToMove !== null && chartContainer !== null) {
|
150
|
-
itemToMove.style.height = `${event.target.chartHeight}px`;
|
151
|
-
itemToMove.style.width = `${event.target.chartWidth}px`;
|
152
|
-
if (chartContainer.firstChild !== null) {
|
153
|
-
chartContainer.firstChild.before(itemToMove);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
};
|
157
|
-
const CircleChart = ({
|
158
|
-
align = "center",
|
159
|
-
aria = {},
|
160
|
-
rounded = false,
|
161
|
-
borderColor = rounded ? null : "",
|
162
|
-
borderWidth = rounded ? 20 : null,
|
163
|
-
chartData,
|
164
|
-
children,
|
165
|
-
className,
|
166
|
-
colors: colors2 = [],
|
167
|
-
customOptions = {},
|
168
|
-
dark = false,
|
169
|
-
data = {},
|
170
|
-
dataLabelHtml = "<div>{point.name}</div>",
|
171
|
-
dataLabels = false,
|
172
|
-
height,
|
173
|
-
htmlOptions = {},
|
174
|
-
id,
|
175
|
-
innerSize = "md",
|
176
|
-
legend = false,
|
177
|
-
maxPointSize = null,
|
178
|
-
minPointSize = null,
|
179
|
-
startAngle = null,
|
180
|
-
style = "pie",
|
181
|
-
title,
|
182
|
-
tooltipHtml,
|
183
|
-
useHtml = false,
|
184
|
-
zMin = null,
|
185
|
-
layout = "horizontal",
|
186
|
-
verticalAlign = "bottom",
|
187
|
-
x = 0,
|
188
|
-
y = 0,
|
189
|
-
...props
|
190
|
-
}) => {
|
191
|
-
const ariaProps = buildAriaProps(aria);
|
192
|
-
const dataProps = buildDataProps(data);
|
193
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
194
|
-
HighchartsMore(Highcharts);
|
195
|
-
const setupTheme = () => {
|
196
|
-
dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
|
197
|
-
};
|
198
|
-
setupTheme();
|
199
|
-
Highcharts.setOptions({
|
200
|
-
tooltip: {
|
201
|
-
headerFormat: null,
|
202
|
-
pointFormat: tooltipHtml ? tooltipHtml : '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',
|
203
|
-
useHTML: useHtml
|
204
|
-
}
|
205
|
-
});
|
206
|
-
const innerSizes = { sm: "35%", md: "50%", lg: "85%", none: "0%" };
|
207
|
-
const innerSizeFormat = (size) => innerSizes[size];
|
208
|
-
const filteredProps = { ...props };
|
209
|
-
delete filteredProps.verticalAlign;
|
210
|
-
const [options, setOptions] = useState({});
|
211
|
-
useEffect(() => {
|
212
|
-
const formattedChartData = chartData.map((obj) => {
|
213
|
-
obj.y = obj.value;
|
214
|
-
delete obj.value;
|
215
|
-
return obj;
|
216
|
-
});
|
217
|
-
const staticOptions = {
|
218
|
-
title: {
|
219
|
-
text: title
|
220
|
-
},
|
221
|
-
chart: {
|
222
|
-
height,
|
223
|
-
type: style,
|
224
|
-
events: {
|
225
|
-
render: (event) => alignBlockElement(event),
|
226
|
-
redraw: (event) => alignBlockElement(event)
|
227
|
-
}
|
228
|
-
},
|
229
|
-
legend: {
|
230
|
-
align,
|
231
|
-
verticalAlign,
|
232
|
-
layout,
|
233
|
-
x,
|
234
|
-
y
|
235
|
-
},
|
236
|
-
plotOptions: {
|
237
|
-
pie: {
|
238
|
-
colors: colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
|
239
|
-
dataLabels: {
|
240
|
-
enabled: dataLabels,
|
241
|
-
connectorShape: "straight",
|
242
|
-
connectorWidth: 3,
|
243
|
-
format: dataLabelHtml
|
244
|
-
},
|
245
|
-
showInLegend: legend
|
246
|
-
}
|
247
|
-
},
|
248
|
-
series: [
|
249
|
-
{
|
250
|
-
minPointSize,
|
251
|
-
maxPointSize,
|
252
|
-
innerSize: borderWidth == 20 ? "100%" : innerSizeFormat(innerSize),
|
253
|
-
data: formattedChartData,
|
254
|
-
zMin,
|
255
|
-
startAngle,
|
256
|
-
borderWidth,
|
257
|
-
borderColor
|
258
|
-
}
|
259
|
-
],
|
260
|
-
credits: false
|
261
|
-
};
|
262
|
-
setOptions(merge(staticOptions, customOptions));
|
263
|
-
}, [chartData]);
|
264
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children ? /* @__PURE__ */ jsxs("div", { id: `wrapper-circle-chart-${id}`, children: [
|
265
|
-
/* @__PURE__ */ jsx(
|
266
|
-
HighchartsReact,
|
267
|
-
{
|
268
|
-
containerProps: {
|
269
|
-
className: classnames("pb_circle_chart", globalProps(filteredProps)),
|
270
|
-
id,
|
271
|
-
...ariaProps,
|
272
|
-
...dataProps,
|
273
|
-
...htmlProps
|
274
|
-
},
|
275
|
-
highcharts: Highcharts,
|
276
|
-
options
|
277
|
-
}
|
278
|
-
),
|
279
|
-
/* @__PURE__ */ jsx("div", { className: "pb-circle-chart-block", children })
|
280
|
-
] }) : /* @__PURE__ */ jsx(
|
281
|
-
HighchartsReact,
|
282
|
-
{
|
283
|
-
containerProps: {
|
284
|
-
className: classnames("pb_circle_chart", globalProps(filteredProps)),
|
285
|
-
id,
|
286
|
-
...ariaProps,
|
287
|
-
...dataProps,
|
288
|
-
...htmlProps
|
289
|
-
},
|
290
|
-
highcharts: Highcharts,
|
291
|
-
options
|
292
|
-
}
|
293
|
-
) });
|
294
|
-
};
|
295
|
-
const Gauge = ({
|
296
|
-
aria = {},
|
297
|
-
chartData,
|
298
|
-
customOptions = {},
|
299
|
-
dark = false,
|
300
|
-
data = {},
|
301
|
-
disableAnimation = false,
|
302
|
-
fullCircle = false,
|
303
|
-
height = null,
|
304
|
-
htmlOptions = {},
|
305
|
-
id,
|
306
|
-
max = 100,
|
307
|
-
min = 0,
|
308
|
-
prefix = "",
|
309
|
-
showLabels = false,
|
310
|
-
style = "solidgauge",
|
311
|
-
suffix = "",
|
312
|
-
title = "",
|
313
|
-
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',
|
314
|
-
colors: colors$1 = [],
|
315
|
-
minorTickInterval = null,
|
316
|
-
circumference = fullCircle ? [0, 360] : [-100, 100],
|
317
|
-
...props
|
318
|
-
}) => {
|
319
|
-
const ariaProps = buildAriaProps(aria);
|
320
|
-
const dataProps = buildDataProps(data);
|
321
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
322
|
-
HighchartsMore(Highcharts);
|
323
|
-
SolidGauge(Highcharts);
|
324
|
-
const setupTheme = () => {
|
325
|
-
dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
|
326
|
-
};
|
327
|
-
setupTheme();
|
328
|
-
Highcharts.setOptions({
|
329
|
-
tooltip: {
|
330
|
-
pointFormat: tooltipHtml,
|
331
|
-
followPointer: true
|
332
|
-
}
|
333
|
-
});
|
334
|
-
const css = buildCss({
|
335
|
-
pb_gauge_kit: true
|
336
|
-
});
|
337
|
-
const [options, setOptions] = useState({});
|
338
|
-
useEffect(() => {
|
339
|
-
const formattedChartData = chartData.map((obj) => {
|
340
|
-
obj.y = obj.value;
|
341
|
-
delete obj.value;
|
342
|
-
return obj;
|
343
|
-
});
|
344
|
-
const staticOptions = {
|
345
|
-
chart: {
|
346
|
-
events: {
|
347
|
-
load() {
|
348
|
-
setTimeout(this.reflow.bind(this), 0);
|
349
|
-
}
|
350
|
-
},
|
351
|
-
type: style,
|
352
|
-
height
|
353
|
-
},
|
354
|
-
title: {
|
355
|
-
text: title
|
356
|
-
},
|
357
|
-
yAxis: {
|
358
|
-
min,
|
359
|
-
max,
|
360
|
-
lineWidth: 0,
|
361
|
-
tickWidth: 0,
|
362
|
-
minorTickInterval,
|
363
|
-
tickAmount: 2,
|
364
|
-
tickPositions: [min, max],
|
365
|
-
labels: {
|
366
|
-
y: 26,
|
367
|
-
enabled: showLabels
|
368
|
-
}
|
369
|
-
},
|
370
|
-
credits: false,
|
371
|
-
series: [
|
372
|
-
{
|
373
|
-
data: formattedChartData
|
374
|
-
}
|
375
|
-
],
|
376
|
-
pane: {
|
377
|
-
center: ["50%", "50%"],
|
378
|
-
size: "90%",
|
379
|
-
startAngle: circumference[0],
|
380
|
-
endAngle: circumference[1],
|
381
|
-
background: {
|
382
|
-
borderWidth: 20,
|
383
|
-
innerRadius: "90%",
|
384
|
-
outerRadius: "90%",
|
385
|
-
shape: "arc",
|
386
|
-
className: "gauge-pane"
|
387
|
-
}
|
388
|
-
},
|
389
|
-
colors: colors$1 !== void 0 && colors$1.length > 0 ? mapColors(colors$1) : highchartsTheme.colors,
|
390
|
-
plotOptions: {
|
391
|
-
series: {
|
392
|
-
animation: !disableAnimation
|
393
|
-
},
|
394
|
-
solidgauge: {
|
395
|
-
borderColor: colors$1 !== void 0 && colors$1.length === 1 ? mapColors(colors$1).join() : highchartsTheme.colors[0],
|
396
|
-
borderWidth: 20,
|
397
|
-
radius: 90,
|
398
|
-
innerRadius: "90%",
|
399
|
-
dataLabels: {
|
400
|
-
borderWidth: 0,
|
401
|
-
color: colors.text_lt_default,
|
402
|
-
enabled: true,
|
403
|
-
format: `<span class="prefix${dark ? " dark" : ""}">${prefix}</span><span class="fix${dark ? " dark" : ""}">{y:,f}</span><span class="suffix${dark ? " dark" : ""}">${suffix}</span>`,
|
404
|
-
style: {
|
405
|
-
fontFamily: typography.font_family_base,
|
406
|
-
fontWeight: typography.regular,
|
407
|
-
fontSize: typography.heading_2
|
408
|
-
},
|
409
|
-
y: -26
|
410
|
-
}
|
411
|
-
}
|
412
|
-
}
|
413
|
-
};
|
414
|
-
setOptions(merge(staticOptions, customOptions));
|
415
|
-
if (document.querySelector(".prefix")) {
|
416
|
-
document.querySelectorAll(".prefix").forEach((prefix2) => {
|
417
|
-
prefix2.setAttribute("y", "28");
|
418
|
-
});
|
419
|
-
document.querySelectorAll(".fix").forEach((fix) => fix.setAttribute("y", "38"));
|
420
|
-
}
|
421
|
-
}, [chartData]);
|
422
|
-
return /* @__PURE__ */ jsx(
|
423
|
-
HighchartsReact,
|
424
|
-
{
|
425
|
-
containerProps: {
|
426
|
-
className: classnames(css, globalProps(props)),
|
427
|
-
id,
|
428
|
-
...ariaProps,
|
429
|
-
...dataProps,
|
430
|
-
...htmlProps
|
431
|
-
},
|
432
|
-
highcharts: Highcharts,
|
433
|
-
options
|
434
|
-
}
|
435
|
-
);
|
436
|
-
};
|
437
|
-
const LineGraph = ({
|
438
|
-
aria = {},
|
439
|
-
data = {},
|
440
|
-
align = "center",
|
441
|
-
className = "pb_bar_graph",
|
442
|
-
customOptions = {},
|
443
|
-
dark = false,
|
444
|
-
gradient = false,
|
445
|
-
type = "line",
|
446
|
-
htmlOptions = {},
|
447
|
-
id,
|
448
|
-
legend = false,
|
449
|
-
toggleLegendClick = true,
|
450
|
-
layout = "horizontal",
|
451
|
-
verticalAlign = "bottom",
|
452
|
-
x = 0,
|
453
|
-
y = 0,
|
454
|
-
axisTitle,
|
455
|
-
xAxisCategories,
|
456
|
-
yAxisMin,
|
457
|
-
yAxisMax,
|
458
|
-
chartData,
|
459
|
-
pointStart,
|
460
|
-
subTitle,
|
461
|
-
title,
|
462
|
-
height,
|
463
|
-
colors: colors2 = [],
|
464
|
-
...props
|
465
|
-
}) => {
|
466
|
-
const ariaProps = buildAriaProps(aria);
|
467
|
-
const dataProps = buildDataProps(data);
|
468
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
469
|
-
const setupTheme = () => {
|
470
|
-
dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
|
471
|
-
};
|
472
|
-
setupTheme();
|
473
|
-
const staticOptions = {
|
474
|
-
title: {
|
475
|
-
text: title
|
476
|
-
},
|
477
|
-
chart: {
|
478
|
-
height,
|
479
|
-
type
|
480
|
-
},
|
481
|
-
subtitle: {
|
482
|
-
text: subTitle
|
483
|
-
},
|
484
|
-
yAxis: {
|
485
|
-
min: yAxisMin,
|
486
|
-
max: yAxisMax,
|
487
|
-
title: {
|
488
|
-
text: axisTitle
|
489
|
-
}
|
490
|
-
},
|
491
|
-
xAxis: {
|
492
|
-
categories: xAxisCategories
|
493
|
-
},
|
494
|
-
legend: {
|
495
|
-
enabled: legend,
|
496
|
-
align,
|
497
|
-
verticalAlign,
|
498
|
-
layout,
|
499
|
-
x,
|
500
|
-
y
|
501
|
-
},
|
502
|
-
colors: colors2 !== void 0 && colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
|
503
|
-
plotOptions: {
|
504
|
-
series: {
|
505
|
-
pointStart,
|
506
|
-
events: {},
|
507
|
-
dataLabels: {
|
508
|
-
enabled: false
|
509
|
-
}
|
510
|
-
}
|
511
|
-
},
|
512
|
-
series: chartData,
|
513
|
-
credits: false
|
514
|
-
};
|
515
|
-
if (!toggleLegendClick) {
|
516
|
-
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
517
|
-
}
|
518
|
-
const filteredProps = { ...props };
|
519
|
-
delete filteredProps.verticalAlign;
|
520
|
-
const [options, setOptions] = useState({});
|
521
|
-
useEffect(() => {
|
522
|
-
setOptions(merge(staticOptions, customOptions));
|
523
|
-
}, [chartData]);
|
524
|
-
return /* @__PURE__ */ jsx(
|
525
|
-
HighchartsReact,
|
526
|
-
{
|
527
|
-
containerProps: {
|
528
|
-
className: classnames(globalProps(filteredProps), className),
|
529
|
-
id,
|
530
|
-
...ariaProps,
|
531
|
-
...dataProps,
|
532
|
-
...htmlProps
|
533
|
-
},
|
534
|
-
highcharts: Highcharts,
|
535
|
-
options
|
536
|
-
}
|
537
|
-
);
|
538
|
-
};
|
539
|
-
export {
|
540
|
-
BarGraph as B,
|
541
|
-
CircleChart as C,
|
542
|
-
Gauge as G,
|
543
|
-
LineGraph as L
|
544
|
-
};
|