Skip to content

Commit 09af98c

Browse files
committed
Merge branch 'main' into feat/sl-resize-cb
2 parents 1404779 + e353960 commit 09af98c

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed
59 KB
Loading

docs/knowledge-base/FAQ.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Meta } from '@storybook/addon-docs';
22
import { Footer, TableOfContent } from '@sb/components';
33
import { MessageStrip } from '@ui5/webcomponents-react';
4+
import SbTagFilter from '@sb/images/sb-pkg-filter.png';
45

56
<Meta title="FAQ" />
67

@@ -86,9 +87,13 @@ Each component developed by the UI5 Web Components team ([`ui5-webcomponents`](h
8687

8788
If a component does not have this note, it is a React-only component provided exclusively by `ui5-webcomponents-react`.
8889

89-
## Scoping
90+
Additionally, Storybook supports filtering by tags, allowing you to filter by different `ui5-webcomponents` packages as well:
9091

91-
Starting from UI5 Web Components (for React) 2.0.0, the order if imports with regards to scoping and components matters.
92+
<img src={SbTagFilter} alt="Storybook Tag Filter" height={320} />
93+
94+
## Why isn't scoping working?
95+
96+
Starting from UI5 Web Components (for React) 2.0.0, the order of imports with regard to scoping and components matters.
9297
Setting the scoping suffix must be done before importing any components, as they use the suffix at the top-level of the module - meaning when a component is imported, the suffix has to be known.
9398
For this to work, calling the method should be done in a separate module (e.g. scoping-config.js) and this module should be imported before any components are imported.
9499
You can find more information about this in the [UI5 Web Components documentation](https://sap.github.io/ui5-webcomponents/docs/advanced/scoping/).

packages/main/src/components/ObjectPageTitle/ObjectPageTitle.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
}
9999

100100
.contentContainer {
101-
flex-basis: 100%;
102-
flex-grow: 1;
101+
flex: 1 1 0;
102+
min-width: 0;
103103
}
104104

105105
.content {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const SplitterElement = forwardRef<HTMLDivElement, SplitterElementPropTypes>((pr
4949
const [componentRef, splitterElementRef] = useSyncRef(ref);
5050
const { vertical, reset } = useContext(SplitterLayoutContext);
5151
const safariStyles = Device.isSafari() ? { width: 'min-content', flex: '1 1 auto' } : {};
52-
const defaultFlexStyles = size !== 'auto' ? { flex: `0 1 ${size}` } : { flex: '1 0 min-content', ...safariStyles };
52+
const _size = typeof size === 'number' ? `${size}px` : size;
53+
const defaultFlexStyles = _size !== 'auto' ? { flex: `0 1 ${_size}` } : { flex: '1 0 min-content', ...safariStyles };
5354
const [flexStyles, setFlexStyles] = useState(defaultFlexStyles);
5455
const [flexBasisApplied, setFlexBasisApplied] = useState(false);
5556

@@ -67,23 +68,23 @@ const SplitterElement = forwardRef<HTMLDivElement, SplitterElementPropTypes>((pr
6768
}
6869
});
6970

70-
if (size === 'auto' && splitterElementRef.current) {
71+
if (_size === 'auto' && splitterElementRef.current) {
7172
elementObserver.observe(splitterElementRef.current);
7273
} else {
73-
setFlexStyles({ flex: `0 1 ${size}` });
74+
setFlexStyles({ flex: `0 1 ${_size}` });
7475
}
7576

7677
return () => {
7778
elementObserver.disconnect();
7879
};
79-
}, [size, flexBasisApplied, vertical]);
80+
}, [_size, flexBasisApplied, vertical]);
8081

8182
useIsomorphicLayoutEffect(() => {
8283
if (reset) {
8384
setFlexStyles(undefined);
8485
setFlexBasisApplied(false);
8586
}
86-
}, [reset, size]);
87+
}, [reset, _size]);
8788

8889
useIsomorphicLayoutEffect(() => {
8990
if (flexStyles === undefined) {

packages/main/src/components/SplitterLayout/SplitterLayout.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('SplitterLayout', () => {
9797
Button 1
9898
</Button>
9999
</SplitterElement>
100-
<SplitterElement minSize={300} size={'400px'} data-testid={'se2'}>
100+
<SplitterElement minSize={300} size={400} data-testid={'se2'}>
101101
<Button>Button 2</Button>
102102
</SplitterElement>
103103
<SplitterElement resizable={false} data-testid={'se3'}>

packages/main/src/components/SplitterLayout/useConcatSplitterElements.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ export const useConcatSplitterElements = (concatSplitterElements: ConcatSplitter
6161

6262
indicesWithSplitter.forEach((index) => {
6363
const size = childrenArray[index]?.props?.size;
64+
const _size = typeof size === 'number' ? `${size}px` : size;
6465
if (size && size !== 'auto') {
6566
childrenArray[index] = cloneElement(childrenArray[index], {
66-
size: `calc(${size} - var(--_ui5wcr-SplitterSize))`,
67+
size: `calc(${_size} - var(--_ui5wcr-SplitterSize))`,
6768
});
6869
}
6970
});

patterns/navigation-layout/src/UserSettingsDialog/MobileItem.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export function MobileItem() {
1515

1616
const handleSelectionChange: UserSettingsItemPropTypes['onSelectionChange'] = () => {
1717
setSelectedView('primary');
18-
// doesn't work - issue created
19-
// setSelectedView(e.detail.view.dataset.view!);
2018
};
2119

2220
return (

0 commit comments

Comments
 (0)