Skip to content

Commit 872ee76

Browse files
committed
fix: fix failing e2e
1 parent 448ecc6 commit 872ee76

File tree

15 files changed

+285
-166
lines changed

15 files changed

+285
-166
lines changed

packages/modules/data-widgets/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Changed
1010

1111
- We enhanced datagrid selection UI with responsive container queries and improved layout styling for header and footer components.
12+
- We enhanced gallery selection UI with responsive container queries and improved layout styling for header and footer components to match datagrid implementation.
1213

1314
## [3.6.1] DataWidgets - 2025-10-14
1415

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

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,18 @@ $gallery-screen-md: $screen-md;
7373
}
7474

7575
.widget-gallery-filter,
76-
.widget-gallery-empty,
77-
.widget-gallery-pagination {
76+
.widget-gallery-empty {
7877
flex: 1;
7978
}
8079

80+
&-top-bar {
81+
container: widget-gallery-header / inline-size;
82+
}
83+
84+
&-footer {
85+
container: widget-gallery-footer / inline-size;
86+
}
87+
8188
/**
8289
Helper classes
8390
*/
@@ -89,20 +96,30 @@ $gallery-screen-md: $screen-md;
8996
width: inherit;
9097
}
9198

92-
:where(.widget-gallery-footer-controls) {
99+
:where(.widget-gallery-footer-controls, .widget-gallery-top-bar-controls) {
93100
display: flex;
94101
flex-flow: row nowrap;
102+
align-items: center;
95103
}
96104

97-
:where(.widget-gallery-fc-start) {
98-
margin-block: var(--spacing-medium);
99-
padding-inline: var(--spacing-medium);
105+
:where(.widget-gallery-fc-end, .widget-gallery-tb-end) {
106+
display: flex;
107+
justify-content: flex-end;
108+
align-items: center;
100109
}
101110

102-
:where(.widget-gallery-fc-start, .widget-gallery-fc-middle, .widget-gallery-fc-end) {
111+
:where(.widget-gallery-fc-start, .widget-gallery-tb-start, .widget-gallery-fc-end, .widget-gallery-tb-end) {
103112
flex-grow: 1;
104113
flex-basis: 33.33%;
105114
min-height: 20px;
115+
height: 54px;
116+
padding: var(--spacing-small) 0;
117+
}
118+
119+
:where(.widget-gallery-fc-start, .widget-gallery-tb-start) {
120+
padding-inline: var(--spacing-medium);
121+
display: flex;
122+
align-items: center;
106123
}
107124

108125
.widget-gallery-clear-selection {
@@ -113,4 +130,33 @@ $gallery-screen-md: $screen-md;
113130
color: var(--link-color);
114131
padding: 0;
115132
display: inline-block;
133+
134+
&:focus:not(:focus-visible) {
135+
outline: none;
136+
}
137+
138+
&:focus-visible {
139+
outline: 1px solid var(--brand-primary, $brand-primary);
140+
outline-offset: 2px;
141+
}
142+
}
143+
144+
@container widget-gallery-footer (width < 500px) {
145+
.widget-gallery-footer-controls {
146+
flex-direction: column;
147+
:where(.widget-gallery-fc-start, .widget-gallery-fc-end, .widget-gallery-fc-middle) {
148+
width: 100%;
149+
justify-content: center;
150+
}
151+
}
152+
}
153+
154+
@container widget-gallery-header (width < 500px) {
155+
.widget-gallery-top-bar-controls {
156+
flex-direction: column-reverse;
157+
:where(.widget-gallery-tb-start, .widget-gallery-tb-end) {
158+
width: 100%;
159+
justify-content: center;
160+
}
161+
}
116162
}

packages/pluggableWidgets/datagrid-dropdown-filter-web/src/hocs/withParentProvidedEnumStore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function withParentProvidedEnumStore<P extends { filterable: boolean }>(
2222

2323
function useEnumFilterAPI(): Result<EnumFilterProps, APIError> {
2424
const ctx = useFilterAPI();
25-
const slctAPI = useRef<EnumFilterProps>(undefined);
25+
const slctAPI = useRef<EnumFilterProps | undefined>(undefined);
2626

2727
if (ctx.hasError) {
2828
return error(ctx.error);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { If } from "@mendix/widget-plugin-component-kit/If";
22
import { observer } from "mobx-react-lite";
3-
import { createElement } from "react";
43
import { useDatagridRootScope } from "../helpers/root-context";
54

65
type SelectionCounterLocation = "top" | "bottom" | undefined;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type WidgetFooterProps = {
88
loadMoreButtonCaption?: string;
99
hasMoreItems: boolean;
1010
setPage?: (computePage: (prevPage: number) => number) => void;
11-
} & JSX.IntrinsicElements["div"];
11+
} & React.JSX.IntrinsicElements["div"];
1212

1313
export function WidgetFooter(props: WidgetFooterProps): ReactElement | null {
1414
const { pagination, selectionCount, paginationType, loadMoreButtonCaption, hasMoreItems, setPage, ...rest } = props;

packages/pluggableWidgets/gallery-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.6.1] - 2025-10-14
1014

1115
### Fixed

packages/pluggableWidgets/gallery-web/src/Gallery.editorConfig.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export function getProperties(values: GalleryPreviewProps, defaultProperties: Pr
1919
}
2020

2121
if (values.itemSelection !== "Multi") {
22-
hidePropertiesIn(defaultProperties, values, ["keepSelection"]);
22+
hidePropertiesIn(defaultProperties, values, [
23+
"keepSelection",
24+
"selectionCountPosition",
25+
"clearSelectionButtonLabel"
26+
]);
2327
}
2428

2529
const usePersonalization = values.storeFilters || values.storeSort;

packages/pluggableWidgets/gallery-web/src/Gallery.editorPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function Preview(props: GalleryPreviewProps): ReactElement {
6464
);
6565

6666
return (
67-
<div ref={containerRef}>
67+
<div ref={containerRef as React.RefObject<HTMLDivElement>}>
6868
<GalleryComponent
6969
className={props.class}
7070
desktopItems={props.desktopItems!}

packages/pluggableWidgets/gallery-web/src/Gallery.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const Container = observer(function GalleryContainer(props: GalleryContainerProp
9292
getPosition={getPositionCallback}
9393
loadMoreButtonCaption={props.loadMoreButtonCaption?.value}
9494
showRefreshIndicator={rootStore.loaderCtrl.showRefreshIndicator}
95+
selectionCountPosition={props.selectionCountPosition}
9596
/>
9697
);
9798
});

packages/pluggableWidgets/gallery-web/src/Gallery.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@
3737
<caption>Keep selection</caption>
3838
<description>If enabled, selected items will stay selected unless cleared by the user or a Nanoflow.</description>
3939
</property>
40+
<property key="selectionCountPosition" type="enumeration" defaultValue="bottom" required="true">
41+
<caption>Show selection count</caption>
42+
<description />
43+
<enumerationValues>
44+
<enumerationValue key="top">Top</enumerationValue>
45+
<enumerationValue key="bottom">Bottom</enumerationValue>
46+
<enumerationValue key="off">Off</enumerationValue>
47+
</enumerationValues>
48+
</property>
49+
<property key="clearSelectionButtonLabel" type="textTemplate" required="false">
50+
<caption>Clear selection label</caption>
51+
<description>Customize the label of the 'Clear section' button</description>
52+
<translations>
53+
<translation lang="en_US">Clear selection</translation>
54+
</translations>
55+
</property>
4056
<property key="content" type="widgets" dataSource="datasource" required="false">
4157
<caption>Content placeholder</caption>
4258
<description />

0 commit comments

Comments
 (0)