Skip to content

Commit 07c86b0

Browse files
committed
fix: reference to updated scss variable
1 parent 871c045 commit 07c86b0

File tree

7 files changed

+202
-88
lines changed

7 files changed

+202
-88
lines changed

packages/modules/data-widgets/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- We enhanced datagrid selection UI with responsive container queries and improved layout styling for header and footer components.
12+
913
## [3.5.0] DataWidgets - 2025-09-16
1014

1115
### Changed

packages/modules/data-widgets/src/themesource/datawidgets/web/_datagrid.scss

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ $root: ".widget-datagrid";
311311
justify-content: flex-end;
312312
white-space: nowrap;
313313
align-items: baseline;
314-
margin: 16px;
314+
margin: 0 16px;
315315
color: $pagination-caption-color;
316316

317317
.paging-status {
@@ -397,6 +397,10 @@ $root: ".widget-datagrid";
397397
}
398398
}
399399

400+
&-top-bar {
401+
container: widget-datagrid-header / inline-size;
402+
}
403+
400404
&-content {
401405
overflow-x: auto;
402406
}
@@ -409,6 +413,10 @@ $root: ".widget-datagrid";
409413
display: contents;
410414
}
411415

416+
&-footer {
417+
container: widget-datagrid-footer / inline-size;
418+
}
419+
412420
&.widget-datagrid-selection-method-click {
413421
.tr.tr-selected .td {
414422
background-color: $grid-selected-row-background;
@@ -517,7 +525,7 @@ $root: ".widget-datagrid";
517525

518526
.widget-datagrid .widget-datagrid-load-more {
519527
display: block !important;
520-
margin: 0 auto;
528+
margin: 0;
521529
}
522530

523531
:where(.widget-datagrid-grid.infinite-loading) {
@@ -529,21 +537,30 @@ $root: ".widget-datagrid";
529537
z-index: 1;
530538
}
531539

532-
:where(#{$root}-paging-bottom) {
540+
:where(#{$root}-paging-bottom, #{$root}-padding-top) {
533541
display: flex;
534542
flex-flow: row nowrap;
535543
align-items: center;
536544
}
537545

538-
:where(#{$root}-pb-start, #{$root}-pb-end, #{$root}-pb-middle) {
546+
:where(#{$root}-pb-end, #{$root}-tb-end) {
547+
display: flex;
548+
justify-content: flex-end;
549+
align-items: center;
550+
}
551+
552+
:where(#{$root}-pb-start, #{$root}-tb-start, #{$root}-pb-end, #{$root}-tb-end, #{$root}-pb-middle) {
539553
flex-grow: 1;
540554
flex-basis: 33.33%;
541555
min-height: 20px;
556+
height: 54px;
557+
padding: var(--spacing-small) 0;
542558
}
543559

544-
:where(#{$root}-pb-start) {
545-
margin-block: var(--spacing-medium);
560+
:where(#{$root}-pb-start, #{$root}-tb-start) {
546561
padding-inline: var(--spacing-medium);
562+
display: flex;
563+
align-items: center;
547564
}
548565

549566
#{$root}-clear-selection {
@@ -567,3 +584,23 @@ $root: ".widget-datagrid";
567584
transform: rotate(1turn);
568585
}
569586
}
587+
588+
@container widget-datagrid-footer (width < 500px) {
589+
#{$root}-paging-bottom {
590+
flex-direction: column;
591+
:where(#{$root}-pb-start, #{$root}-pb-end, #{$root}-pb-middle) {
592+
width: 100%;
593+
justify-content: center;
594+
}
595+
}
596+
}
597+
598+
@container widget-datagrid-header (width < 500px) {
599+
#{$root}-padding-top {
600+
flex-direction: column-reverse;
601+
:where(#{$root}-tb-start, #{$root}-tb-end) {
602+
width: 100%;
603+
justify-content: center;
604+
}
605+
}
606+
}

packages/pluggableWidgets/datagrid-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- We added configurable selection count visibility and clear selection button label template for improved row selection management.
12+
913
## [3.4.0] - 2025-09-12
1014

1115
### Fixed

packages/pluggableWidgets/datagrid-web/src/components/Widget.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
LoadingTypeEnum,
1010
PaginationEnum,
1111
PagingPositionEnum,
12-
ShowPagingButtonsEnum,
13-
SelectionCountVisibilityEnum
12+
SelectionCountVisibilityEnum,
13+
ShowPagingButtonsEnum
1414
} from "../../typings/DatagridProps";
1515
import { SelectActionHelper } from "../helpers/SelectActionHelper";
1616
import { useDatagridRootScope } from "../helpers/root-context";
@@ -136,10 +136,11 @@ const Main = observer(<C extends GridColumn>(props: WidgetProps<C>): ReactElemen
136136
visibleColumns
137137
} = props;
138138

139-
const { basicData } = useDatagridRootScope();
139+
const { basicData, selectionCountStore } = useDatagridRootScope();
140140

141141
const showHeader = !!headerContent;
142142
const showTopBar = paging && (pagingPosition === "top" || pagingPosition === "both");
143+
const showFooter = paging && (pagingPosition === "bottom" || pagingPosition === "both");
143144

