playbook_ui 13.28.0.pre.alpha.PBNTR297gradientoverlay3029 → 13.28.0.pre.alpha.PLAY888Cardkithighlightoverflowtooltiperror2937

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -3
  3. data/app/pb_kits/playbook/index.js +0 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -14
  9. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -10
  10. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
  12. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -4
  13. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -16
  14. data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom_rails.html.erb → _bar_graph_custom.html.erb} +3 -3
  15. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +1 -2
  16. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
  17. data/app/pb_kits/playbook/pb_card/_card.scss +1 -1
  18. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -2
  19. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +2 -1
  20. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +3 -9
  21. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +1 -22
  22. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -14
  23. data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -24
  24. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -7
  25. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -9
  26. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -10
  27. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
  28. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -4
  29. data/app/pb_kits/playbook/pb_gauge/gauge.rb +1 -6
  30. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +2 -8
  31. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -22
  32. data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
  33. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -1
  34. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +32 -30
  35. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +2 -0
  36. data/app/pb_kits/playbook/pb_table/_table.tsx +0 -5
  37. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +32 -33
  38. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
  39. data/app/pb_kits/playbook/pb_table/docs/{_table_outer_padding.html.erb → _table_alignment_row.html.erb} +7 -7
  40. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
  41. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
  42. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
  43. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +50 -51
  44. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
  45. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
  46. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +38 -37
  47. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
  48. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  49. data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
  50. data/app/pb_kits/playbook/pb_table/table.rb +1 -14
  51. data/app/pb_kits/playbook/pb_table/table.test.js +1 -5
  52. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -12
  53. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +1 -6
  54. data/app/pb_kits/playbook/playbook-doc.js +0 -4
  55. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -12
  56. data/dist/menu.yml +2 -7
  57. data/dist/playbook-rails.js +6 -6
  58. data/lib/playbook/classnames.rb +0 -1
  59. data/lib/playbook/forms/builder.rb +0 -1
  60. data/lib/playbook/kit_base.rb +0 -2
  61. data/lib/playbook/version.rb +1 -1
  62. metadata +7 -51
  63. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +0 -40
  64. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +0 -3
  65. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +0 -34
  66. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +0 -31
  67. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
  68. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
  69. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
  70. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -53
  71. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -10
  72. data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +0 -53
  73. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +0 -92
  74. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +0 -53
  75. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +0 -159
  76. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +0 -121
  77. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -9
  78. data/app/pb_kits/playbook/pb_draggable/docs/index.js +0 -3
  79. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -65
  80. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -54
  81. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +0 -57
  82. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
  83. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
  84. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -12
  85. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +0 -93
  86. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +0 -40
  87. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +0 -7
  88. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +0 -36
  89. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +0 -5
  90. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -4
  91. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -2
  92. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -66
  93. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +0 -2
  94. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +0 -34
  95. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +0 -2
  96. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +0 -54
  97. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +0 -2
  98. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +0 -1
  99. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +0 -53
  100. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +0 -1
  101. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +0 -76
  102. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +0 -1
  103. data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +0 -21
  104. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -61
  105. data/app/pb_kits/playbook/tokens/_vertical_align.scss +0 -18
  106. data/app/pb_kits/playbook/utilities/_vertical_align.scss +0 -16
  107. data/lib/playbook/forms/builder/dropdown_field.rb +0 -14
  108. data/lib/playbook/vertical_align.rb +0 -37
  109. /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column_rails.html.erb → _table_alignment_column.html.erb} +0 -0
@@ -8,7 +8,6 @@ import Highcharts from "highcharts";
8
8
  import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
9
9
  import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
10
10
  import mapColors from "../pb_dashboard/pbChartsColorsHelper";
11
- import { merge } from 'lodash'
12
11
 
