playbook_ui 14.16.0.pre.alpha.PBNTR924reacttablecustomheaders6846 → 14.16.0.pre.alpha.PLAY1938completetooltipfloatinguitransition6830
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +2 -34
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +2 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +9 -19
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +1 -38
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +37 -49
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -39
- data/app/pb_kits/playbook/pb_table/_table.tsx +0 -4
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +0 -76
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +1 -11
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +1 -11
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +0 -5
- data/app/pb_kits/playbook/pb_table/table.test.js +0 -17
- data/app/pb_kits/playbook/pb_tooltip/index.js +184 -57
- data/dist/chunks/{_typeahead-HN7DWIZV.js → _typeahead-BEyzuDQy.js} +3 -3
- data/dist/chunks/{_weekday_stacked-CEWwCgZj.js → _weekday_stacked-BWYgED9z.js} +1 -1
- data/dist/chunks/lib-BgzBJfYr.js +29 -0
- data/dist/chunks/{pb_form_validation-DMajaRt3.js → pb_form_validation-CJD-PyIw.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +7 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb +0 -39
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +0 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +0 -50
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +0 -59
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +0 -1
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
- data/dist/chunks/lib-Co5y3V4K.js +0 -29
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_react.md → _advanced_table_selectable_rows.md} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.md → _advanced_table_selectable_rows_no_subrows.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 794a2d3bca7088071c4fbd83fff2a367725c1919abc36cc77cd4b46aebd7d752
|
4
|
+
data.tar.gz: 78a0d55d2565ea0f8181c350c797dbd8cf68ab5be5de79fb8956b48183ce7fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8c882af3d81f788032d5b534917b5494d149610824acc75cca8337fb13826f526ceec4c851784985b5e0e2a9af5f895980a9c4d8b904435353afe2ff851683a
|
7
|
+
data.tar.gz: 13ccd9cf6c192109eee944d6bd83fe8b8ba03d40d48e3481f04e96d63c49a7d455c9a812478920c575fdf5a89db751c29823ae99fa52bfe696be2a966a080f24
|
@@ -101,15 +101,6 @@
|
|
101
101
|
border-top-left-radius: 0px !important;
|
102
102
|
border-top-right-radius: 0px !important;
|
103
103
|
}
|
104
|
-
// Right align header content of first data column in selectable row no subrow setup
|
105
|
-
&.selectable-rows-enabled {
|
106
|
-
tr {
|
107
|
-
th:nth-child(2),
|
108
|
-
.pb_flex_kit_orientation_row_justify_content_start_align_items_center_spacing_none.gap_none {
|
109
|
-
justify-content: flex-end;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
}
|
113
104
|
|
114
105
|
// Set fixed width for header cells to match table body
|
115
106
|
th {
|
@@ -121,8 +112,7 @@
|
|
121
112
|
}
|
122
113
|
|
123
114
|
// Set fixed width for checkbox column
|
124
|
-
&.table-header-cells-custom
|
125
|
-
&.checkbox-cell.checkbox-cell-header {
|
115
|
+
&.table-header-cells-custom {
|
126
116
|
width: 40px !important;
|
127
117
|
min-width: 40px !important;
|
128
118
|
box-sizing: border-box !important;
|
@@ -178,15 +168,6 @@
|
|
178
168
|
text-align: right;
|
179
169
|
}
|
180
170
|
}
|
181
|
-
// Right align row content of first data column in selectable row no subrow setup
|
182
|
-
&.selectable-rows-enabled {
|
183
|
-
tr {
|
184
|
-
td:nth-child(2),
|
185
|
-
.pb_flex_kit_orientation_row_justify_content_start_align_items_center_spacing_none {
|
186
|
-
justify-content: end;
|
187
|
-
}
|
188
|
-
}
|
189
|
-
}
|
190
171
|
}
|
191
172
|
|
192
173
|
.table-header-cells-active:first-child {
|
@@ -281,8 +262,7 @@
|
|
281
262
|
.table-header-cells:first-child,
|
282
263
|
.table-header-cells-custom:first-child,
|
283
264
|
td:first-child,
|
284
|
-
.pb_table_td:first-child
|
285
|
-
.checkbox-cell.checkbox-cell-header:first-child {
|
265
|
+
.pb_table_td:first-child {
|
286
266
|
box-shadow: 1px 0px 0px 0px $border_light !important;
|
287
267
|
}
|
288
268
|
|
@@ -338,7 +318,6 @@
|
|
338
318
|
.table-header-cells:first-child,
|
339
319
|
td:first-child,
|
340
320
|
.pb_table_td:first-child,
|
341
|
-
.checkbox-cell.checkbox-cell-header:first-child,
|
342
321
|
[class*="pinned-left"] {
|
343
322
|
background-color: $white;
|
344
323
|
box-shadow: $shadow_deep !important;
|
@@ -456,16 +435,6 @@
|
|
456
435
|
) !important;
|
457
436
|
}
|
458
437
|
}
|
459
|
-
|
460
|
-
// Vertical separator
|
461
|
-
.table-header-cells:first-child,
|
462
|
-
.table-header-cells-custom:first-child,
|
463
|
-
td:first-child,
|
464
|
-
.pb_table_td:first-child,
|
465
|
-
.checkbox-cell.checkbox-cell-header:first-child {
|
466
|
-
box-shadow: 1px 0px 0px 0px $border_dark !important;
|
467
|
-
}
|
468
|
-
|
469
438
|
// Dark Mode Responsive Styles
|
470
439
|
@media only screen and (max-width: $screen-xl-min) {
|
471
440
|
&[class*="advanced-table-responsive-scroll"] {
|
@@ -490,7 +459,6 @@
|
|
490
459
|
.table-header-cells:first-child,
|
491
460
|
td:first-child,
|
492
461
|
.pb_table_td:first-child,
|
493
|
-
.checkbox-cell.checkbox-cell-header:first-child,
|
494
462
|
[class*="pinned-left"] {
|
495
463
|
background: $bg_dark_card;
|
496
464
|
border-right: $border_dark;
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<% if content.present? %>
|
4
4
|
<% content.presence %>
|
5
5
|
<% else %>
|
6
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading
|
7
|
-
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading
|
6
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading }) %>
|
7
|
+
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading }) %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
@@ -20,8 +20,6 @@ module Playbook
|
|
20
20
|
prop :max_height, type: Playbook::Props::Enum,
|
21
21
|
values: %w[auto xs sm md lg xl xxl xxxl],
|
22
22
|
default: "auto"
|
23
|
-
prop :selectable_rows, type: Playbook::Props::Boolean,
|
24
|
-
default: false
|
25
23
|
|
26
24
|
def classname
|
27
25
|
generate_classname("pb_advanced_table", responsive_classname, max_height_classname, separator: " ")
|
@@ -34,14 +32,6 @@ module Playbook
|
|
34
32
|
def max_height_classname
|
35
33
|
max_height.present? ? "advanced-table-max-height-#{max_height}" : ""
|
36
34
|
end
|
37
|
-
|
38
|
-
def selected_rows
|
39
|
-
@selected_rows ||= []
|
40
|
-
end
|
41
|
-
|
42
|
-
def selected_rows_length
|
43
|
-
selected_rows.length
|
44
|
-
end
|
45
35
|
end
|
46
36
|
end
|
47
37
|
end
|
@@ -11,8 +11,6 @@ examples:
|
|
11
11
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
12
12
|
- advanced_table_column_headers: Multi-Header Columns
|
13
13
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
14
|
-
# - advanced_table_selectable_rows: Selectable Rows
|
15
|
-
# - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
16
14
|
|
17
15
|
|
18
16
|
react:
|
@@ -21,8 +21,6 @@ module Playbook
|
|
21
21
|
prop :responsive, type: Playbook::Props::Enum,
|
22
22
|
values: %w[none scroll],
|
23
23
|
default: "scroll"
|
24
|
-
prop :selectable_rows, type: Playbook::Props::Boolean,
|
25
|
-
default: false
|
26
24
|
|
27
25
|
def flatten_columns(columns)
|
28
26
|
columns.flat_map do |col|
|
@@ -58,7 +56,7 @@ module Playbook
|
|
58
56
|
current_data_attributes = current_depth.zero? ? { row_depth: 0 } : table_data_attributes
|
59
57
|
|
60
58
|
# Additional class and data attributes needed for toggle logic
|
61
|
-
output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading
|
59
|
+
output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading })
|
62
60
|
|
63
61
|
if row[:children].present?
|
64
62
|
row[:children].each do |child_row|
|
@@ -83,7 +81,7 @@ module Playbook
|
|
83
81
|
def classname
|
84
82
|
additional_classes = []
|
85
83
|
additional_classes << "advanced-table-responsive-#{responsive} pinned-left" if responsive == "scroll"
|
86
|
-
|
84
|
+
|
87
85
|
generate_classname("pb_advanced_table_body", *additional_classes, separator: " ")
|
88
86
|
end
|
89
87
|
|
@@ -1,29 +1,19 @@
|
|
1
1
|
<%= pb_content_tag(:thead) do %>
|
2
2
|
<% object.header_rows.each_with_index do |header_row, row_index| %>
|
3
3
|
<%= pb_rails("table/table_row") do %>
|
4
|
-
<% if row_index == 0 && object.selectable_rows && object.enable_toggle_expansion == "none" %>
|
5
|
-
<%= object.render_select_all_header %>
|
6
|
-
<% end %>
|
7
4
|
<% header_row.each_with_index do |cell, cell_index| %>
|
8
5
|
<% header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}" %>
|
9
6
|
<%= pb_rails("table/table_header", props: { id: header_id, colspan: cell[:colspan], classname: [object.th_classname(is_first_column: cell_index.zero?), ('last-header-cell' if cell[:is_last_in_group] && cell_index != 0)].compact.join(' '), sort_menu: cell[:accessor] ? cell[:sort_menu] : nil }) do %>
|
10
7
|
<%= pb_rails("flex", props: { align: "center", justify: cell_index.zero? ? "start" : row_index === header_rows.size - 1 ? "end" : "center", text_align: "end" }) do %>
|
11
|
-
<% if cell_index.zero? && row_index === header_rows.size - 1 %>
|
12
|
-
<% if
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<% else %>
|
21
|
-
<button
|
22
|
-
class="gray-icon toggle-all-icon"
|
23
|
-
onclick="expandAllRows(this); event.preventDefault();">
|
24
|
-
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
|
25
|
-
</button>
|
26
|
-
<% end %>
|
8
|
+
<% if cell_index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") && row_index === header_rows.size - 1 %>
|
9
|
+
<% if loading %>
|
10
|
+
<div class="<%= object.loading ? 'loading-toggle-icon' : '' %>"></div>
|
11
|
+
<% else %>
|
12
|
+
<button
|
13
|
+
class="gray-icon toggle-all-icon"
|
14
|
+
onclick="expandAllRows(this); event.preventDefault();">
|
15
|
+
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
|
16
|
+
</button>
|
27
17
|
<% end %>
|
28
18
|
<% end %>
|
29
19
|
<%= cell[:label] %>
|
@@ -13,20 +13,17 @@ module Playbook
|
|
13
13
|
prop :responsive, type: Playbook::Props::Enum,
|
14
14
|
values: %w[none scroll],
|
15
15
|
default: "scroll"
|
16
|
-
prop :selectable_rows, type: Playbook::Props::Boolean,
|
17
|
-
default: false
|
18
16
|
|
19
17
|
def classname
|
20
18
|
additional_classes = []
|
21
19
|
additional_classes << "advanced-table-responsive-#{responsive} pinned-left" if responsive == "scroll"
|
22
|
-
additional_classes << "selectable-rows-enabled" if selectable_rows && enable_toggle_expansion == "none"
|
23
20
|
|
24
21
|
generate_classname("pb_advanced_table_header", "pb_table_thead", *additional_classes, separator: " ")
|
25
22
|
end
|
26
23
|
|
27
24
|
def th_classname(is_first_column: false)
|
28
25
|
additional_classes = []
|
29
|
-
additional_classes << "pinned-left" if is_first_column && responsive == "scroll"
|
26
|
+
additional_classes << "pinned-left" if is_first_column && responsive == "scroll"
|
30
27
|
|
31
28
|
generate_classname("table-header-cells", *additional_classes, separator: " ")
|
32
29
|
end
|
@@ -41,40 +38,6 @@ module Playbook
|
|
41
38
|
rows
|
42
39
|
end
|
43
40
|
|
44
|
-
# Selectable Rows No Subrows - checkboxes in their own first cell
|
45
|
-
def render_select_all_header
|
46
|
-
if selectable_rows
|
47
|
-
additional_classes = []
|
48
|
-
additional_classes << "table-header-cells-custom"
|
49
|
-
additional_classes << "checkbox-cell-header"
|
50
|
-
additional_classes << "pinned-left" if responsive == "scroll"
|
51
|
-
pb_rails("table/table_header", props: {
|
52
|
-
classname: additional_classes.join(" "),
|
53
|
-
}) do
|
54
|
-
pb_rails("checkbox", props: {
|
55
|
-
id: "select-all-rows",
|
56
|
-
name: "select-all-rows",
|
57
|
-
data: {
|
58
|
-
action: "click->pb-advanced-table#toggleAllRowSelection",
|
59
|
-
},
|
60
|
-
})
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
|
66
|
-
def render_select_all_checkbox
|
67
|
-
if selectable_rows
|
68
|
-
pb_rails("checkbox", props: {
|
69
|
-
id: "select-all-rows",
|
70
|
-
name: "select-all-rows",
|
71
|
-
data: {
|
72
|
-
action: "click->pb-advanced-table#toggleAllRowSelection",
|
73
|
-
},
|
74
|
-
})
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
41
|
private
|
79
42
|
|
80
43
|
def compute_max_depth(columns)
|
@@ -1,60 +1,48 @@
|
|
1
1
|
<%= pb_content_tag(:tr) do %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
|
13
|
-
<% left_offset = i * 1.0 + additional_offset %>
|
14
|
-
<div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
|
2
|
+
<% object.column_definitions.each_with_index do |column, index| %>
|
3
|
+
<% next unless column[:accessor].present? %>
|
4
|
+
<%= pb_rails("table/table_cell", props: { classname:object.td_classname(column, index)}) do %>
|
5
|
+
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", classname: object.loading ? "loading-cell" : "" }) do %>
|
6
|
+
<% if collapsible_trail && index.zero? %>
|
7
|
+
<% (1..depth).each do |i| %>
|
8
|
+
<% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
|
9
|
+
<% left_offset = i * 1.0 + additional_offset %>
|
10
|
+
<div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
|
11
|
+
<% end %>
|
15
12
|
<% end %>
|
16
|
-
<% end %>
|
17
13
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
<div style="padding-left: <%= depth * 1.25 %>em">
|
15
|
+
<%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
|
16
|
+
<% if index.zero? && object.row[:children].present? %>
|
17
|
+
<button
|
18
|
+
id="<%= "#{object.id}_#{object.row.object_id}" %>"
|
19
|
+
class="gray-icon expand-toggle-icon"
|
20
|
+
data-advanced-table="true">
|
21
|
+
<%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
|
22
|
+
<%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
|
23
|
+
</button>
|
26
24
|
<% end %>
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
<%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
|
40
|
-
<% elsif index.zero? %>
|
41
|
-
<% if object.depth.zero? %>
|
42
|
-
<%= object.row[column[:accessor].to_sym] %>
|
43
|
-
<% else %>
|
44
|
-
<% object.depth_accessors.each_with_index do |item, accessor_index| %>
|
45
|
-
<% if object.depth - 1 == accessor_index %>
|
46
|
-
<% key = item.to_sym %>
|
47
|
-
<%= object.row[key] %>
|
25
|
+
<%= pb_rails("flex/flex_item", props:{padding_left: index.zero? && object.row[:children].present? ? "none" : "xs"}) do %>
|
26
|
+
<% if column[:custom_renderer].present? %>
|
27
|
+
<%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
|
28
|
+
<% elsif index.zero? %>
|
29
|
+
<% if object.depth.zero? %>
|
30
|
+
<%= object.row[column[:accessor].to_sym] %>
|
31
|
+
<% else %>
|
32
|
+
<% object.depth_accessors.each_with_index do |item, accessor_index| %>
|
33
|
+
<% if object.depth - 1 == accessor_index %>
|
34
|
+
<% key = item.to_sym %>
|
35
|
+
<%= object.row[key] %>
|
36
|
+
<% end %>
|
48
37
|
<% end %>
|
49
38
|
<% end %>
|
39
|
+
<% else %>
|
40
|
+
<%= object.row[column[:accessor].to_sym] %>
|
50
41
|
<% end %>
|
51
|
-
<% else %>
|
52
|
-
<%= object.row[column[:accessor].to_sym] %>
|
53
42
|
<% end %>
|
54
43
|
<% end %>
|
55
|
-
|
56
|
-
|
44
|
+
</div>
|
45
|
+
<% end %>
|
57
46
|
<% end %>
|
58
47
|
<% end %>
|
59
|
-
|
60
|
-
<% end %>
|
48
|
+
<% end %>
|
@@ -20,13 +20,6 @@ module Playbook
|
|
20
20
|
default: "scroll"
|
21
21
|
prop :is_pinned_left, type: Playbook::Props::Boolean,
|
22
22
|
default: false
|
23
|
-
prop :selectable_rows, type: Playbook::Props::Boolean,
|
24
|
-
default: false
|
25
|
-
prop :row_id, type: Playbook::Props::String,
|
26
|
-
default: ""
|
27
|
-
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
28
|
-
values: %w[all header none],
|
29
|
-
default: "header"
|
30
23
|
|
31
24
|
def data
|
32
25
|
Hash(prop(:data)).merge(table_data_attributes)
|
@@ -49,38 +42,6 @@ module Playbook
|
|
49
42
|
end.compact
|
50
43
|
end
|
51
44
|
|
52
|
-
# Selectable Rows No Subrows - checkboxes in their own first cell
|
53
|
-
def render_checkbox_cell
|
54
|
-
if selectable_rows
|
55
|
-
pb_rails("table/table_cell", props: {
|
56
|
-
classname: "checkbox-cell",
|
57
|
-
}) do
|
58
|
-
pb_rails("checkbox", props: {
|
59
|
-
id: "select-row-#{row_id || row.object_id}",
|
60
|
-
name: "select-row-#{row_id || row.object_id}",
|
61
|
-
data: {
|
62
|
-
row_id: row_id || row.object_id.to_s,
|
63
|
-
action: "click->pb-advanced-table#toggleRowSelection",
|
64
|
-
},
|
65
|
-
})
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
|
71
|
-
def render_row_checkbox
|
72
|
-
if selectable_rows
|
73
|
-
pb_rails("checkbox", props: {
|
74
|
-
id: "select-row-#{row_id || row.object_id}",
|
75
|
-
name: "select-row-#{row_id || row.object_id}",
|
76
|
-
data: {
|
77
|
-
row_id: row_id || row.object_id.to_s,
|
78
|
-
action: "click->pb-advanced-table#toggleRowSelection",
|
79
|
-
},
|
80
|
-
})
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
45
|
private
|
85
46
|
|
86
47
|
def custom_renderer_value(column, index)
|
@@ -21,7 +21,6 @@ type TableProps = {
|
|
21
21
|
data?: { [key: string]: string },
|
22
22
|
dataTable: boolean,
|
23
23
|
disableHover?: boolean,
|
24
|
-
headerStyle?: "default" | "borderless" | "floating"
|
25
24
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
26
25
|
id?: string,
|
27
26
|
outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
@@ -47,7 +46,6 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
47
46
|
data = {},
|
48
47
|
dataTable = false,
|
49
48
|
disableHover = false,
|
50
|
-
headerStyle = "default",
|
51
49
|
htmlOptions = {},
|
52
50
|
id,
|
53
51
|
outerPadding = '',
|
@@ -87,8 +85,6 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
87
85
|
'sticky-left-column': stickyLeftColumn,
|
88
86
|
'sticky-right-column': stickyRightColumn,
|
89
87
|
'striped': striped,
|
90
|
-
'header-borderless': headerStyle === 'borderless',
|
91
|
-
'header-floating': headerStyle === 'floating',
|
92
88
|
[outerPaddingCss]: outerPadding !== '',
|
93
89
|
},
|
94
90
|
globalProps(props),
|
@@ -75,5 +75,3 @@ examples:
|
|
75
75
|
- table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
|
76
76
|
- table_with_clickable_rows: Table with Clickable Rows
|
77
77
|
- table_with_selectable_rows: Table with Selectable Rows
|
78
|
-
- table_with_header_style_borderless: Header Style Borderless
|
79
|
-
- table_with_header_style_floating: Header Style Floating
|
@@ -35,5 +35,3 @@ export { default as TableWithCollapsibleWithNestedRows } from './_table_with_col
|
|
35
35
|
export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
|
36
36
|
export { default as TableWithSelectableRows } from './_table_with_selectable_rows.jsx'
|
37
37
|
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|
38
|
-
export { default as TableWithHeaderStyleBorderless } from './_table_with_header_style_borderless.jsx'
|
39
|
-
export { default as TableWithHeaderStyleFloating } from './_table_with_header_style_floating.jsx'
|
@@ -14,79 +14,3 @@
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
}
|
17
|
-
// remove all outward facing borders from header
|
18
|
-
.header-borderless > thead,
|
19
|
-
.header-borderless > thead > tr,
|
20
|
-
.header-borderless > thead > tr > th,
|
21
|
-
.header-borderless > .pb_table_thead,
|
22
|
-
.header-borderless > .pb_table_thead > .pb_table_tr,
|
23
|
-
.header-borderless > .pb_table_thead .pb_table_th {
|
24
|
-
border-top: none !important;
|
25
|
-
border-left: none !important;
|
26
|
-
border-right: none !important;
|
27
|
-
}
|
28
|
-
|
29
|
-
// remove bottom border (internal to table) on header cells - only light mode needs this redundancy handled likely due to a difference in the base scss and table-dark.scss
|
30
|
-
.header-borderless:not(.table-dark) > thead > tr:last-child > th,
|
31
|
-
.header-borderless:not(.table-dark) > .pb_table_thead > .pb_table_tr:last-child > .pb_table_th {
|
32
|
-
border-bottom: none !important;
|
33
|
-
}
|
34
|
-
|
35
|
-
// preserves top rounded corners to header at top of table-card for unnested card
|
36
|
-
.header-borderless > thead > tr:first-child > th:first-child,
|
37
|
-
.header-borderless > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:first-child {
|
38
|
-
border-top-left-radius: $border_radius_md !important;
|
39
|
-
}
|
40
|
-
|
41
|
-
.header-borderless > thead > tr:first-child > th:last-child,
|
42
|
-
.header-borderless > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:last-child {
|
43
|
-
border-top-right-radius: $border_radius_md !important;
|
44
|
-
}
|
45
|
-
|
46
|
-
// ensures top border is from first row of body to prevent double borders
|
47
|
-
.header-borderless > tbody > tr:first-child > td,
|
48
|
-
.header-borderless > .pb_table_tbody > .pb_table_tr:first-child > .pb_table_td {
|
49
|
-
border-top: 1px solid $border_light !important;
|
50
|
-
}
|
51
|
-
|
52
|
-
// floating code - this carries over everything for header-borderless
|
53
|
-
.header-floating > thead,
|
54
|
-
.header-floating > thead > tr,
|
55
|
-
.header-floating > thead > tr > th,
|
56
|
-
.header-floating > .pb_table_thead,
|
57
|
-
.header-floating > .pb_table_thead > .pb_table_tr,
|
58
|
-
.header-floating > .pb_table_thead .pb_table_th {
|
59
|
-
border-top: none !important;
|
60
|
-
border-left: none !important;
|
61
|
-
border-right: none !important;
|
62
|
-
}
|
63
|
-
|
64
|
-
.header-floating:not(.table-dark) > thead > tr:last-child > th,
|
65
|
-
.header-floating:not(.table-dark) > .pb_table_thead > .pb_table_tr:last-child > .pb_table_th {
|
66
|
-
border-bottom: none !important;
|
67
|
-
}
|
68
|
-
|
69
|
-
.header-floating > thead > tr:first-child > th:first-child,
|
70
|
-
.header-floating > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:first-child {
|
71
|
-
border-top-left-radius: $border_radius_md !important;
|
72
|
-
}
|
73
|
-
|
74
|
-
.header-floating > thead > tr:first-child > th:last-child,
|
75
|
-
.header-floating > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:last-child {
|
76
|
-
border-top-right-radius: $border_radius_md !important;
|
77
|
-
}
|
78
|
-
|
79
|
-
.header-floating > tbody > tr:first-child > td,
|
80
|
-
.header-floating > .pb_table_tbody > .pb_table_tr:first-child > .pb_table_td {
|
81
|
-
border-top: 1px solid $border_light !important;
|
82
|
-
}
|
83
|
-
|
84
|
-
// flatten out corners for floating headerstyle variant to avoid small triangle of white/empty space
|
85
|
-
.header-floating > thead > tr:first-child > th:first-child,
|
86
|
-
.header-floating > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:first-child {
|
87
|
-
border-top-left-radius: 0 !important;
|
88
|
-
}
|
89
|
-
.header-floating > thead > tr:first-child > th:last-child,
|
90
|
-
.header-floating > .pb_table_thead > .pb_table_tr:first-child > .pb_table_th:last-child {
|
91
|
-
border-top-right-radius: 0 !important;
|
92
|
-
}
|
@@ -12,7 +12,6 @@ type TableHeadPropTypes = {
|
|
12
12
|
children: React.ReactNode[] | React.ReactNode;
|
13
13
|
className: string;
|
14
14
|
data?: { [key: string]: string };
|
15
|
-
headerStyle?: "default" | "borderless" | "floating";
|
16
15
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
17
16
|
id?: string;
|
18
17
|
tag?: "table" | "div";
|
@@ -24,7 +23,6 @@ const TableHead = (props: TableHeadPropTypes): React.ReactElement => {
|
|
24
23
|
children,
|
25
24
|
className,
|
26
25
|
data = {},
|
27
|
-
headerStyle = "default",
|
28
26
|
htmlOptions = {},
|
29
27
|
id,
|
30
28
|
tag = "table",
|
@@ -33,15 +31,7 @@ const TableHead = (props: TableHeadPropTypes): React.ReactElement => {
|
|
33
31
|
const ariaProps = buildAriaProps(aria);
|
34
32
|
const dataProps = buildDataProps(data);
|
35
33
|
const htmlProps = buildHtmlProps(htmlOptions);
|
36
|
-
const classes = classnames(
|
37
|
-
"pb_table_thead",
|
38
|
-
{
|
39
|
-
"pb_table_thead_borderless": headerStyle === "borderless" || headerStyle === "floating",
|
40
|
-
"pb_table_thead_floating": headerStyle === "floating",
|
41
|
-
},
|
42
|
-
globalProps(props),
|
43
|
-
className
|
44
|
-
);
|
34
|
+
const classes = classnames("pb_table_thead", globalProps(props), className);
|
45
35
|
const isTableTag = tag === "table";
|
46
36
|
|
47
37
|
return (
|
@@ -12,7 +12,6 @@ type TableHeaderPropTypes = {
|
|
12
12
|
children: React.ReactNode[] | React.ReactNode;
|
13
13
|
className: string;
|
14
14
|
data?: { [key: string]: string };
|
15
|
-
headerStyle?: "default" | "borderless" | "floating";
|
16
15
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
17
16
|
id?: string;
|
18
17
|
tag?: "table" | "div";
|
@@ -25,7 +24,6 @@ const TableHeader = (props: TableHeaderPropTypes): React.ReactElement => {
|
|
25
24
|
children,
|
26
25
|
className,
|
27
26
|
data = {},
|
28
|
-
headerStyle = "default",
|
29
27
|
htmlOptions = {},
|
30
28
|
id,
|
31
29
|
tag = "table",
|
@@ -35,15 +33,7 @@ const TableHeader = (props: TableHeaderPropTypes): React.ReactElement => {
|
|
35
33
|
const ariaProps = buildAriaProps(aria);
|
36
34
|
const dataProps = buildDataProps(data);
|
37
35
|
const htmlProps = buildHtmlProps(htmlOptions);
|
38
|
-
const classes = classnames(
|
39
|
-
"pb_table_th",
|
40
|
-
{
|
41
|
-
"pb_table_thead_borderless": headerStyle === "borderless" || headerStyle === "floating",
|
42
|
-
"pb_table_thead_floating": headerStyle === "floating",
|
43
|
-
},
|
44
|
-
globalProps(props),
|
45
|
-
className
|
46
|
-
);
|
36
|
+
const classes = classnames("pb_table_th", globalProps(props), className);
|
47
37
|
const isTableTag = tag === "table";
|
48
38
|
|
49
39
|
return (
|
@@ -22,7 +22,6 @@ type TableRowPropTypes = {
|
|
22
22
|
dark?: boolean;
|
23
23
|
dragId?: string;
|
24
24
|
draggableItem?: boolean;
|
25
|
-
headerStyle?: "default" | "borderless" | "floating";
|
26
25
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
27
26
|
id?: string;
|
28
27
|
toggleCellId?: string;
|
@@ -42,7 +41,6 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
42
41
|
dark = false,
|
43
42
|
dragId,
|
44
43
|
draggableItem = false,
|
45
|
-
headerStyle = "default",
|
46
44
|
htmlOptions = {},
|
47
45
|
id,
|
48
46
|
toggleCellId,
|
@@ -62,9 +60,6 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
62
60
|
const classes = classnames(
|
63
61
|
buildCss("pb_table_row_kit", sideHighlightClass),
|
64
62
|
"pb_table_tr",
|
65
|
-
{
|
66
|
-
"pb_table_tr_borderless_header": headerStyle === "borderless",
|
67
|
-
},
|
68
63
|
collapsibleRow,
|
69
64
|
globalProps(props),
|
70
65
|
className
|