playbook_ui 13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 → 13.28.0.pre.alpha.play829selectablecardalignment2978
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 +3 -2
- data/app/pb_kits/playbook/index.js +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -4
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -16
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +2 -5
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -16
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -14
- data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -24
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -7
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -9
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -4
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -16
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +30 -32
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +0 -2
- data/app/pb_kits/playbook/pb_table/_table.tsx +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +32 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/{_table_outer_padding.html.erb → _table_alignment_row.html.erb} +7 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +50 -51
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +38 -37
- data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
- data/app/pb_kits/playbook/pb_table/table.rb +1 -14
- data/app/pb_kits/playbook/pb_table/table.test.js +1 -5
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +2 -0
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -12
- data/dist/menu.yml +2 -5
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/classnames.rb +0 -1
- data/lib/playbook/kit_base.rb +0 -2
- data/lib/playbook/version.rb +1 -1
- metadata +6 -35
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -53
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -10
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +0 -53
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +0 -92
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +0 -53
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +0 -159
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +0 -121
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -65
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -54
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +0 -57
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +0 -54
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +0 -53
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +0 -76
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +0 -21
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -61
- data/app/pb_kits/playbook/tokens/_vertical_align.scss +0 -18
- data/app/pb_kits/playbook/utilities/_vertical_align.scss +0 -16
- data/lib/playbook/vertical_align.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ea0b161920a1666fef468539f56e8185b902f0fe7b31969a8ee2d761a64b59
|
4
|
+
data.tar.gz: 2a85f19f34fea779816b46739f34f643fa2def667bce1194e678a32f0eb67e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f383ffb93e9d97358349b13cc4f3a282b140ecc628fba9c097dd652ba6c0a824efaa1f796b932b165cd38b326899d0c6875d96b6f731858824bbdf42687d956f
|
7
|
+
data.tar.gz: ea09734e0f9abbc10a328f6b5e5b0c8248f1df495dc33abf14ea96cfb2f90e97aeb92f6e6ec0512fe2ffa3212fb4c8543cf9a187afd3e84c383a0f0b93a87f41
|
@@ -1,3 +1,6 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
1
4
|
@import 'pb_advanced_table/advanced_table';
|
2
5
|
@import 'pb_avatar/avatar';
|
3
6
|
@import 'pb_avatar_action_button/avatar_action_button';
|
@@ -28,7 +31,6 @@
|
|
28
31
|
@import 'pb_detail/detail';
|
29
32
|
@import 'pb_dialog/dialog';
|
30
33
|
@import 'pb_distribution_bar/distribution_bar';
|
31
|
-
@import 'pb_draggable/draggable';
|
32
34
|
@import 'pb_dropdown/dropdown';
|
33
35
|
@import 'pb_file_upload/file_upload';
|
34
36
|
@import 'pb_filter/filter';
|
@@ -119,4 +121,3 @@
|
|
119
121
|
@import './utilities/text_align';
|
120
122
|
@import './utilities/overflow';
|
121
123
|
@import './utilities/truncate';
|
122
|
-
@import './utilities/vertical_align';
|
@@ -35,8 +35,6 @@ export { default as DateYearStacked } from './pb_date_year_stacked/_date_year_st
|
|
35
35
|
export { default as Detail} from './pb_detail/_detail'
|
36
36
|
export { default as Dialog } from './pb_dialog/_dialog'
|
37
37
|
export { default as DistributionBar } from './pb_distribution_bar/_distribution_bar'
|
38
|
-
export { default as Draggable} from './pb_draggable/_draggable'
|
39
|
-
export { DraggableProvider} from './pb_draggable/context'
|
40
38
|
export { default as Dropdown} from './pb_dropdown/_dropdown'
|
41
39
|
export { default as FileUpload } from './pb_file_upload/_file_upload'
|
42
40
|
export { default as Filter } from './pb_filter/_filter'
|
@@ -163,9 +163,6 @@ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
|
|
163
163
|
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
164
164
|
}
|
165
165
|
|
166
|
-
const filteredProps: any = {...props};
|
167
|
-
delete filteredProps.verticalAlign;
|
168
|
-
|
169
166
|
const [options, setOptions] = useState({});
|
170
167
|
|
171
168
|
useEffect(() => {
|
@@ -175,7 +172,7 @@ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
|
|
175
172
|
return (
|
176
173
|
<HighchartsReact
|
177
174
|
containerProps={{
|
178
|
-
className: classnames(globalProps(
|
175
|
+
className: classnames(globalProps(props), className),
|
179
176
|
id: id,
|
180
177
|
...ariaProps,
|
181
178
|
...dataProps,
|
@@ -74,22 +74,6 @@ module Playbook
|
|
74
74
|
standard_options.deep_merge(custom_options)
|
75
75
|
end
|
76
76
|
|
77
|
-
def vertical_align_props
|
78
|
-
if vertical_align
|
79
|
-
if object.vertical_align
|
80
|
-
original_result = super
|
81
|
-
class_to_remove = "vertical_align_#{object.vertical_align}"
|
82
|
-
|
83
|
-
modified_result = original_result.gsub(class_to_remove, "").strip
|
84
|
-
modified_result.empty? ? nil : modified_result
|
85
|
-
else
|
86
|
-
super
|
87
|
-
end
|
88
|
-
else
|
89
|
-
super
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
77
|
def classname
|
94
78
|
generate_classname("pb_bar_graph")
|
95
79
|
end
|
@@ -28,7 +28,8 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
|
|
28
28
|
|
29
29
|
@mixin pb_card_selected($border_color: $primary) {
|
30
30
|
border-color: $border_color;
|
31
|
-
border-width: $pb_card_border_width
|
31
|
+
border-width: $pb_card_border_width;
|
32
|
+
outline: 1px solid $border_color;
|
32
33
|
}
|
33
34
|
|
34
35
|
@mixin pb_card_selected_dark {
|
@@ -115,9 +115,6 @@ const CircleChart = ({
|
|
115
115
|
innerSizes[size];
|
116
116
|
|
117
117
|
|
118
|
-
const filteredProps: any = {...props};
|
119
|
-
delete filteredProps.verticalAlign;
|
120
|
-
|
121
118
|
const [options, setOptions] = useState({});
|
122
119
|
|
123
120
|
useEffect(() => {
|
@@ -184,7 +181,7 @@ const CircleChart = ({
|
|
184
181
|
<div id={`wrapper-circle-chart-${id}`}>
|
185
182
|
<HighchartsReact
|
186
183
|
containerProps={{
|
187
|
-
className: classnames("pb_circle_chart", globalProps(
|
184
|
+
className: classnames("pb_circle_chart", globalProps(props)),
|
188
185
|
id: id,
|
189
186
|
...ariaProps,
|
190
187
|
...dataProps,
|
@@ -198,7 +195,7 @@ const CircleChart = ({
|
|
198
195
|
) : (
|
199
196
|
<HighchartsReact
|
200
197
|
containerProps={{
|
201
|
-
className: classnames("pb_circle_chart", globalProps(
|
198
|
+
className: classnames("pb_circle_chart", globalProps(props)),
|
202
199
|
id: id,
|
203
200
|
...ariaProps,
|
204
201
|
...dataProps,
|
@@ -68,22 +68,6 @@ module Playbook
|
|
68
68
|
}
|
69
69
|
end
|
70
70
|
|
71
|
-
def vertical_align_props
|
72
|
-
if vertical_align
|
73
|
-
if object.vertical_align
|
74
|
-
original_result = super
|
75
|
-
class_to_remove = "vertical_align_#{object.vertical_align}"
|
76
|
-
|
77
|
-
modified_result = original_result.gsub(class_to_remove, "").strip
|
78
|
-
modified_result.empty? ? nil : modified_result
|
79
|
-
else
|
80
|
-
super
|
81
|
-
end
|
82
|
-
else
|
83
|
-
super
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
71
|
def classname
|
88
72
|
generate_classname("pb_circle_chart")
|
89
73
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect
|
1
|
+
import React, { useEffect } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import useCollapsible from './useCollapsible'
|
4
4
|
|
@@ -11,16 +11,9 @@ import CollapsibleContext from './context'
|
|
11
11
|
import { IconSizes } from "../pb_icon/_icon"
|
12
12
|
import CollapsibleIcon from './child_kits/CollapsibleIcon'
|
13
13
|
|
14
|
-
type CollapsibleMainProps = {
|
15
|
-
children: React.ReactNode
|
16
|
-
}
|
17
|
-
|
18
|
-
type CollapsibleContentProps = {
|
19
|
-
children: React.ReactNode
|
20
|
-
}
|
21
14
|
|
22
15
|
type CollapsibleProps = {
|
23
|
-
children?:
|
16
|
+
children?: React.ReactElement | [] | any,
|
24
17
|
aria?: {[key: string]: string},
|
25
18
|
className?: string,
|
26
19
|
collapsed?: boolean,
|
@@ -37,7 +30,7 @@ type CollapsibleProps = {
|
|
37
30
|
const Collapsible = ({
|
38
31
|
aria = {},
|
39
32
|
className,
|
40
|
-
children,
|
33
|
+
children = [],
|
41
34
|
collapsed = true,
|
42
35
|
data = {},
|
43
36
|
htmlOptions = {},
|
@@ -55,12 +48,13 @@ const Collapsible = ({
|
|
55
48
|
setIsCollapsed(collapsed)
|
56
49
|
},[collapsed])
|
57
50
|
|
58
|
-
|
51
|
+
const CollapsibleParent = React.Children.toArray(children) as React.ReactElement[]
|
52
|
+
|
53
|
+
if (CollapsibleParent.length !== 2) {
|
59
54
|
throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
|
60
55
|
}
|
61
|
-
|
62
|
-
const
|
63
|
-
const SecondChild = children[1]
|
56
|
+
const FirstChild = CollapsibleParent[0]
|
57
|
+
const SecondChild = CollapsibleParent[1]
|
64
58
|
|
65
59
|
const Main = FirstChild.type === CollapsibleMain ? FirstChild : null
|
66
60
|
const Content = SecondChild.type === CollapsibleContent ? SecondChild : null
|
@@ -48,27 +48,3 @@ test('returns namespaced additional_class class name', () => {
|
|
48
48
|
const kit = screen.getByTestId(testId)
|
49
49
|
expect(kit).toHaveClass(`${kitClass} additional_class`)
|
50
50
|
})
|
51
|
-
|
52
|
-
test('html structure is correct', () => {
|
53
|
-
const { container } = render(
|
54
|
-
<Collapsible
|
55
|
-
className="additional_class"
|
56
|
-
data={{ testid: testId }}
|
57
|
-
iconColor='lighter'
|
58
|
-
iconSize="lg"
|
59
|
-
>
|
60
|
-
<Collapsible.Main>
|
61
|
-
<div>{'Main Section'}</div>
|
62
|
-
</Collapsible.Main>
|
63
|
-
<Collapsible.Content>
|
64
|
-
<div>
|
65
|
-
{
|
66
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
|
67
|
-
}
|
68
|
-
</div>
|
69
|
-
</Collapsible.Content>
|
70
|
-
</Collapsible>
|
71
|
-
)
|
72
|
-
|
73
|
-
expect(container).toMatchSnapshot()
|
74
|
-
})
|
@@ -3,12 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
-
interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
|
7
|
-
traverseUpButton?: {
|
8
|
-
position: { y: number };
|
9
|
-
};
|
10
|
-
}
|
11
|
-
|
12
6
|
const highchartsDarkTheme: ThemeProps = {
|
13
7
|
lang: {
|
14
8
|
thousandsSep: ',',
|
@@ -206,7 +200,7 @@ const highchartsDarkTheme: ThemeProps = {
|
|
206
200
|
traverseUpButton: {
|
207
201
|
position: { y: -50 },
|
208
202
|
},
|
209
|
-
}
|
203
|
+
},
|
210
204
|
},
|
211
205
|
credits: {
|
212
206
|
enabled: false
|
@@ -3,13 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
-
interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
|
7
|
-
traverseUpButton?: {
|
8
|
-
position: { y: number };
|
9
|
-
};
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
6
|
const highchartsTheme: ThemeProps = {
|
14
7
|
lang: {
|
15
8
|
thousandsSep: ',',
|
@@ -157,7 +150,6 @@ const highchartsTheme: ThemeProps = {
|
|
157
150
|
fontSize: typography.text_smaller,
|
158
151
|
color: colors.text_lt_light,
|
159
152
|
fontWeight: typography.regular,
|
160
|
-
textOutline: '2px $white',
|
161
153
|
},
|
162
154
|
},
|
163
155
|
},
|
@@ -206,7 +198,7 @@ const highchartsTheme: ThemeProps = {
|
|
206
198
|
traverseUpButton: {
|
207
199
|
position: { y: -50 },
|
208
200
|
},
|
209
|
-
}
|
201
|
+
},
|
210
202
|
},
|
211
203
|
credits: {
|
212
204
|
enabled: false
|
@@ -107,7 +107,7 @@
|
|
107
107
|
}
|
108
108
|
|
109
109
|
& > [class^=pb_date_picker_kit]:not(:last-child) {
|
110
|
-
.
|
110
|
+
.text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .flatpickr-wrapper {
|
111
111
|
border-bottom-right-radius: 0;
|
112
112
|
border-top-right-radius: 0;
|
113
113
|
border-right-width: 0;
|
@@ -115,7 +115,7 @@
|
|
115
115
|
}
|
116
116
|
|
117
117
|
& > [class^=pb_date_picker_kit]:not(:first-child) {
|
118
|
-
.
|
118
|
+
.text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .flatpickr-wrapper {
|
119
119
|
border-bottom-left-radius: 0;
|
120
120
|
border-top-left-radius: 0;
|
121
121
|
}
|
@@ -130,9 +130,6 @@ const LineGraph = ({
|
|
130
130
|
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
131
131
|
}
|
132
132
|
|
133
|
-
const filteredProps: any = {...props};
|
134
|
-
delete filteredProps.verticalAlign;
|
135
|
-
|
136
133
|
const [options, setOptions] = useState({});
|
137
134
|
|
138
135
|
useEffect(() => {
|
@@ -142,7 +139,7 @@ const LineGraph = ({
|
|
142
139
|
return (
|
143
140
|
<HighchartsReact
|
144
141
|
containerProps={{
|
145
|
-
className: classnames(globalProps(
|
142
|
+
className: classnames(globalProps(props), className),
|
146
143
|
id: id,
|
147
144
|
...ariaProps,
|
148
145
|
...dataProps,
|
@@ -64,22 +64,6 @@ module Playbook
|
|
64
64
|
}
|
65
65
|
end
|
66
66
|
|
67
|
-
def vertical_align_props
|
68
|
-
if vertical_align
|
69
|
-
if object.vertical_align
|
70
|
-
original_result = super
|
71
|
-
class_to_remove = "vertical_align_#{object.vertical_align}"
|
72
|
-
|
73
|
-
modified_result = original_result.gsub(class_to_remove, "").strip
|
74
|
-
modified_result.empty? ? nil : modified_result
|
75
|
-
else
|
76
|
-
super
|
77
|
-
end
|
78
|
-
else
|
79
|
-
super
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
67
|
def classname
|
84
68
|
generate_classname("pb_line_graph")
|
85
69
|
end
|
@@ -131,43 +131,41 @@ const SelectableCard = (props: SelectableCardProps) => {
|
|
131
131
|
className={globalProps(labelProps)}
|
132
132
|
htmlFor={inputIdPresent}
|
133
133
|
>
|
134
|
-
|
135
|
-
|
136
|
-
<Flex
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
<Input
|
144
|
-
dark={dark}
|
145
|
-
>
|
146
|
-
<input
|
147
|
-
checked={checked}
|
148
|
-
disabled={disabled}
|
149
|
-
onClick={handleClick}
|
150
|
-
readOnly
|
151
|
-
type={inputType}
|
152
|
-
/>
|
153
|
-
</Input>
|
154
|
-
</Flex>
|
155
|
-
<div className="separator" />
|
156
|
-
<div className="psuedo_separator"/>
|
157
|
-
<Card
|
158
|
-
borderNone
|
134
|
+
{variant === 'displayInput' ?
|
135
|
+
<Flex vertical="center">
|
136
|
+
<Flex
|
137
|
+
orientation="column"
|
138
|
+
padding="sm"
|
139
|
+
paddingRight="xs"
|
140
|
+
vertical="center"
|
141
|
+
>
|
142
|
+
<Input
|
159
143
|
dark={dark}
|
160
|
-
padding="sm"
|
161
|
-
status={error ? 'negative' : null}
|
162
144
|
>
|
163
|
-
|
164
|
-
|
145
|
+
<input
|
146
|
+
checked={checked}
|
147
|
+
disabled={disabled}
|
148
|
+
onClick={handleClick}
|
149
|
+
readOnly
|
150
|
+
type={inputType}
|
151
|
+
/>
|
152
|
+
</Input>
|
165
153
|
</Flex>
|
166
|
-
|
154
|
+
<div className="separator" />
|
155
|
+
<div className="psuedo_separator"/>
|
156
|
+
<Card
|
157
|
+
borderNone
|
158
|
+
dark={dark}
|
159
|
+
padding="sm"
|
160
|
+
status={error ? 'negative' : null}
|
161
|
+
>
|
162
|
+
{text ||props.children}
|
163
|
+
</Card>
|
164
|
+
</Flex>
|
165
|
+
:
|
167
166
|
text || props.children
|
168
|
-
|
167
|
+
}
|
169
168
|
{displayIcon()}
|
170
|
-
</div>
|
171
169
|
</label>
|
172
170
|
</div>
|
173
171
|
)
|
@@ -11,7 +11,6 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<label class="<%= object.label_class %>" for="<%= object.input_id_present %>">
|
14
|
-
<div class="buffer">
|
15
14
|
<% if object.variant == "display_input" %>
|
16
15
|
<%= pb_rails("flex", props: { vertical: "center" }) do %>
|
17
16
|
<%= pb_rails("flex", props: {
|
@@ -46,7 +45,6 @@
|
|
46
45
|
</div>
|
47
46
|
<% end %>
|
48
47
|
<% end %>
|
49
|
-
</div>
|
50
48
|
</label>
|
51
49
|
|
52
50
|
<% if object.variant == "display_input" %>
|
@@ -23,7 +23,6 @@ type TableProps = {
|
|
23
23
|
disableHover?: boolean,
|
24
24
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
25
25
|
id?: string,
|
26
|
-
outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
27
26
|
responsive?: "collapse" | "scroll" | "none",
|
28
27
|
singleLine?: boolean,
|
29
28
|
size?: "sm" | "md" | "lg",
|
@@ -46,7 +45,6 @@ const Table = (props: TableProps) => {
|
|
46
45
|
disableHover = false,
|
47
46
|
htmlOptions = {},
|
48
47
|
id,
|
49
|
-
outerPadding = '',
|
50
48
|
responsive = 'collapse',
|
51
49
|
singleLine = false,
|
52
50
|
size = 'sm',
|
@@ -61,8 +59,6 @@ const Table = (props: TableProps) => {
|
|
61
59
|
const htmlProps = buildHtmlProps(htmlOptions)
|
62
60
|
const tableCollapseCss = responsive !== 'none' ? `table-collapse-${collapse}` : ''
|
63
61
|
const verticalBorderCss = verticalBorder ? 'vertical-border' : ''
|
64
|
-
const spaceCssName = outerPadding !== 'none' ? 'space_' : ''
|
65
|
-
const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
|
66
62
|
const isTableTag = tag === 'table'
|
67
63
|
|
68
64
|
const classNames = classnames(
|
@@ -77,7 +73,6 @@ const Table = (props: TableProps) => {
|
|
77
73
|
'no-hover': disableHover,
|
78
74
|
'sticky-header': sticky,
|
79
75
|
'striped': striped,
|
80
|
-
[outerPaddingCss]: outerPadding !== '',
|
81
76
|
},
|
82
77
|
globalProps(props),
|
83
78
|
tableCollapseCss,
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= pb_rails("table") do %>
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th>Column 1</th>
|
5
|
+
<th>Column 2</th>
|
6
|
+
<th>Column 3</th>
|
7
|
+
<th align="center">Rating</th>
|
8
|
+
<th align="right">Money</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<tr>
|
13
|
+
<td>Value 1</td>
|
14
|
+
<td>Value 2</td>
|
15
|
+
<td>Value 3</td>
|
16
|
+
<td align="center">3</td>
|
17
|
+
<td align="right">$57.32</td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>Value 1</td>
|
21
|
+
<td>Value 2</td>
|
22
|
+
<td>Value 3</td>
|
23
|
+
<td align="center">2</td>
|
24
|
+
<td align="right">$5,657.08</td>
|
25
|
+
</tr>
|
26
|
+
<tr>
|
27
|
+
<td>Value 1</td>
|
28
|
+
<td>Value 2</td>
|
29
|
+
<td>Value 3</td>
|
30
|
+
<td align="center">4</td>
|
31
|
+
<td align="right">$358.77</td>
|
32
|
+
</tr>
|
33
|
+
</tbody>
|
34
|
+
<% end %>
|
@@ -7,40 +7,39 @@ const TableAlignmentColumn = (props) => {
|
|
7
7
|
<Table
|
8
8
|
{...props}
|
9
9
|
>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>{'Column 1'}</th>
|
13
|
+
<th>{'Column 2'}</th>
|
14
|
+
<th>{'Column 3'}</th>
|
15
|
+
<th align="center">{'Rating'}</th>
|
16
|
+
<th align="right">{'Money'}</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<tr>
|
21
|
+
<td>{'Value 1'}</td>
|
22
|
+
<td>{'Value 2'}</td>
|
23
|
+
<td>{'Value 3'}</td>
|
24
|
+
<td align="center">{'3'}</td>
|
25
|
+
<td align="right">{'$57.32'}</td>
|
26
|
+
</tr>
|
27
|
+
<tr>
|
28
|
+
<td>{'Value 1'}</td>
|
29
|
+
<td>{'Value 2'}</td>
|
30
|
+
<td>{'Value 3'}</td>
|
31
|
+
<td align="center">{'2'}</td>
|
32
|
+
<td align="right">{'$5,657.08'}</td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>{'Value 1'}</td>
|
36
|
+
<td>{'Value 2'}</td>
|
37
|
+
<td>{'Value 3'}</td>
|
38
|
+
<td align="center">{'4'}</td>
|
39
|
+
<td align="right">{'$358.77'}</td>
|
40
|
+
</tr>
|
41
|
+
</tbody>
|
42
42
|
</Table>
|
43
|
-
|
44
43
|
)
|
45
44
|
}
|
46
45
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
You can individually align a piece of table data, but a more practical use would be applied to align a column.
|
2
2
|
In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
<%= pb_rails("table"
|
1
|
+
<%= pb_rails("table") do %>
|
2
2
|
<thead>
|
3
3
|
<tr>
|
4
4
|
<th>Column 1</th>
|
5
5
|
<th>Column 2</th>
|
6
6
|
<th>Column 3</th>
|
7
7
|
<th>Column 4</th>
|
8
|
-
<th
|
8
|
+
<th>Column 5</th>
|
9
9
|
</tr>
|
10
10
|
</thead>
|
11
11
|
<tbody>
|
@@ -14,21 +14,21 @@
|
|
14
14
|
<td>Value 2</td>
|
15
15
|
<td>Value 3</td>
|
16
16
|
<td>Value 4</td>
|
17
|
-
<td
|
17
|
+
<td>Value 5</td>
|
18
18
|
</tr>
|
19
|
-
<tr>
|
19
|
+
<tr align="center">
|
20
20
|
<td>Value 1</td>
|
21
21
|
<td>Value 2</td>
|
22
22
|
<td>Value 3</td>
|
23
23
|
<td>Value 4</td>
|
24
|
-
<td
|
24
|
+
<td>Value 5</td>
|
25
25
|
</tr>
|
26
|
-
<tr>
|
26
|
+
<tr align="right">
|
27
27
|
<td>Value 1</td>
|
28
28
|
<td>Value 2</td>
|
29
29
|
<td>Value 3</td>
|
30
30
|
<td>Value 4</td>
|
31
|
-
<td
|
31
|
+
<td>Value 5</td>
|
32
32
|
</tr>
|
33
33
|
</tbody>
|
34
34
|
<% end %>
|