forked from jmix-framework/jmix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Horizontal menu component jmix-framework#2492
- Loading branch information
1 parent
9b89310
commit afbbfe1
Showing
20 changed files
with
1,620 additions
and
8 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
5 changes: 5 additions & 0 deletions
5
...src/main/resources/io/jmix/flowui/kit/meta/icon/component/navigationMenuBar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...ain/resources/io/jmix/flowui/kit/meta/icon/component/navigationMenuBar_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions
54
...main/resources/META-INF/resources/themes/jmix-lumo/component/jmix-navigation-menu-bar.css
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,54 @@ | ||
/* | ||
* Copyright 2023 Haulmont. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
.jmix-navigation-menu-bar { | ||
color: var(--lumo-secondary-text-color); | ||
} | ||
|
||
.jmix-navigation-menu-bar-root-item:hover { | ||
color: var(--lumo-contrast-80pct); | ||
} | ||
|
||
.jmix-navigation-menu-bar vaadin-menu-bar-button { | ||
color: inherit; | ||
background-color: transparent; | ||
border-radius: var(--lumo-border-radius-m); | ||
} | ||
|
||
.jmix-navigation-menu-bar vaadin-menu-bar-button[expanded] { | ||
background-color: var(--lumo-primary-color-10pct); | ||
} | ||
|
||
vaadin-menu-bar-item .jmix-navigation-menu-bar-menu-item, | ||
vaadin-menu-bar-list-box .jmix-navigation-menu-bar-menu-item { | ||
color: inherit; | ||
display: flex; | ||
cursor: pointer; | ||
width: 100%; | ||
} | ||
|
||
.jmix-navigation-menu-bar-menu-item:hover { | ||
text-decoration: none; | ||
} | ||
|
||
.jmix-navigation-menu-bar-item-icon-with-title { | ||
margin-right: var(--lumo-space-s); | ||
} | ||
|
||
.jmix-navigation-menu-bar-item-icon { | ||
width: var(--lumo-icon-size-s); | ||
height: var(--lumo-icon-size-s); | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...a/io/jmix/flowui/component/navigationmenubar/MenuConfigNavigationMenuBarItemProvider.java
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,51 @@ | ||
/* | ||
* Copyright 2023 Haulmont. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.jmix.flowui.component.navigationmenubar; | ||
|
||
import io.jmix.flowui.menu.MenuConfig; | ||
import io.jmix.flowui.menu.MenuItem; | ||
import io.jmix.flowui.menu.provider.MenuConfigMenuItemProvider; | ||
import org.springframework.beans.factory.config.BeanDefinition; | ||
import org.springframework.context.annotation.Scope; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
/** | ||
* Menu item provider for {@link io.jmix.flowui.component.navigationmenubar.NavigationMenuBar} | ||
*/ | ||
@Component("flowui_MenuConfigNavigationMenuBarItemProvider") | ||
@Scope(BeanDefinition.SCOPE_PROTOTYPE) | ||
public class MenuConfigNavigationMenuBarItemProvider | ||
extends MenuConfigMenuItemProvider<NavigationMenuBar.AbstractMenuItem<?>> { | ||
|
||
protected NavigationMenuBarItemConverter itemConverter; | ||
|
||
public MenuConfigNavigationMenuBarItemProvider(MenuConfig menuConfig, | ||
NavigationMenuBarItemConverter itemConverter) { | ||
super(menuConfig); | ||
this.itemConverter = itemConverter; | ||
} | ||
|
||
@Override | ||
protected List<NavigationMenuBar.AbstractMenuItem<?>> convertToMenuItems(Collection<MenuItem> menuConfigItems) { | ||
return menuConfigItems.stream() | ||
.flatMap(item -> itemConverter.createMenuItemWithChildren(item).stream()) | ||
.toList(); | ||
} | ||
} |
Oops, something went wrong.