13
12
  type LineGraphProps = {
14
13
  align?: "left" | "right" | "center";
@@ -22,7 +21,6 @@ type LineGraphProps = {
22
21
  name: string;
23
22
  data: number[];
24
23
  }[];
25
- customOptions?: Partial<Highcharts.Options>;
26
24
  gradient?: boolean;
27
25
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
28
26
  id: string;
@@ -47,7 +45,6 @@ const LineGraph = ({
47
45
  data = {},
48
46
  align = "center",
49
47
  className = "pb_bar_graph",
50
- customOptions = {},
51
48
  dark = false,
52
49
  gradient = false,
53
50
  type = "line",
@@ -133,19 +130,16 @@ const LineGraph = ({
133
130
  staticOptions.plotOptions.series.events = { legendItemClick: () => false };
134
131
  }
135
132
 
136
- const filteredProps: any = {...props};
137
- delete filteredProps.verticalAlign;
138
-
139
133
  const [options, setOptions] = useState({});
140
134
 
141
135
  useEffect(() => {
142
- setOptions(merge(staticOptions, customOptions));
136
+ setOptions({ ...staticOptions });
143
137
  }, [chartData]);
144
138
 
145
139
  return (
146
140
  <HighchartsReact
147
141
  containerProps={{
148
- className: classnames(globalProps(filteredProps), className),
142
+ className: classnames(globalProps(props), className),
149
143
  id: id,
150
144
  ...ariaProps,
151
145
  ...dataProps,
@@ -9,7 +9,6 @@ module Playbook
9
9
  prop :axis_title
10
10
  prop :chart_data, type: Playbook::Props::Array,
11
11
  default: []
12
- prop :custom_options, default: {}
13
12
  prop :gradient, type: Playbook::Props::Boolean,
14
13
  default: false
15
14
  prop :point_start, type: Playbook::Props::Numeric
@@ -39,7 +38,7 @@ module Playbook
39
38
  gradient ? "area" : "line"
40
39
  end
41
40
 
42
- def standard_options
41
+ def chart_options
43
42
  {
44
43
  align: align,
45
44
  id: id,
@@ -65,26 +64,6 @@ module Playbook
65
64
  }
66
65
  end
67
66
 
68
- def chart_options
69
- standard_options.deep_merge(custom_options)
70
- end
71
-
72
- def vertical_align_props
73
- if vertical_align
74
- if object.vertical_align
75
- original_result = super
76
- class_to_remove = "vertical_align_#{object.vertical_align}"
77
-
78
- modified_result = original_result.gsub(class_to_remove, "").strip
79
- modified_result.empty? ? nil : modified_result
80
- else
81
- super
82
- end
83
- else
84
- super
85
- end
86
- end
87
-
88
67
  def classname
89
68
  generate_classname("pb_line_graph")
90
69
  end
@@ -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 <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
1
+ A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color here: https://playbook.powerapp.cloud/utilities
@@ -28,7 +28,6 @@ $pb_selectable_card_border: 2px;
28
28
  padding: $space_sm;
29
29
  margin-bottom: $space_sm;
30
30
  cursor: pointer;
31
- outline: 1px solid transparent;
32
31
 
33
32
  @media (hover:hover) {
34
33
  &:hover {
@@ -131,41 +131,43 @@ const SelectableCard = (props: SelectableCardProps) => {
131
131
  className={globalProps(labelProps)}
132
132
  htmlFor={inputIdPresent}
133
133
  >
134
- {variant === 'displayInput' ?
135
- <Flex vertical="center">
136
- <Flex
137
- orientation="column"
138
- padding="sm"
139
- paddingRight="xs"
140
- vertical="center"
141
- >
142
- <Input
134
+ <div className="buffer">
135
+ {variant === 'displayInput' ?
136
+ <Flex vertical="center">
137
+ <Flex
138
+ orientation="column"
139
+ padding="sm"
140
+ paddingRight="xs"
141
+ vertical="center"
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
143
159
  dark={dark}
160
+ padding="sm"
161
+ status={error ? 'negative' : null}
144
162
  >
145
- <input
146
- checked={checked}
147
- disabled={disabled}
148
- onClick={handleClick}
149
- readOnly
150
- type={inputType}
151
- />
152
- </Input>
163
+ {text ||props.children}
164
+ </Card>
153
165
  </Flex>
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
- :
166
+ :
166
167
  text || props.children
167
- }
168
+ }
168
169
  {displayIcon()}
170
+ </div>
169
171
  </label>
170
172
  </div>
171
173
  )
@@ -11,6 +11,7 @@
11
11
  <% end %>
12
12
 
13
13
  <label class="<%= object.label_class %>" for="<%= object.input_id_present %>">
14
+ <div class="buffer">
14
15
  <% if object.variant == "display_input" %>
15
16
  <%= pb_rails("flex", props: { vertical: "center" }) do %>
16
17
  <%= pb_rails("flex", props: {
@@ -45,6 +46,7 @@
45
46
  </div>
46
47
  <% end %>
47
48
  <% end %>
49
+ </div>
48
50
  </label>
49
51
 
50
52
  <% 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,
@@ -7,40 +7,39 @@ const TableAlignmentColumn = (props) => {
7
7
  <Table
8
8
  {...props}
9
9
  >
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>
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
- 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.
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", props: { outer_padding: "sm", size: "sm" }) do %>
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></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 align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></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 align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></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 align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></td>
31
+ <td>Value 5</td>
32
32
  </tr>
33
33
  </tbody>
34
34
  <% end %>
@@ -7,39 +7,39 @@ const TableAlignmentRow = (props) => {
7
7
  <Table
8
8
  {...props}
9
9
  >
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>
10
+ <thead>
11
+ <tr>
12
+ <th>{'Column 1'}</th>
13
+ <th>{'Column 2'}</th>
14
+ <th>{'Column 3'}</th>
15
+ <th>{'Column 4'}</th>
16
+ <th>{'Column 5'}</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>{'Value 4'}</td>
25
+ <td>{'Value 5'}</td>
26
+ </tr>
27
+ <tr align="center">
28
+ <td>{'Value 1'}</td>
29
+ <td>{'Value 2'}</td>
30
+ <td>{'Value 3'}</td>
31
+ <td>{'Value 4'}</td>
32
+ <td>{'Value 5'}</td>
33
+ </tr>
34
+ <tr align="right">
35
+ <td>{'Value 1'}</td>
36
+ <td>{'Value 2'}</td>
37
+ <td>{'Value 3'}</td>
38
+ <td>{'Value 4'}</td>
39
+ <td>{'Value 5'}</td>
40
+ </tr>
41
+ </tbody>
42
+ </Table>
43
43
  )
44
44
  }
45
45
 
@@ -1,2 +1,2 @@
1
- Pass our `textAlign` global prop to any `table.row` subcomponent to change the text alignment of all cells within that row.
1
+ This is to be used to shift the whole 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,63 @@
1
+ <%= pb_rails("table") do %>
2
+ <thead>
3
+ <tr>
4
+ <th>&nbsp;</th>
5
+ <th>Price</th>
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ <tr>
10
+ <td shift="down">Total</td>
11
+ <td>
12
+ $12
13
+ <br/>
14
+ $46
15
+ <br/>
16
+ $25
17
+ <br/>
18
+ -------
19
+ <br/>
20
+ $83
21
+ </td>
22
+ </tr>
23
+ </tbody>
24
+ <% end %>
25
+ <br/>
26
+ <%= pb_rails("table") do %>
27
+ <thead>
28
+ <tr>
29
+ <th>Espresso Drinks</th>
30
+ <th>Ingredients</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <tr>
35
+ <td shift="up">Cappuccino</td>
36
+ <td>
37
+ Espresso
38
+ <br/>
39
+ Steamed Milk
40
+ <br/>
41
+ Milk Foam
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td shift="up">Macchiato</td>
46
+ <td>
47
+ Espresso
48
+ <br/>
49
+ Steamed Milk
50
+ </td>
51
+ </tr>
52
+ <tr>
53
+ <td shift="up">Mocha</td>
54
+ <td>
55
+ Espresso
56
+ <br/>
57
+ Hot Chocolate
58
+ <br/>
59
+ Steamed Milk
60
+ </td>
61
+ </tr>
62
+ </tbody>
63
+ <% end %>
@@ -9,16 +9,16 @@ const TableAlignmentShiftData = (props) => {
9
9
  marginBottom="md"
10
10
  {...props}
11
11
  >
12
- <Table.Head>
13
- <Table.Row>
14
- <Table.Header>&nbsp;</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>
12
+ <thead>
13
+ <tr>
14
+ <th>&nbsp;</th>
15
+ <th>{'Price'}</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <tr>
20
+ <td shift="down">{'Total'}</td>
21
+ <td>
22
22
  {'$12'}
23
23
  <br />
24
24
  {'$46'}
@@ -28,51 +28,50 @@ const TableAlignmentShiftData = (props) => {
28
28
  {'-------'}
29
29
  <br />
30
30
  {'$83'}
31
- </Table.Cell>
32
- </Table.Row>
33
- </Table.Body>
31
+ </td>
32
+ </tr>
33
+ </tbody>
34
34
  </Table>
35
-
36
35
  <Table
37
36
  {...props}
38
37
  >
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>
38
+ <thead>
39
+ <tr>
40
+ <th>{'Espresso Drinks'}</th>
41
+ <th>{'Ingredients'}</th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ <tr>
46
+ <td shift="up">{'Cappuccino'}</td>
47
+ <td>
48
+ {'Espresso'}
49
+ <br />
50
+ {'Steamed Milk'}
51
+ <br />
52
+ {'Milk Foam'}
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td shift="up">{'Macchiato'}</td>
57
+ <td>
58
+ {'Espresso'}
59
+ <br />
60
+ {'Steamed Milk'}
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td shift="up">{'Mocha'}</td>
65
+ <td>
66
+ {'Espresso'}
67
+ <br />
68
+ {'Hot Chocolate'}
69
+ <br />
70
+ {'Steamed Milk'}
71
+ </td>
72
+ </tr>
73
+ </tbody>
74
+ </Table>
76
75
  </div>
77
76
  )
78
77
  }
@@ -1,2 +1,2 @@
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.
1
+ You can individually shift a piece of table data, or shift an entire column.
2
2
  The first table shifts "Total" down, whereas the second table shifts the "Espresso Drinks" column contents up.