playbook_ui 14.4.0.pre.alpha.PBNTR534filtermaxwidth3903 → 14.4.0.pre.alpha.PLAY1486highchartscssdrivenPOC3921
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +25 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +5 -184
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +1 -1
- data/app/pb_kits/playbook/pb_button/_button.tsx +6 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +5 -216
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +1 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +2 -6
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +2 -7
- data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +25 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +465 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +195 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +3 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.rb +8 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +77 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +10 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/filter.rb +0 -1
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +3 -64
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +5 -203
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +5 -154
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +1 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +14 -13
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +4 -4
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +5 -2
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +17 -13
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +5 -113
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +1 -1
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +13 -13
- data/dist/chunks/_typeahead-BywvWGAm.js +22 -0
- data/dist/chunks/_weekday_stacked-5OGZKZeo.js +45 -0
- data/dist/chunks/lib-DMOmCoAX.js +29 -0
- data/dist/chunks/{pb_form_validation-D9zkwt2b.js → pb_form_validation-Dna2I7fw.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +3 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/pagination_renderer.rb +10 -2
- data/lib/playbook/version.rb +1 -1
- metadata +21 -6
- data/dist/chunks/_typeahead-C7ICra83.js +0 -22
- data/dist/chunks/_weekday_stacked-DwrIhNbf.js +0 -45
- data/dist/chunks/lib-CEpcaI8y.js +0 -29
@@ -1,118 +1,10 @@
|
|
1
|
-
import React
|
2
|
-
import classnames from "classnames";
|
3
|
-
|
4
|
-
import { globalProps } from "../utilities/globalProps";
|
5
|
-
import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
|
6
|
-
|
7
|
-
import HighchartsReact from "highcharts-react-official";
|
8
|
-
import Highcharts from "highcharts";
|
9
|
-
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
10
|
-
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
11
|
-
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
12
|
-
import treemap from 'highcharts/modules/treemap'
|
13
|
-
import { merge } from 'lodash'
|
14
|
-
|
15
|
-
type TreemapChartProps = {
|
16
|
-
chartData: {
|
17
|
-
name: string;
|
18
|
-
parent?: string | number;
|
19
|
-
value: number;
|
20
|
-
color?: string;
|
21
|
-
id?: string | number;
|
22
|
-
}[];
|
23
|
-
className?: string;
|
24
|
-
colors: string[];
|
25
|
-
customOptions?: Partial<Highcharts.Options>;
|
26
|
-
dark?: boolean;
|
27
|
-
drillable: boolean;
|
28
|
-
grouped: boolean;
|
29
|
-
height?: string;
|
30
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
31
|
-
id: number | string;
|
32
|
-
title?: string;
|
33
|
-
tooltipHtml: string;
|
34
|
-
type?: string;
|
35
|
-
aria?: { [key: string]: string };
|
36
|
-
data?: { [key: string]: string };
|
37
|
-
};
|
38
|
-
|
39
|
-
const TreemapChart = ({
|
40
|
-
aria = {},
|
41
|
-
data = {},
|
42
|
-
chartData,
|
43
|
-
colors,
|
44
|
-
customOptions = {},
|
45
|
-
dark = false,
|
46
|
-
drillable = false,
|
47
|
-
grouped = false,
|
48
|
-
height,
|
49
|
-
htmlOptions = {},
|
50
|
-
id,
|
51
|
-
title = "",
|
52
|
-
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.value}</b>',
|
53
|
-
type = "treemap",
|
54
|
-
...props
|
55
|
-
}: TreemapChartProps): React.ReactElement => {
|
56
|
-
|
57
|
-
const ariaProps = buildAriaProps(aria)
|
58
|
-
const dataProps = buildDataProps(data)
|
59
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
60
|
-
|
61
|
-
const setupTheme = () => {
|
62
|
-
dark
|
63
|
-
? Highcharts.setOptions(highchartsDarkTheme)
|
64
|
-
: Highcharts.setOptions(highchartsTheme);
|
65
|
-
};
|
66
|
-
treemap(Highcharts)
|
67
|
-
setupTheme();
|
68
|
-
|
69
|
-
const staticOptions = {
|
70
|
-
title: {
|
71
|
-
text: title,
|
72
|
-
},
|
73
|
-
chart: {
|
74
|
-
height: height,
|
75
|
-
type: type,
|
76
|
-
},
|
77
|
-
credits: false,
|
78
|
-
series: [
|
79
|
-
{
|
80
|
-
data: chartData,
|
81
|
-
},
|
82
|
-
],
|
83
|
-
plotOptions: {
|
84
|
-
treemap: {
|
85
|
-
tooltip: {
|
86
|
-
pointFormat: tooltipHtml,
|
87
|
-
},
|
88
|
-
allowTraversingTree: drillable,
|
89
|
-
colorByPoint: !grouped,
|
90
|
-
colors:
|
91
|
-
colors !== undefined && colors.length > 0
|
92
|
-
? mapColors(colors)
|
93
|
-
: highchartsTheme.colors,
|
94
|
-
},
|
95
|
-
},
|
96
|
-
};
|
97
|
-
|
98
|
-
const [options, setOptions] = useState({});
|
99
|
-
|
100
|
-
useEffect(() => {
|
101
|
-
setOptions(merge(staticOptions, customOptions));
|
102
|
-
}, [chartData]);
|
1
|
+
import React from 'react';
|
103
2
|
|
3
|
+
const TreemapChart: React.FC = () => {
|
104
4
|
return (
|
105
|
-
<
|
106
|
-
|
107
|
-
|
108
|
-
id: id,
|
109
|
-
...ariaProps,
|
110
|
-
...dataProps,
|
111
|
-
...htmlProps
|
112
|
-
}}
|
113
|
-
highcharts={Highcharts}
|
114
|
-
options={options}
|
115
|
-
/>
|
5
|
+
<div>
|
6
|
+
This is a simple div component.
|
7
|
+
</div>
|
116
8
|
);
|
117
9
|
};
|
118
10
|
|
@@ -2,11 +2,11 @@ import React from "react";
|
|
2
2
|
import ReactDOMServer from 'react-dom/server';
|
3
3
|
|
4
4
|
const spinner = (
|
5
|
-
<svg
|
6
|
-
fill="none"
|
7
|
-
height="25"
|
8
|
-
viewBox="0 0 31 25"
|
9
|
-
width="31"
|
5
|
+
<svg
|
6
|
+
fill="none"
|
7
|
+
height="25"
|
8
|
+
viewBox="0 0 31 25"
|
9
|
+
width="31"
|
10
10
|
xmlns="http://www.w3.org/2000/svg"
|
11
11
|
>
|
12
12
|
<path d="M17.4043 1.85547C17.4043 2.69922 16.7012 3.35547 15.9043 3.35547C15.0605 3.35547 14.4043 2.69922 14.4043 1.85547C14.4043 1.05859 15.0605 0.355469 15.9043 0.355469C16.7012 0.355469 17.4043 1.05859 17.4043 1.85547ZM17.4043 22.8555C17.4043 23.6992 16.7012 24.3555 15.9043 24.3555C15.0605 24.3555 14.4043 23.6992 14.4043 22.8555C14.4043 22.0586 15.0605 21.3555 15.9043 21.3555C16.7012 21.3555 17.4043 22.0586 17.4043 22.8555ZM24.9043 12.3555C24.9043 11.5586 25.5605 10.8555 26.4043 10.8555C27.2012 10.8555 27.9043 11.5586 27.9043 12.3555C27.9043 13.1992 27.2012 13.8555 26.4043 13.8555C25.5605 13.8555 24.9043 13.1992 24.9043 12.3555ZM5.4043 13.8555C4.56055 13.8555 3.9043 13.1992 3.9043 12.3555C3.9043 11.5586 4.56055 10.8555 5.4043 10.8555C6.20117 10.8555 6.9043 11.5586 6.9043 12.3555C6.9043 13.1992 6.20117 13.8555 5.4043 13.8555ZM7.41992 20.8398C6.81055 20.2773 6.81055 19.3398 7.41992 18.7305C7.98242 18.168 8.91992 18.168 9.5293 18.7305C10.0918 19.3398 10.0918 20.2773 9.5293 20.8398C8.91992 21.4492 7.98242 21.4492 7.41992 20.8398ZM22.2324 20.8398C21.8574 20.5117 21.6699 19.9023 21.8105 19.3867C21.9512 18.8711 22.373 18.4492 22.8887 18.3086C23.4043 18.168 24.0137 18.3555 24.3887 18.7305C24.7637 19.1055 24.9512 19.668 24.8105 20.2305C24.6699 20.7461 24.248 21.168 23.7324 21.3086C23.1699 21.4492 22.6074 21.2617 22.2324 20.8398ZM7.41992 3.87109C7.98242 3.30859 8.91992 3.30859 9.5293 3.87109C10.0918 4.48047 10.0918 5.41797 9.5293 6.02734C8.91992 6.58984 7.98242 6.58984 7.41992 6.02734C6.81055 5.41797 6.81055 4.48047 7.41992 3.87109Z"
|
@@ -16,10 +16,10 @@ const spinner = (
|
|
16
16
|
)
|
17
17
|
|
18
18
|
const clock = (
|
19
|
-
<svg
|
20
|
-
fill="none"
|
21
|
-
height="25"
|
22
|
-
viewBox="0 0 31 25"
|
19
|
+
<svg
|
20
|
+
fill="none"
|
21
|
+
height="25"
|
22
|
+
viewBox="0 0 31 25"
|
23
23
|
width="31"
|
24
24
|
xmlns="http://www.w3.org/2000/svg"
|
25
25
|
>
|
@@ -31,10 +31,10 @@ const clock = (
|
|
31
31
|
|
32
32
|
const times = (
|
33
33
|
<svg
|
34
|
-
fill="none"
|
35
|
-
height="25"
|
36
|
-
viewBox="0 0 31 25"
|
37
|
-
width="31"
|
34
|
+
fill="none"
|
35
|
+
height="25"
|
36
|
+
viewBox="0 0 31 25"
|
37
|
+
width="31"
|
38
38
|
xmlns="http://www.w3.org/2000/svg"
|
39
39
|
>
|
40
40
|
<path
|