Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo props - displayCollapseIcon #77

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ApolloSpreadsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const ApolloSpreadSheet: React.FC<ApolloSpreadsheetProps> = forwardRef(
mergedPositions={mergedPositions}
isMerged={isMerged}
// onRowCollapse={props?.onRowCollapseChange}
// displayCollapseIcon={props?.displayCollapseIcon}
displayCollapseIcon={props?.displayCollapseIcon}
nestedRowsProps={nestedRowsProps}
theme={theme}
coreId={`core-${props?.id}`}
Expand Down
4 changes: 4 additions & 0 deletions src/ApolloSpreadsheetProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ export interface ApolloLayoutProps {
* Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0.
*/
noContentOverlay?: () => ReactNode
/**
* Toggle icon display in Collapses
*/
displayCollapseIcon?: boolean
}

export interface ApolloCoreProps {
Expand Down
5 changes: 3 additions & 2 deletions src/gridWrapper/GridWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const GridWrapper: React.FC<GridWrapperProps> = React.memo(
rowHeight,
noContentOverlay,
onRowCollapse,
//displayCollapseIcon = true,
displayCollapseIcon = true,
coreId,
}) => {
const logger = useLogger('GridWrapper')
Expand Down Expand Up @@ -309,7 +309,7 @@ const GridWrapper: React.FC<GridWrapperProps> = React.memo(
const component = (
<div style={depth > 1 ? { marginLeft: nestedMargin } : {}}>
{cell.value}
{/* {displayCollapseIcon ? renderExpandOrCollapseIcon() : null} */}
{displayCollapseIcon ? renderExpandOrCollapseIcon() : null}
</div>
)
return wrapper(component)
Expand All @@ -336,6 +336,7 @@ const GridWrapper: React.FC<GridWrapperProps> = React.memo(
nestedRowsProps,
highlightBorderColor,
apiRef,
displayCollapseIcon,
onRowCollapse,
logger,
],
Expand Down
2 changes: 1 addition & 1 deletion src/gridWrapper/gridWrapperProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ export interface GridWrapperProps
theme?: GridTheme
coreId?: string
onRowCollapse?: (params: string) => any
// displayCollapseIcon?: boolean
displayCollapseIcon?: boolean
}
2 changes: 1 addition & 1 deletion stories/components/Budget/P&L.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ export function Financial() {
containerClassName={useTheme.containerClass}
theme={useTheme.theme}
//onColumnCollapseChange={getExpandedColumns}
// displayCollapseIcon={false}
displayCollapseIcon={false}
getSelectedCoords={getSelectedCoords4}
suppressNavigation
defaultCoords={{ rowIndex: -1, colIndex: -1 }}
Expand Down