playbook_ui 13.28.0.pre.alpha.PBNTR296dropdownwithform2941 → 13.28.0.pre.alpha.PBNTR297gradientoverlay3029
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 -3
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +40 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +14 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +10 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +34 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +31 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +4 -1
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +31 -0
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +16 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +2 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom.html.erb → _bar_graph_custom_rails.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -3
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +22 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +53 -0
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +14 -8
- data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +24 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +7 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +9 -1
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +10 -0
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +53 -0
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +92 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +159 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +121 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +65 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +54 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +57 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +4 -1
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +6 -1
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +35 -0
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +8 -2
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +52 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +22 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +12 -0
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +93 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +66 -0
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- 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 +5 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +33 -32
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +2 -0
- 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_row_rails.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +51 -50
- 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_data_rails.html.erb +54 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +37 -38
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +53 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_row.html.erb → _table_outer_padding.html.erb} +7 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +76 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
- 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/_outer_padding.scss +21 -0
- data/app/pb_kits/playbook/pb_table/table.rb +14 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +5 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +12 -9
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +61 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +6 -1
- data/app/pb_kits/playbook/playbook-doc.js +4 -0
- data/app/pb_kits/playbook/tokens/_vertical_align.scss +18 -0
- data/app/pb_kits/playbook/utilities/_vertical_align.scss +16 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +12 -1
- data/dist/menu.yml +7 -2
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/version.rb +1 -1
- data/lib/playbook/vertical_align.rb +37 -0
- metadata +50 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +0 -63
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +0 -52
- /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column.html.erb → _table_alignment_column_rails.html.erb} +0 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import { render, screen } from '../utilities/test-utils'
|
4
|
+
import { Overlay } from '..'
|
5
|
+
|
6
|
+
const testId = "overlay"
|
7
|
+
const children = "This is the Overlay children"
|
8
|
+
|
9
|
+
test('should pass data prop', () => {
|
10
|
+
const props = {
|
11
|
+
children,
|
12
|
+
data: { testid: testId }
|
13
|
+
}
|
14
|
+
|
15
|
+
render(<Overlay {...props} />)
|
16
|
+
const kit = screen.getByTestId(testId)
|
17
|
+
expect(kit).toBeInTheDocument()
|
18
|
+
})
|
19
|
+
|
20
|
+
test("should pass className prop", () => {
|
21
|
+
const className = "custom-class-name"
|
22
|
+
const props = {
|
23
|
+
className,
|
24
|
+
children,
|
25
|
+
data: { testid: testId },
|
26
|
+
}
|
27
|
+
|
28
|
+
render(<Overlay {...props} />)
|
29
|
+
const kit = screen.getByTestId(testId)
|
30
|
+
expect(kit).toHaveClass(className)
|
31
|
+
})
|
32
|
+
|
33
|
+
test('should pass aria prop', () => {
|
34
|
+
const props = {
|
35
|
+
aria: { label: testId },
|
36
|
+
children,
|
37
|
+
data: { testid: testId },
|
38
|
+
}
|
39
|
+
|
40
|
+
render(<Overlay {...props} />)
|
41
|
+
const kit = screen.getByTestId(testId)
|
42
|
+
expect(kit).toHaveAttribute('aria-label', testId)
|
43
|
+
})
|
44
|
+
|
45
|
+
test('should pass id prop', () => {
|
46
|
+
const props = {
|
47
|
+
children,
|
48
|
+
data: { testid: testId },
|
49
|
+
id: testId
|
50
|
+
}
|
51
|
+
|
52
|
+
render(<Overlay {...props} />)
|
53
|
+
const kit = screen.getByTestId(testId)
|
54
|
+
expect(kit).toHaveAttribute('id', testId)
|
55
|
+
})
|
56
|
+
|
57
|
+
test('should render children', () => {
|
58
|
+
const props = {
|
59
|
+
children,
|
60
|
+
data: { testid: testId }
|
61
|
+
}
|
62
|
+
|
63
|
+
render(<Overlay {...props} />)
|
64
|
+
const kit = screen.getByTestId(testId)
|
65
|
+
expect(kit).toHaveTextContent(props.children)
|
66
|
+
})
|
@@ -1 +1 @@
|
|
1
|
-
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color
|
1
|
+
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
@@ -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,6 +23,7 @@ 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",
|
26
27
|
responsive?: "collapse" | "scroll" | "none",
|
27
28
|
singleLine?: boolean,
|
28
29
|
size?: "sm" | "md" | "lg",
|
@@ -45,6 +46,7 @@ const Table = (props: TableProps) => {
|
|
45
46
|
disableHover = false,
|
46
47
|
htmlOptions = {},
|
47
48
|
id,
|
49
|
+
outerPadding = '',
|
48
50
|
responsive = 'collapse',
|
49
51
|
singleLine = false,
|
50
52
|
size = 'sm',
|
@@ -59,6 +61,8 @@ const Table = (props: TableProps) => {
|
|
59
61
|
const htmlProps = buildHtmlProps(htmlOptions)
|
60
62
|
const tableCollapseCss = responsive !== 'none' ? `table-collapse-${collapse}` : ''
|
61
63
|
const verticalBorderCss = verticalBorder ? 'vertical-border' : ''
|
64
|
+
const spaceCssName = outerPadding !== 'none' ? 'space_' : ''
|
65
|
+
const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
|
62
66
|
const isTableTag = tag === 'table'
|
63
67
|
|
64
68
|
const classNames = classnames(
|
@@ -73,6 +77,7 @@ const Table = (props: TableProps) => {
|
|
73
77
|
'no-hover': disableHover,
|
74
78
|
'sticky-header': sticky,
|
75
79
|
'striped': striped,
|
80
|
+
[outerPaddingCss]: outerPadding !== '',
|
76
81
|
},
|
77
82
|
globalProps(props),
|
78
83
|
tableCollapseCss,
|
@@ -7,39 +7,40 @@ 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
|
+
<Table.Head>
|
11
|
+
<Table.Row>
|
12
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
13
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
14
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
15
|
+
<Table.Header textAlign="center">{'Rating'}</Table.Header>
|
16
|
+
<Table.Header textAlign="right">{'Money'}</Table.Header>
|
17
|
+
</Table.Row>
|
18
|
+
</Table.Head>
|
19
|
+
<Table.Body>
|
20
|
+
<Table.Row>
|
21
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
22
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
23
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
24
|
+
<Table.Cell textAlign="center">{'3'}</Table.Cell>
|
25
|
+
<Table.Cell textAlign="right">{'$57.32'}</Table.Cell>
|
26
|
+
</Table.Row>
|
27
|
+
<Table.Row>
|
28
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
29
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
30
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
31
|
+
<Table.Cell textAlign="center">{'2'}</Table.Cell>
|
32
|
+
<Table.Cell textAlign="right">{'$5,657.08'}</Table.Cell>
|
33
|
+
</Table.Row>
|
34
|
+
<Table.Row>
|
35
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
36
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
37
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
38
|
+
<Table.Cell textAlign="center">{'4'}</Table.Cell>
|
39
|
+
<Table.Cell textAlign="right">{'$358.77'}</Table.Cell>
|
40
|
+
</Table.Row>
|
41
|
+
</Table.Body>
|
42
42
|
</Table>
|
43
|
+
|
43
44
|
)
|
44
45
|
}
|
45
46
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Pass our `textAlign` global prop to any `table.cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
2
|
In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
|
@@ -0,0 +1,2 @@
|
|
1
|
+
Pass our `text_align` global prop to any `table/table_cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
|
+
In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
|
@@ -7,39 +7,39 @@ const TableAlignmentRow = (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
|
-
|
42
|
-
|
10
|
+
<Table.Head>
|
11
|
+
<Table.Row>
|
12
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
13
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
14
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
15
|
+
<Table.Header>{'Column 4'}</Table.Header>
|
16
|
+
<Table.Header>{'Column 5'}</Table.Header>
|
17
|
+
</Table.Row>
|
18
|
+
</Table.Head>
|
19
|
+
<Table.Body>
|
20
|
+
<Table.Row>
|
21
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
22
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
23
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
24
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
25
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
26
|
+
</Table.Row>
|
27
|
+
<Table.Row textAlign="center">
|
28
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
29
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
30
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
31
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
32
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
33
|
+
</Table.Row>
|
34
|
+
<Table.Row textAlign="right">
|
35
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
36
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
37
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
38
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
39
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
40
|
+
</Table.Row>
|
41
|
+
</Table.Body>
|
42
|
+
</Table>
|
43
43
|
)
|
44
44
|
}
|
45
45
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Pass our `textAlign` global prop to any `table.row` subcomponent to change the text alignment of all cells within that row.
|
2
2
|
The header/ first row is the default, followed by the second row being centered, and then the last row shifted to the right.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= pb_rails("table") do %>
|
2
|
+
<%= pb_rails("table/table_head") do %>
|
3
|
+
<%= pb_rails("table/table_row") do %>
|
4
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
5
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
6
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
7
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
8
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= pb_rails("table/table_body") do %>
|
12
|
+
<%= pb_rails("table/table_row") do %>
|
13
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
14
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
15
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
16
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
17
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
18
|
+
<% end %>
|
19
|
+
<%= pb_rails("table/table_row", props: { text_align: "center" }) do %>
|
20
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
25
|
+
<% end %>
|
26
|
+
<%= pb_rails("table/table_row", props: { text_align: "right" }) do %>
|
27
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
28
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
29
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
30
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
@@ -9,16 +9,16 @@ const TableAlignmentShiftData = (props) => {
|
|
9
9
|
marginBottom="md"
|
10
10
|
{...props}
|
11
11
|
>
|
12
|
-
<
|
13
|
-
<
|
14
|
-
<
|
15
|
-
<
|
16
|
-
</
|
17
|
-
</
|
18
|
-
<
|
19
|
-
<
|
20
|
-
<
|
21
|
-
<
|
12
|
+
<Table.Head>
|
13
|
+
<Table.Row>
|
14
|
+
<Table.Header> </Table.Header>
|
15
|
+
<Table.Header>{'Price'}</Table.Header>
|
16
|
+
</Table.Row>
|
17
|
+
</Table.Head>
|
18
|
+
<Table.Body>
|
19
|
+
<Table.Row>
|
20
|
+
<Table.Cell verticalAlign="bottom">{'Total'}</Table.Cell>
|
21
|
+
<Table.Cell>
|
22
22
|
{'$12'}
|
23
23
|
<br />
|
24
24
|
{'$46'}
|
@@ -28,50 +28,51 @@ const TableAlignmentShiftData = (props) => {
|
|
28
28
|
{'-------'}
|
29
29
|
<br />
|
30
30
|
{'$83'}
|
31
|
-
</
|
32
|
-
</
|
33
|
-
</
|
31
|
+
</Table.Cell>
|
32
|
+
</Table.Row>
|
33
|
+
</Table.Body>
|
34
34
|
</Table>
|
35
|
+
|
35
36
|
<Table
|
36
37
|
{...props}
|
37
38
|
>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
<
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
39
|
+
<Table.Head>
|
40
|
+
<Table.Row>
|
41
|
+
<Table.Header>{'Espresso Drinks'}</Table.Header>
|
42
|
+
<Table.Header>{'Ingredients'}</Table.Header>
|
43
|
+
</Table.Row>
|
44
|
+
</Table.Head>
|
45
|
+
<Table.Body>
|
46
|
+
<Table.Row>
|
47
|
+
<Table.Cell verticalAlign="top">{'Cappuccino'} </Table.Cell>
|
48
|
+
<Table.Cell>
|
49
|
+
{'Steamed Milk'}
|
50
|
+
<br />
|
51
|
+
{'Milk Foam'}
|
52
|
+
</Table.Cell>
|
53
|
+
</Table.Row>
|
54
|
+
<Table.Row>
|
55
|
+
<Table.Cell verticalAlign="top">
|
56
|
+
{'Macchiato'}
|
57
|
+
</Table.Cell>
|
58
|
+
<Table.Cell verticalAlign="top">
|
59
|
+
{'Espresso'}
|
60
|
+
<br />
|
61
|
+
{'Steamed Milk'}
|
62
|
+
</Table.Cell>
|
63
|
+
</Table.Row>
|
64
|
+
<Table.Row>
|
65
|
+
<Table.Cell>
|
66
|
+
{'Mocha'}
|
67
|
+
</Table.Cell>
|
68
|
+
<Table.Cell>
|
69
|
+
{'Hot Chocolate'}
|
70
|
+
<br />
|
71
|
+
{'Steamed Milk'}
|
72
|
+
</Table.Cell>
|
73
|
+
</Table.Row>
|
74
|
+
</Table.Body>
|
75
|
+
</Table>
|
75
76
|
</div>
|
76
77
|
)
|
77
78
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Pass our `verticalAlign` global prop to any `table.cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
2
|
The first table shifts "Total" down, whereas the second table shifts the "Espresso Drinks" column contents up.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<%= pb_rails("table") do %>
|
2
|
+
<%= pb_rails("table/table_head") do %>
|
3
|
+
<%= pb_rails("table/table_row") do %>
|
4
|
+
<%= pb_rails("table/table_header", props: { text: " " }) %>
|
5
|
+
<%= pb_rails("table/table_header", props: { text: "Price" }) %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
<%= pb_rails("table/table_body") do %>
|
9
|
+
<%= pb_rails("table/table_row") do %>
|
10
|
+
<%= pb_rails("table/table_cell", props: { text: "Total", vertical_align: "bottom" }) %>
|
11
|
+
<%= pb_rails("table/table_cell") do %>
|
12
|
+
$12<br/>
|
13
|
+
$46<br/>
|
14
|
+
$25<br/>
|
15
|
+
-------<br/>
|
16
|
+
$83
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
<br/>
|
22
|
+
<%= pb_rails("table", props: { size: "sm" }) do %>
|
23
|
+
<%= pb_rails("table/table_head") do %>
|
24
|
+
<%= pb_rails("table/table_row") do %>
|
25
|
+
<%= pb_rails("table/table_header", props: { text: "Espresso Drinks" }) %>
|
26
|
+
<%= pb_rails("table/table_header", props: { text: "Ingredients" }) %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
<%= pb_rails("table/table_body") do %>
|
30
|
+
<%= pb_rails("table/table_row") do %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Cappuccino", vertical_align: "top" }) %>
|
32
|
+
<%= pb_rails("table/table_cell") do %>
|
33
|
+
Espresso<br/>
|
34
|
+
Steamed Milk<br/>
|
35
|
+
Milk Foam
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
<%= pb_rails("table/table_row") do %>
|
39
|
+
<%= pb_rails("table/table_cell", props: { text: "Macchiato", vertical_align: "top" }) %>
|
40
|
+
<%= pb_rails("table/table_cell") do %>
|
41
|
+
Espresso<br/>
|
42
|
+
Steamed Milk
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
<%= pb_rails("table/table_row") do %>
|
46
|
+
<%= pb_rails("table/table_cell", props: { text: "Mocha", vertical_align: "top" }) %>
|
47
|
+
<%= pb_rails("table/table_cell") do %>
|
48
|
+
Espresso<br/>
|
49
|
+
Hot Chocolate<br/>
|
50
|
+
Steamed Milk
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
Pass our `vertical_align` global prop to any `table/table_cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
|
+
The first table shifts "Total" down, whereas the second table shifts the "Espresso Drinks" column contents up.
|