playbook_ui 10.26.0.pre.alpha.display1 → 10.26.0.pre.alpha.sticky1
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/data/menu.yml +0 -1
- data/app/pb_kits/playbook/index.js +1 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +3 -3
- data/app/pb_kits/playbook/pb_body/_body.tsx +8 -8
- data/app/pb_kits/playbook/pb_caption/{_caption.tsx → _caption.jsx} +8 -7
- data/app/pb_kits/playbook/pb_card/_card.jsx +1 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -37
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +0 -37
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.js +2 -1
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.html.erb +83 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.jsx +94 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky.md +10 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_sticky_header.scss +23 -0
- data/app/pb_kits/playbook/pb_table/table.rb +7 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
- data/app/pb_kits/playbook/pb_title/{_title.tsx → _title.jsx} +12 -10
- data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/playbook-rails-react-bindings.js +0 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +0 -34
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +5 -21
- data/app/pb_kits/playbook/utilities/_display.scss +2 -60
- data/app/pb_kits/playbook/utilities/globalProps.ts +16 -31
- data/lib/playbook/display.rb +7 -21
- data/lib/playbook/version.rb +1 -1
- metadata +10 -27
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +0 -79
- 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/treemap_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +0 -43
- data/app/pb_kits/playbook/tokens/_display.scss +0 -13
@@ -12,7 +12,7 @@ test('returns namespaced class name', () => {
|
|
12
12
|
)
|
13
13
|
|
14
14
|
const kit = screen.getByTestId('primary-test')
|
15
|
-
expect(kit).toHaveClass('
|
15
|
+
expect(kit).toHaveClass('pb_title_kit_3')
|
16
16
|
})
|
17
17
|
|
18
18
|
test('with colors', () => {
|
@@ -25,5 +25,5 @@ test('with colors', () => {
|
|
25
25
|
)
|
26
26
|
|
27
27
|
const kit = screen.getByTestId('primary-test')
|
28
|
-
expect(kit).toHaveClass('
|
28
|
+
expect(kit).toHaveClass('pb_title_kit_3_success')
|
29
29
|
})
|
@@ -91,7 +91,6 @@ import * as Title from 'pb_title/docs'
|
|
91
91
|
import * as TitleCount from 'pb_title_count/docs'
|
92
92
|
import * as TitleDetail from 'pb_title_detail/docs'
|
93
93
|
import * as Toggle from 'pb_toggle/docs'
|
94
|
-
import * as TreemapChart from 'pb_treemap_chart/docs'
|
95
94
|
import * as Typeahead from 'pb_typeahead/docs'
|
96
95
|
import * as User from 'pb_user/docs'
|
97
96
|
import * as UserBadge from 'pb_user_badge/docs'
|
@@ -186,7 +185,6 @@ WebpackerReact.setup({
|
|
186
185
|
...TitleCount,
|
187
186
|
...TitleDetail,
|
188
187
|
...Toggle,
|
189
|
-
...TreemapChart,
|
190
188
|
...Typeahead,
|
191
189
|
...User,
|
192
190
|
...UserBadge,
|
@@ -13,7 +13,6 @@ import Legend from './pb_legend/_legend'
|
|
13
13
|
import LineGraph from './pb_line_graph/_line_graph'
|
14
14
|
import Passphrase from './pb_passphrase/_passphrase'
|
15
15
|
import RichTextEditor from './pb_rich_text_editor/_rich_text_editor'
|
16
|
-
import TreemapChart from './pb_treemap_chart/_treemap_chart'
|
17
16
|
import Typeahead from './pb_typeahead/_typeahead'
|
18
17
|
|
19
18
|
WebpackerReact.registerComponents({
|
@@ -27,7 +26,6 @@ WebpackerReact.registerComponents({
|
|
27
26
|
LineGraph,
|
28
27
|
Passphrase,
|
29
28
|
RichTextEditor,
|
30
|
-
TreemapChart,
|
31
29
|
Typeahead,
|
32
30
|
})
|
33
31
|
|
@@ -7,7 +7,6 @@ import colors from '../tokens/exports/_colors.scss'
|
|
7
7
|
import pie from 'highcharts/modules/variable-pie'
|
8
8
|
import highchartsMore from 'highcharts/highcharts-more'
|
9
9
|
import solidGauge from 'highcharts/modules/solid-gauge'
|
10
|
-
import treemap from 'highcharts/modules/treemap'
|
11
10
|
|
12
11
|
pie(Highcharts)
|
13
12
|
|
@@ -64,8 +63,6 @@ class pbChart {
|
|
64
63
|
this.setupPieChart(options)
|
65
64
|
} else if (this.options.type == 'gauge') {
|
66
65
|
this.setupGauge(options)
|
67
|
-
} else if (this.options.type == 'treemap') {
|
68
|
-
this.setupTreemap(options)
|
69
66
|
} else {
|
70
67
|
this.setupChart(options)
|
71
68
|
}
|
@@ -194,37 +191,6 @@ class pbChart {
|
|
194
191
|
})
|
195
192
|
}
|
196
193
|
|
197
|
-
setupTreemap(options) {
|
198
|
-
treemap(Highcharts)
|
199
|
-
this.setupTheme()
|
200
|
-
options.dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme)
|
201
|
-
|
202
|
-
Highcharts.chart(this.defaults.id, {
|
203
|
-
title: {
|
204
|
-
text: this.defaults.title,
|
205
|
-
},
|
206
|
-
chart: {
|
207
|
-
height: this.defaults.height,
|
208
|
-
type: this.defaults.type,
|
209
|
-
},
|
210
|
-
credits: false,
|
211
|
-
series: [{
|
212
|
-
data: this.defaults.chartData,
|
213
|
-
}],
|
214
|
-
plotOptions: {
|
215
|
-
treemap: {
|
216
|
-
allowTraversingTree: this.defaults.drillable,
|
217
|
-
colorByPoint: !this.defaults.grouped,
|
218
|
-
colors: options.colors !== undefined && options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
|
219
|
-
},
|
220
|
-
},
|
221
|
-
tooltip: {
|
222
|
-
pointFormat: this.defaults.tooltipHtml,
|
223
|
-
useHTML: true,
|
224
|
-
},
|
225
|
-
})
|
226
|
-
}
|
227
|
-
|
228
194
|
setupChart(options) {
|
229
195
|
this.setupTheme()
|
230
196
|
const configOptions = {
|
@@ -10,11 +10,11 @@ $screen-xl-min: 1200px;
|
|
10
10
|
$screen-xl-max: $screen-xl-min - 1;
|
11
11
|
|
12
12
|
$breakpoints: (
|
13
|
-
xs: $screen-xs-min,
|
14
|
-
sm: $screen-sm-min,
|
15
|
-
md: $screen-md-min,
|
16
|
-
lg: $screen-lg-min,
|
17
|
-
xl: $screen-xl-min
|
13
|
+
xs: $screen-xs-min,
|
14
|
+
sm: $screen-sm-min,
|
15
|
+
md: $screen-md-min,
|
16
|
+
lg: $screen-lg-min,
|
17
|
+
xl: $screen-xl-min
|
18
18
|
);
|
19
19
|
|
20
20
|
|
@@ -28,19 +28,3 @@ $breakpoints: (
|
|
28
28
|
@content;
|
29
29
|
}
|
30
30
|
}
|
31
|
-
|
32
|
-
@mixin break_on($min: null, $max: null) {
|
33
|
-
@if not $max {
|
34
|
-
@media screen and (min-width: $min) {
|
35
|
-
@content;
|
36
|
-
}
|
37
|
-
} @else if not $min {
|
38
|
-
@media screen and (max-width: $max) {
|
39
|
-
@content;
|
40
|
-
}
|
41
|
-
} @else {
|
42
|
-
@media screen and (min-width: $min) and (max-width: $max) {
|
43
|
-
@content;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@import "../tokens/display";
|
2
|
-
|
3
1
|
.display_block {
|
4
2
|
display: block;
|
5
3
|
}
|
@@ -20,62 +18,6 @@
|
|
20
18
|
display: inline-flex;
|
21
19
|
}
|
22
20
|
|
23
|
-
.
|
21
|
+
.display_hidden {
|
24
22
|
display: none;
|
25
|
-
}
|
26
|
-
|
27
|
-
$screen-xs-min: 575px;
|
28
|
-
$screen-xs-max: $screen-xs-min - 1;
|
29
|
-
$screen-sm-min: 576px;
|
30
|
-
$screen-sm-max: $screen-sm-min - 1;
|
31
|
-
$screen-md-min: 768px;
|
32
|
-
$screen-md-max: $screen-md-min - 1;
|
33
|
-
$screen-lg-min: 992px;
|
34
|
-
$screen-lg-max: $screen-lg-min - 1;
|
35
|
-
$screen-xl-min: 1200px;
|
36
|
-
$screen-xl-max: $screen-xl-min - 1;
|
37
|
-
|
38
|
-
$breakpoints: (
|
39
|
-
xs: (
|
40
|
-
// min: 0,
|
41
|
-
max: $screen-xs-min // 575
|
42
|
-
),
|
43
|
-
sm: (
|
44
|
-
min: $screen-sm-min, // 576
|
45
|
-
max: $screen-md-max // 767
|
46
|
-
),
|
47
|
-
md: (
|
48
|
-
min: $screen-md-min, // 768
|
49
|
-
max: $screen-lg-max // 991
|
50
|
-
),
|
51
|
-
lg: (
|
52
|
-
min: $screen-lg-min, // 992
|
53
|
-
max: $screen-xl-max // 1199
|
54
|
-
),
|
55
|
-
xl: (
|
56
|
-
min: $screen-xl-min, //1200
|
57
|
-
// max: 0
|
58
|
-
)
|
59
|
-
);
|
60
|
-
|
61
|
-
|
62
|
-
$display_values: (
|
63
|
-
none: $display_none,
|
64
|
-
flex: $display_flex,
|
65
|
-
inline: $display_inline,
|
66
|
-
inline_block: $display_inline_block,
|
67
|
-
inline_flex: $display_inline_flex,
|
68
|
-
block: $display_block
|
69
|
-
);
|
70
|
-
|
71
|
-
@each $size, $size_value in $breakpoints {
|
72
|
-
@each $display, $display_value in $display_values {
|
73
|
-
$min_size: map-get($size_value, "min");
|
74
|
-
$max_size: map-get($size_value, "max");
|
75
|
-
.display_#{$size}_#{$display} {
|
76
|
-
@include break_on($min_size, $max_size) {
|
77
|
-
display: #{$display_value} !important;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
81
|
-
}
|
23
|
+
}
|
@@ -1,12 +1,7 @@
|
|
1
1
|
import { omit } from 'lodash'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Display,
|
6
|
-
DisplaySizes,
|
7
|
-
None,
|
8
|
-
Sizes,
|
9
|
-
} from '../types'
|
3
|
+
type Sizes = "xs" | "sm" | "md" | "lg" | "xl"
|
4
|
+
type None = "none"
|
10
5
|
|
11
6
|
type AllSizes = None & Sizes
|
12
7
|
|
@@ -47,23 +42,27 @@ type ZIndex = {
|
|
47
42
|
}
|
48
43
|
|
49
44
|
type Shadow = {
|
50
|
-
shadow?:
|
45
|
+
shadow?: "none" | "deep" | "deeper" | "deepest",
|
51
46
|
}
|
52
47
|
|
53
48
|
type LineHeight = {
|
54
49
|
lineHeight?: "loosest" | "looser" | "loose" | "normal" | "tight" | "tighter" | "tightest",
|
55
50
|
}
|
56
51
|
|
52
|
+
type Display = {
|
53
|
+
display?: "block" | "flex" | "hidden" | "inline_block" | "inline" | "inline_flex",
|
54
|
+
}
|
55
|
+
|
57
56
|
type Cursor = {
|
58
57
|
cursor?: "pointer",
|
59
58
|
}
|
60
59
|
|
61
60
|
type BorderRadius = {
|
62
|
-
borderRadius?:
|
61
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "rounded",
|
63
62
|
}
|
64
63
|
|
65
64
|
type Flex = {
|
66
|
-
flex?:
|
65
|
+
flex?: "none" | "initial" | "auto" | 1
|
67
66
|
}
|
68
67
|
|
69
68
|
type FlexDirection = {
|
@@ -71,11 +70,11 @@ type FlexDirection = {
|
|
71
70
|
}
|
72
71
|
|
73
72
|
type FlexGrow = {
|
74
|
-
flexGrow?:
|
73
|
+
flexGrow?: 0 | 1
|
75
74
|
}
|
76
75
|
|
77
76
|
type FlexShrink = {
|
78
|
-
flexShrink?:
|
77
|
+
flexShrink?: 0 | 1
|
79
78
|
}
|
80
79
|
|
81
80
|
type FlexWrap = {
|
@@ -107,11 +106,11 @@ type AlignSelf = {
|
|
107
106
|
}
|
108
107
|
|
109
108
|
type Order = {
|
110
|
-
order?:
|
109
|
+
order?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
111
110
|
}
|
112
111
|
|
113
112
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
114
|
-
BorderRadius & Cursor & Dark & Display &
|
113
|
+
BorderRadius & Cursor & Dark & Display & Flex & FlexDirection &
|
115
114
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
116
115
|
LineHeight & Margin & MaxWidth & NumberSpacing & Order & Padding &
|
117
116
|
Shadow & ZIndex
|
@@ -181,21 +180,9 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
181
180
|
css += lineHeight ? `line_height_${lineHeight} ` : ''
|
182
181
|
return css
|
183
182
|
},
|
184
|
-
displayProps: (display: Display
|
183
|
+
displayProps: ({ display }: Display) => {
|
185
184
|
let css = ''
|
186
|
-
|
187
|
-
if (displayEntry[0] == "display") {
|
188
|
-
if (typeof displayEntry[1] == "string") {
|
189
|
-
css += `display_${displayEntry[1]} `
|
190
|
-
} else if (typeof displayEntry[1] == "object") {
|
191
|
-
Object.entries(displayEntry[1]).forEach((displayObj) => {
|
192
|
-
css += `display_${displayObj[0]}_${displayObj[1]} `
|
193
|
-
})
|
194
|
-
} else {
|
195
|
-
' '
|
196
|
-
}
|
197
|
-
}
|
198
|
-
})
|
185
|
+
css += display ? `display_${display} ` : ''
|
199
186
|
return css
|
200
187
|
},
|
201
188
|
cursorProps: ({ cursor }: Cursor) => {
|
@@ -272,9 +259,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
272
259
|
}
|
273
260
|
}
|
274
261
|
|
275
|
-
|
276
|
-
|
277
|
-
export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {}): string => {
|
262
|
+
export const globalProps = (props: GlobalProps, defaultProps: {[key: string]: string} | {} = {}): string => {
|
278
263
|
const allProps = { ...props, ...defaultProps }
|
279
264
|
return Object.keys(PROP_CATEGORIES).map((key) => {
|
280
265
|
return PROP_CATEGORIES[key](allProps)
|
data/lib/playbook/display.rb
CHANGED
@@ -8,22 +8,12 @@ module Playbook
|
|
8
8
|
|
9
9
|
def display_props
|
10
10
|
selected_props = display_options.keys.select { |sk| try(sk) }
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
display_value = send(
|
15
|
-
display_value
|
16
|
-
|
17
|
-
end
|
18
|
-
elsif display_value.is_a?(String)
|
19
|
-
selected_props.each do |k|
|
20
|
-
display_value = send(k)
|
21
|
-
css += "display_#{display_value}" if display_values.include? display_value
|
22
|
-
end
|
23
|
-
else
|
24
|
-
""
|
25
|
-
end
|
26
|
-
css unless css.blank?
|
11
|
+
return nil unless selected_props.present?
|
12
|
+
|
13
|
+
selected_props.map do |k|
|
14
|
+
display_value = send(k)
|
15
|
+
"display_#{display_value}" if display_values.include? display_value
|
16
|
+
end.compact.join(" ")
|
27
17
|
end
|
28
18
|
|
29
19
|
def display_options
|
@@ -32,12 +22,8 @@ module Playbook
|
|
32
22
|
}
|
33
23
|
end
|
34
24
|
|
35
|
-
def display_size_values
|
36
|
-
%w[xs sm md lg xl]
|
37
|
-
end
|
38
|
-
|
39
25
|
def display_values
|
40
|
-
%w[block inline_block inline flex inline_flex
|
26
|
+
%w[block inline_block inline flex inline_flex hidden]
|
41
27
|
end
|
42
28
|
end
|
43
29
|
end
|
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: 10.26.0.pre.alpha.
|
4
|
+
version: 10.26.0.pre.alpha.sticky1
|
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: 2022-05-
|
12
|
+
date: 2022-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -452,8 +452,8 @@ files:
|
|
452
452
|
- app/pb_kits/playbook/pb_button_toolbar/docs/_description.md
|
453
453
|
- app/pb_kits/playbook/pb_button_toolbar/docs/example.yml
|
454
454
|
- app/pb_kits/playbook/pb_button_toolbar/docs/index.js
|
455
|
+
- app/pb_kits/playbook/pb_caption/_caption.jsx
|
455
456
|
- app/pb_kits/playbook/pb_caption/_caption.scss
|
456
|
-
- app/pb_kits/playbook/pb_caption/_caption.tsx
|
457
457
|
- app/pb_kits/playbook/pb_caption/_caption_mixin.scss
|
458
458
|
- app/pb_kits/playbook/pb_caption/caption.html.erb
|
459
459
|
- app/pb_kits/playbook/pb_caption/caption.rb
|
@@ -1734,6 +1734,9 @@ files:
|
|
1734
1734
|
- app/pb_kits/playbook/pb_table/docs/_table_sm.html.erb
|
1735
1735
|
- app/pb_kits/playbook/pb_table/docs/_table_sm.jsx
|
1736
1736
|
- app/pb_kits/playbook/pb_table/docs/_table_sm.md
|
1737
|
+
- app/pb_kits/playbook/pb_table/docs/_table_sticky.html.erb
|
1738
|
+
- app/pb_kits/playbook/pb_table/docs/_table_sticky.jsx
|
1739
|
+
- app/pb_kits/playbook/pb_table/docs/_table_sticky.md
|
1737
1740
|
- app/pb_kits/playbook/pb_table/docs/_table_two_actions.html.erb
|
1738
1741
|
- app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx
|
1739
1742
|
- app/pb_kits/playbook/pb_table/docs/_table_two_actions.md
|
@@ -1755,6 +1758,7 @@ files:
|
|
1755
1758
|
- app/pb_kits/playbook/pb_table/styles/_reset.scss
|
1756
1759
|
- app/pb_kits/playbook/pb_table/styles/_side_highlight.scss
|
1757
1760
|
- app/pb_kits/playbook/pb_table/styles/_single-line.scss
|
1761
|
+
- app/pb_kits/playbook/pb_table/styles/_sticky_header.scss
|
1758
1762
|
- app/pb_kits/playbook/pb_table/styles/_structure.scss
|
1759
1763
|
- app/pb_kits/playbook/pb_table/styles/_table-card.scss
|
1760
1764
|
- app/pb_kits/playbook/pb_table/styles/_table-dark.scss
|
@@ -1762,6 +1766,7 @@ files:
|
|
1762
1766
|
- app/pb_kits/playbook/pb_table/styles/_variables.scss
|
1763
1767
|
- app/pb_kits/playbook/pb_table/table.html.erb
|
1764
1768
|
- app/pb_kits/playbook/pb_table/table.rb
|
1769
|
+
- app/pb_kits/playbook/pb_table/table.test.js
|
1765
1770
|
- app/pb_kits/playbook/pb_table/table_row.html.erb
|
1766
1771
|
- app/pb_kits/playbook/pb_table/table_row.rb
|
1767
1772
|
- app/pb_kits/playbook/pb_text_input/_text_input.jsx
|
@@ -1884,8 +1889,8 @@ files:
|
|
1884
1889
|
- app/pb_kits/playbook/pb_timestamp/docs/index.js
|
1885
1890
|
- app/pb_kits/playbook/pb_timestamp/timestamp.html.erb
|
1886
1891
|
- app/pb_kits/playbook/pb_timestamp/timestamp.rb
|
1892
|
+
- app/pb_kits/playbook/pb_title/_title.jsx
|
1887
1893
|
- app/pb_kits/playbook/pb_title/_title.scss
|
1888
|
-
- app/pb_kits/playbook/pb_title/_title.tsx
|
1889
1894
|
- app/pb_kits/playbook/pb_title/_title_mixin.scss
|
1890
1895
|
- app/pb_kits/playbook/pb_title/docs/_description.md
|
1891
1896
|
- app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb
|
@@ -1950,27 +1955,6 @@ files:
|
|
1950
1955
|
- app/pb_kits/playbook/pb_tooltip/index.js
|
1951
1956
|
- app/pb_kits/playbook/pb_tooltip/tooltip.html.erb
|
1952
1957
|
- app/pb_kits/playbook/pb_tooltip/tooltip.rb
|
1953
|
-
- app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
|
1954
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_description.md
|
1955
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb
|
1956
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx
|
1957
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md
|
1958
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb
|
1959
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx
|
1960
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md
|
1961
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb
|
1962
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx
|
1963
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md
|
1964
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb
|
1965
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx
|
1966
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md
|
1967
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb
|
1968
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx
|
1969
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md
|
1970
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/example.yml
|
1971
|
-
- app/pb_kits/playbook/pb_treemap_chart/docs/index.js
|
1972
|
-
- app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb
|
1973
|
-
- app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb
|
1974
1958
|
- app/pb_kits/playbook/pb_typeahead/_typeahead.jsx
|
1975
1959
|
- app/pb_kits/playbook/pb_typeahead/_typeahead.scss
|
1976
1960
|
- app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.jsx
|
@@ -2071,7 +2055,6 @@ files:
|
|
2071
2055
|
- app/pb_kits/playbook/tokens/_animation-curves.scss
|
2072
2056
|
- app/pb_kits/playbook/tokens/_border_radius.scss
|
2073
2057
|
- app/pb_kits/playbook/tokens/_colors.scss
|
2074
|
-
- app/pb_kits/playbook/tokens/_display.scss
|
2075
2058
|
- app/pb_kits/playbook/tokens/_line_height.scss
|
2076
2059
|
- app/pb_kits/playbook/tokens/_opacity.scss
|
2077
2060
|
- app/pb_kits/playbook/tokens/_positioning.scss
|
@@ -2177,7 +2160,7 @@ files:
|
|
2177
2160
|
- lib/playbook_ui.rb
|
2178
2161
|
homepage: http://playbook.powerapp.cloud
|
2179
2162
|
licenses:
|
2180
|
-
-
|
2163
|
+
- ISC
|
2181
2164
|
metadata: {}
|
2182
2165
|
post_install_message:
|
2183
2166
|
rdoc_options: []
|
@@ -1,79 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import classnames from 'classnames'
|
5
|
-
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
7
|
-
import pbChart from '../plugins/pb_chart'
|
8
|
-
|
9
|
-
type TreemapChartProps = {
|
10
|
-
chartData: array<{
|
11
|
-
name: string,
|
12
|
-
parent?: string | number,
|
13
|
-
value: number,
|
14
|
-
color?: string,
|
15
|
-
id?: string | number,
|
16
|
-
}>,
|
17
|
-
className?: string,
|
18
|
-
colors: array,
|
19
|
-
dark?: boolean,
|
20
|
-
drillable: boolean,
|
21
|
-
grouped: boolean,
|
22
|
-
height?: string,
|
23
|
-
id: number,
|
24
|
-
title: string,
|
25
|
-
tooltipHtml: string,
|
26
|
-
type?: string,
|
27
|
-
}
|
28
|
-
|
29
|
-
export default class TreemapChart extends React.Component<TreemapChartProps> {
|
30
|
-
static defaultProps = {
|
31
|
-
className: 'pb_treemap_chart',
|
32
|
-
dark: false,
|
33
|
-
drillable: false,
|
34
|
-
grouped: false,
|
35
|
-
type: 'treemap',
|
36
|
-
}
|
37
|
-
|
38
|
-
componentDidMount() {
|
39
|
-
const {
|
40
|
-
chartData,
|
41
|
-
className,
|
42
|
-
colors = [],
|
43
|
-
dark,
|
44
|
-
drillable,
|
45
|
-
grouped,
|
46
|
-
height,
|
47
|
-
id,
|
48
|
-
title = "",
|
49
|
-
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">● </span>{point.name}: <b>{point.value}</b>',
|
50
|
-
type,
|
51
|
-
} = this.props
|
52
|
-
|
53
|
-
new pbChart(`.${className}`, {
|
54
|
-
chartData: chartData,
|
55
|
-
colors: colors,
|
56
|
-
dark,
|
57
|
-
drillable,
|
58
|
-
grouped,
|
59
|
-
height: height,
|
60
|
-
id: id,
|
61
|
-
title: title,
|
62
|
-
tooltipHtml,
|
63
|
-
type,
|
64
|
-
})
|
65
|
-
}
|
66
|
-
|
67
|
-
props: TreemapChartProps
|
68
|
-
|
69
|
-
render() {
|
70
|
-
const { className, id } = this.props
|
71
|
-
|
72
|
-
return (
|
73
|
-
<div
|
74
|
-
className={classnames(globalProps(this.props), className)}
|
75
|
-
id={id}
|
76
|
-
/>
|
77
|
-
)
|
78
|
-
}
|
79
|
-
}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Treemap charts are used to compare the relative size of groups of data. They can also use a nested data structure, allowing a user to drill down into a group to see its constituent data points.
|
2
|
-
|
3
|
-
The default height of treemap is 400px and can be changed. The default height is in pixel units, but can also use percentage string (percentage would be that of the width. For example, `height:"50%"` would mean that the height is 50% of the width). This allows for preserving the aspect ratio across responsive sizes.
|
4
|
-
|
5
|
-
For more information, see: <a href="https://api.highcharts.com/highcharts/chart.height" target="_blank"> highcharts/chart.height</a>.
|
@@ -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
|
-
colors: ["data-4", "data-7", "#8E6E53", "#124732"],
|
35
|
-
id: "treemap-colors",
|
36
|
-
title: "Favored Pizza Toppings",
|
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 TreemapChartColors = (props) => (
|
37
|
-
<div>
|
38
|
-
<TreemapChart
|
39
|
-
chartData={chartData}
|
40
|
-
colors={["data-4", "data-7", "#8E6E53", "#124732"]}
|
41
|
-
id="treemap-colors"
|
42
|
-
title="Favored Pizza Toppings"
|
43
|
-
{...props}
|
44
|
-
/>
|
45
|
-
</div>
|
46
|
-
)
|
47
|
-
|
48
|
-
export default TreemapChartColors
|