Skip to content

Commit 362fb9b

Browse files
committed
fix(FilterGroupItem): don't display undefined if label prop isn't set, expand filters to all available width in dialog, fix filterContainerWidth prop
1 parent 44bedf8 commit 362fb9b

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

packages/main/src/components/FilterBar/FilterBar.jss.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const styles = {
99
background: ThemingParameters.sapObjectHeader_Background,
1010
boxShadow: ThemingParameters.sapContent_HeaderShadow
1111
},
12+
filterItemExpand: {
13+
'--_ui5_input_width': '100%'
14+
},
1215
filterBarHeader: {
1316
alignItems: 'center',
1417
display: 'flex',

packages/main/src/components/FilterBar/FilterBarDialog.jss.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const styles = {
88
flexDirection: 'column',
99
maxWidth: '960px',
1010
width: '80vw',
11-
maxHeight: '70vh'
11+
maxHeight: '70vh',
12+
'--_ui5_input_width': '100%'
1213
},
1314
header: {
1415
width: '100%',

packages/main/src/components/FilterBar/demo.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const renderDefaultStory = (props) => {
2424
filterBarExpanded={props.filterBarExpanded}
2525
loading={props.loading}
2626
considerGroupName={props.considerGroupName}
27-
filterContainerWidth={props.auto}
27+
filterContainerWidth={props.filterContainerWidth}
2828
activeFiltersCount={props.activeFiltersCount}
2929
showClearOnFB={props.showClearOnFB}
3030
showRestoreOnFB={props.showRestoreOnFB}
@@ -116,7 +116,7 @@ export default {
116116
useToolbar: true,
117117
filterBarExpanded: true,
118118
considerGroupName: false,
119-
filterContainerWidth: '13rem',
119+
filterContainerWidth: '13.125rem',
120120
activeFiltersCount: 0,
121121
showClearOnFB: false,
122122
showRestoreOnFB: false,

packages/main/src/components/FilterBar/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ const FilterBar: FC<FilterBarPropTypes> = forwardRef((props: FilterBarPropTypes,
306306
if (className) {
307307
cssClasses.put(className);
308308
}
309+
if (filterContainerWidth) {
310+
cssClasses.put(classes.filterItemExpand);
311+
}
309312

310313
useEffect(() => {
311314
prevSearchInputPropsValueRef.current = search?.props?.value;

packages/main/src/components/FilterBar/utils.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ export const filterValue = (ref, child) => {
55
let filterItemProps = {};
66
if (
77
tagName === 'UI5-INPUT' ||
8-
tagName === 'UI5-DATEPICKER' ||
8+
tagName === 'UI5-DATE-PICKER' ||
99
tagName === 'UI5-DATETIME-PICKER' ||
10+
tagName === 'UI5-DATERANGE-PICKER' ||
11+
tagName === 'UI5-TIME-PICKER' ||
1012
tagName === 'UI5-DURATION-PICKER'
1113
) {
1214
filterItemProps = { value: ref.value };

packages/main/src/components/FilterGroupItem/FilterGroupItem.jss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const styles = {
22
filterItem: {
3-
width: '13rem',
3+
width: 'var(--_ui5_input_width)',
44
marginRight: '1rem',
55
marginBottom: '1rem'
66
},

packages/main/src/components/FilterGroupItem/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,6 @@ FilterGroupItem.defaultProps = {
8787
groupName: 'default',
8888
visible: true,
8989
visibleInFilterBar: true,
90-
required: false
90+
required: false,
91+
label: ''
9192
};

0 commit comments

Comments
 (0)