playbook_ui 14.24.0.pre.alpha.testingwithoutlazyload9529 → 14.24.0.pre.rc.0
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +6 -7
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +25 -24
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +10 -10
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +13 -11
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +4 -7
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +2 -112
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -13
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -90
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +0 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +11 -4
- data/app/pb_kits/playbook/pb_advanced_table/index.js +125 -108
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +4 -10
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +5 -22
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -12
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +1 -2
- data/app/pb_kits/playbook/pb_checkbox/index.js +26 -218
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -10
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +3 -5
- data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
- data/app/pb_kits/playbook/pb_date/date.rb +0 -2
- data/app/pb_kits/playbook/pb_date/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -17
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -11
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +0 -6
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +9 -18
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +1 -12
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_rails.md +1 -3
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +1 -3
- data/app/pb_kits/playbook/pb_pagination/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_pagination/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -11
- data/app/pb_kits/playbook/pb_select/select.rb +2 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +1 -49
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.scss +0 -0
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +202 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx +69 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx +71 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx +110 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_beacon.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_overlay.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_styled.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/example.yml +10 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx +34 -0
- data/dist/chunks/{_line_graph-qk_BN_J0.js → _line_graph-BfCo79KE.js} +1 -1
- data/dist/chunks/{_typeahead-ZLTFtAoW.js → _typeahead-Db4YQA5c.js} +2 -2
- data/dist/chunks/_weekday_stacked-DhFTG-Jt.js +61 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-CY5ZPzic.js → lib-DnQyMxO1.js} +2 -2
- data/dist/chunks/{pb_form_validation-D3b0JKHH.js → pb_form_validation-kl-4Jv4t.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +11 -4
- data/dist/playbook-doc.js +2 -2
- 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 +2 -2
- metadata +19 -36
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +0 -107
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.md +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +0 -24
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +0 -3
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +0 -17
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown_mixin.scss +0 -36
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +0 -90
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +0 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +0 -22
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +0 -43
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.html.erb +0 -75
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx +0 -94
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md +0 -3
- data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +0 -212
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +0 -112
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +0 -3
- data/dist/chunks/_weekday_stacked-rU5SIBAO.js +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e6c42711223f44800761968ff6b12e3e01d675dbf792208ac3af880849420ba
|
4
|
+
data.tar.gz: 7ac59da841cc4a9040005e6de70ff3e1e87645917aa19714338d8031397d97e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e3d0844fe67b12098f03a4eb1c4c31fd1307d6f4fec41c3c324fbe4645336a89af6abfb7f80a49ba292f6824677c88cd98c9624df441e61a5764605a62bb15
|
7
|
+
data.tar.gz: 51924ba09262e9be87069173a5b994f843f42e45c4da68def19965c66161842eeef85be41d968c68244b4ffff73337e0dd0afe9d5e141b481ba86460bc0732c5
|
@@ -107,6 +107,7 @@
|
|
107
107
|
@import 'pb_typeahead/typeahead';
|
108
108
|
@import 'pb_user/user';
|
109
109
|
@import 'pb_user_badge/user_badge';
|
110
|
+
@import 'pb_walkthrough/walkthrough';
|
110
111
|
@import 'pb_weekday_stacked/weekday_stacked';
|
111
112
|
@import 'pb_empty_state/empty_state';
|
112
113
|
@import 'utilities/mixins';
|
@@ -20,7 +20,7 @@ interface CustomCellProps {
|
|
20
20
|
customRenderer?: (row: Row<GenericObject>, value: string | undefined) => React.ReactNode
|
21
21
|
selectableRows?: boolean
|
22
22
|
customStyle?: GenericObject
|
23
|
-
}
|
23
|
+
}
|
24
24
|
|
25
25
|
export const CustomCell = ({
|
26
26
|
getValue,
|
@@ -35,7 +35,7 @@ export const CustomCell = ({
|
|
35
35
|
|
36
36
|
const handleOnExpand = (row: Row<GenericObject>) => {
|
37
37
|
onRowToggleClick && onRowToggleClick(row);
|
38
|
-
|
38
|
+
|
39
39
|
if (!expandedControl) {
|
40
40
|
setExpanded({ ...expanded, [row.id]: !row.getIsExpanded() });
|
41
41
|
}
|
@@ -46,8 +46,8 @@ export const CustomCell = ({
|
|
46
46
|
|
47
47
|
return (
|
48
48
|
<div style={{ paddingLeft: `${row.depth * 1.25}em`}}>
|
49
|
-
<Flex
|
50
|
-
alignItems="center"
|
49
|
+
<Flex
|
50
|
+
alignItems="center"
|
51
51
|
columnGap="xs"
|
52
52
|
justify="start"
|
53
53
|
orientation="row"
|
@@ -71,12 +71,11 @@ export const CustomCell = ({
|
|
71
71
|
>
|
72
72
|
{row.getIsExpanded() ? (
|
73
73
|
<Icon cursor="pointer"
|
74
|
-
icon="circle-play"
|
75
|
-
rotation={90}
|
74
|
+
icon="circle-play-down"
|
76
75
|
/>
|
77
76
|
) : (
|
78
77
|
<Icon cursor="pointer"
|
79
|
-
icon="circle-play"
|
78
|
+
icon="circle-play"
|
80
79
|
/>
|
81
80
|
)}
|
82
81
|
</button>
|
@@ -58,9 +58,7 @@ const TableCellRenderer = ({
|
|
58
58
|
// Find the “owning” colDefinition by accessor. Needed for multi column logic
|
59
59
|
const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
|
60
60
|
const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
|
61
|
-
|
62
|
-
const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
|
63
|
-
|
61
|
+
|
64
62
|
return (
|
65
63
|
<td
|
66
64
|
align={cellAlignment}
|
@@ -70,7 +68,6 @@ const TableCellRenderer = ({
|
|
70
68
|
isPinnedLeft && 'pinned-left',
|
71
69
|
stickyLeftColumn && stickyLeftColumn.length > 0 && isPinnedLeft && 'sticky-left',
|
72
70
|
isLastCell && 'last-cell',
|
73
|
-
paddingClass
|
74
71
|
)}
|
75
72
|
key={`${cell.id}-data`}
|
76
73
|
style={{
|
@@ -4,48 +4,49 @@ import { Header } from "@tanstack/react-table"
|
|
4
4
|
import { GenericObject } from "../../types"
|
5
5
|
|
6
6
|
import Icon from "../../pb_icon/_icon"
|
7
|
+
import { getAllIcons } from "../../utilities/icons/allicons"
|
7
8
|
|
8
9
|
import { displayIcon } from "../Utilities/IconHelpers"
|
9
10
|
|
10
11
|
type SortIconButtonProps = {
|
11
12
|
header: Header<GenericObject, unknown>
|
12
13
|
sortIcon?: string | string[]
|
13
|
-
enableSortingRemoval?: boolean
|
14
14
|
}
|
15
15
|
|
16
|
-
export const SortIconButton = ({ header, sortIcon
|
17
|
-
|
18
|
-
|
16
|
+
export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => {
|
17
|
+
|
18
|
+
const firstIcon = displayIcon(sortIcon)[0]
|
19
|
+
const secondIcon = displayIcon(sortIcon)[1]
|
20
|
+
const upIcon = getAllIcons()["arrowUpShortWide"].icon as unknown as { [key: string]: SVGElement }
|
21
|
+
const downIcon = getAllIcons()["arrowDownShortWide"].icon as unknown as { [key: string]: SVGElement }
|
19
22
|
|
20
23
|
return (
|
21
24
|
<>
|
22
|
-
{header.column.getIsSorted() === "desc"
|
23
|
-
<div
|
24
|
-
className="sort-button-icon"
|
25
|
+
{header.column.getIsSorted() === "desc" ? (
|
26
|
+
<div className="sort-button-icon"
|
25
27
|
key={firstIcon}
|
26
|
-
style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
|
27
28
|
>
|
29
|
+
{ firstIcon === "arrow-up-short-wide" ? (
|
30
|
+
<Icon
|
31
|
+
className="svg-inline--fa"
|
32
|
+
customIcon={upIcon}
|
33
|
+
/> ) : (
|
28
34
|
<Icon icon={firstIcon} />
|
35
|
+
)}
|
29
36
|
</div>
|
30
|
-
)
|
31
|
-
|
32
|
-
<div
|
33
|
-
className="sort-button-icon"
|
37
|
+
) : (
|
38
|
+
<div className="sort-button-icon"
|
34
39
|
key={secondIcon}
|
35
|
-
style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
|
36
40
|
>
|
41
|
+
{ secondIcon === "arrow-down-short-wide" ? (
|
42
|
+
<Icon
|
43
|
+
className="svg-inline--fa"
|
44
|
+
customIcon={downIcon}
|
45
|
+
/> ) : (
|
37
46
|
<Icon icon={secondIcon} />
|
38
|
-
|
39
|
-
)}
|
40
|
-
{header.column.getIsSorted() === false && (
|
41
|
-
<div
|
42
|
-
className="sort-button-icon"
|
43
|
-
key={enableSortingRemoval ? "arrow-up-arrow-down" : secondIcon}
|
44
|
-
style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
|
45
|
-
>
|
46
|
-
<Icon icon={enableSortingRemoval ? "arrow-up-arrow-down" : secondIcon} />
|
47
|
+
)}
|
47
48
|
</div>
|
48
49
|
)}
|
49
50
|
</>
|
50
|
-
)
|
51
|
-
}
|
51
|
+
)
|
52
|
+
}
|
@@ -112,7 +112,7 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
112
112
|
paddingBottom="xs"
|
113
113
|
text={node.label}
|
114
114
|
/>
|
115
|
-
<Flex flexDirection="column"
|
115
|
+
<Flex flexDirection="column"
|
116
116
|
paddingLeft="lg"
|
117
117
|
>
|
118
118
|
{node?.children?.map((child) =>
|
@@ -141,8 +141,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
141
141
|
setShowPopover(!shouldClose)
|
142
142
|
|
143
143
|
const popoverReference = (
|
144
|
-
<Tooltip
|
145
|
-
placement="top"
|
144
|
+
<Tooltip
|
145
|
+
placement="top"
|
146
146
|
text="Column Configuration"
|
147
147
|
>
|
148
148
|
<div onClick={togglePopover}>
|
@@ -170,8 +170,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
170
170
|
>
|
171
171
|
{type === "row-selection" ? (
|
172
172
|
<>
|
173
|
-
<Caption color="light"
|
174
|
-
paddingLeft="xs"
|
173
|
+
<Caption color="light"
|
174
|
+
paddingLeft="xs"
|
175
175
|
size="xs"
|
176
176
|
>
|
177
177
|
{selectedCount} Selected
|
@@ -188,15 +188,15 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
188
188
|
zIndex={3}
|
189
189
|
>
|
190
190
|
<>
|
191
|
-
<Caption
|
192
|
-
paddingY="sm"
|
191
|
+
<Caption
|
192
|
+
paddingY="sm"
|
193
193
|
text="Columns Config"
|
194
|
-
textAlign="center"
|
194
|
+
textAlign="center"
|
195
195
|
/>
|
196
196
|
<SectionSeparator paddingBottom="xs" />
|
197
197
|
{tree.map((node: VisibilityNode) => (
|
198
|
-
<Flex cursor="pointer"
|
199
|
-
flexDirection="column"
|
198
|
+
<Flex cursor="pointer"
|
199
|
+
flexDirection="column"
|
200
200
|
key={node.id}
|
201
201
|
paddingX="xs"
|
202
202
|
>
|
@@ -50,7 +50,6 @@ export const TableHeaderCell = ({
|
|
50
50
|
expanded,
|
51
51
|
setExpanded,
|
52
52
|
expandByDepth,
|
53
|
-
enableSortingRemoval,
|
54
53
|
onExpandByDepthClick,
|
55
54
|
toggleExpansionIcon,
|
56
55
|
sortControl,
|
@@ -65,7 +64,6 @@ export const TableHeaderCell = ({
|
|
65
64
|
|
66
65
|
type justifyTypes = "none" | "center" | "start" | "end" | "between" | "around" | "evenly"
|
67
66
|
|
68
|
-
|
69
67
|
const toggleSortButton = (event: React.SyntheticEvent) => {
|
70
68
|
if (sortControl) {
|
71
69
|
const sortIsDesc = header?.column.getIsSorted() === "desc"
|
@@ -103,6 +101,7 @@ export const TableHeaderCell = ({
|
|
103
101
|
if (!header) return false;
|
104
102
|
|
105
103
|
if (header.colSpan > 1 && header.column.parent !== undefined) return true;
|
104
|
+
|
106
105
|
const parent = header.column.parent;
|
107
106
|
|
108
107
|
if (!parent) {
|
@@ -112,7 +111,7 @@ export const TableHeaderCell = ({
|
|
112
111
|
const visibleSiblings = parent.columns.filter(columnHasVisibleLeaf);
|
113
112
|
return visibleSiblings.at(-1) === header.column;
|
114
113
|
})();
|
115
|
-
|
114
|
+
|
116
115
|
const cellClassName = classnames(
|
117
116
|
"table-header-cells",
|
118
117
|
`${showActionsBar && isActionBarVisible && "header-cells-with-actions"}`,
|
@@ -121,7 +120,7 @@ const cellClassName = classnames(
|
|
121
120
|
{ "pinned-left": responsive === "scroll" && isPinnedLeft },
|
122
121
|
isLastHeaderCell ? "last-header-cell" : "",
|
123
122
|
stickyLeftColumn && stickyLeftColumn.length > 0 && isPinnedLeft ? 'sticky-left' : "",
|
124
|
-
|
123
|
+
|
125
124
|
);
|
126
125
|
|
127
126
|
const cellId = `${loading ?
|
@@ -258,9 +257,12 @@ const isToggleExpansionEnabled =
|
|
258
257
|
)}
|
259
258
|
|
260
259
|
<Flex
|
261
|
-
className={`${header?.index === 0 &&
|
262
|
-
|
263
|
-
|
260
|
+
className={`${header?.index === 0 &&
|
261
|
+
enableSorting &&
|
262
|
+
"header-sort-button pb_th_link"}`}
|
263
|
+
cursor={header?.index === 0 && enableSorting ? "pointer" : "default"}
|
264
|
+
{...(header?.index === 0 &&
|
265
|
+
enableSorting && {
|
264
266
|
htmlOptions: {
|
265
267
|
onClick: (event: React.MouseEvent) => toggleSortButton(event),
|
266
268
|
onKeyDown: (event: React.KeyboardEvent) => {
|
@@ -278,13 +280,13 @@ const isToggleExpansionEnabled =
|
|
278
280
|
{flexRender(header?.column.columnDef.header, header?.getContext())}
|
279
281
|
</div>
|
280
282
|
|
281
|
-
{
|
283
|
+
{header?.index === 0 &&
|
284
|
+
header.column.getCanSort() &&
|
285
|
+
enableSorting &&
|
282
286
|
(loading ? (
|
283
287
|
<div className="loading-toggle-icon" />
|
284
288
|
) : (
|
285
|
-
<SortIconButton
|
286
|
-
enableSortingRemoval={enableSortingRemoval}
|
287
|
-
header={header}
|
289
|
+
<SortIconButton header={header}
|
288
290
|
sortIcon={sortIcon}
|
289
291
|
/>
|
290
292
|
))}
|
@@ -16,10 +16,8 @@ import { createCellFunction } from "../Utilities/CellRendererUtils";
|
|
16
16
|
interface UseTableStateProps {
|
17
17
|
tableData: GenericObject[];
|
18
18
|
columnDefinitions: GenericObject[];
|
19
|
-
enableSortingRemoval?: boolean;
|
20
19
|
expandedControl?: GenericObject;
|
21
20
|
sortControl?: GenericObject;
|
22
|
-
firstColumnSort?: boolean;
|
23
21
|
onRowToggleClick?: (arg: Row<GenericObject>) => void;
|
24
22
|
selectableRows?: boolean;
|
25
23
|
initialLoadingRowsCount?: number;
|
@@ -40,7 +38,6 @@ interface UseTableStateProps {
|
|
40
38
|
export function useTableState({
|
41
39
|
tableData,
|
42
40
|
columnDefinitions,
|
43
|
-
enableSortingRemoval,
|
44
41
|
expandedControl,
|
45
42
|
sortControl,
|
46
43
|
onRowToggleClick,
|
@@ -86,19 +83,19 @@ export function useTableState({
|
|
86
83
|
const buildColumns = useCallback((columnDefinitions: GenericObject[], isRoot = true): any[] => {
|
87
84
|
return columnDefinitions?.map((column, index) => {
|
88
85
|
const isFirstColumn = isRoot && index === 0;
|
86
|
+
|
89
87
|
// Handle grouped columns
|
90
88
|
if (column.columns && column.columns.length > 0) {
|
91
89
|
return {
|
92
|
-
header: column.header
|
93
|
-
id: column.id ?? column.label ?? `group-${index}`,
|
90
|
+
header: column.header || column.label || "",
|
94
91
|
columns: buildColumns(column.columns, false),
|
95
92
|
};
|
96
93
|
}
|
94
|
+
|
97
95
|
// Define the base column structure
|
98
96
|
const columnStructure = {
|
99
97
|
...columnHelper.accessor(column.accessor, {
|
100
98
|
header: column.header ?? column.label ?? "",
|
101
|
-
enableSorting: isFirstColumn || column.enableSort === true,
|
102
99
|
}),
|
103
100
|
};
|
104
101
|
|
@@ -169,7 +166,7 @@ export function useTableState({
|
|
169
166
|
getCoreRowModel: getCoreRowModel(),
|
170
167
|
getExpandedRowModel: getExpandedRowModel(),
|
171
168
|
getSortedRowModel: getSortedRowModel(),
|
172
|
-
enableSortingRemoval:
|
169
|
+
enableSortingRemoval: false,
|
173
170
|
sortDescFirst: true,
|
174
171
|
onRowSelectionChange: setRowSelection,
|
175
172
|
onRowPinningChange,
|
@@ -124,65 +124,13 @@
|
|
124
124
|
-ms-overflow-style: none !important;
|
125
125
|
scrollbar-width: none !important;
|
126
126
|
}
|
127
|
-
|
128
|
-
// When action bar is hidden, ensure proper border radius for header corners
|
129
|
-
&.hidden-action-bar {
|
130
|
-
.pb_advanced_table_header {
|
131
|
-
> tr:first-child {
|
132
|
-
th:first-child {
|
133
|
-
border-top-left-radius: 4px !important;
|
134
|
-
}
|
135
|
-
th:last-child {
|
136
|
-
border-top-right-radius: 4px !important;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
// Also handle the case when there are multiple header rows
|
142
|
-
.pb_advanced_table_header {
|
143
|
-
> tr:first-child {
|
144
|
-
th:first-child,
|
145
|
-
.table-header-cells:first-child,
|
146
|
-
.table-header-cells-custom:first-child {
|
147
|
-
border-top-left-radius: 4px !important;
|
148
|
-
}
|
149
|
-
th:last-child,
|
150
|
-
.table-header-cells:last-child,
|
151
|
-
.table-header-cells-custom:last-child {
|
152
|
-
border-top-right-radius: 4px !important;
|
153
|
-
}
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
// When action bar is shown, remove border radius from header
|
159
|
-
.row-selection-actions-card.is-visible ~ * .pb_advanced_table_header,
|
160
|
-
.row-selection-actions-card.show-action-card ~ * .pb_advanced_table_header {
|
161
|
-
> tr:first-child {
|
162
|
-
th:first-child,
|
163
|
-
th:last-child,
|
164
|
-
.table-header-cells:first-child,
|
165
|
-
.table-header-cells:last-child,
|
166
|
-
.table-header-cells-custom:first-child,
|
167
|
-
.table-header-cells-custom:last-child {
|
168
|
-
border-top-left-radius: 0 !important;
|
169
|
-
border-top-right-radius: 0 !important;
|
170
|
-
}
|
171
|
-
}
|
172
|
-
}
|
173
|
-
|
127
|
+
|
174
128
|
|
175
129
|
.row-selection-actions-card {
|
176
130
|
border-bottom-right-radius: 0px !important;
|
177
131
|
border-bottom-left-radius: 0px !important;
|
178
132
|
border-bottom-color: transparent;
|
179
133
|
transition: height 300ms ease;
|
180
|
-
|
181
|
-
&.is-visible,
|
182
|
-
&.show-action-card {
|
183
|
-
border-top-left-radius: 4px !important;
|
184
|
-
border-top-right-radius: 4px !important;
|
185
|
-
}
|
186
134
|
}
|
187
135
|
.table-header-cells:first-child {
|
188
136
|
min-width: 180px;
|
@@ -422,15 +370,6 @@
|
|
422
370
|
padding: 2px;
|
423
371
|
}
|
424
372
|
|
425
|
-
.header-sort-secondary-columns {
|
426
|
-
color: $primary !important;
|
427
|
-
|
428
|
-
&:hover {
|
429
|
-
background-color: rgba($primary, 0.03);
|
430
|
-
border-radius: $border_radius_md;
|
431
|
-
}
|
432
|
-
}
|
433
|
-
|
434
373
|
.toggle-all-icon {
|
435
374
|
@extend .button-icon;
|
436
375
|
@extend %primary-color-pseudo;
|
@@ -971,58 +910,9 @@
|
|
971
910
|
}
|
972
911
|
}
|
973
912
|
}
|
974
|
-
|
975
|
-
// Firefox-specific fix for last-header-cell and last-cell vertical borders
|
976
|
-
@-moz-document url-prefix() {
|
977
|
-
.pb_advanced_table_header {
|
978
|
-
.last-header-cell {
|
979
|
-
border-right: none !important;
|
980
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
981
|
-
}
|
982
|
-
}
|
983
|
-
|
984
|
-
.pb_advanced_table_body {
|
985
|
-
.last-cell {
|
986
|
-
border-right: none !important;
|
987
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
988
|
-
}
|
989
|
-
}
|
990
|
-
|
991
|
-
// Dark mode Firefox fixes
|
992
|
-
&.dark {
|
993
|
-
.pb_advanced_table_header {
|
994
|
-
.last-header-cell {
|
995
|
-
border-right: none !important;
|
996
|
-
box-shadow: 1px 0 0 0 $border_dark !important;
|
997
|
-
}
|
998
|
-
}
|
999
|
-
|
1000
|
-
.pb_advanced_table_body {
|
1001
|
-
.last-cell {
|
1002
|
-
border-right: none !important;
|
1003
|
-
box-shadow: 1px 0 0 0 $border_dark !important;
|
1004
|
-
}
|
1005
|
-
}
|
1006
|
-
}
|
1007
|
-
}
|
1008
913
|
}
|
1009
914
|
|
1010
915
|
// Outside of the pb_advanced_table class for popover
|
1011
916
|
.pb-advanced-table-popover-option:hover {
|
1012
917
|
background-color: $bg_light;
|
1013
|
-
}
|
1014
|
-
// Removes borders when Wrapped inside the Card Kit
|
1015
|
-
[class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_body .last-cell,
|
1016
|
-
[class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_header .last-header-cell,
|
1017
|
-
[class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_body tr td:last-child,
|
1018
|
-
[class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_header tr th:last-child {
|
1019
|
-
border-right: none !important;
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
// Removes borders when Wrapped inside the Card Kit
|
1023
|
-
[class^=pb_card_kit] > .pb_advanced_table tr:last-child,
|
1024
|
-
[class^=pb_card_kit] > .pb_advanced_table .last-row-cell {
|
1025
|
-
td {
|
1026
|
-
border-bottom: none !important;
|
1027
|
-
}
|
1028
|
-
}
|
918
|
+
}
|
@@ -40,7 +40,6 @@ type AdvancedTableProps = {
|
|
40
40
|
dark?: boolean
|
41
41
|
data?: { [key: string]: string }
|
42
42
|
enableToggleExpansion?: "all" | "header" | "none"
|
43
|
-
enableSortingRemoval?: boolean
|
44
43
|
expandedControl?: GenericObject
|
45
44
|
expandByDepth?: { [key: string]: string | number }
|
46
45
|
onExpandByDepthClick?: (arg: number, arg1: any) => void
|
@@ -88,7 +87,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
88
87
|
dark = false,
|
89
88
|
data = {},
|
90
89
|
enableToggleExpansion = "header",
|
91
|
-
enableSortingRemoval = false,
|
92
90
|
expandedControl,
|
93
91
|
expandByDepth,
|
94
92
|
onExpandByDepthClick,
|
@@ -124,6 +122,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
124
122
|
// Component refs
|
125
123
|
const tableWrapperRef = useRef<HTMLDivElement>(null);
|
126
124
|
|
125
|
+
// Initialize table state
|
127
126
|
const {
|
128
127
|
table,
|
129
128
|
expanded,
|
@@ -138,7 +137,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
138
137
|
} = useTableState({
|
139
138
|
tableData,
|
140
139
|
columnDefinitions,
|
141
|
-
enableSortingRemoval,
|
142
140
|
expandedControl,
|
143
141
|
sortControl,
|
144
142
|
onRowToggleClick,
|
@@ -220,10 +218,10 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
220
218
|
)
|
221
219
|
|
222
220
|
return (
|
223
|
-
<Card
|
221
|
+
<Card
|
224
222
|
borderNone
|
225
223
|
borderRadius="none"
|
226
|
-
className="advanced-table-fullscreen-header"
|
224
|
+
className="advanced-table-fullscreen-header"
|
227
225
|
{...props}
|
228
226
|
>
|
229
227
|
<Flex justify="end">
|
@@ -252,10 +250,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
252
250
|
const ariaProps = buildAriaProps(aria);
|
253
251
|
const dataProps = buildDataProps(data);
|
254
252
|
const htmlProps = buildHtmlProps(htmlOptions);
|
255
|
-
|
256
|
-
// Visibility flag for action bar
|
257
|
-
const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
|
258
|
-
|
259
253
|
const classes = classnames(
|
260
254
|
buildCss("pb_advanced_table"),
|
261
255
|
`advanced-table-responsive-${responsive}`,
|
@@ -263,8 +257,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
263
257
|
{
|
264
258
|
'advanced-table-fullscreen': isFullscreen,
|
265
259
|
'advanced-table-allow-fullscreen': allowFullScreen,
|
266
|
-
// Add the hidden-action-bar class when action bar functionality exists but is not visible
|
267
|
-
'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
|
268
260
|
},
|
269
261
|
{'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
|
270
262
|
columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
|
@@ -278,6 +270,9 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
278
270
|
? getVirtualizedContainerStyles(maxHeight)
|
279
271
|
: {};
|
280
272
|
|
273
|
+
// Visibility flag for action bar
|
274
|
+
const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
|
275
|
+
|
281
276
|
// The actual Main <Table /> element
|
282
277
|
const tableElement = (
|
283
278
|
<Table
|
@@ -293,7 +288,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
293
288
|
) : (
|
294
289
|
<>
|
295
290
|
<TableHeader />
|
296
|
-
<TableBody
|
291
|
+
<TableBody
|
297
292
|
isFetching={isFetching}
|
298
293
|
/>
|
299
294
|
</>
|
@@ -335,7 +330,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
335
330
|
columnGroupBorderColor={columnGroupBorderColor}
|
336
331
|
columnVisibilityControl={columnVisibilityControl}
|
337
332
|
customSort={customSort}
|
338
|
-
enableSortingRemoval={enableSortingRemoval}
|
339
333
|
enableToggleExpansion={enableToggleExpansion}
|
340
334
|
enableVirtualization={virtualizedRows}
|
341
335
|
expandByDepth={expandByDepth}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% if content.present? %>
|
12
12
|
<% content.presence %>
|
13
13
|
<% else %>
|
14
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
14
|
+
<%= 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, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
|
15
15
|
<%= 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, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling }) %>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
@@ -35,12 +35,7 @@ module Playbook
|
|
35
35
|
default: []
|
36
36
|
|
37
37
|
def classname
|
38
|
-
additional_classes = [
|
39
|
-
responsive_classname,
|
40
|
-
max_height_classname,
|
41
|
-
hide_scroll_bar_class,
|
42
|
-
hidden_action_bar_class,
|
43
|
-
]
|
38
|
+
additional_classes = [responsive_classname, max_height_classname, hide_scroll_bar_class]
|
44
39
|
additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
|
45
40
|
generate_classname("pb_advanced_table", *additional_classes, separator: " ")
|
46
41
|
end
|
@@ -54,12 +49,7 @@ module Playbook
|
|
54
49
|
end
|
55
50
|
|
56
51
|
def hide_scroll_bar_class
|
57
|
-
scroll_bar_none ? "advanced-table-hide-scrollbar" : ""
|
58
|
-
end
|
59
|
-
|
60
|
-
def hidden_action_bar_class
|
61
|
-
# Add hidden-action-bar class when action bar functionality is enabled but not currently visible
|
62
|
-
selectable_rows && !is_action_bar_visible ? "hidden-action-bar" : ""
|
52
|
+
scroll_bar_none ? "advanced-table-hide-scrollbar " : ""
|
63
53
|
end
|
64
54
|
|
65
55
|
def selected_rows
|