playbook_ui 15.2.0.pre.alpha.play257911600 → 15.2.0.pre.alpha.testingmanual1
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 +5 -5
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +3 -18
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +14 -56
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -9
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +5 -49
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +6 -8
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +10 -7
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +1 -73
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +10 -7
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +0 -47
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +2 -41
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +20 -60
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +0 -36
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +1 -127
- data/dist/chunks/{_line_graph-BnVgr42C.js → _line_graph-DiZsCIbc.js} +1 -1
- data/dist/chunks/_typeahead-e_XlDkym.js +6 -0
- data/dist/chunks/{_weekday_stacked-B3YOt9GF.js → _weekday_stacked-qKBP2x1z.js} +2 -2
- data/dist/chunks/{lib-QZuu1ltS.js → lib-izYrkvOQ.js} +2 -2
- data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-Cah5Z5J3.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +0 -12
- 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 +1 -1
- metadata +7 -85
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +0 -39
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.html.erb +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.html.erb +0 -40
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +0 -3
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +0 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.scss +0 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.tsx +0 -69
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +0 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.html.erb +0 -12
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +0 -24
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +0 -5
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.html.erb +0 -45
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +0 -119
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.md +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.html.erb +0 -5
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.jsx +0 -24
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.html.erb +0 -23
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +0 -37
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.html.erb +0 -40
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +0 -56
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_live_data.jsx +0 -64
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.html.erb +0 -27
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +0 -40
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.md +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.html.erb +0 -19
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.jsx +0 -65
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.md +0 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.html.erb +0 -14
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.jsx +0 -27
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.html.erb +0 -39
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +0 -58
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.md +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/example.yml +0 -29
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pbGaugeGraphTheme.ts +0 -91
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.rb +0 -25
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +0 -80
- data/app/pb_kits/playbook/pb_pb_line_graph/_pb_line_graph.scss +0 -3
- data/app/pb_kits/playbook/pb_pb_line_graph/_pb_line_graph.tsx +0 -61
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +0 -3
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.html.erb +0 -34
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +0 -52
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.md +0 -5
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.html.erb +0 -34
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.jsx +0 -45
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_height.html.erb +0 -47
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_height.jsx +0 -64
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend.html.erb +0 -24
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend.jsx +0 -37
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_nonclickable.html.erb +0 -39
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_nonclickable.jsx +0 -45
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +0 -86
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.jsx +0 -116
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.md +0 -11
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/example.yml +0 -20
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_pb_line_graph/pbLineGraphTheme.ts +0 -125
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.rb +0 -25
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.test.jsx +0 -110
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +0 -38
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +0 -34
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +0 -37
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +0 -37
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +0 -38
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +0 -69
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.md +0 -1
- data/dist/chunks/_typeahead-BH_dkgOy.js +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e8ef155b4d79e24efd486c6a36d78ef1b17a6136be9a113198974c4d52a19cd
|
|
4
|
+
data.tar.gz: 4c219fadfca9c05f5d61ba5383840fcf5ec960854132dc992cdc8837743a03b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e10856ba655efce776625e87ff40d0cf47e97d7d12fe6ee8683ceac9c8b6dc44cf8454898e43fb1b413a14757348effe607cc3a9e6a642e9c34fcb5ed09f51c1
|
|
7
|
+
data.tar.gz: '083b616e200f57f18e1581cdde8b1ce7efbd0fcc0b5f5d04414054de09ed303685e59088e615865b249a70790ccbef110b3a9456676760770b6d0d85d5b7ba7e'
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
2
4
|
@import 'pb_advanced_table/advanced_table';
|
|
3
5
|
@import 'pb_avatar/avatar';
|
|
4
6
|
@import 'pb_background/background';
|
|
@@ -31,7 +33,6 @@
|
|
|
31
33
|
@import 'pb_distribution_bar/distribution_bar';
|
|
32
34
|
@import 'pb_draggable/draggable';
|
|
33
35
|
@import 'pb_dropdown/dropdown';
|
|
34
|
-
@import 'pb_empty_state/empty_state';
|
|
35
36
|
@import 'pb_file_upload/file_upload';
|
|
36
37
|
@import 'pb_filter/filter';
|
|
37
38
|
@import 'pb_fixed_confirmation_toast/fixed_confirmation_toast';
|
|
@@ -69,10 +70,6 @@
|
|
|
69
70
|
@import 'pb_overlay/overlay';
|
|
70
71
|
@import 'pb_pagination/pagination';
|
|
71
72
|
@import 'pb_passphrase/passphrase';
|
|
72
|
-
@import 'pb_pb_bar_graph/pb_bar_graph';
|
|
73
|
-
@import 'pb_pb_circle_chart/pb_circle_chart';
|
|
74
|
-
@import 'pb_pb_gauge_chart/pb_gauge_chart';
|
|
75
|
-
@import 'pb_pb_line_graph/pb_line_graph';
|
|
76
73
|
@import 'pb_person/person';
|
|
77
74
|
@import 'pb_person_contact/person_contact';
|
|
78
75
|
@import 'pb_phone_number_input/phone_number_input';
|
|
@@ -111,6 +108,9 @@
|
|
|
111
108
|
@import 'pb_user/user';
|
|
112
109
|
@import 'pb_user_badge/user_badge';
|
|
113
110
|
@import 'pb_weekday_stacked/weekday_stacked';
|
|
111
|
+
@import 'pb_empty_state/empty_state';
|
|
112
|
+
@import 'pb_pb_bar_graph/pb_bar_graph';
|
|
113
|
+
@import 'pb_pb_circle_chart/pb_circle_chart';
|
|
114
114
|
@import 'utilities/mixins';
|
|
115
115
|
@import 'utilities/spacing';
|
|
116
116
|
@import 'utilities/cursor';
|
|
@@ -9,9 +9,6 @@ interface UseTableActionsProps {
|
|
|
9
9
|
setExpanded: (expanded: GenericObject) => void;
|
|
10
10
|
onToggleExpansionClick?: (arg: Row<GenericObject>) => void;
|
|
11
11
|
onRowSelectionChange?: (rowSelection: any) => void;
|
|
12
|
-
inlineRowLoading?: boolean;
|
|
13
|
-
localPagination?: { pageIndex: number; pageSize: number };
|
|
14
|
-
setLocalPagination?: (pagination: { pageIndex: number; pageSize: number }) => void;
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
export function useTableActions({
|
|
@@ -19,10 +16,7 @@ export function useTableActions({
|
|
|
19
16
|
expanded,
|
|
20
17
|
setExpanded,
|
|
21
18
|
onToggleExpansionClick,
|
|
22
|
-
onRowSelectionChange
|
|
23
|
-
inlineRowLoading = false,
|
|
24
|
-
localPagination,
|
|
25
|
-
setLocalPagination
|
|
19
|
+
onRowSelectionChange
|
|
26
20
|
}: UseTableActionsProps) {
|
|
27
21
|
|
|
28
22
|
// State to achieve 1 second delay before fetching more rows
|
|
@@ -44,17 +38,8 @@ export function useTableActions({
|
|
|
44
38
|
|
|
45
39
|
// Handle pagination
|
|
46
40
|
const onPageChange = useCallback((page: number) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
setLocalPagination({
|
|
50
|
-
...localPagination,
|
|
51
|
-
pageIndex: page - 1
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
// Use tanstack's built-in pagination
|
|
55
|
-
table.setPageIndex(page - 1);
|
|
56
|
-
}
|
|
57
|
-
}, [table, inlineRowLoading, setLocalPagination, localPagination]);
|
|
41
|
+
table.setPageIndex(page - 1);
|
|
42
|
+
}, [table]);
|
|
58
43
|
|
|
59
44
|
// Handle scroll detection for infinite scroll/virtualization
|
|
60
45
|
const fetchMoreOnBottomReached = useCallback((
|
|
@@ -35,7 +35,6 @@ interface UseTableStateProps {
|
|
|
35
35
|
onRowSelectionChange?: (arg: RowSelectionState) => void;
|
|
36
36
|
columnVisibilityControl?: GenericObject;
|
|
37
37
|
rowStyling?: GenericObject;
|
|
38
|
-
inlineRowLoading?: boolean;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
export function useTableState({
|
|
@@ -54,8 +53,7 @@ export function useTableState({
|
|
|
54
53
|
tableOptions,
|
|
55
54
|
columnVisibilityControl,
|
|
56
55
|
pinnedRows,
|
|
57
|
-
rowStyling
|
|
58
|
-
inlineRowLoading = false
|
|
56
|
+
rowStyling
|
|
59
57
|
}: UseTableStateProps) {
|
|
60
58
|
|
|
61
59
|
// Create a local state for expanded and setExpanded if expandedControl not used
|
|
@@ -66,12 +64,6 @@ export function useTableState({
|
|
|
66
64
|
const [localRowPinning, setLocalRowPinning] = useState<RowPinningState>({
|
|
67
65
|
top: [],
|
|
68
66
|
});
|
|
69
|
-
// Manage local state to preserve current page index when inlineRowLoading is enabled so it does not boot table to page 1
|
|
70
|
-
// We can extend this for more usecases, but for now scoping it only for inlineRowLoading
|
|
71
|
-
const [localPagination, setLocalPagination] = useState({
|
|
72
|
-
pageIndex: paginationProps?.pageIndex ?? 0,
|
|
73
|
-
pageSize: paginationProps?.pageSize ?? 20,
|
|
74
|
-
});
|
|
75
67
|
// Determine whether to use the prop or the local state
|
|
76
68
|
const expanded = expandedControl ? expandedControl.value : localExpanded;
|
|
77
69
|
const setExpanded = expandedControl ? expandedControl.onChange : setLocalExpanded;
|
|
@@ -141,7 +133,6 @@ export function useTableState({
|
|
|
141
133
|
...(selectableRows && { rowSelection }),
|
|
142
134
|
...(columnVisibility && { columnVisibility }),
|
|
143
135
|
...(pinnedRows && { rowPinning }),
|
|
144
|
-
...(inlineRowLoading && { pagination: localPagination }),
|
|
145
136
|
},
|
|
146
137
|
}), [
|
|
147
138
|
expanded,
|
|
@@ -151,36 +142,23 @@ export function useTableState({
|
|
|
151
142
|
rowSelection,
|
|
152
143
|
columnVisibility,
|
|
153
144
|
rowPinning,
|
|
154
|
-
inlineRowLoading,
|
|
155
|
-
localPagination
|
|
156
145
|
]);
|
|
157
146
|
|
|
158
147
|
// Pagination configuration
|
|
159
148
|
const paginationInitializer = useMemo(() => {
|
|
160
149
|
if (!pagination) return {};
|
|
161
150
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
} else {
|
|
171
|
-
// Use normal pagination initialization for non- inlineRowLoading usecases
|
|
172
|
-
return {
|
|
173
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
174
|
-
paginateExpandedRows: false,
|
|
175
|
-
initialState: {
|
|
176
|
-
pagination: {
|
|
177
|
-
pageIndex: paginationProps?.pageIndex ?? 0,
|
|
178
|
-
pageSize: paginationProps?.pageSize ?? 20,
|
|
179
|
-
},
|
|
151
|
+
return {
|
|
152
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
153
|
+
paginateExpandedRows: false,
|
|
154
|
+
initialState: {
|
|
155
|
+
pagination: {
|
|
156
|
+
pageIndex: paginationProps?.pageIndex ?? 0,
|
|
157
|
+
pageSize: paginationProps?.pageSize ?? 20,
|
|
180
158
|
},
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}, [pagination, paginationProps
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}, [pagination, paginationProps]);
|
|
184
162
|
|
|
185
163
|
// Initialize the table
|
|
186
164
|
const table = useReactTable({
|
|
@@ -228,27 +206,9 @@ export function useTableState({
|
|
|
228
206
|
// Set pagination state when pagination is enabled
|
|
229
207
|
useEffect(() => {
|
|
230
208
|
if (pagination && paginationProps?.pageSize) {
|
|
231
|
-
|
|
232
|
-
// Update local pagination state for inlineRowLoading
|
|
233
|
-
setLocalPagination(prev => ({
|
|
234
|
-
...prev,
|
|
235
|
-
pageSize: paginationProps.pageSize
|
|
236
|
-
}));
|
|
237
|
-
} else {
|
|
238
|
-
table.setPageSize(paginationProps.pageSize);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}, [pagination, paginationProps?.pageSize, table, inlineRowLoading]);
|
|
242
|
-
|
|
243
|
-
// Update local pagination when paginationProps change and inlineRowLoading is enabled
|
|
244
|
-
useEffect(() => {
|
|
245
|
-
if (pagination && inlineRowLoading && paginationProps) {
|
|
246
|
-
setLocalPagination({
|
|
247
|
-
pageIndex: paginationProps.pageIndex ?? localPagination.pageIndex,
|
|
248
|
-
pageSize: paginationProps.pageSize ?? localPagination.pageSize,
|
|
249
|
-
});
|
|
209
|
+
table.setPageSize(paginationProps.pageSize);
|
|
250
210
|
}
|
|
251
|
-
}, [pagination,
|
|
211
|
+
}, [pagination, paginationProps?.pageSize, table]);
|
|
252
212
|
|
|
253
213
|
// Check if table has any sub-rows
|
|
254
214
|
const hasAnySubRows = table.getRowModel().rows.some(row => row.subRows && row.subRows.length > 0);
|
|
@@ -287,8 +247,6 @@ export function useTableState({
|
|
|
287
247
|
rowSelection,
|
|
288
248
|
fullData,
|
|
289
249
|
totalFetched,
|
|
290
|
-
isFetching
|
|
291
|
-
localPagination,
|
|
292
|
-
setLocalPagination
|
|
250
|
+
isFetching
|
|
293
251
|
};
|
|
294
252
|
}
|
|
@@ -134,9 +134,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
134
134
|
updateLoadingStateRowCount,
|
|
135
135
|
fullData,
|
|
136
136
|
totalFetched,
|
|
137
|
-
isFetching
|
|
138
|
-
localPagination,
|
|
139
|
-
setLocalPagination
|
|
137
|
+
isFetching
|
|
140
138
|
} = useTableState({
|
|
141
139
|
tableData,
|
|
142
140
|
columnDefinitions,
|
|
@@ -154,8 +152,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
154
152
|
onRowSelectionChange,
|
|
155
153
|
columnVisibilityControl,
|
|
156
154
|
pinnedRows,
|
|
157
|
-
rowStyling
|
|
158
|
-
inlineRowLoading
|
|
155
|
+
rowStyling
|
|
159
156
|
});
|
|
160
157
|
|
|
161
158
|
// Initialize table actions
|
|
@@ -168,10 +165,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
168
165
|
expanded,
|
|
169
166
|
setExpanded,
|
|
170
167
|
onToggleExpansionClick,
|
|
171
|
-
onRowSelectionChange
|
|
172
|
-
inlineRowLoading,
|
|
173
|
-
localPagination,
|
|
174
|
-
setLocalPagination
|
|
168
|
+
onRowSelectionChange
|
|
175
169
|
});
|
|
176
170
|
|
|
177
171
|
// Set table row count for loading state
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<% if content.present? %>
|
|
12
12
|
<% content.presence %>
|
|
13
13
|
<% else %>
|
|
14
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
15
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
14
|
+
<%= pb_rails("advanced_table/table_header", props: { id: object.id, 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
|
+
<%= 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 %>
|
|
18
18
|
<% end %>
|
|
@@ -2,9 +2,7 @@ The AdvancedTable kit accepts tree data and automatically renders expansion cont
|
|
|
2
2
|
|
|
3
3
|
### id
|
|
4
4
|
|
|
5
|
-
A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar
|
|
6
|
-
|
|
7
|
-
You must also set `table_id` when using subcomponents like `table_header` or `table_body`.
|
|
5
|
+
A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar will not be able to properly reference the correct table.
|
|
8
6
|
|
|
9
7
|
### table_data
|
|
10
8
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
]
|
|
52
52
|
%>
|
|
53
53
|
|
|
54
|
-
<%= pb_rails("advanced_table", props: {
|
|
55
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
56
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
54
|
+
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "beta_sort", table_data: @table_data, column_definitions: column_definitions, enable_toggle_expansion: "all" }) %>
|
|
57
57
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
subrow_headers = ["Quarter", "Month", "Day"]
|
|
35
35
|
%>
|
|
36
36
|
|
|
37
|
-
<%= pb_rails("advanced_table", props: {
|
|
38
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
39
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
37
|
+
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "test_table" }) do %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
39
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "test_table", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
|
40
40
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb
CHANGED
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
] %>
|
|
32
32
|
|
|
33
33
|
<%= pb_rails("advanced_table", props: { id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
34
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
35
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
34
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
35
|
+
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
|
|
36
36
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The `columnStyling` prop is an optional item that can be used within `columnDefinitions` as shown in the code snippet below. It is an object that has
|
|
1
|
+
The `columnStyling` prop is an optional item that can be used within `columnDefinitions` as shown in the code snippet below. It is an object that has 2 optional key/value pairs:
|
|
2
2
|
|
|
3
3
|
1) `headerAlignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
4
4
|
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
] %>
|
|
59
59
|
|
|
60
60
|
<%= pb_rails("advanced_table", props: { id: "column-styling-multi", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
61
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
62
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
61
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
62
|
+
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
63
63
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb
CHANGED
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
] %>
|
|
34
34
|
|
|
35
35
|
<%= pb_rails("advanced_table", props: { id: "column-styling", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
36
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
37
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
36
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
37
|
+
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
38
38
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The `column_styling` prop is an optional item that can be used within `column_definitions` as shown in the code snippet below.
|
|
1
|
+
The `column_styling` prop is an optional item that can be used within `column_definitions` as shown in the code snippet below. It is an object that has 2 optional key/value pairs:
|
|
2
2
|
|
|
3
3
|
1) `header_alignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The `row_styling` prop can be used in conjunction with row ids to control certain styling options on individual rows.
|
|
1
|
+
The `row_styling` prop can be used in conjunction with row ids to control certain styling options on individual rows. Currently, `row_styling` gives you 3 optional controls:
|
|
2
2
|
|
|
3
3
|
- `background_color` : use this to control the background color of the row
|
|
4
4
|
- `font_color`: use this to control font color for each row if needed, for example if using a darker background color.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The `rowStyling` prop can be used in conjunction with row ids to control certain styling options on individual rows.
|
|
1
|
+
The `rowStyling` prop can be used in conjunction with row ids to control certain styling options on individual rows. Currently, `rowStyling` gives you 3 optional controls:
|
|
2
2
|
|
|
3
3
|
- `backgroundColor` : use this to control the background color of the row
|
|
4
4
|
- `fontColor`: use this to control font color for each row if needed, for example if using a darker background color.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
CHANGED
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
%>
|
|
35
35
|
|
|
36
36
|
<%= pb_rails("advanced_table", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, selectable_rows: true }) do %>
|
|
37
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
38
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
37
|
+
<%= pb_rails("advanced_table/table_header", props: { id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
|
|
39
39
|
<% end %>
|
|
@@ -21,11 +21,8 @@ examples:
|
|
|
21
21
|
- advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
|
|
22
22
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
|
23
23
|
- advanced_table_row_styling: Row Styling
|
|
24
|
-
- advanced_table_padding_control_per_row_rails: Padding Control using Row Styling
|
|
25
24
|
- advanced_table_column_styling_rails: Column Styling
|
|
26
25
|
- advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
|
27
|
-
- advanced_table_padding_control_rails: Padding Control using Column Styling
|
|
28
|
-
- advanced_table_background_control_rails: Background Control using Column Styling
|
|
29
26
|
- advanced_table_column_border_color_rails: Column Group Border Color
|
|
30
27
|
|
|
31
28
|
|
|
@@ -331,12 +331,8 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
|
331
331
|
// Split the dataContent to get all ancestor IDs, check against ExpandedRows
|
|
332
332
|
const ancestorIds = dataContent.split("-").slice(0, -1);
|
|
333
333
|
|
|
334
|
-
// Get the table_id from the child row's parent to construct proper prefixed IDs
|
|
335
|
-
const parentRowId = childRow.dataset.rowParent;
|
|
336
|
-
const tableId = parentRowId ? parentRowId.split('_').slice(0, -1).join('_') : '';
|
|
337
|
-
|
|
338
334
|
const prefixedAncestorIds = ancestorIds.map(
|
|
339
|
-
(id) => `${
|
|
335
|
+
(id) => `${childRow.id}_${id}`
|
|
340
336
|
);
|
|
341
337
|
const allAncestorsExpanded = prefixedAncestorIds.every((id) =>
|
|
342
338
|
PbAdvancedTable.expandedRows.has(id)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableBody < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :table_data, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
@@ -53,7 +53,7 @@ module Playbook
|
|
|
53
53
|
subrow_data_attributes = {
|
|
54
54
|
advanced_table_content: subrow_ancestor_ids.join("-"),
|
|
55
55
|
row_depth: current_depth,
|
|
56
|
-
row_parent: "#{
|
|
56
|
+
row_parent: "#{id}_#{ancestor_ids.last}",
|
|
57
57
|
}
|
|
58
58
|
# Subrow header if applicable
|
|
59
59
|
output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: leaf_columns, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail, classname: "toggle-content", responsive: responsive, subrow_data_attributes: subrow_data_attributes, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
|
|
@@ -69,7 +69,7 @@ module Playbook
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
# Additional class and data attributes needed for toggle logic
|
|
72
|
-
output << pb_rails("advanced_table/table_row", props: {
|
|
72
|
+
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, selectable_rows: selectable_rows, row_id: row[:id], enable_toggle_expansion: enable_toggle_expansion, row_styling: row_styling, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id })
|
|
73
73
|
|
|
74
74
|
if row[:children].present?
|
|
75
75
|
row[:children].each do |child_row|
|
|
@@ -78,9 +78,9 @@ module Playbook
|
|
|
78
78
|
data_content = new_ancestor_ids.join("-") + "-#{child_row.object_id}"
|
|
79
79
|
|
|
80
80
|
child_data_attributes = {
|
|
81
|
-
top_parent: "#{
|
|
81
|
+
top_parent: "#{id}_#{top_parent_id}",
|
|
82
82
|
row_depth: current_depth + 1,
|
|
83
|
-
row_parent: "#{
|
|
83
|
+
row_parent: "#{id}_#{immediate_parent_id}",
|
|
84
84
|
advanced_table_content: data_content,
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableHeader < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
|
@@ -58,10 +58,10 @@ module Playbook
|
|
|
58
58
|
classname: additional_classes.join(" "),
|
|
59
59
|
}) do
|
|
60
60
|
pb_rails("checkbox", props: {
|
|
61
|
-
id: "#{
|
|
61
|
+
id: "#{id ? "#{id}-" : ''}select-all-rows",
|
|
62
62
|
indeterminate_main: true,
|
|
63
63
|
indeterminate_main_labels: ["", ""],
|
|
64
|
-
name: "#{
|
|
64
|
+
name: "#{id ? "#{id}-" : ''}select-all-rows",
|
|
65
65
|
})
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -71,10 +71,10 @@ module Playbook
|
|
|
71
71
|
def render_select_all_checkbox
|
|
72
72
|
if selectable_rows
|
|
73
73
|
pb_rails("checkbox", props: {
|
|
74
|
-
id: "#{
|
|
74
|
+
id: "#{id ? "#{id}-" : ''}select-all-rows",
|
|
75
75
|
indeterminate_main: true,
|
|
76
76
|
indeterminate_main_labels: ["", ""],
|
|
77
|
-
name: "#{
|
|
77
|
+
name: "#{id ? "#{id}-" : ''}select-all-rows",
|
|
78
78
|
data: {
|
|
79
79
|
action: "click->pb-advanced-table#toggleAllRowSelection",
|
|
80
80
|
},
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
<% object.column_definitions.each_with_index do |column, index| %>
|
|
14
14
|
<% next unless column[:accessor].present? %>
|
|
15
|
-
|
|
16
|
-
<%= pb_rails(component_info[:name], props: component_info[:props]) do %>
|
|
15
|
+
<%= pb_rails("table/table_cell", props: { html_options: { style: { "background-color": bg_color, color: font_color } }, classname:object.td_classname(column, index)}) do %>
|
|
17
16
|
<%= pb_rails("flex", props:{ align: "center", justify: object.justify_for(column, index), classname: object.loading ? "loading-cell" : "" }) do %>
|
|
18
17
|
<% if collapsible_trail && index.zero? %>
|
|
19
18
|
<% (1..depth).each do |i| %>
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
<% end %>
|
|
35
34
|
<% if object.row[:children].present? %>
|
|
36
35
|
<button
|
|
37
|
-
id="<%= "#{object.
|
|
36
|
+
id="<%= "#{object.id}_#{object.row.object_id}" %>"
|
|
38
37
|
class="gray-icon expand-toggle-icon"
|
|
39
38
|
data-advanced-table="true"
|
|
40
39
|
style="color: <%= button_color %>"
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableRow < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :row
|
|
@@ -46,53 +46,9 @@ module Playbook
|
|
|
46
46
|
classes = %w[id-cell]
|
|
47
47
|
classes << "last-cell" if column[:is_last_in_group]
|
|
48
48
|
classes << "pinned-left" if index.zero? && is_pinned_left && responsive == "scroll"
|
|
49
|
-
|
|
50
|
-
row_style = row_styling.find { |style| style[:row_id].to_s == row_id.to_s }
|
|
51
|
-
row_padding = row_style&.[](:cell_padding)
|
|
52
|
-
|
|
53
|
-
if column[:accessor].present?
|
|
54
|
-
orig_def = find_column_def_by_accessor(column_definitions, column[:accessor])
|
|
55
|
-
column_padding = orig_def[:column_styling][:cell_padding] if orig_def && orig_def[:column_styling].is_a?(Hash) && orig_def[:column_styling][:cell_padding].present?
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
classes << "p_#{row_padding}" if row_padding.present?
|
|
59
|
-
classes << "p_#{column_padding}" if column_padding.present?
|
|
60
|
-
|
|
61
49
|
classes.join(" ")
|
|
62
50
|
end
|
|
63
51
|
|
|
64
|
-
def cell_background_color(column)
|
|
65
|
-
return nil unless column[:accessor].present?
|
|
66
|
-
|
|
67
|
-
orig_def = find_column_def_by_accessor(column_definitions, column[:accessor])
|
|
68
|
-
if orig_def && orig_def[:column_styling].is_a?(Hash) && orig_def[:column_styling][:cell_background_color].present?
|
|
69
|
-
bg_color = orig_def[:column_styling][:cell_background_color]
|
|
70
|
-
if bg_color.respond_to?(:call)
|
|
71
|
-
bg_color.call(row)
|
|
72
|
-
else
|
|
73
|
-
bg_color
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def has_custom_background_color?(column)
|
|
79
|
-
cell_background_color(column).present?
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
# Uses a regular table/table_cell component if there is no custom background color; if there is a cell_background_color uses a background component with tag "td"
|
|
83
|
-
def cell_component_info(column, index, bg_color, font_color)
|
|
84
|
-
if has_custom_background_color?(column)
|
|
85
|
-
custom_bg_color = cell_background_color(column)
|
|
86
|
-
component_name = "background"
|
|
87
|
-
component_props = { background_color: custom_bg_color, tag: "td", classname: td_classname(column, index) }
|
|
88
|
-
else
|
|
89
|
-
component_name = "table/table_cell"
|
|
90
|
-
component_props = { html_options: { style: { "background-color": bg_color, color: font_color } }, classname: td_classname(column, index) }
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
{ name: component_name, props: component_props }
|
|
94
|
-
end
|
|
95
|
-
|
|
96
52
|
def depth_accessors
|
|
97
53
|
column_definitions.flat_map do |column|
|
|
98
54
|
column[:cellAccessors] if column.key?(:cellAccessors)
|
|
@@ -102,13 +58,13 @@ module Playbook
|
|
|
102
58
|
# Selectable Rows No Subrows - checkboxes in their own first cell
|
|
103
59
|
def render_checkbox_cell
|
|
104
60
|
if selectable_rows
|
|
105
|
-
prefix =
|
|
61
|
+
prefix = id ? "#{id}-" : ""
|
|
106
62
|
pb_rails("table/table_cell", props: {
|
|
107
63
|
classname: "checkbox-cell",
|
|
108
64
|
}) do
|
|
109
65
|
pb_rails("checkbox", props: {
|
|
110
66
|
id: "#{prefix}select-row-#{row_id || row.object_id}",
|
|
111
|
-
indeterminate_parent: "#{
|
|
67
|
+
indeterminate_parent: "#{id ? "#{id}-" : ''}select-all-rows",
|
|
112
68
|
name: "#{prefix}select-row-#{row_id || row.object_id}",
|
|
113
69
|
data: {
|
|
114
70
|
row_id: row_id || row.object_id.to_s,
|
|
@@ -122,7 +78,7 @@ module Playbook
|
|
|
122
78
|
# Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
|
|
123
79
|
def render_row_checkbox
|
|
124
80
|
if selectable_rows
|
|
125
|
-
prefix =
|
|
81
|
+
prefix = id ? "#{id}-" : ""
|
|
126
82
|
indeterminate_parent =
|
|
127
83
|
if depth.zero?
|
|
128
84
|
"#{prefix}select-all-rows"
|