-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add auto close to navigation-item inside header and main-naviga…
…tion (#2344)
- Loading branch information
Showing
7 changed files
with
82 additions
and
11 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
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 |
---|---|---|
|
@@ -89,4 +89,12 @@ | |
} | ||
} | ||
} | ||
|
||
&[data-force-close="true"] { | ||
& > menu menu { | ||
@include screen-sizes.screen("md") { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
16 changes: 13 additions & 3 deletions
16
packages/components/src/components/main-navigation/model.ts
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 |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import { GlobalProps, GlobalState } from '../../shared/model'; | ||
import { | ||
GlobalProps, | ||
GlobalState, | ||
InitializedState, | ||
NavigationBehaviourState | ||
} from '../../shared/model'; | ||
|
||
export interface DBMainNavigationDefaultProps {} | ||
|
||
export type DBMainNavigationProps = DBMainNavigationDefaultProps & GlobalProps; | ||
|
||
export interface DBMainNavigationDefaultState {} | ||
export interface DBMainNavigationDefaultState { | ||
forceClose: boolean; | ||
} | ||
|
||
export type DBMainNavigationState = DBMainNavigationDefaultState & GlobalState; | ||
export type DBMainNavigationState = DBMainNavigationDefaultState & | ||
InitializedState & | ||
GlobalState & | ||
NavigationBehaviourState; |
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,11 @@ | ||
export const isEventTargetNavigationItem = (event: unknown): boolean => { | ||
const { target } = event as { target: HTMLElement }; | ||
return Boolean( | ||
!target?.classList?.contains('db-navigation-item-expand-button') && | ||
target?.parentElement?.classList.contains('db-navigation-item') | ||
); | ||
}; | ||
|
||
export default { | ||
isEventTargetNavigationItem | ||
}; |