primevue-mirror/components/lib/tieredmenu/style/TieredMenuStyle.js

168 lines
4.6 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-tieredmenu {
background: ${dt('tieredmenu.background')};
color: ${dt('tieredmenu.color')};
border: 1px solid ${dt('tieredmenu.border.color')};
2024-05-10 08:05:59 +00:00
border-radius: ${dt('tieredmenu.border.radius')};
min-width: 12.5rem;
}
.p-tieredmenu-root-list,
.p-tieredmenu-submenu {
margin: 0;
2024-05-10 08:05:59 +00:00
padding: ${dt('tieredmenu.list.padding')};
list-style: none;
outline: 0 none;
2024-05-10 08:05:59 +00:00
display: flex;
flex-direction: column;
gap: ${dt('tieredmenu.list.gap')};
}
.p-tieredmenu-submenu {
position: absolute;
min-width: 100%;
z-index: 1;
background: ${dt('tieredmenu.background')};
color: ${dt('tieredmenu.color')};
border: 1px solid ${dt('tieredmenu.border.color')};
2024-05-10 08:05:59 +00:00
border-radius: ${dt('tieredmenu.border.radius')};
box-shadow: ${dt('tieredmenu.shadow')};
}
2024-05-10 08:35:14 +00:00
.p-tieredmenu-item {
position: relative;
}
.p-tieredmenu-item-content {
2024-05-10 08:05:59 +00:00
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')};
border-radius: ${dt('tieredmenu.item.border.radius')};
color: ${dt('tieredmenu.item.color')};
}
.p-tieredmenu-item-link {
cursor: pointer;
display: flex;
align-items: center;
text-decoration: none;
overflow: hidden;
position: relative;
color: inherit;
2024-05-10 08:05:59 +00:00
padding: ${dt('tieredmenu.item.padding')};
gap: ${dt('tieredmenu.item.gap')};
user-select: none;
2024-05-10 08:05:59 +00:00
outline: 0 none;
}
.p-tieredmenu-item-label {
line-height: 1;
}
.p-tieredmenu-item-icon {
color: ${dt('tieredmenu.item.icon.color')};
}
.p-tieredmenu-submenu-icon {
2024-05-10 08:05:59 +00:00
color: ${dt('tieredmenu.submenu.icon.color')};
margin-left: auto;
2024-05-10 08:05:59 +00:00
font-size: ${dt('tieredmenu.submenu.icon.size')};
width: ${dt('tieredmenu.submenu.icon.size')};
height: ${dt('tieredmenu.submenu.icon.size')};
}
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content {
2024-05-05 15:51:29 +00:00
color: ${dt('tieredmenu.item.focus.color')};
background: ${dt('tieredmenu.item.focus.background')};
}
2024-05-10 08:05:59 +00:00
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-item-icon {
color: ${dt('tieredmenu.item.icon.focus.color')};
}
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {
2024-05-10 08:05:59 +00:00
color: ${dt('tieredmenu.submenu.icon.focus.color')};
}
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover {
2024-05-05 15:51:29 +00:00
color: ${dt('tieredmenu.item.focus.color')};
background: ${dt('tieredmenu.item.focus.background')};
}
2024-05-10 08:05:59 +00:00
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-item-icon {
color: ${dt('tieredmenu.item.icon.focus.color')};
}
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-submenu-icon {
2024-05-10 08:05:59 +00:00
color: ${dt('tieredmenu.submenu.icon.focus.color')};
}
.p-tieredmenu-item-active > .p-tieredmenu-item-content {
2024-05-10 08:05:59 +00:00
color: ${dt('tieredmenu.item.active.color')};
background: ${dt('tieredmenu.item.active.background')};
}
.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-item-icon {
color: ${dt('tieredmenu.item.icon.active.color')};
}
.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {
2024-05-10 08:05:59 +00:00
color: ${dt('tieredmenu.item.icon.active.color')};
}
.p-tieredmenu-separator {
border-top: 1px solid ${dt('tieredmenu.separator.border.color')};
}
.p-tieredmenu-overlay {
2024-05-10 08:05:59 +00:00
box-shadow: ${dt('tieredmenu.shadow')};
}
.p-tieredmenu-enter-from,
.p-tieredmenu-leave-active {
opacity: 0;
}
.p-tieredmenu-enter-active {
transition: opacity 250ms;
}
`;
const inlineStyles = {
2024-05-10 08:57:09 +00:00
submenu: ({ instance, processedItem }) => ({ display: instance.isItemActive(processedItem) ? 'flex' : 'none' })
};
const classes = {
root: ({ instance, props }) => [
'p-tieredmenu p-component',
{
'p-tieredmenu-overlay': props.popup
}
],
start: 'p-tieredmenu-start',
rootList: 'p-tieredmenu-root-list',
item: ({ instance, processedItem }) => [
2024-04-09 13:11:24 +00:00
'p-tieredmenu-item',
{
2024-04-09 13:11:24 +00:00
'p-tieredmenu-item-active': instance.isItemActive(processedItem),
'p-focus': instance.isItemFocused(processedItem),
'p-disabled': instance.isItemDisabled(processedItem)
}
],
itemContent: 'p-tieredmenu-item-content',
itemLink: 'p-tieredmenu-item-link',
itemIcon: 'p-tieredmenu-item-icon',
itemLabel: 'p-tieredmenu-item-label',
2024-04-09 13:11:24 +00:00
submenuIcon: 'p-tieredmenu-submenu-icon',
2024-04-09 13:43:12 +00:00
submenu: 'p-tieredmenu-submenu',
2024-04-09 13:11:24 +00:00
separator: 'p-tieredmenu-separator',
end: 'p-tieredmenu-end'
};
export default BaseStyle.extend({
name: 'tieredmenu',
theme,
classes,
inlineStyles
});