Skip to content

Commit

Permalink
Merge pull request #77 from Apollo-Spreadsheet/feat/apollo-build-test
Browse files Browse the repository at this point in the history
Apollo props - displayCollapseIcon
  • Loading branch information
VeraRibeiro authored Aug 18, 2022
2 parents eeabd16 + e218269 commit 7e61711
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
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

0 comments on commit 7e61711

Please sign in to comment.