-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tabs): Added
overflowButton
property (#1060)
Co-authored-by: Greta <[email protected]>
- Loading branch information
1 parent
5679f3c
commit 6183552
Showing
19 changed files
with
1,067 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@itwin/itwinui-react': minor | ||
'@itwin/itwinui-css': minor | ||
--- | ||
|
||
- Added data attribute 'data-iui-overflow' - when true it adds styling for overflow tabs | ||
- Added property 'overflowOptions' - contains `useOverflow`, which when true enables tabs to scroll if there's overflow | ||
|
||
```typescript | ||
<Tabs type='default' overflowButton={{ useOverflow: true }}> | ||
{tabs} | ||
</Tabs> | ||
``` |
Binary file added
BIN
+14.3 KB
...s-visual-screenshots/baseline/Tabs.test.ts-Horizontal Overflow (Scroll end).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...visual-screenshots/baseline/Tabs.test.ts-Horizontal Overflow (Scroll start).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...rybook/cypress-visual-screenshots/baseline/Tabs.test.ts-Horizontal Overflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
...torybook/cypress-visual-screenshots/baseline/Tabs.test.ts-Vertical Overflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import * as React from 'react'; | ||
import { Tabs, Tab } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
const [index, setIndex] = React.useState(0); | ||
const getContent = () => { | ||
switch (index) { | ||
case 0: | ||
return 'Bentley Systems, Incorporated, is an American-based software development company that develops, manufactures, licenses, sells and supports computer software and services for the design, construction, and operation of infrastructure.'; | ||
case 1: | ||
return "The company's software serves the building, plant, civil, and geospatial markets in the areas of architecture, engineering, construction (AEC) and operations."; | ||
case 2: | ||
return 'Their software products are used to design, engineer, build, and operate large constructed assets such as roadways, railways, bridges, buildings, industrial plants, power plants, and utility networks.'; | ||
case 3: | ||
return 'The company re-invests 20% of their revenues in research and development.'; | ||
case 4: | ||
return 'Bentley Systems is headquartered in Exton, Pennsylvania, United States, but has development, sales and other departments in over 50 countries.'; | ||
case 5: | ||
return 'The company had revenues of $700 million in 2018.'; | ||
case 6: | ||
return 'Keith A. Bentley and Barry J. Bentley founded Bentley Systems in 1984.'; | ||
default: | ||
return 'They introduced the commercial version of PseudoStation in 1985, which allowed users of Intergraphs VAX systems to use low-cost graphics terminals to view and modify the designs on their Intergraph IGDS (Interactive Graphics Design System) installations.'; | ||
} | ||
}; | ||
const labels = [ | ||
<Tab key={1} label='Bentley Overview' />, | ||
<Tab key={2} label='Markets' />, | ||
<Tab key={3} label='Uses' />, | ||
<Tab key={4} label='Reinvestment' />, | ||
<Tab key={5} label='Location' />, | ||
<Tab key={6} label='Revenue' />, | ||
<Tab key={7} label='Founders' />, | ||
<Tab key={8} label='History' />, | ||
]; | ||
|
||
return ( | ||
<div style={{ maxWidth: 425, border: '1px solid lightpink', padding: 8 }}> | ||
<Tabs | ||
labels={labels} | ||
overflowOptions={{ useOverflow: true }} | ||
onTabSelected={setIndex} | ||
activeIndex={index} | ||
> | ||
{getContent()} | ||
</Tabs> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+57.4 KB
...esults/bitmaps_reference/iTwinUI_tabs_Type_Overflow_dark_0_demo-overflow_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.9 KB
...lts/bitmaps_reference/iTwinUI_tabs_Type_Overflow_hc_dark_0_demo-overflow_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.3 KB
...ts/bitmaps_reference/iTwinUI_tabs_Type_Overflow_hc_light_0_demo-overflow_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.1 KB
...sults/bitmaps_reference/iTwinUI_tabs_Type_Overflow_light_0_demo-overflow_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.