playbook_ui 15.3.0.pre.alpha.PLAY2407daterangeinlineshowcurrentyear12138 → 15.3.0.pre.alpha.PLAY2565formkitsubmitfix11681
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/Components/RegularTableView.tsx +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -3
- 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 -71
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -122
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +0 -28
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -11
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +1 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +0 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +20 -90
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -31
- data/app/pb_kits/playbook/pb_background/background.html.erb +2 -10
- data/app/pb_kits/playbook/pb_background/docs/_background_category.md +1 -1
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -4
- data/app/pb_kits/playbook/pb_badge/badge.test.js +0 -13
- data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +7 -20
- data/app/pb_kits/playbook/pb_currency/currency.rb +8 -35
- data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -47
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +4 -16
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss +30 -11
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +13 -20
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +4 -6
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +0 -17
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -111
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +2 -148
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.md +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +1 -15
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +8 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +10 -11
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.md +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +14 -7
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +15 -6
- data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_item_spacing.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_nav_with_spacing_control.md +1 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +1 -1
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +34 -69
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_popover/popover.test.js +0 -80
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -29
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_react.md +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -7
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -105
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +9 -23
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -33
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +1 -67
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +6 -68
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
- data/dist/chunks/{_line_graph-BRirnhGy.js → _line_graph-h5H-imfn.js} +1 -1
- data/dist/chunks/_typeahead-U8AjZIIW.js +6 -0
- data/dist/chunks/_weekday_stacked-CbCUYuuZ.js +37 -0
- data/dist/chunks/{lib-BXBHAZMY.js → lib-CGxXTQ75.js} +1 -1
- data/dist/chunks/{pb_form_validation-BZppqQZM.js → pb_form_validation-DebqlUKZ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- 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 +8 -35
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.html.erb +0 -104
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading_empty_children.js +0 -42
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.md +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.jsx +0 -38
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.md +0 -14
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +0 -43
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.jsx +0 -18
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.md +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.jsx +0 -18
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.jsx +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.jsx +0 -38
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.md +0 -14
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +0 -60
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +0 -68
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to_react.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.html.erb +0 -63
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.jsx +0 -89
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_rails.md +0 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md +0 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb +0 -64
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx +0 -70
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.md +0 -1
- data/dist/chunks/_typeahead-CFOqvZNu.js +0 -6
- data/dist/chunks/_weekday_stacked-DEkzyJsS.js +0 -37
- /data/app/pb_kits/playbook/pb_popover/docs/{_popover_append_to_rails.md → _popover_append_to.md} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e57165e0f6855d1e877e88b67b0cfc62dffcca56c75494c4919a2774443a3f4e
|
|
4
|
+
data.tar.gz: c13a71137883d0c2277e488a8a0163f88768e01a22d75c9d0f1bcd157ca473b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e40cbc1a718b7157b85199fbd02852055a6dfa954d351af3a3299a84311b3185b8bbc93de30b9000b2161d97ae1bdd79f8a519ce3524d9907e506b095ed3c9b7
|
|
7
|
+
data.tar.gz: e06abbce30f98797e15dc84498c72d3d370275df49cb93f490fa8a9cdda3cc5844efe471a2fdb37ad969db0801bc6f6fb6c0f476204eae726b50b30042f1f296
|
|
@@ -66,7 +66,6 @@ const TableCellRenderer = ({
|
|
|
66
66
|
// Find the “owning” colDefinition by accessor. Needed for multi column logic
|
|
67
67
|
const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
|
|
68
68
|
const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
|
|
69
|
-
const cellFontColor = colDef?.columnStyling?.fontColor
|
|
70
69
|
const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
|
|
71
70
|
const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
|
|
72
71
|
|
|
@@ -89,7 +88,7 @@ const TableCellRenderer = ({
|
|
|
89
88
|
: `${column.getStart("left")}px`
|
|
90
89
|
: undefined,
|
|
91
90
|
backgroundColor: i === 0 && customRowStyle?.backgroundColor,
|
|
92
|
-
color:
|
|
91
|
+
color: customRowStyle?.fontColor,
|
|
93
92
|
}}
|
|
94
93
|
>
|
|
95
94
|
{collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
|
|
@@ -30,7 +30,6 @@ type TableHeaderCellProps = {
|
|
|
30
30
|
headerChildren?: React.ReactNode | React.ReactNode[]
|
|
31
31
|
isPinnedLeft?: boolean
|
|
32
32
|
loading?: boolean
|
|
33
|
-
persistToggleExpansionButton?: boolean
|
|
34
33
|
sortIcon?: string | string[]
|
|
35
34
|
table?: Table<GenericObject>
|
|
36
35
|
} & GlobalProps
|
|
@@ -59,7 +58,6 @@ export const TableHeaderCell = ({
|
|
|
59
58
|
selectableRows,
|
|
60
59
|
hasAnySubRows,
|
|
61
60
|
showActionsBar,
|
|
62
|
-
persistToggleExpansionButton,
|
|
63
61
|
stickyLeftColumn,
|
|
64
62
|
inlineRowLoading,
|
|
65
63
|
isActionBarVisible,
|
|
@@ -222,7 +220,7 @@ const isToggleExpansionEnabled =
|
|
|
222
220
|
/>
|
|
223
221
|
)
|
|
224
222
|
}
|
|
225
|
-
{isToggleExpansionEnabled &&
|
|
223
|
+
{isToggleExpansionEnabled && hasAnySubRows && !expandByDepth && (
|
|
226
224
|
<ToggleIconButton onClick={handleExpandOrCollapse} />
|
|
227
225
|
)}
|
|
228
226
|
{isToggleExpansionEnabled && hasAnySubRows && expandByDepth && (
|
|
@@ -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,42 +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
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}, [pagination, inlineRowLoading, paginationProps?.pageIndex, paginationProps?.pageSize]);
|
|
252
|
-
|
|
253
|
-
// Call the callback with the new page index when localPagination.pageIndex changes (with inlineRowLoading)
|
|
254
|
-
useEffect(() => {
|
|
255
|
-
if (pagination && inlineRowLoading && paginationProps?.onPageChange) {
|
|
256
|
-
paginationProps.onPageChange(localPagination.pageIndex);
|
|
257
|
-
}
|
|
258
|
-
}, [localPagination.pageIndex, pagination, inlineRowLoading, paginationProps]);
|
|
259
|
-
|
|
260
|
-
// Call the callback with the new page index when localPagination.pageIndex changes (without inlineRowLoading)
|
|
261
|
-
useEffect(() => {
|
|
262
|
-
if (pagination && !inlineRowLoading && paginationProps?.onPageChange) {
|
|
263
|
-
const currentPageIndex = table.getState().pagination.pageIndex;
|
|
264
|
-
paginationProps.onPageChange(currentPageIndex);
|
|
209
|
+
table.setPageSize(paginationProps.pageSize);
|
|
265
210
|
}
|
|
266
|
-
}, [
|
|
211
|
+
}, [pagination, paginationProps?.pageSize, table]);
|
|
267
212
|
|
|
268
213
|
// Check if table has any sub-rows
|
|
269
214
|
const hasAnySubRows = table.getRowModel().rows.some(row => row.subRows && row.subRows.length > 0);
|
|
@@ -302,8 +247,6 @@ export function useTableState({
|
|
|
302
247
|
rowSelection,
|
|
303
248
|
fullData,
|
|
304
249
|
totalFetched,
|
|
305
|
-
isFetching
|
|
306
|
-
localPagination,
|
|
307
|
-
setLocalPagination
|
|
250
|
+
isFetching
|
|
308
251
|
};
|
|
309
252
|
}
|
|
@@ -39,7 +39,6 @@ export const TableHeader = ({
|
|
|
39
39
|
hasAnySubRows,
|
|
40
40
|
showActionsBar,
|
|
41
41
|
selectableRows,
|
|
42
|
-
persistToggleExpansionButton,
|
|
43
42
|
responsive,
|
|
44
43
|
headerRef,
|
|
45
44
|
virtualizedRows,
|
|
@@ -93,7 +92,6 @@ export const TableHeader = ({
|
|
|
93
92
|
isPinnedLeft={isPinnedLeft}
|
|
94
93
|
key={`${header.id}-header`}
|
|
95
94
|
loading={loading}
|
|
96
|
-
persistToggleExpansionButton={persistToggleExpansionButton}
|
|
97
95
|
sortIcon={sortIcon}
|
|
98
96
|
table={table}
|
|
99
97
|
/>
|
|
@@ -138,7 +136,6 @@ export const TableHeader = ({
|
|
|
138
136
|
isVirtualized
|
|
139
137
|
key={`${header.id}-header-virtualized`}
|
|
140
138
|
loading={loading}
|
|
141
|
-
persistToggleExpansionButton={persistToggleExpansionButton}
|
|
142
139
|
sortIcon={sortIcon}
|
|
143
140
|
table={table}
|
|
144
141
|
/>
|
|
@@ -63,7 +63,6 @@ type AdvancedTableProps = {
|
|
|
63
63
|
scrollBarNone?: boolean,
|
|
64
64
|
selectableRows?: boolean,
|
|
65
65
|
showActionsBar?: boolean,
|
|
66
|
-
persistToggleExpansionButton?: boolean,
|
|
67
66
|
sortControl?: GenericObject
|
|
68
67
|
tableData: GenericObject[]
|
|
69
68
|
tableOptions?: GenericObject
|
|
@@ -110,7 +109,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
110
109
|
scrollBarNone= false,
|
|
111
110
|
showActionsBar = true,
|
|
112
111
|
selectableRows,
|
|
113
|
-
persistToggleExpansionButton = false,
|
|
114
112
|
sortControl,
|
|
115
113
|
stickyLeftColumn,
|
|
116
114
|
tableData,
|
|
@@ -136,9 +134,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
136
134
|
updateLoadingStateRowCount,
|
|
137
135
|
fullData,
|
|
138
136
|
totalFetched,
|
|
139
|
-
isFetching
|
|
140
|
-
localPagination,
|
|
141
|
-
setLocalPagination
|
|
137
|
+
isFetching
|
|
142
138
|
} = useTableState({
|
|
143
139
|
tableData,
|
|
144
140
|
columnDefinitions,
|
|
@@ -156,8 +152,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
156
152
|
onRowSelectionChange,
|
|
157
153
|
columnVisibilityControl,
|
|
158
154
|
pinnedRows,
|
|
159
|
-
rowStyling
|
|
160
|
-
inlineRowLoading
|
|
155
|
+
rowStyling
|
|
161
156
|
});
|
|
162
157
|
|
|
163
158
|
// Initialize table actions
|
|
@@ -170,10 +165,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
170
165
|
expanded,
|
|
171
166
|
setExpanded,
|
|
172
167
|
onToggleExpansionClick,
|
|
173
|
-
onRowSelectionChange
|
|
174
|
-
inlineRowLoading,
|
|
175
|
-
localPagination,
|
|
176
|
-
setLocalPagination
|
|
168
|
+
onRowSelectionChange
|
|
177
169
|
});
|
|
178
170
|
|
|
179
171
|
// Set table row count for loading state
|
|
@@ -357,7 +349,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
357
349
|
loading={loading}
|
|
358
350
|
onCustomSortClick={onCustomSortClick}
|
|
359
351
|
onExpandByDepthClick={onExpandByDepthClick}
|
|
360
|
-
persistToggleExpansionButton={persistToggleExpansionButton}
|
|
361
352
|
pinnedRows={pinnedRows}
|
|
362
353
|
responsive={responsive}
|
|
363
354
|
rowStyling={rowStyling}
|
|
@@ -108,48 +108,6 @@ const MOCK_DATA_WITH_ID = [
|
|
|
108
108
|
},
|
|
109
109
|
]
|
|
110
110
|
|
|
111
|
-
const MOCK_DATA_NO_SUBROWS = [
|
|
112
|
-
{
|
|
113
|
-
year: "2021",
|
|
114
|
-
quarter: null,
|
|
115
|
-
month: null,
|
|
116
|
-
day: null,
|
|
117
|
-
newEnrollments: "20",
|
|
118
|
-
scheduledMeetings: "10",
|
|
119
|
-
attendanceRate: "51%",
|
|
120
|
-
completedClasses: "3",
|
|
121
|
-
classCompletionRate: "33%",
|
|
122
|
-
graduatedStudents: "19",
|
|
123
|
-
children: [],
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
year: "2022",
|
|
127
|
-
quarter: null,
|
|
128
|
-
month: null,
|
|
129
|
-
day: null,
|
|
130
|
-
newEnrollments: "25",
|
|
131
|
-
scheduledMeetings: "17",
|
|
132
|
-
attendanceRate: "75%",
|
|
133
|
-
completedClasses: "5",
|
|
134
|
-
classCompletionRate: "45%",
|
|
135
|
-
graduatedStudents: "32",
|
|
136
|
-
children: [],
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
year: "2023",
|
|
140
|
-
quarter: null,
|
|
141
|
-
month: null,
|
|
142
|
-
day: null,
|
|
143
|
-
newEnrollments: "30",
|
|
144
|
-
scheduledMeetings: "22",
|
|
145
|
-
attendanceRate: "80%",
|
|
146
|
-
completedClasses: "7",
|
|
147
|
-
classCompletionRate: "55%",
|
|
148
|
-
graduatedStudents: "45",
|
|
149
|
-
children: [],
|
|
150
|
-
},
|
|
151
|
-
]
|
|
152
|
-
|
|
153
111
|
const columnDefinitions = [
|
|
154
112
|
{
|
|
155
113
|
accessor: "year",
|
|
@@ -551,23 +509,6 @@ test("inlineRowLoading prop renders inline loading if true", () => {
|
|
|
551
509
|
expect(inlineLoading).toBeInTheDocument()
|
|
552
510
|
})
|
|
553
511
|
|
|
554
|
-
test("persistToggleExpansionButton prop shows header toggle when inlineRowLoading is true", () => {
|
|
555
|
-
render(
|
|
556
|
-
<AdvancedTable
|
|
557
|
-
columnDefinitions={columnDefinitions}
|
|
558
|
-
data={{ testid: testId }}
|
|
559
|
-
enableToggleExpansion="all"
|
|
560
|
-
inlineRowLoading
|
|
561
|
-
persistToggleExpansionButton
|
|
562
|
-
tableData={MOCK_DATA_NO_SUBROWS}
|
|
563
|
-
/>
|
|
564
|
-
)
|
|
565
|
-
|
|
566
|
-
const kit = screen.getByTestId(testId)
|
|
567
|
-
const headerToggleButton = kit.querySelector(".gray-icon.toggle-all-icon")
|
|
568
|
-
expect(headerToggleButton).toBeInTheDocument()
|
|
569
|
-
})
|
|
570
|
-
|
|
571
512
|
test("responsive prop functions as expected", () => {
|
|
572
513
|
render(
|
|
573
514
|
<AdvancedTable
|
|
@@ -740,69 +681,6 @@ test("columnStyling.cellPadding sets cell padding", () => {
|
|
|
740
681
|
expect(firstEnrollmentCell).toHaveClass('p_none')
|
|
741
682
|
});
|
|
742
683
|
|
|
743
|
-
test("columnStyling.fontColor sets cell font color", () => {
|
|
744
|
-
const styledColumnDefs = [
|
|
745
|
-
{
|
|
746
|
-
accessor: "year",
|
|
747
|
-
label: "Year",
|
|
748
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
accessor: "newEnrollments",
|
|
752
|
-
label: "New Enrollments",
|
|
753
|
-
columnStyling: { fontColor: colors.category_1 },
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
accessor: "scheduledMeetings",
|
|
757
|
-
label: "Scheduled Meetings",
|
|
758
|
-
},
|
|
759
|
-
];
|
|
760
|
-
|
|
761
|
-
render(
|
|
762
|
-
<AdvancedTable
|
|
763
|
-
columnDefinitions={styledColumnDefs}
|
|
764
|
-
data={{ testid: testId }}
|
|
765
|
-
tableData={MOCK_DATA}
|
|
766
|
-
/>
|
|
767
|
-
);
|
|
768
|
-
|
|
769
|
-
const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
|
|
770
|
-
expect(firstEnrollmentCell).toHaveStyle({ color: colors.category_1 });
|
|
771
|
-
});
|
|
772
|
-
|
|
773
|
-
test("columnStyling.fontColor works with background color", () => {
|
|
774
|
-
const styledColumnDefs = [
|
|
775
|
-
{
|
|
776
|
-
accessor: "year",
|
|
777
|
-
label: "Year",
|
|
778
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
779
|
-
},
|
|
780
|
-
{
|
|
781
|
-
accessor: "newEnrollments",
|
|
782
|
-
label: "New Enrollments",
|
|
783
|
-
columnStyling: {
|
|
784
|
-
cellBackgroundColor: (row) => row.newEnrollments > 20 ? "success_secondary" : "warning_secondary",
|
|
785
|
-
fontColor: colors.white
|
|
786
|
-
},
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
accessor: "scheduledMeetings",
|
|
790
|
-
label: "Scheduled Meetings",
|
|
791
|
-
},
|
|
792
|
-
];
|
|
793
|
-
|
|
794
|
-
render(
|
|
795
|
-
<AdvancedTable
|
|
796
|
-
columnDefinitions={styledColumnDefs}
|
|
797
|
-
data={{ testid: testId }}
|
|
798
|
-
tableData={MOCK_DATA}
|
|
799
|
-
/>
|
|
800
|
-
);
|
|
801
|
-
|
|
802
|
-
const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
|
|
803
|
-
expect(firstEnrollmentCell).toHaveStyle({ color: colors.white });
|
|
804
|
-
});
|
|
805
|
-
|
|
806
684
|
test("renders virtualized table rows and header", () => {
|
|
807
685
|
render(
|
|
808
686
|
<AdvancedTable
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
`column_styling` can also be used to control the background color on all cells in a given column via the use of the `cell_background_color` key/value pair. Use `cell_background_color` to achieve custom background colors for individual cells as seen here.
|
|
1
|
+
`column_styling` can also be used to control the background color on all cells in a given column via the use of the `cell_background_color` key/value pair. Use `cell_background_color` to achieve custom background colors for individual cells as seen here.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
The borders of column groups can be set to a different color using the `columnGroupBorderColor` prop. In order for these borders to be visible, this prop must be used with `tableProps` and `verticalBorder` set to true.
|
|
2
2
|
|
|
3
|
-
The available colors for the border are Playbook's Text Colors, which can be found [here](https://playbook.powerapp.cloud/
|
|
3
|
+
The available colors for the border are Playbook's Text Colors, which can be found [here](https://playbook.powerapp.cloud/visual_guidelines/colors).
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
The borders of column groups can be set to a different color using the `column_group_border_color` prop. In order for these borders to be visible, this prop must be used with `table_props` and `vertical_border` set to true.
|
|
2
2
|
|
|
3
|
-
The available colors for the border are Playbook's Text Colors, which can be found [here](https://playbook.powerapp.cloud/
|
|
3
|
+
The available colors for the border are Playbook's Text Colors, which can be found [here](https://playbook.powerapp.cloud/visual_guidelines/colors).
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import
|
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
3
|
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
const AdvancedTableColumnStyling = (props) => {
|
|
7
6
|
const columnDefinitions = [
|
|
8
7
|
{
|
|
@@ -35,7 +34,6 @@ const AdvancedTableColumnStyling = (props) => {
|
|
|
35
34
|
{
|
|
36
35
|
accessor: "graduatedStudents",
|
|
37
36
|
label: "Graduated Students",
|
|
38
|
-
columnStyling:{fontColor: colors.data_8},
|
|
39
37
|
},
|
|
40
38
|
]
|
|
41
39
|
|
|
@@ -4,6 +4,4 @@ The `columnStyling` prop is an optional item that can be used within `columnDefi
|
|
|
4
4
|
|
|
5
5
|
2) `cellAlignment`: This will allow you to control alignment of content within all cells in the given column. This is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
6
6
|
|
|
7
|
-
3) `fontColor`: This will allow you to control the font color for a given column.
|
|
8
|
-
|
|
9
7
|
`columnStyling` can be used within the columnDefinition of all the columns or some of them, as shown. Each column has its own individual control in this way.
|
|
@@ -4,6 +4,4 @@ The `column_styling` prop is an optional item that can be used within `column_de
|
|
|
4
4
|
|
|
5
5
|
2) `cell_alignment`: This will allow you to control alignment of content within all cells in the given column. This is set to right aligned by default. you can set this to `left`, `right` or `center`.
|
|
6
6
|
|
|
7
|
-
3) `font_color`: This will allow you to control the font color for a given column.
|
|
8
|
-
|
|
9
7
|
`column_styling` can be used within the column_definition of all the columns or some of them, as shown. Each column has its own individual control in this way.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
|
-
import Caption from '../../pb_caption/_caption'
|
|
4
3
|
import { MOCK_DATA_INLINE_LOADING } from "./_mock_data_inline_loading"
|
|
5
|
-
import { MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN } from "./_mock_data_inline_loading_empty_children"
|
|
6
4
|
|
|
7
5
|
const AdvancedTableInlineRowLoading = (props) => {
|
|
8
6
|
const columnDefinitions = [
|
|
@@ -43,42 +41,16 @@ const AdvancedTableInlineRowLoading = (props) => {
|
|
|
43
41
|
|
|
44
42
|
return (
|
|
45
43
|
<div>
|
|
46
|
-
<Caption text="Inline Row Loading - Demonstrated in Row 1 (Rows 2 and 3 have data)" />
|
|
47
44
|
<AdvancedTable
|
|
48
45
|
columnDefinitions={columnDefinitions}
|
|
49
46
|
enableToggleExpansion="all"
|
|
50
47
|
inlineRowLoading
|
|
51
|
-
marginBottom="md"
|
|
52
48
|
tableData={MOCK_DATA_INLINE_LOADING}
|
|
53
49
|
{...props}
|
|
54
50
|
>
|
|
55
51
|
<AdvancedTable.Header />
|
|
56
52
|
<AdvancedTable.Body subRowHeaders={subRowHeaders}/>
|
|
57
53
|
</AdvancedTable>
|
|
58
|
-
<Caption text="Inline Row Loading with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is not rendered" />
|
|
59
|
-
<AdvancedTable
|
|
60
|
-
columnDefinitions={columnDefinitions}
|
|
61
|
-
enableToggleExpansion="all"
|
|
62
|
-
inlineRowLoading
|
|
63
|
-
marginBottom="md"
|
|
64
|
-
tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
<AdvancedTable.Header />
|
|
68
|
-
<AdvancedTable.Body subRowHeaders={subRowHeaders}/>
|
|
69
|
-
</AdvancedTable>
|
|
70
|
-
<Caption text="Inline Row Loading and Persist Toggle Expansion Button with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is rendered" />
|
|
71
|
-
<AdvancedTable
|
|
72
|
-
columnDefinitions={columnDefinitions}
|
|
73
|
-
enableToggleExpansion="all"
|
|
74
|
-
inlineRowLoading
|
|
75
|
-
persistToggleExpansionButton
|
|
76
|
-
tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
|
|
77
|
-
{...props}
|
|
78
|
-
>
|
|
79
|
-
<AdvancedTable.Header />
|
|
80
|
-
<AdvancedTable.Body subRowHeaders={subRowHeaders}/>
|
|
81
|
-
</AdvancedTable>
|
|
82
54
|
</div>
|
|
83
55
|
)
|
|
84
56
|
}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
### inlineRowLoading
|
|
2
1
|
As a default, the kit assumes that the initial dataset is complete, and it renders all expansion buttons/controls based on that data; if no children are present, no expansion controls are rendered. If, however, you want to change the initial dataset to omit some or all of its children (to improve load times of a complex dataset, perhaps), and you implement a querying logic that loads children only when its parent is expanded, then you must use the `inlineRowLoading` prop to ensure your expansion controls are rendered even though your child data is not yet loaded. You must also pass an empty `children` array to any node that will have children to ensure its parent maintains its ability to expand. If this prop is called AND your data contains empty `children` arrays, the kit will render expansion controls on any row with empty children, and then add an inline loading state within the expanded subrow until those child row(s) are returned to the page [by your query logic].
|
|
3
2
|
|
|
4
|
-
In
|
|
3
|
+
In this code example, 2021 has an empty children array. Toggle it open to see the inline loading state. Once the correct data loads, this state will be replaced with the correct data rows.
|
|
5
4
|
|
|
6
|
-
This prop is set to `false` by default.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### persistToggleExpansion
|
|
10
|
-
The `persistToggleExpansionButton` is a boolean prop that renders the toggle-all icon in the top left header cell for complex datasets with empty `children` arrays and advanced querying logic explained in the preceeding doc example. Your logic may require an additional query helper file to update data specifically from requerying via toggle all buttons.
|
|
11
|
-
|
|
12
|
-
In the second and third Advanced Tables in this code example, all 3 rows have empty children arrays. The second Advanced Table demonstrates that the toggle all button does not render (prior to an initial row expansion) without `persistToggleExpansionButton` in place. The third Advanced Table shows the toggle all button due to `persistToggleExpansionButton`.
|
|
13
|
-
|
|
14
|
-
This prop is set to false by default and should only be used in conjunction with `inlineRowLoading`.
|
|
5
|
+
This prop is set to `false` by default.
|
|
@@ -22,6 +22,7 @@ const AdvancedTablePaddingControl = (props) => {
|
|
|
22
22
|
{value}
|
|
23
23
|
</Background>
|
|
24
24
|
),
|
|
25
|
+
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
accessor: "scheduledMeetings",
|
|
@@ -38,15 +39,6 @@ const AdvancedTablePaddingControl = (props) => {
|
|
|
38
39
|
{
|
|
39
40
|
accessor: "classCompletionRate",
|
|
40
41
|
label: "Class Completion Rate",
|
|
41
|
-
columnStyling:{cellPadding: "none", fontColor: "white"},
|
|
42
|
-
customRenderer: (row, value) => (
|
|
43
|
-
<Background
|
|
44
|
-
backgroundColor={"category_1"}
|
|
45
|
-
padding="xs"
|
|
46
|
-
>
|
|
47
|
-
{value}
|
|
48
|
-
</Background>
|
|
49
|
-
),
|
|
50
42
|
},
|
|
51
43
|
{
|
|
52
44
|
accessor: "graduatedStudents",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
`columnStyling` can also be used to control padding on all cells in a given column via the use of the `cellPadding` key/value pair. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
|
|
2
2
|
|
|
3
|
-
This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
|
|
3
|
+
This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
|