-
Notifications
You must be signed in to change notification settings - Fork 14
feat: add navigation-item component #1167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e9dac0b
fe1852a
972f22b
664e122
ed691d0
9572995
7dd4f50
a3d0e47
55a7676
e70fed7
4af4f4a
98052ad
044117a
247851c
d3797a3
83075d6
626502c
6e59089
68ae20d
a9dceb1
8b9c2d6
68e8500
de9b4ba
e5fe031
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { DBNavigationItem, DBNavigationItemModule } from './navigation-item'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ## Angular | ||
|
|
||
| For general installation and configuration look at the [ngx-components](https://www.npmjs.com/package/@db-ui/ngx-components) package. | ||
|
|
||
| ### Load component | ||
|
|
||
| ```ts app.module.ts | ||
| //app.module.ts | ||
| import { DBNavigationItemModule } from '@db-ui/ngx-components'; | ||
|
|
||
| @NgModule({ | ||
| ... | ||
| imports: [..., DBNavigationItemModule], | ||
| ... | ||
| }) | ||
|
|
||
| ``` | ||
|
|
||
| ### Use component | ||
|
|
||
| ```html app.component.html | ||
| <!-- app.component.html --> | ||
| <a routerLink="mypath"> | ||
| <db-navigation-item>NavigationItem</db-navigation-item> | ||
| </a> | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ## HTML | ||
|
|
||
| For general installation and configuration look at the [components](https://www.npmjs.com/package/@db-ui/components) package. | ||
|
|
||
| ### Use component | ||
|
|
||
| ```html index.html | ||
| <!-- index.html --> | ||
| ... | ||
| <body> | ||
| <a href="mypath"> | ||
| <li aria-haspopup="false" class="db-navigation-item"> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| NavigationItem | ||
|
|
||
| <!-- If you want to use it as main-naivgation with pulse--> | ||
| <div class="active-indicator" /> | ||
|
Comment on lines
+15
to
+16
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should check whether we really need a block level element for this and cannot achieve it either via |
||
| </li> | ||
| </a> | ||
| </body> | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ## General | ||
|
|
||
| > **Note** | ||
| > For a general installation or migration process check out this [documentation](https://www.npmjs.com/package/@db-ui/components). | ||
|
|
||
| ## DB UI Core ➡ DB UI Components | ||
|
|
||
| New Component 🥳 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ## React | ||
|
|
||
| For general installation and configuration look at the [react-components](https://www.npmjs.com/package/@db-ui/react-components) package. | ||
|
|
||
| ### Use component | ||
|
|
||
| ```tsx App.tsx | ||
| // App.tsx | ||
| import { Link } from "react-router-dom"; | ||
| import { DBNavigationItem } from "@db-ui/react-components"; | ||
|
|
||
| const App = () => ( | ||
| <Link to="mypath"> | ||
| <DBNavigationItem>NavigationItem</DBNavigationItem> | ||
| </Link> | ||
| ); | ||
|
|
||
| export default App; | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ## Vue | ||
|
|
||
| For general installation and configuration look at the [v-components](https://www.npmjs.com/package/@db-ui/v-components) package. | ||
|
|
||
| ### Use component | ||
|
|
||
| ```vue App.vue | ||
| <!-- App.vue --> | ||
| <script> | ||
| import { DBNavigationItem } from "@db-ui/v-components"; | ||
| </script> | ||
|
|
||
| <template> | ||
| <router-link to="mypath"> | ||
| <DBNavigationItem>NavigationItem</DBNavigationItem> | ||
| </router-link> | ||
| </template> | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default as DBNavigationItem } from './navigation-item'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import { | ||
| ClickEventProps, | ||
| ClickEventState, | ||
| GlobalProps, | ||
| GlobalState, | ||
| IconAfterProps, | ||
| IconProps, | ||
| IconState, | ||
| InitializedState, | ||
| WidthProps | ||
| } from '../../shared/model'; | ||
|
|
||
| export interface DBNavigationItemDefaultProps { | ||
| /** | ||
| * Indicator for active navigation item (bold font). | ||
| */ | ||
| active?: boolean; | ||
|
|
||
| /** | ||
| * The disabled attribute can be set to [keep a user from clicking on the item](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled). | ||
| */ | ||
| disabled?: boolean; | ||
|
|
||
| /** | ||
| * React-specific property to pass in a slot for sub-navigation | ||
| */ | ||
|
|
||
| slotSubNavigation?: any; | ||
| } | ||
|
|
||
| export type DBNavigationItemProps = DBNavigationItemDefaultProps & | ||
| GlobalProps & | ||
| ClickEventProps & | ||
| IconProps & | ||
| IconAfterProps & | ||
| WidthProps; | ||
|
|
||
| export interface DBNavigationItemDefaultState { | ||
| hasAreaPopup: boolean; | ||
| subNavigationId: string; | ||
| hideSubNavigation?: boolean; | ||
| } | ||
|
|
||
| export type DBNavigationItemState = DBNavigationItemDefaultState & | ||
| ClickEventState & | ||
| GlobalState & | ||
| IconState & | ||
| InitializedState; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @forward "navigation-item"; |
Uh oh!
There was an error while loading. Please reload this page.