playbook_ui 14.21.2.pre.alpha.PLAY2233removetreemapchart8408 → 14.21.2.pre.alpha.PLAY2241tablestickycolumnsdatanotids8357
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 +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +5 -30
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -25
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +39 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +39 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.jsx +11 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.jsx +8 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.jsx +14 -23
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +0 -4
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.scss +14 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +119 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +63 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +48 -0
- data/dist/chunks/_typeahead-BmfmVMFP.js +22 -0
- data/dist/chunks/_weekday_stacked-DAC7yY_H.js +45 -0
- data/dist/chunks/lib-C2o6nu8G.js +29 -0
- data/dist/chunks/{pb_form_validation-DqRmTS8m.js → pb_form_validation-EyK6DbAT.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +9 -0
- data/dist/playbook-doc.js +3 -3
- 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 +29 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.md +0 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.jsx +0 -99
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -47
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +0 -1
- data/dist/chunks/_typeahead-DOgzItP7.js +0 -22
- data/dist/chunks/_weekday_stacked-SYZ-Kt4V.js +0 -45
- data/dist/chunks/lib-Carqm8Ip.js +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb903e9fac61dab1799f3b2480e1107fbe15b44cc240a7b47d203c96caecd13
|
4
|
+
data.tar.gz: d6114a181c65aa31d5c7f30bb729652ebb30b59ea8cf71946294c1d81c9206e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f322fb4c59317a1f6d71ed145305656f34c3461b585904996b63c5f8b76fc175374dd9c82fc5ff2ab7f4d8830da244c1208ed44a3b29ae1fd334b12c7086dd5d
|
7
|
+
data.tar.gz: 60dbd83fd98aab746396b84410bc7c52125fcced4261870642be768fd6ce1db41dbc61f59ff845bcb76edcdbda826a4839397d3d39cc114b0c7a6a16c2e222f3
|
@@ -104,6 +104,7 @@
|
|
104
104
|
@import 'pb_title_detail/title_detail';
|
105
105
|
@import 'pb_toggle/toggle';
|
106
106
|
@import 'pb_tooltip/tooltip';
|
107
|
+
@import 'pb_treemap_chart/treemap_chart';
|
107
108
|
@import 'pb_typeahead/typeahead';
|
108
109
|
@import 'pb_user/user';
|
109
110
|
@import 'pb_user_badge/user_badge';
|
@@ -19,7 +19,6 @@ interface CustomCellProps {
|
|
19
19
|
value?: string
|
20
20
|
customRenderer?: (row: Row<GenericObject>, value: string | undefined) => React.ReactNode
|
21
21
|
selectableRows?: boolean
|
22
|
-
customStyle?: GenericObject
|
23
22
|
}
|
24
23
|
|
25
24
|
export const CustomCell = ({
|
@@ -29,7 +28,6 @@ export const CustomCell = ({
|
|
29
28
|
value,
|
30
29
|
customRenderer,
|
31
30
|
selectableRows,
|
32
|
-
customStyle = {},
|
33
31
|
}: CustomCellProps & GlobalProps) => {
|
34
32
|
const { setExpanded, expanded, expandedControl, inlineRowLoading, hasAnySubRows } = useContext(AdvancedTableContext);
|
35
33
|
|
@@ -45,7 +43,7 @@ export const CustomCell = ({
|
|
45
43
|
const renderButton = inlineRowLoading ? RowHasChildren : row.getCanExpand()
|
46
44
|
|
47
45
|
return (
|
48
|
-
<div style={{ paddingLeft: `${row.depth * 1.25}em`}}>
|
46
|
+
<div style={{ paddingLeft: `${row.depth * 1.25}em` }}>
|
49
47
|
<Flex
|
50
48
|
alignItems="center"
|
51
49
|
columnGap="xs"
|
@@ -67,7 +65,6 @@ export const CustomCell = ({
|
|
67
65
|
<button
|
68
66
|
className="gray-icon expand-toggle-icon"
|
69
67
|
onClick={() => handleOnExpand(row)}
|
70
|
-
style={{ color: customStyle?.expandButtonColor }}
|
71
68
|
>
|
72
69
|
{row.getIsExpanded() ? (
|
73
70
|
<Icon cursor="pointer"
|
@@ -27,7 +27,6 @@ const TableCellRenderer = ({
|
|
27
27
|
loading = false,
|
28
28
|
stickyLeftColumn,
|
29
29
|
columnPinning,
|
30
|
-
customRowStyle,
|
31
30
|
columnDefinitions,
|
32
31
|
}: {
|
33
32
|
row: Row<GenericObject>
|
@@ -35,7 +34,6 @@ const TableCellRenderer = ({
|
|
35
34
|
loading?: boolean | string
|
36
35
|
stickyLeftColumn?: string[]
|
37
36
|
columnPinning: { left: string[] }
|
38
|
-
customRowStyle?: GenericObject
|
39
37
|
columnDefinitions?: {[key:string]:any}[]
|
40
38
|
}) => {
|
41
39
|
return (
|
@@ -76,8 +74,6 @@ const TableCellRenderer = ({
|
|
76
74
|
? '180px'
|
77
75
|
: `${column.getStart("left")}px`
|
78
76
|
: undefined,
|
79
|
-
backgroundColor: i === 0 && customRowStyle?.backgroundColor,
|
80
|
-
color: customRowStyle?.fontColor,
|
81
77
|
}}
|
82
78
|
>
|
83
79
|
{collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
|
@@ -111,7 +107,6 @@ export const RegularTableView = ({
|
|
111
107
|
pinnedRows,
|
112
108
|
headerHeight,
|
113
109
|
rowHeight,
|
114
|
-
rowStyling = [],
|
115
110
|
sampleRowRef,
|
116
111
|
} = useContext(AdvancedTableContext)
|
117
112
|
|
@@ -176,7 +171,6 @@ export const RegularTableView = ({
|
|
176
171
|
const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
|
177
172
|
const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
|
178
173
|
const isFirstRegularRow = rowIndex === 0 && !row.getIsPinned();
|
179
|
-
const customRowStyle = rowStyling?.length > 0 && rowStyling?.find((s: GenericObject) => s?.rowId === row.id);
|
180
174
|
|
181
175
|
return (
|
182
176
|
<React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
|
@@ -195,7 +189,6 @@ export const RegularTableView = ({
|
|
195
189
|
className={`${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
|
196
190
|
id={`${row.index}-${row.id}-${row.depth}-row`}
|
197
191
|
ref={isFirstRegularRow ? sampleRowRef : null}
|
198
|
-
style={{backgroundColor: customRowStyle?.backgroundColor, color: customRowStyle?.fontColor}}
|
199
192
|
>
|
200
193
|
{/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
|
201
194
|
{selectableRows && !hasAnySubRows && (
|
@@ -213,7 +206,6 @@ export const RegularTableView = ({
|
|
213
206
|
collapsibleTrail={collapsibleTrail}
|
214
207
|
columnDefinitions={columnDefinitions}
|
215
208
|
columnPinning={columnPinning}
|
216
|
-
customRowStyle={customRowStyle}
|
217
209
|
loading={loading}
|
218
210
|
row={row}
|
219
211
|
stickyLeftColumn={stickyLeftColumn}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useState, useCallback, useMemo
|
1
|
+
import { useState, useCallback, useMemo } from 'react';
|
2
2
|
import {
|
3
3
|
useReactTable,
|
4
4
|
getCoreRowModel,
|
@@ -32,7 +32,6 @@ interface UseTableStateProps {
|
|
32
32
|
tableOptions?: GenericObject;
|
33
33
|
onRowSelectionChange?: (arg: RowSelectionState) => void;
|
34
34
|
columnVisibilityControl?: GenericObject;
|
35
|
-
rowStyling?: GenericObject;
|
36
35
|
}
|
37
36
|
|
38
37
|
export function useTableState({
|
@@ -50,9 +49,7 @@ export function useTableState({
|
|
50
49
|
tableOptions,
|
51
50
|
columnVisibilityControl,
|
52
51
|
pinnedRows,
|
53
|
-
rowStyling
|
54
52
|
}: UseTableStateProps) {
|
55
|
-
|
56
53
|
// Create a local state for expanded and setExpanded if expandedControl not used
|
57
54
|
const [localExpanded, setLocalExpanded] = useState({});
|
58
55
|
const [loadingStateRowCount, setLoadingStateRowCount] = useState(initialLoadingRowsCount);
|
@@ -66,8 +63,8 @@ export function useTableState({
|
|
66
63
|
const setExpanded = expandedControl ? expandedControl.onChange : setLocalExpanded;
|
67
64
|
const columnVisibility = (columnVisibilityControl && columnVisibilityControl.value) ? columnVisibilityControl.value : localColumnVisibility;
|
68
65
|
const setColumnVisibility = (columnVisibilityControl && columnVisibilityControl.onChange) ? columnVisibilityControl.onChange : setLocalColumnVisibility;
|
69
|
-
const rowPinning = pinnedRows
|
70
|
-
const
|
66
|
+
const rowPinning = pinnedRows && pinnedRows.value || localRowPinning;
|
67
|
+
const setRowPinning = (pinnedRows && pinnedRows.onChange) ? pinnedRows.onChange : setLocalRowPinning;
|
71
68
|
|
72
69
|
// Virtualized data handling (chunked loading)
|
73
70
|
const fetchSize = 20; // Number of rows per "page"
|
@@ -105,8 +102,7 @@ export function useTableState({
|
|
105
102
|
column.customRenderer,
|
106
103
|
isFirstColumn,
|
107
104
|
onRowToggleClick,
|
108
|
-
selectableRows
|
109
|
-
rowStyling
|
105
|
+
selectableRows
|
110
106
|
);
|
111
107
|
}
|
112
108
|
|
@@ -169,8 +165,7 @@ export function useTableState({
|
|
169
165
|
enableSortingRemoval: false,
|
170
166
|
sortDescFirst: true,
|
171
167
|
onRowSelectionChange: setRowSelection,
|
172
|
-
|
173
|
-
getRowId: (selectableRows || pinnedRows || rowStyling) ? row => row.id : undefined,
|
168
|
+
getRowId: (selectableRows || pinnedRows) ? row => row.id : undefined,
|
174
169
|
onColumnVisibilityChange: setColumnVisibility,
|
175
170
|
meta: {
|
176
171
|
columnDefinitions
|
@@ -180,26 +175,6 @@ export function useTableState({
|
|
180
175
|
...tableOptions,
|
181
176
|
});
|
182
177
|
|
183
|
-
// Handle row pinning changes
|
184
|
-
useEffect(() => {
|
185
|
-
const topPins = pinnedRows?.value?.top ?? [];
|
186
|
-
if (topPins.length === 0) {
|
187
|
-
onRowPinningChange({ top: [] });
|
188
|
-
return;
|
189
|
-
}
|
190
|
-
const rows = table.getRowModel().rows;
|
191
|
-
const collectAllDescendantIds = (subs: Row<GenericObject>[]): string[] =>
|
192
|
-
subs.flatMap(r => [r.id, ...collectAllDescendantIds(r.subRows)]);
|
193
|
-
const allPinned: string[] = [];
|
194
|
-
topPins.forEach(id => {
|
195
|
-
const parent = rows.find(r => r.id === id && r.depth === 0);
|
196
|
-
if (parent) {
|
197
|
-
allPinned.push(parent.id, ...collectAllDescendantIds(parent.subRows));
|
198
|
-
}
|
199
|
-
});
|
200
|
-
onRowPinningChange({ top: allPinned });
|
201
|
-
}, [table, pinnedRows?.value?.top?.join(',')]);
|
202
|
-
|
203
178
|
// Check if table has any sub-rows
|
204
179
|
const hasAnySubRows = table.getRowModel().rows.some(row => row.subRows && row.subRows.length > 0);
|
205
180
|
const selectedRowsLength = Object.keys(table.getState().rowSelection).length;
|
@@ -17,8 +17,7 @@ export const createCellFunction = (
|
|
17
17
|
customRenderer?: (row: Row<GenericObject>, value: any) => JSX.Element,
|
18
18
|
isFirstColumn?: boolean,
|
19
19
|
onRowToggleClick?: (row: Row<GenericObject>) => void,
|
20
|
-
selectableRows?: boolean
|
21
|
-
rowStyling?: GenericObject
|
20
|
+
selectableRows?: boolean
|
22
21
|
) => {
|
23
22
|
// Add display name to the returned function
|
24
23
|
const cellRenderer = ({
|
@@ -29,7 +28,6 @@ export const createCellFunction = (
|
|
29
28
|
getValue: Getter<string>
|
30
29
|
}) => {
|
31
30
|
const rowData = row.original;
|
32
|
-
const customStyle = rowStyling?.length > 0 && rowStyling?.find((s:GenericObject) => s?.rowId === row.id);
|
33
31
|
|
34
32
|
if (isFirstColumn) {
|
35
33
|
switch (row.depth) {
|
@@ -37,7 +35,6 @@ export const createCellFunction = (
|
|
37
35
|
return (
|
38
36
|
<CustomCell
|
39
37
|
customRenderer={customRenderer}
|
40
|
-
customStyle={customStyle}
|
41
38
|
getValue={getValue}
|
42
39
|
onRowToggleClick={onRowToggleClick}
|
43
40
|
row={row}
|
@@ -57,7 +57,6 @@ type AdvancedTableProps = {
|
|
57
57
|
onChange?: (value: RowPinningState) => void;
|
58
58
|
};
|
59
59
|
responsive?: "scroll" | "none",
|
60
|
-
rowStyling?: GenericObject[],
|
61
60
|
scrollBarNone?: boolean,
|
62
61
|
selectableRows?: boolean,
|
63
62
|
showActionsBar?: boolean,
|
@@ -99,7 +98,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
99
98
|
paginationProps,
|
100
99
|
pinnedRows,
|
101
100
|
responsive = "scroll",
|
102
|
-
rowStyling,
|
103
101
|
scrollBarNone= false,
|
104
102
|
showActionsBar = true,
|
105
103
|
selectableRows,
|
@@ -146,7 +144,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
146
144
|
onRowSelectionChange,
|
147
145
|
columnVisibilityControl,
|
148
146
|
pinnedRows,
|
149
|
-
rowStyling
|
150
147
|
});
|
151
148
|
|
152
149
|
// Initialize table actions
|
@@ -339,7 +336,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
339
336
|
onExpandByDepthClick={onExpandByDepthClick}
|
340
337
|
pinnedRows={pinnedRows}
|
341
338
|
responsive={responsive}
|
342
|
-
rowStyling={rowStyling}
|
343
339
|
selectableRows={selectableRows}
|
344
340
|
setExpanded={setExpanded}
|
345
341
|
showActionsBar={showActionsBar}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, {useState} from "react"
|
2
2
|
import { render, screen, waitFor } from "../utilities/test-utils"
|
3
3
|
|
4
|
-
import { AdvancedTable, Pill
|
4
|
+
import { AdvancedTable, Pill } from "playbook-ui"
|
5
5
|
|
6
6
|
global.ResizeObserver = class {
|
7
7
|
observe() {}
|
@@ -652,27 +652,3 @@ test("renders virtualized table rows and header", () => {
|
|
652
652
|
const virtualizedRows = kit.querySelectorAll('.virtualized-table-row')
|
653
653
|
expect(virtualizedRows.length).toBeLessThan(MOCK_DATA_WITH_ID.length)
|
654
654
|
})
|
655
|
-
|
656
|
-
test("rowStyling prop works as expected", () => {
|
657
|
-
const rowStyling = [
|
658
|
-
{
|
659
|
-
rowId: "1",
|
660
|
-
backgroundColor: colors.white,
|
661
|
-
fontColor: colors.black
|
662
|
-
},
|
663
|
-
];
|
664
|
-
|
665
|
-
render(
|
666
|
-
<AdvancedTable
|
667
|
-
columnDefinitions={columnDefinitions}
|
668
|
-
data={{ testid: testId }}
|
669
|
-
rowStyling={rowStyling}
|
670
|
-
tableData={MOCK_DATA_WITH_ID}
|
671
|
-
/>
|
672
|
-
)
|
673
|
-
|
674
|
-
const kit = screen.getByTestId(testId)
|
675
|
-
const tableBody = kit.querySelector('tbody')
|
676
|
-
const row1 = tableBody.querySelector('tr:nth-child(1)')
|
677
|
-
expect(row1).toHaveStyle({backgroundColor: colors.white, color: colors.black})
|
678
|
-
})
|
@@ -1,7 +1,5 @@
|
|
1
|
-
Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and
|
1
|
+
Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and reorganizing via sorting.
|
2
2
|
|
3
|
-
**NOTE:**
|
3
|
+
**NOTE:** This prop is in Beta. Current Requirements for V1:
|
4
4
|
- Sticky header required: Pinned rows must be used with `sticky: true` via `tableProps` (works with both responsive and non-responsive tables)
|
5
|
-
- Row ids required:
|
6
|
-
- `pinnedRows` takes an array of row ids to the `top` property as shown in the code snippet below.
|
7
|
-
- For expandable rows, use the parent id in `pinnedRows`, all its children will automatically be pinned with it. If id for a child is passed in without parent being pinned, nothing will be pinned.
|
5
|
+
- Row ids required: Pass an array of row ids to the `top` property. For expandable rows, both parent and all its child row ids must be included individually
|
@@ -59,7 +59,6 @@ examples:
|
|
59
59
|
- advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
|
60
60
|
- advanced_table_pinned_rows: Pinned Rows
|
61
61
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
62
|
-
- advanced_table_row_styling: Row Styling
|
63
62
|
- advanced_table_column_styling: Column Styling
|
64
63
|
- advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
|
65
64
|
- advanced_table_infinite_scroll: Infinite Scroll
|
@@ -34,7 +34,6 @@ export { default as AdvancedTableColumnVisibilityMulti } from './_advanced_table
|
|
34
34
|
export { default as AdvancedTableColumnVisibilityWithState } from './_advanced_table_column_visibility_with_state.jsx'
|
35
35
|
export { default as AdvancedTablePinnedRows } from './_advanced_table_pinned_rows.jsx'
|
36
36
|
export { default as AdvancedTableScrollbarNone} from './_advanced_table_scrollbar_none.jsx'
|
37
|
-
export { default as AdvancedTableRowStyling } from './_advanced_table_row_styling.jsx'
|
38
37
|
export { default as AdvancedTableColumnStyling } from './_advanced_table_column_styling.jsx'
|
39
38
|
export { default as AdvancedTableColumnStylingColumnHeaders } from './_advanced_table_column_styling_column_headers.jsx'
|
40
39
|
export { default as AdvancedTableInfiniteScroll} from './_advanced_table_infinite_scroll.jsx'
|
@@ -3,6 +3,8 @@ import typography from '../tokens/exports/_typography.module.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
+
import { PlotTreemapOptions } from "highcharts";
|
7
|
+
|
6
8
|
const highchartsDarkTheme: ThemeProps = {
|
7
9
|
lang: {
|
8
10
|
thousandsSep: ',',
|
@@ -164,7 +166,43 @@ const highchartsDarkTheme: ThemeProps = {
|
|
164
166
|
marker: {
|
165
167
|
lineColor: colors.border_dark,
|
166
168
|
},
|
167
|
-
}
|
169
|
+
},
|
170
|
+
|
171
|
+
//TREEMAP CHART STYLES
|
172
|
+
treemap: {
|
173
|
+
layoutAlgorithm: "squarified",
|
174
|
+
allowTraversingTree: false,
|
175
|
+
animationLimit: 1000,
|
176
|
+
colors: [
|
177
|
+
colors.data_1,
|
178
|
+
colors.data_2,
|
179
|
+
colors.data_3,
|
180
|
+
colors.data_4,
|
181
|
+
colors.data_5,
|
182
|
+
colors.data_6,
|
183
|
+
colors.data_7,
|
184
|
+
colors.data_8,
|
185
|
+
],
|
186
|
+
dataLabels: {
|
187
|
+
enabled: true,
|
188
|
+
style: {
|
189
|
+
fontFamily: typography.font_family_base,
|
190
|
+
fontWeight: typography.bold,
|
191
|
+
fontSize: typography.heading_4,
|
192
|
+
},
|
193
|
+
},
|
194
|
+
levels: [
|
195
|
+
{
|
196
|
+
level: 1,
|
197
|
+
dataLabels: {
|
198
|
+
enabled: false,
|
199
|
+
},
|
200
|
+
},
|
201
|
+
],
|
202
|
+
traverseUpButton: {
|
203
|
+
position: { y: -50 },
|
204
|
+
},
|
205
|
+
} as PlotTreemapOptions,
|
168
206
|
},
|
169
207
|
credits: {
|
170
208
|
enabled: false
|
@@ -3,6 +3,8 @@ import typography from '../tokens/exports/_typography.module.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
+
import { PlotTreemapOptions } from "highcharts";
|
7
|
+
|
6
8
|
const highchartsTheme: ThemeProps = {
|
7
9
|
lang: {
|
8
10
|
thousandsSep: ',',
|
@@ -163,7 +165,43 @@ const highchartsTheme: ThemeProps = {
|
|
163
165
|
marker: {
|
164
166
|
lineColor: '#333',
|
165
167
|
},
|
166
|
-
}
|
168
|
+
},
|
169
|
+
|
170
|
+
//TREEMAP CHART STYLES
|
171
|
+
treemap: {
|
172
|
+
layoutAlgorithm: "squarified",
|
173
|
+
allowTraversingTree: false,
|
174
|
+
animationLimit: 1000,
|
175
|
+
colors: [
|
176
|
+
colors.data_1,
|
177
|
+
colors.data_2,
|
178
|
+
colors.data_3,
|
179
|
+
colors.data_4,
|
180
|
+
colors.data_5,
|
181
|
+
colors.data_6,
|
182
|
+
colors.data_7,
|
183
|
+
colors.data_8,
|
184
|
+
],
|
185
|
+
dataLabels: {
|
186
|
+
enabled: true,
|
187
|
+
style: {
|
188
|
+
fontFamily: typography.font_family_base,
|
189
|
+
fontWeight: typography.bold,
|
190
|
+
fontSize: typography.heading_4,
|
191
|
+
},
|
192
|
+
},
|
193
|
+
levels: [
|
194
|
+
{
|
195
|
+
level: 1,
|
196
|
+
dataLabels: {
|
197
|
+
enabled: false,
|
198
|
+
},
|
199
|
+
},
|
200
|
+
],
|
201
|
+
traverseUpButton: {
|
202
|
+
position: { y: -50 },
|
203
|
+
},
|
204
|
+
} as PlotTreemapOptions,
|
167
205
|
},
|
168
206
|
credits: {
|
169
207
|
enabled: false
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
options = [
|
3
|
-
{ label: 'United States', value: '
|
4
|
-
{ label: 'Canada', value: '
|
5
|
-
{ label: 'Pakistan', value: '
|
3
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
6
|
]
|
7
7
|
|
8
8
|
%>
|
@@ -5,20 +5,17 @@ const DropdownBlankSelection = (props) => {
|
|
5
5
|
const options = [
|
6
6
|
{
|
7
7
|
label: "United States",
|
8
|
-
value: "
|
9
|
-
id: "us"
|
8
|
+
value: "United States",
|
10
9
|
},
|
11
10
|
{
|
12
11
|
label: "Canada",
|
13
|
-
value: "
|
14
|
-
id: "ca"
|
12
|
+
value: "Canada",
|
15
13
|
},
|
16
14
|
{
|
17
15
|
label: "Pakistan",
|
18
|
-
value: "
|
19
|
-
id: "pk"
|
16
|
+
value: "Pakistan",
|
20
17
|
}
|
21
|
-
];
|
18
|
+
];
|
22
19
|
|
23
20
|
return (
|
24
21
|
<>
|
@@ -6,18 +6,15 @@ import Dropdown from '../../pb_dropdown/_dropdown'
|
|
6
6
|
const options = [
|
7
7
|
{
|
8
8
|
label: "United States",
|
9
|
-
value: "
|
10
|
-
id: "us"
|
9
|
+
value: "United States",
|
11
10
|
},
|
12
11
|
{
|
13
12
|
label: "Canada",
|
14
|
-
value: "
|
15
|
-
id: "ca"
|
13
|
+
value: "Canada",
|
16
14
|
},
|
17
15
|
{
|
18
16
|
label: "Pakistan",
|
19
|
-
value: "
|
20
|
-
id: "pk"
|
17
|
+
value: "Pakistan",
|
21
18
|
}
|
22
19
|
]
|
23
20
|
|
@@ -6,18 +6,15 @@ const DropdownDefault = (props) => {
|
|
6
6
|
const options = [
|
7
7
|
{
|
8
8
|
label: "United States",
|
9
|
-
value: "
|
10
|
-
id: "us"
|
9
|
+
value: "United States",
|
11
10
|
},
|
12
11
|
{
|
13
12
|
label: "Canada",
|
14
|
-
value: "
|
15
|
-
id: "ca"
|
13
|
+
value: "Canada",
|
16
14
|
},
|
17
15
|
{
|
18
16
|
label: "Pakistan",
|
19
|
-
value: "
|
20
|
-
id: "pk"
|
17
|
+
value: "Pakistan",
|
21
18
|
}
|
22
19
|
];
|
23
20
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
options = [
|
3
|
-
{ label: 'United States', value: '
|
4
|
-
{ label: 'Canada', value: '
|
5
|
-
{ label: 'Pakistan', value: '
|
3
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
6
|
]
|
7
7
|
|
8
8
|
%>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
options = [
|
3
|
-
{ label: 'United States', value: '
|
4
|
-
{ label: 'Canada', value: '
|
5
|
-
{ label: 'Pakistan', value: '
|
3
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
6
|
]
|
7
7
|
|
8
8
|
%>
|
@@ -5,20 +5,17 @@ const DropdownDefaultValue = (props) => {
|
|
5
5
|
const options = [
|
6
6
|
{
|
7
7
|
label: "United States",
|
8
|
-
value: "
|
9
|
-
id: "us"
|
8
|
+
value: "United States",
|
10
9
|
},
|
11
10
|
{
|
12
11
|
label: "Canada",
|
13
|
-
value: "
|
14
|
-
id: "ca"
|
12
|
+
value: "Canada",
|
15
13
|
},
|
16
14
|
{
|
17
15
|
label: "Pakistan",
|
18
|
-
value: "
|
19
|
-
id: "pk"
|
16
|
+
value: "Pakistan",
|
20
17
|
}
|
21
|
-
];
|
18
|
+
];
|
22
19
|
|
23
20
|
return (
|
24
21
|
<>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
options = [
|
3
|
-
{ label: 'United States', value: '
|
4
|
-
{ label: 'Canada', value: '
|
5
|
-
{ label: 'Pakistan', value: '
|
3
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
6
|
]
|
7
7
|
%>
|
8
8
|
|
@@ -10,20 +10,17 @@ const DropdownError = (props) => {
|
|
10
10
|
const options = [
|
11
11
|
{
|
12
12
|
label: "United States",
|
13
|
-
value: "
|
14
|
-
id: "us"
|
13
|
+
value: "United States",
|
15
14
|
},
|
16
15
|
{
|
17
16
|
label: "Canada",
|
18
|
-
value: "
|
19
|
-
id: "ca"
|
17
|
+
value: "Canada",
|
20
18
|
},
|
21
19
|
{
|
22
20
|
label: "Pakistan",
|
23
|
-
value: "
|
24
|
-
id: "pk"
|
21
|
+
value: "Pakistan",
|
25
22
|
}
|
26
|
-
]
|
23
|
+
]
|
27
24
|
|
28
25
|
return (
|
29
26
|
<>
|
@@ -6,48 +6,39 @@ const DropdownMultiSelect = (props) => {
|
|
6
6
|
const options = [
|
7
7
|
{
|
8
8
|
label: "United States",
|
9
|
-
value: "
|
10
|
-
id: "us"
|
9
|
+
value: "United States",
|
11
10
|
},
|
12
11
|
{
|
13
|
-
|
14
|
-
|
15
|
-
id: "gb"
|
12
|
+
label: "United Kingdom",
|
13
|
+
value: "United Kingdom",
|
16
14
|
},
|
17
15
|
{
|
18
16
|
label: "Canada",
|
19
|
-
value: "
|
20
|
-
id: "ca"
|
17
|
+
value: "Canada",
|
21
18
|
},
|
22
19
|
{
|
23
20
|
label: "Pakistan",
|
24
|
-
value: "
|
25
|
-
id: "pk"
|
21
|
+
value: "Pakistan",
|
26
22
|
},
|
27
23
|
{
|
28
24
|
label: "India",
|
29
|
-
value: "
|
30
|
-
id: "in"
|
25
|
+
value: "India",
|
31
26
|
},
|
32
27
|
{
|
33
28
|
label: "Australia",
|
34
|
-
value: "
|
35
|
-
id: "au"
|
29
|
+
value: "Australia",
|
36
30
|
},
|
37
31
|
{
|
38
32
|
label: "New Zealand",
|
39
|
-
value: "
|
40
|
-
id: "nz"
|
33
|
+
value: "New Zealand",
|
41
34
|
},
|
42
35
|
{
|
43
36
|
label: "Italy",
|
44
|
-
value: "
|
45
|
-
id: "it"
|
37
|
+
value: "Italy",
|
46
38
|
},
|
47
39
|
{
|
48
40
|
label: "Spain",
|
49
|
-
value: "
|
50
|
-
id: "es"
|
41
|
+
value: "Spain",
|
51
42
|
}
|
52
43
|
];
|
53
44
|
|