playbook_ui 12.11.0 → 12.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +20 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +31 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -0
- data/lib/playbook/version.rb +2 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52982a7fd482e46a592ec1dd33c640b2f4c3468c8c2c6ef89e63c2ac3aedc642
|
4
|
+
data.tar.gz: 9b01af38e5ed588b0d649a9ff770a3aa6529cf8673eec79919b197f9c1cdacaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c68065b2497b859a00255121fd7240cf0dc4f667c3c74ccccf1e59b6dae29d1a8c5146fe95780a1c9e5f90ced89fad71f79046a0c70b1723268e1674170b6d
|
7
|
+
data.tar.gz: '08ea2b02f9def8c1da0372a5a4b76a8740217256cb47582fda6d668736adbd936c7b086313a533a51ad0c1e809366068dfecf799dd5098b3d9296c83e374d638'
|
@@ -32,6 +32,7 @@ type CircleChartProps = {
|
|
32
32
|
startAngle?: number;
|
33
33
|
style?: string;
|
34
34
|
title?: string;
|
35
|
+
tooltipHtml: string;
|
35
36
|
useHtml?: boolean;
|
36
37
|
zMin?: number;
|
37
38
|
layout?: "horizontal" | "vertical" | "proximate";
|
@@ -78,6 +79,7 @@ const CircleChart = ({
|
|
78
79
|
startAngle = null,
|
79
80
|
style = "pie",
|
80
81
|
title,
|
82
|
+
tooltipHtml,
|
81
83
|
useHtml = false,
|
82
84
|
zMin = null,
|
83
85
|
layout = "horizontal",
|
@@ -100,9 +102,7 @@ const CircleChart = ({
|
|
100
102
|
Highcharts.setOptions({
|
101
103
|
tooltip: {
|
102
104
|
headerFormat: null,
|
103
|
-
pointFormat:
|
104
|
-
'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
105
|
-
"<b>{point.y}</b>",
|
105
|
+
pointFormat: tooltipHtml ? tooltipHtml : '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' + "<b>{point.y}</b>",
|
106
106
|
useHTML: useHtml,
|
107
107
|
},
|
108
108
|
});
|
@@ -24,6 +24,9 @@ module Playbook
|
|
24
24
|
prop :use_html, type: Playbook::Props::Boolean, default: false
|
25
25
|
prop :legend, type: Playbook::Props::Boolean, default: false
|
26
26
|
prop :title, default: ""
|
27
|
+
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">● </span>
|
28
|
+
{point.name}: ' + '<b>{point.y}
|
29
|
+
</b>'
|
27
30
|
prop :height
|
28
31
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
29
32
|
prop :colors, type: Playbook::Props::Array,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% data = [{
|
2
|
+
name: 'Waiting for Calls',
|
3
|
+
value: 41,
|
4
|
+
},
|
5
|
+
{
|
6
|
+
name: 'On Call',
|
7
|
+
value: 49,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'After call',
|
11
|
+
value: 10,
|
12
|
+
}
|
13
|
+
] %>
|
14
|
+
|
15
|
+
|
16
|
+
<%= pb_rails("circle_chart", props: {
|
17
|
+
chart_data: data,
|
18
|
+
tooltip_html: "<p>Custom tooltip for {point.name} <br/>with value: {point.y}</p>",
|
19
|
+
id: "default-test"
|
20
|
+
}) %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import CircleChart from '../_circle_chart'
|
4
|
+
|
5
|
+
const data = [
|
6
|
+
{
|
7
|
+
name: 'Waiting for Calls',
|
8
|
+
value: 41,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: 'On Call',
|
12
|
+
value: 49,
|
13
|
+
},
|
14
|
+
{
|
15
|
+
name: 'After call',
|
16
|
+
value: 10,
|
17
|
+
},
|
18
|
+
]
|
19
|
+
|
20
|
+
const CircleChartCustomTooltip = (props) => (
|
21
|
+
<div>
|
22
|
+
<CircleChart
|
23
|
+
chartData={data}
|
24
|
+
id="circle-chart-default"
|
25
|
+
tooltipHtml= '<p>Custom tooltip for {point.name} <br/>with value: {point.y}</p>'
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
</div>
|
29
|
+
)
|
30
|
+
|
31
|
+
export default CircleChartCustomTooltip
|
@@ -9,7 +9,8 @@ examples:
|
|
9
9
|
- circle_chart_with_legend_kit: Legend
|
10
10
|
- circle_chart_legend_position: Legend Position
|
11
11
|
- circle_chart_with_title: Title
|
12
|
-
- circle_chart_inner_sizes: Inner Circle Size Options
|
12
|
+
- circle_chart_inner_sizes: Inner Circle Size Options
|
13
|
+
- circle_chart_custom_tooltip: Tooltip Customization
|
13
14
|
|
14
15
|
react:
|
15
16
|
- circle_chart_default: Default Style
|
@@ -22,5 +23,6 @@ examples:
|
|
22
23
|
- circle_chart_legend_position: Legend Position
|
23
24
|
- circle_chart_with_title: Title
|
24
25
|
- circle_chart_inner_sizes: Inner Circle Size Options
|
26
|
+
- circle_chart_custom_tooltip: Tooltip Customization
|
25
27
|
|
26
28
|
|
@@ -8,3 +8,4 @@ export { default as CircleChartWithLegendKit } from './_circle_chart_with_legend
|
|
8
8
|
export { default as CircleChartLegendPosition } from './_circle_chart_legend_position.jsx'
|
9
9
|
export { default as CircleChartWithTitle } from './_circle_chart_with_title.jsx'
|
10
10
|
export { default as CircleChartInnerSizes } from './_circle_chart_inner_sizes.jsx'
|
11
|
+
export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-03-
|
12
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -570,6 +570,9 @@ files:
|
|
570
570
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb
|
571
571
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx
|
572
572
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.md
|
573
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb
|
574
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx
|
575
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md
|
573
576
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb
|
574
577
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx
|
575
578
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb
|