Skip to content

Commit

Permalink
fix(html): move Grid selection aggregates outside of aria-root
Browse files Browse the repository at this point in the history
  • Loading branch information
TeyaVes committed Dec 2, 2024
1 parent c85350d commit 848b733
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
3 changes: 3 additions & 0 deletions packages/html/src/grid/grid.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type KendoGridProps = KendoGridOptions & {
pager?: React.JSX.Element;
pagerPosition?: 'top' | 'bottom';
groupingHeader?: React.JSX.Element;
gridSelectionAggregates?: React.JSX.Element;
_renderAriaRoot?: boolean;
};

Expand All @@ -35,6 +36,7 @@ export const Grid = (
toolbar,
pager,
groupingHeader,
gridSelectionAggregates,
_renderAriaRoot,
...other
} = props;
Expand All @@ -54,6 +56,7 @@ export const Grid = (
{ props.children && _renderAriaRoot ?
<div className="k-grid-aria-root">{props.children}</div> : props.children
}
{gridSelectionAggregates}
{pagerPosition === 'bottom' && pager}
</div>
);
Expand Down
62 changes: 33 additions & 29 deletions packages/html/src/grid/templates/grid-with-selection-aggregates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,43 @@ export const GridWithSelectionAggregates = ({ aggregated = false, contentClassNa
</GridTable>
</GridContent>
</GridContainer>
</>
)}
gridSelectionAggregates={
(
<div className="k-selection-aggregates k-grid-selection-aggregates">
{ aggregated ?
<>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Sum:</span>
<span className="k-selection-aggregates-item-value">122.00</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Avg:</span>
<span className="k-selection-aggregates-item-value">30.50</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Min:</span>
<span className="k-selection-aggregates-item-value">13</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Max:</span>
<span className="k-selection-aggregates-item-value">53</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Count:</span>
<span className="k-selection-aggregates-item-value">8</span>
</div>
</>
:
{ aggregated ?
<>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Sum:</span>
<span className="k-selection-aggregates-item-value">122.00</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Avg:</span>
<span className="k-selection-aggregates-item-value">30.50</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Min:</span>
<span className="k-selection-aggregates-item-value">13</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Max:</span>
<span className="k-selection-aggregates-item-value">53</span>
</div>
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Count:</span>
<span className="k-selection-aggregates-item-value">0</span>
<span className="k-selection-aggregates-item-value">8</span>
</div>
}
</div>
</>
)}
</>
:
<div className="k-selection-aggregates-item">
<span className="k-selection-aggregates-item-text">Count:</span>
<span className="k-selection-aggregates-item-value">0</span>
</div>
}
</div>
)
}
{...other}>

</Grid>
Expand Down

0 comments on commit 848b733

Please sign in to comment.