Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37560da

Browse files
committed
fix: fix failing e2e
1 parent 896e243 commit 37560da

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
@@ -75,11 +75,18 @@ $gallery-screen-md: $screen-md;
7575
}
7676

7777
.widget-gallery-filter,
78-
.widget-gallery-empty,
79-
.widget-gallery-pagination {
78+
.widget-gallery-empty {
8079
flex: 1;
8180
}
8281

82+
&-top-bar {
83+
container: widget-gallery-header / inline-size;
84+
}
85+
86+
&-footer {
87+
container: widget-gallery-footer / inline-size;
88+
}
89+
8390
/**
8491
Helper classes
8592
*/
@@ -91,20 +98,30 @@ $gallery-screen-md: $screen-md;
9198
width: inherit;
9299
}
93100

94-
:where(.widget-gallery-footer-controls) {
101+
:where(.widget-gallery-footer-controls, .widget-gallery-top-bar-controls) {
95102
display: flex;
96103
flex-flow: row nowrap;
104+
align-items: center;
97105
}
98106

99-
:where(.widget-gallery-fc-start) {
100-
margin-block: var(--spacing-medium);
101-
padding-inline: var(--spacing-medium);
107+
:where(.widget-gallery-fc-end, .widget-gallery-tb-end) {
108+
display: flex;
109+
justify-content: flex-end;
110+
align-items: center;
102111
}
103112

104-
:where(.widget-gallery-fc-start, .widget-gallery-fc-middle, .widget-gallery-fc-end) {
113+
:where(.widget-gallery-fc-start, .widget-gallery-tb-start, .widget-gallery-fc-end, .widget-gallery-tb-end) {
105114
flex-grow: 1;
106115
flex-basis: 33.33%;
107116
min-height: 20px;
117+
height: 54px;
118+
padding: var(--spacing-small) 0;
119+
}
120+
121+
:where(.widget-gallery-fc-start, .widget-gallery-tb-start) {
122+
padding-inline: var(--spacing-medium);
123+
display: flex;
124+
align-items: center;
108125
}
109126

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

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
### Fixed
1014

1115
- We fixed an issue where setting the gallery gap to 0 caused an offset, which made the bottom border of items to dissapear.

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)