144145
const pagination = paging ? (
145146
<Pagination
@@ -165,14 +166,14 @@ const Main = observer(<C extends GridColumn>(props: WidgetProps<C>): ReactElemen
165166

166167
return (
167168
<Fragment>
168-
{showTopBar && (
169-
<WidgetTopBar
170-
selectionCountVisibility={selectionCountVisibility}
171-
clearSelectionButtonLabel={clearSelectionButtonLabel}
172-
>
173-
{pagination}
174-
</WidgetTopBar>
175-
)}
169+
<WidgetTopBar
170+
selectedCount={selectionCountStore.selectedCount}
171+
showTopBar={showTopBar}
172+
selectionCountVisibility={selectionCountVisibility}
173+
clearSelectionButtonLabel={clearSelectionButtonLabel}
174+
>
175+
{pagination}
176+
</WidgetTopBar>
176177
{showHeader && <WidgetHeader headerTitle={headerTitle}>{headerContent}</WidgetHeader>}
177178
<WidgetContent>
178179
<Grid
@@ -243,8 +244,9 @@ const Main = observer(<C extends GridColumn>(props: WidgetProps<C>): ReactElemen
243244
</Grid>
244245
</WidgetContent>
245246
<WidgetFooter
247+
selectedCount={selectionCountStore.selectedCount}
248+
showFooter={showFooter}
246249
pagination={pagination}
247-
pagingPosition={pagingPosition}
248250
paginationType={paginationType}
249251
loadMoreButtonCaption={loadMoreButtonCaption}
250252
clearSelectionButtonLabel={clearSelectionButtonLabel}

packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
import { createElement, ReactElement, ReactNode } from "react";
2-
import { PaginationEnum, PagingPositionEnum, SelectionCountVisibilityEnum } from "../../typings/DatagridProps";
2+
import { PaginationEnum, SelectionCountVisibilityEnum } from "../../typings/DatagridProps";
33
import { SelectionCounter } from "./SelectionCounter";
44

55
type WidgetFooterProps = {
6-
pagingPosition: PagingPositionEnum;
76
pagination: ReactNode;
87
paginationType: PaginationEnum;
98
loadMoreButtonCaption?: string;
109
clearSelectionButtonLabel?: string;
1110
selectionCountVisibility?: SelectionCountVisibilityEnum;
1211
hasMoreItems: boolean;
12+
showFooter: boolean;
13+
selectedCount: number;
1314
setPage?: (computePage: (prevPage: number) => number) => void;
1415
} & JSX.IntrinsicElements["div"];
1516

1617
export function WidgetFooter(props: WidgetFooterProps): ReactElement | null {
1718
const {
18-
pagingPosition,
1919
pagination,
2020
paginationType,
2121
loadMoreButtonCaption,
2222
clearSelectionButtonLabel,
2323
selectionCountVisibility,
2424
hasMoreItems,
2525
setPage,
26+
showFooter,
27+
selectedCount,
2628
...rest
2729
} = props;
2830

2931
return (
3032
<div {...rest} className="widget-datagrid-footer table-footer">
3133
<div className="widget-datagrid-paging-bottom">
32-
<div className="widget-datagrid-pb-start">
33-
{selectionCountVisibility === "bottom" && (
34+
{selectionCountVisibility === "bottom" && selectedCount > 0 && (
35+
<div className="widget-datagrid-pb-start">
3436
<SelectionCounter clearSelectionButtonLabel={clearSelectionButtonLabel} />
35-
)}
36-
</div>
37-
{hasMoreItems && paginationType === "loadMore" && (
38-
<div className="widget-datagrid-pb-middle">
37+
</div>
38+
)}
39+
<div className="widget-datagrid-pb-end">
40+
{showFooter && pagination}
41+
{hasMoreItems && paginationType === "loadMore" && (
3942
<button
4043
className="btn btn-primary widget-datagrid-load-more"
4144
onClick={() => setPage && setPage(prev => prev + 1)}
4245
tabIndex={0}
4346
>
4447
{loadMoreButtonCaption}
4548
</button>
46-
</div>
47-
)}
48-
<div className="widget-datagrid-pb-end">
49-
{(pagingPosition === "bottom" || pagingPosition === "both") && pagination}
49+
)}
5050
</div>
5151
</div>
5252
</div>

packages/pluggableWidgets/datagrid-web/src/components/WidgetTopBar.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ import { SelectionCounter } from "./SelectionCounter";
55
type WidgetTopBarProps = {
66
selectionCountVisibility?: SelectionCountVisibilityEnum;
77
clearSelectionButtonLabel?: string;
8+
showTopBar: boolean;
9+
selectedCount: number;
810
} & JSX.IntrinsicElements["div"];
911

1012
export function WidgetTopBar(props: WidgetTopBarProps): ReactElement {
11-
const { selectionCountVisibility, clearSelectionButtonLabel } = props;
12-
13-
console.warn(selectionCountVisibility);
14-
13+
const { selectionCountVisibility, clearSelectionButtonLabel, showTopBar, selectedCount, ...restProps } = props;
1514
return (
16-
<div {...props} className="widget-datagrid-top-bar table-header">
17-
{selectionCountVisibility === "top" && (
18-
<SelectionCounter clearSelectionButtonLabel={clearSelectionButtonLabel} />
19-
)}
20-
{props.children}
15+
<div {...restProps} className="widget-datagrid-top-bar table-header">
16+
<div className="widget-datagrid-padding-top">
17+
{selectionCountVisibility === "top" && selectedCount > 0 && (
18+
<div className="widget-datagrid-tb-start">
19+
<SelectionCounter clearSelectionButtonLabel={clearSelectionButtonLabel} />
20+
</div>
21+
)}
22+
{showTopBar && <div className="widget-datagrid-tb-end">{props.children}</div>}
23+
</div>
2124
</div>
2225
);
2326
}

0 commit comments

Comments
 (0)