playbook_ui 14.16.0.pre.rc.6 → 14.17.0.pre.alpha.PBNTR920emojipickerpoc7130
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/Utilities/types.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +104 -2
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +168 -85
- 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 +10 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +20 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +90 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb +39 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +19 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +38 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +49 -37
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +39 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.scss +5 -5
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +14 -7
- data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +16 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +0 -11
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +0 -7
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +28 -24
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +115 -5
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +6 -4
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +91 -24
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +35 -28
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +184 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +97 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +11 -2
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +65 -6
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +3 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +3 -4
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +67 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +67 -0
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +22 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.scss +8 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.html.erb +10 -4
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.jsx +49 -24
- data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +4 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_click.jsx +13 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +58 -0
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +20 -7
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +190 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +90 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +57 -0
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +23 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +28 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.html.erb +72 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.jsx +97 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +71 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +91 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_multi_level_select/index.js +105 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +10 -0
- data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -0
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +5 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +29 -11
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +4 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +2 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
- data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +8 -4
- data/app/pb_kits/playbook/pb_table/_table.tsx +4 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +50 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +59 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +76 -0
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +11 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +11 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -0
- data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_picker.jsx +371 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +183 -56
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.jsx +23 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -0
- data/app/pb_kits/playbook/pb_user/_user.tsx +78 -13
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.html.erb +22 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +40 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_rails.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_react.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/user.html.erb +28 -12
- data/app/pb_kits/playbook/pb_user/user.rb +17 -1
- data/app/pb_kits/playbook/pb_user/user.test.js +182 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
- data/app/pb_kits/playbook/tokens/_colors.scss +1 -4
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/app/pb_kits/playbook/utilities/object.test.js +287 -1
- data/app/pb_kits/playbook/utilities/object.ts +171 -3
- data/app/pb_kits/playbook/utilities/text.ts +1 -1
- data/dist/chunks/_typeahead-7W5Ha5Td.js +22 -0
- data/dist/chunks/_weekday_stacked-DSKatW3m.js +45 -0
- data/dist/chunks/lib-BGzBzFZX.js +29 -0
- data/dist/chunks/{pb_form_validation-BvDxpfs-.js → pb_form_validation-BvNy9Bd6.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/forms/builder/multi_level_select_field.rb +2 -0
- data/lib/playbook/kit_base.rb +4 -4
- data/lib/playbook/version.rb +2 -2
- metadata +40 -9
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
- data/dist/chunks/_typeahead-CRAPc8k-.js +0 -22
- data/dist/chunks/_weekday_stacked-T0kFfioG.js +0 -45
- data/dist/chunks/lib-BeKPJYlk.js +0 -29
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.md → _advanced_table_selectable_rows_no_subrows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Table from '../../pb_table/_table'
|
4
|
+
|
5
|
+
const TableWithHeaderStyleBorderless = (props) => {
|
6
|
+
return (
|
7
|
+
<>
|
8
|
+
<Table
|
9
|
+
headerStyle="borderless"
|
10
|
+
size="sm"
|
11
|
+
{...props}
|
12
|
+
>
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th>{'Column 1'}</th>
|
16
|
+
<th>{'Column 2'}</th>
|
17
|
+
<th>{'Column 3'}</th>
|
18
|
+
<th>{'Column 4'}</th>
|
19
|
+
<th>{'Column 5'}</th>
|
20
|
+
</tr>
|
21
|
+
</thead>
|
22
|
+
<tbody>
|
23
|
+
<tr>
|
24
|
+
<td>{'Value 1'}</td>
|
25
|
+
<td>{'Value 2'}</td>
|
26
|
+
<td>{'Value 3'}</td>
|
27
|
+
<td>{'Value 4'}</td>
|
28
|
+
<td>{'Value 5'}</td>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td>{'Value 1'}</td>
|
32
|
+
<td>{'Value 2'}</td>
|
33
|
+
<td>{'Value 3'}</td>
|
34
|
+
<td>{'Value 4'}</td>
|
35
|
+
<td>{'Value 5'}</td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td>{'Value 1'}</td>
|
39
|
+
<td>{'Value 2'}</td>
|
40
|
+
<td>{'Value 3'}</td>
|
41
|
+
<td>{'Value 4'}</td>
|
42
|
+
<td>{'Value 5'}</td>
|
43
|
+
</tr>
|
44
|
+
</tbody>
|
45
|
+
</Table>
|
46
|
+
</>
|
47
|
+
)
|
48
|
+
}
|
49
|
+
|
50
|
+
export default TableWithHeaderStyleBorderless
|
@@ -0,0 +1 @@
|
|
1
|
+
Customize your header by removing the header borders with the `headerStyle="borderless"` prop.
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Background from '../../pb_background/_background'
|
4
|
+
import Card from '../../pb_card/_card'
|
5
|
+
import Table from '../../pb_table/_table'
|
6
|
+
|
7
|
+
const TableWithHeaderStyleFloating = (props) => {
|
8
|
+
return (
|
9
|
+
<>
|
10
|
+
<Card background="light"
|
11
|
+
{...props}
|
12
|
+
>
|
13
|
+
<Table
|
14
|
+
headerStyle="floating"
|
15
|
+
size="sm"
|
16
|
+
{...props}
|
17
|
+
>
|
18
|
+
<Table.Head>
|
19
|
+
<Background backgroundColor="light"
|
20
|
+
tag="tr"
|
21
|
+
{...props}
|
22
|
+
>
|
23
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
24
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
25
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
26
|
+
<Table.Header>{'Column 4'}</Table.Header>
|
27
|
+
<Table.Header>{'Column 5'}</Table.Header>
|
28
|
+
</Background>
|
29
|
+
</Table.Head>
|
30
|
+
<Table.Body>
|
31
|
+
<Table.Row>
|
32
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
33
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
34
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
35
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
36
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
37
|
+
</Table.Row>
|
38
|
+
<Table.Row>
|
39
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
40
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
41
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
42
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
43
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
44
|
+
</Table.Row>
|
45
|
+
<Table.Row>
|
46
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
47
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
48
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
49
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
50
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
51
|
+
</Table.Row>
|
52
|
+
</Table.Body>
|
53
|
+
</Table>
|
54
|
+
</Card>
|
55
|
+
</>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
|
59
|
+
export default TableWithHeaderStyleFloating
|
@@ -0,0 +1 @@
|
|
1
|
+
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `backgroundColor` for the element in which it is nested).
|
@@ -75,3 +75,5 @@ 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,3 +35,5 @@ 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,3 +14,79 @@
|
|
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
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
[class^=pb_table] {
|
1
|
+
[class^=pb_table]:not(:has(colgroup)) {
|
2
2
|
&.striped {
|
3
3
|
tbody, .pb_table_tbody {
|
4
|
-
tr:nth-child(odd), .pb_table_tr:nth-child(odd) {
|
4
|
+
tr:nth-child(odd):not(.pb_background_kit), .pb_table_tr:nth-child(odd):not(.pb_background_kit) {
|
5
5
|
background-color: $bg_light;
|
6
6
|
}
|
7
7
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
&.dark {
|
11
11
|
&.striped {
|
12
12
|
tbody, .pb_table_tbody {
|
13
|
-
tr:nth-child(odd), .pb_table_tr:nth-child(odd) {
|
13
|
+
tr:nth-child(odd):not(.pb_background_kit), .pb_table_tr:nth-child(odd):not(.pb_background_kit) {
|
14
14
|
background-color: $bg_dark;
|
15
15
|
}
|
16
16
|
}
|
@@ -12,6 +12,7 @@ type TableHeadPropTypes = {
|
|
12
12
|
children: React.ReactNode[] | React.ReactNode;
|
13
13
|
className: string;
|
14
14
|
data?: { [key: string]: string };
|
15
|
+
headerStyle?: "default" | "borderless" | "floating";
|
15
16
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
16
17
|
id?: string;
|
17
18
|
tag?: "table" | "div";
|
@@ -23,6 +24,7 @@ const TableHead = (props: TableHeadPropTypes): React.ReactElement => {
|
|
23
24
|
children,
|
24
25
|
className,
|
25
26
|
data = {},
|
27
|
+
headerStyle = "default",
|
26
28
|
htmlOptions = {},
|
27
29
|
id,
|
28
30
|
tag = "table",
|
@@ -31,7 +33,15 @@ const TableHead = (props: TableHeadPropTypes): React.ReactElement => {
|
|
31
33
|
const ariaProps = buildAriaProps(aria);
|
32
34
|
const dataProps = buildDataProps(data);
|
33
35
|
const htmlProps = buildHtmlProps(htmlOptions);
|
34
|
-
const classes = classnames(
|
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
|
+
);
|
35
45
|
const isTableTag = tag === "table";
|
36
46
|
|
37
47
|
return (
|
@@ -12,6 +12,7 @@ type TableHeaderPropTypes = {
|
|
12
12
|
children: React.ReactNode[] | React.ReactNode;
|
13
13
|
className: string;
|
14
14
|
data?: { [key: string]: string };
|
15
|
+
headerStyle?: "default" | "borderless" | "floating";
|
15
16
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
16
17
|
id?: string;
|
17
18
|
tag?: "table" | "div";
|
@@ -24,6 +25,7 @@ const TableHeader = (props: TableHeaderPropTypes): React.ReactElement => {
|
|
24
25
|
children,
|
25
26
|
className,
|
26
27
|
data = {},
|
28
|
+
headerStyle = "default",
|
27
29
|
htmlOptions = {},
|
28
30
|
id,
|
29
31
|
tag = "table",
|
@@ -33,7 +35,15 @@ const TableHeader = (props: TableHeaderPropTypes): React.ReactElement => {
|
|
33
35
|
const ariaProps = buildAriaProps(aria);
|
34
36
|
const dataProps = buildDataProps(data);
|
35
37
|
const htmlProps = buildHtmlProps(htmlOptions);
|
36
|
-
const classes = classnames(
|
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
|
+
);
|
37
47
|
const isTableTag = tag === "table";
|
38
48
|
|
39
49
|
return (
|
@@ -22,6 +22,7 @@ type TableRowPropTypes = {
|
|
22
22
|
dark?: boolean;
|
23
23
|
dragId?: string;
|
24
24
|
draggableItem?: boolean;
|
25
|
+
headerStyle?: "default" | "borderless" | "floating";
|
25
26
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
26
27
|
id?: string;
|
27
28
|
toggleCellId?: string;
|
@@ -41,6 +42,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
41
42
|
dark = false,
|
42
43
|
dragId,
|
43
44
|
draggableItem = false,
|
45
|
+
headerStyle = "default",
|
44
46
|
htmlOptions = {},
|
45
47
|
id,
|
46
48
|
toggleCellId,
|
@@ -60,6 +62,9 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
60
62
|
const classes = classnames(
|
61
63
|
buildCss("pb_table_row_kit", sideHighlightClass),
|
62
64
|
"pb_table_tr",
|
65
|
+
{
|
66
|
+
"pb_table_tr_borderless_header": headerStyle === "borderless",
|
67
|
+
},
|
63
68
|
collapsibleRow,
|
64
69
|
globalProps(props),
|
65
70
|
className
|
@@ -167,3 +167,20 @@ test("Should have outerPadding class", () => {
|
|
167
167
|
const kit = renderKit(Table, props, { outerPadding: "sm" })
|
168
168
|
expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card outer_padding_space_sm table-collapse-sm")
|
169
169
|
})
|
170
|
+
|
171
|
+
test("when headerStyle is default", () => {
|
172
|
+
const kit = renderKit(Table, props)
|
173
|
+
expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card table-collapse-sm")
|
174
|
+
expect(kit).not.toHaveClass("header-borderless")
|
175
|
+
expect(kit).not.toHaveClass("header-floating")
|
176
|
+
})
|
177
|
+
|
178
|
+
test("when headerStyle is borderless", () => {
|
179
|
+
const kit = renderKit(Table, props, { headerStyle: "borderless" })
|
180
|
+
expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card header-borderless table-collapse-sm")
|
181
|
+
})
|
182
|
+
|
183
|
+
test("when headerStyle is floating", () => {
|
184
|
+
const kit = renderKit(Table, props, { headerStyle: "floating" })
|
185
|
+
expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card header-floating table-collapse-sm")
|
186
|
+
})
|