playbook_ui 14.21.2.pre.alpha.PLAY2179playbookiconsupdate8389 → 14.21.2.pre.alpha.PLAY2233removetreemapchart8408
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/Hooks/useTableState.ts +25 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +5 -3
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -39
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -39
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +7 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +7 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +7 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.jsx +19 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display.jsx +19 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.jsx +20 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.jsx +8 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.jsx +23 -14
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.html.erb +52 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.jsx +99 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_react.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.html.erb +28 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +47 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/index.ts +4 -4
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +4 -0
- data/dist/chunks/{_typeahead-BXD634Vm.js → _typeahead-DOgzItP7.js} +2 -2
- data/dist/chunks/{_weekday_stacked--dPf0i--.js → _weekday_stacked-SYZ-Kt4V.js} +2 -2
- data/dist/chunks/{lib-9VvC3Rp0.js → lib-Carqm8Ip.js} +2 -2
- data/dist/chunks/{pb_form_validation-CbyL4Bqa.js → pb_form_validation-DqRmTS8m.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +0 -9
- data/dist/playbook-doc.js +2 -2
- 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/version.rb +1 -1
- metadata +13 -28
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.scss +0 -14
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +0 -119
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +0 -2
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +0 -47
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +0 -79
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +0 -90
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +0 -54
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +0 -65
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -63
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +0 -48
@@ -1,65 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import TreemapChart from '../_treemap_chart'
|
4
|
-
|
5
|
-
const chartData = [
|
6
|
-
{
|
7
|
-
name: 'Meat',
|
8
|
-
id: 'Meat',
|
9
|
-
color: "#0056CF",
|
10
|
-
}, {
|
11
|
-
name: 'Pepperoni',
|
12
|
-
parent: 'Meat',
|
13
|
-
value: 250,
|
14
|
-
}, {
|
15
|
-
name: 'Meatball',
|
16
|
-
parent: 'Meat',
|
17
|
-
value: 400,
|
18
|
-
}, {
|
19
|
-
name: "Anchovy",
|
20
|
-
parent: 'Meat',
|
21
|
-
value: 40,
|
22
|
-
}, {
|
23
|
-
name: 'Vegetarian',
|
24
|
-
id: 'Vegetarian',
|
25
|
-
color: "#F9BB00",
|
26
|
-
}, {
|
27
|
-
name: 'Onions',
|
28
|
-
parent: 'Vegetarian',
|
29
|
-
value: 300,
|
30
|
-
}, {
|
31
|
-
name: 'Pineapple',
|
32
|
-
parent: 'Vegetarian',
|
33
|
-
value: 90,
|
34
|
-
}, {
|
35
|
-
name: "Peppers",
|
36
|
-
parent: 'Vegetarian',
|
37
|
-
value: 80,
|
38
|
-
}, {
|
39
|
-
name: "Specialty",
|
40
|
-
id: "Specialty",
|
41
|
-
color: "#9E64E9",
|
42
|
-
},{
|
43
|
-
name: "Buffalo Chicken",
|
44
|
-
parent: "Specialty",
|
45
|
-
value: 400,
|
46
|
-
}, {
|
47
|
-
name: "Supreme",
|
48
|
-
parent: "Specialty",
|
49
|
-
value: 150,
|
50
|
-
}
|
51
|
-
]
|
52
|
-
|
53
|
-
const TreemapChartGroupedData = (props) => (
|
54
|
-
<div>
|
55
|
-
<TreemapChart
|
56
|
-
chartData={chartData}
|
57
|
-
grouped
|
58
|
-
id="treemap-grouped-data"
|
59
|
-
title="Grouped Toppings"
|
60
|
-
{...props}
|
61
|
-
/>
|
62
|
-
</div>
|
63
|
-
)
|
64
|
-
|
65
|
-
export default TreemapChartGroupedData
|
@@ -1,3 +0,0 @@
|
|
1
|
-
Data can be grouped into distinct segments by specifying the relationship in the `chartData`. For a point to be a parent, it needs an `id` of type `string` included in its object. Any other data points may then reference that `id` as their `parent` value to establish the tree structure.
|
2
|
-
|
3
|
-
Parents can also be passed a custom color to be applied to all of its child points.
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<% data = [
|
2
|
-
{
|
3
|
-
name: "Pepperoni",
|
4
|
-
parent: "Toppings",
|
5
|
-
value: 600,
|
6
|
-
}, {
|
7
|
-
name: "Cheese",
|
8
|
-
parent: "Toppings",
|
9
|
-
value: 510,
|
10
|
-
}, {
|
11
|
-
name: "Mushroom",
|
12
|
-
parent: "Toppings",
|
13
|
-
value: 330,
|
14
|
-
},{
|
15
|
-
name: "Onions",
|
16
|
-
parent: "Toppings",
|
17
|
-
value: 250,
|
18
|
-
}, {
|
19
|
-
name: "Olives",
|
20
|
-
parent: "Toppings",
|
21
|
-
value: 204,
|
22
|
-
}, {
|
23
|
-
name: "Pineapple",
|
24
|
-
parent: "Toppings",
|
25
|
-
value: 90,
|
26
|
-
}, {
|
27
|
-
name: "Pizza Toppings",
|
28
|
-
id: "Toppings",
|
29
|
-
},
|
30
|
-
] %>
|
31
|
-
|
32
|
-
<%= pb_rails("treemap_chart", props: {
|
33
|
-
chart_data: data,
|
34
|
-
id: "treemap-tooltip",
|
35
|
-
title: "Favored Pizza Toppings",
|
36
|
-
tooltip_html: "<p>Custom tooltip for {point.name} <br/>with value: {point.value}</p>",
|
37
|
-
}) %>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import TreemapChart from '../_treemap_chart'
|
4
|
-
|
5
|
-
const chartData = [
|
6
|
-
{
|
7
|
-
name: "Pepperoni",
|
8
|
-
parent: "Toppings",
|
9
|
-
value: 600,
|
10
|
-
}, {
|
11
|
-
name: "Cheese",
|
12
|
-
parent: "Toppings",
|
13
|
-
value: 510,
|
14
|
-
}, {
|
15
|
-
name: "Mushroom",
|
16
|
-
parent: "Toppings",
|
17
|
-
value: 330,
|
18
|
-
},{
|
19
|
-
name: "Onions",
|
20
|
-
parent: "Toppings",
|
21
|
-
value: 250,
|
22
|
-
}, {
|
23
|
-
name: "Olives",
|
24
|
-
parent: "Toppings",
|
25
|
-
value: 204,
|
26
|
-
}, {
|
27
|
-
name: "Pineapple",
|
28
|
-
parent: "Toppings",
|
29
|
-
value: 90,
|
30
|
-
}, {
|
31
|
-
name: "Pizza Toppings",
|
32
|
-
id: "Toppings",
|
33
|
-
},
|
34
|
-
]
|
35
|
-
|
36
|
-
const TreemapChartTooltip = (props) => (
|
37
|
-
<div>
|
38
|
-
<TreemapChart
|
39
|
-
chartData={chartData}
|
40
|
-
id="treemap-tooltip"
|
41
|
-
title="Favored Pizza Toppings"
|
42
|
-
tooltipHtml= '<p>Custom tooltip for {point.name} <br/>with value: {point.value}</p>'
|
43
|
-
{...props}
|
44
|
-
/>
|
45
|
-
</div>
|
46
|
-
)
|
47
|
-
|
48
|
-
export default TreemapChartTooltip
|
@@ -1,15 +0,0 @@
|
|
1
|
-
examples:
|
2
|
-
|
3
|
-
rails:
|
4
|
-
- treemap_chart_default: Default
|
5
|
-
- treemap_chart_grouped_data: Grouped Data
|
6
|
-
- treemap_chart_drillable: Drillable
|
7
|
-
- treemap_chart_colors: Color Overrides
|
8
|
-
- treemap_chart_tooltip: Tooltip Customization
|
9
|
-
|
10
|
-
react:
|
11
|
-
- treemap_chart_default: Default
|
12
|
-
- treemap_chart_grouped_data: Grouped Data
|
13
|
-
- treemap_chart_drillable: Drillable
|
14
|
-
- treemap_chart_colors: Color Overrides
|
15
|
-
- treemap_chart_tooltip: Tooltip Customization
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export { default as TreemapChartDefault } from './_treemap_chart_default.jsx'
|
2
|
-
export { default as TreemapChartGroupedData } from './_treemap_chart_grouped_data.jsx'
|
3
|
-
export { default as TreemapChartDrillable } from './_treemap_chart_drillable.jsx'
|
4
|
-
export { default as TreemapChartColors } from './_treemap_chart_colors.jsx'
|
5
|
-
export { default as TreemapChartTooltip } from './_treemap_chart_tooltip.jsx'
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/* eslint-disable no-console */
|
2
|
-
|
3
|
-
import React from 'react';
|
4
|
-
import { render, screen } from '../utilities/test-utils';
|
5
|
-
import TreemapChart from './_treemap_chart';
|
6
|
-
|
7
|
-
beforeEach(() => {
|
8
|
-
// Silences error logs within the test suite.
|
9
|
-
jest.spyOn(console, 'error');
|
10
|
-
jest.spyOn(console, 'warn');
|
11
|
-
console.error.mockImplementation(() => {});
|
12
|
-
console.warn.mockImplementation(() => {});
|
13
|
-
});
|
14
|
-
|
15
|
-
afterEach(() => {
|
16
|
-
console.error.mockRestore();
|
17
|
-
console.warn.mockRestore();
|
18
|
-
});
|
19
|
-
|
20
|
-
const testId = 'treemapchart1';
|
21
|
-
|
22
|
-
test('uses exact classname', () => {
|
23
|
-
const data = [
|
24
|
-
{
|
25
|
-
name: "Pepperoni",
|
26
|
-
parent: "Toppings",
|
27
|
-
value: 600,
|
28
|
-
}, {
|
29
|
-
name: "Cheese",
|
30
|
-
parent: "Toppings",
|
31
|
-
value: 510,
|
32
|
-
}, {
|
33
|
-
name: "Mushroom",
|
34
|
-
parent: "Toppings",
|
35
|
-
value: 330,
|
36
|
-
},{
|
37
|
-
name: "Onions",
|
38
|
-
parent: "Toppings",
|
39
|
-
value: 250,
|
40
|
-
}, {
|
41
|
-
name: "Olives",
|
42
|
-
parent: "Toppings",
|
43
|
-
value: 204,
|
44
|
-
}, {
|
45
|
-
name: "Pineapple",
|
46
|
-
parent: "Toppings",
|
47
|
-
value: 90,
|
48
|
-
}, {
|
49
|
-
name: "Pizza Toppings",
|
50
|
-
id: "Toppings",
|
51
|
-
},
|
52
|
-
]
|
53
|
-
render(
|
54
|
-
<TreemapChart
|
55
|
-
chartData={data}
|
56
|
-
data={{ testid: testId }}
|
57
|
-
id="tree-map-id"
|
58
|
-
/>
|
59
|
-
);
|
60
|
-
|
61
|
-
const kit = screen.getByTestId(testId);
|
62
|
-
expect(kit).toHaveClass('pb_treemap_chart');
|
63
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= react_component('TreemapChart', object.chart_options) %>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbTreemapChart
|
5
|
-
class TreemapChart < Playbook::KitBase
|
6
|
-
prop :chart_data, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :colors, type: Playbook::Props::Array,
|
9
|
-
default: []
|
10
|
-
prop :custom_options, default: {}
|
11
|
-
prop :drillable, type: Playbook::Props::Boolean, default: false
|
12
|
-
prop :grouped, type: Playbook::Props::Boolean, default: false
|
13
|
-
prop :height
|
14
|
-
prop :title, default: ""
|
15
|
-
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">● </span>
|
16
|
-
{point.name}: ' + '<b>{point.value}
|
17
|
-
</b>'
|
18
|
-
|
19
|
-
def chart_type
|
20
|
-
"treemap"
|
21
|
-
end
|
22
|
-
|
23
|
-
def standard_options
|
24
|
-
{
|
25
|
-
chartData: chart_data,
|
26
|
-
className: classname,
|
27
|
-
colors: colors,
|
28
|
-
dark: dark ? "dark" : "",
|
29
|
-
drillable: drillable,
|
30
|
-
grouped: grouped,
|
31
|
-
height: height,
|
32
|
-
id: id,
|
33
|
-
title: title,
|
34
|
-
tooltipHtml: tooltip_html,
|
35
|
-
type: chart_type,
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
def chart_options
|
40
|
-
standard_options.deep_merge(custom_options)
|
41
|
-
end
|
42
|
-
|
43
|
-
def classname
|
44
|
-
generate_classname("pb_treemap_chart")
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|