playbook_ui 14.5.0.pre.alpha.PBNTR606multilevelselectreset4035 → 14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3930
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/pb_bar_graph/_bar_graph.scss +54 -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_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_form_pill/_form_pill.tsx +1 -9
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +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_multi_level_select/_multi_level_select.tsx +227 -211
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -2
- 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/pb_typeahead/_typeahead.tsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
- 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/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/pb_doc_helper.rb +5 -5
- data/lib/playbook/version.rb +1 -1
- metadata +6 -16
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +0 -19
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +0 -27
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +0 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +0 -93
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +0 -105
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +0 -106
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -149
- data/dist/chunks/_typeahead-C9g4qCcE.js +0 -22
- data/dist/chunks/_weekday_stacked-Div3Fpd3.js +0 -45
- data/dist/chunks/lib-CEpcaI8y.js +0 -29
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- multi_level_select_selected_ids: Selected Ids
|
8
8
|
- multi_level_select_with_form: With Form
|
9
9
|
- multi_level_select_color: With Pills (Custom Color)
|
10
|
-
- multi_level_select_reset: Reset Selection
|
11
10
|
|
12
11
|
react:
|
13
12
|
- multi_level_select_default: Default
|
@@ -16,6 +15,3 @@ examples:
|
|
16
15
|
- multi_level_select_return_all_selected: Return All Selected
|
17
16
|
- multi_level_select_selected_ids_react: Selected Ids
|
18
17
|
- multi_level_select_color: With Pills (Custom Color)
|
19
|
-
- multi_level_select_with_children: Checkboxes With Children
|
20
|
-
- multi_level_select_with_children_with_radios: Single Select With Children
|
21
|
-
|
@@ -4,5 +4,3 @@ export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_se
|
|
4
4
|
export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
|
5
5
|
export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_select_selected_ids_react.jsx"
|
6
6
|
export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
|
7
|
-
export { default as MultiLevelSelectWithChildren } from './_multi_level_select_with_children.jsx'
|
8
|
-
export { default as MultiLevelSelectWithChildrenWithRadios } from './_multi_level_select_with_children_with_radios.jsx'
|
@@ -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
|
|
@@ -136,15 +136,12 @@ const Typeahead = ({
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
|
139
|
-
const filteredProps: TypeaheadProps = {...props}
|
140
|
-
delete filteredProps.truncate
|
141
|
-
|
142
139
|
const dataProps = buildDataProps(data)
|
143
140
|
const htmlProps = buildHtmlProps(htmlOptions)
|
144
141
|
const classes = classnames(
|
145
142
|
'pb_typeahead_kit react-select',
|
146
143
|
`mb_${marginBottom}`,
|
147
|
-
globalProps(
|
144
|
+
globalProps(props),
|
148
145
|
className
|
149
146
|
)
|
150
147
|
|
@@ -16,7 +16,7 @@ type Props = {
|
|
16
16
|
const MultiValue = (props: Props) => {
|
17
17
|
const { removeProps } = props
|
18
18
|
const { imageUrl, label } = props.data
|
19
|
-
const { dark, multiKit, pillColor
|
19
|
+
const { dark, multiKit, pillColor } = props.selectProps
|
20
20
|
|
21
21
|
const formPillProps = {
|
22
22
|
marginRight: 'xs',
|
@@ -51,7 +51,6 @@ const MultiValue = (props: Props) => {
|
|
51
51
|
name={label}
|
52
52
|
size={multiKit === 'smallPill' ? 'small' : ''}
|
53
53
|
text=''
|
54
|
-
truncate={truncate}
|
55
54
|
{...props}
|
56
55
|
/>
|
57
56
|
}
|
@@ -65,7 +64,6 @@ const MultiValue = (props: Props) => {
|
|
65
64
|
name=''
|
66
65
|
size={multiKit === 'smallPill' ? 'small' : ''}
|
67
66
|
text={label}
|
68
|
-
truncate={truncate}
|
69
67
|
{...props}
|
70
68
|
/>
|
71
69
|
}
|
@@ -65,10 +65,10 @@ module Playbook
|
|
65
65
|
def typeahead_react_options
|
66
66
|
base_options = {
|
67
67
|
className: classname,
|
68
|
+
pillColor: pill_color,
|
68
69
|
dark: dark,
|
69
70
|
defaultValue: default_options,
|
70
71
|
error: error,
|
71
|
-
htmlOptions: html_options,
|
72
72
|
id: id,
|
73
73
|
inline: inline,
|
74
74
|
isMulti: is_multi,
|
@@ -77,10 +77,8 @@ module Playbook
|
|
77
77
|
multiKit: multi_kit,
|
78
78
|
name: name,
|
79
79
|
options: options,
|
80
|
-
pillColor: pill_color,
|
81
80
|
placeholder: placeholder,
|
82
81
|
plusIcon: plus_icon,
|
83
|
-
truncate: truncate,
|
84
82
|
}
|
85
83
|
|
86
84
|
base_options[:getOptionLabel] = get_option_label if get_option_label.present?
|