primevue-mirror/components/lib/panelmenu/style/PanelMenuStyle.js

186 lines
5.7 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-panelmenu {
display: flex;
flex-direction: column;
2024-05-11 12:42:19 +00:00
gap: ${dt('panelmenu.gap')};
}
.p-panelmenu-panel {
background: ${dt('panelmenu.panel.background')};
2024-05-11 12:42:19 +00:00
border-width: ${dt('panelmenu.panel.border.width')};
border-style: solid;
border-color: ${dt('panelmenu.panel.border.color')};
color: ${dt('panelmenu.panel.color')};
2024-05-11 12:42:19 +00:00
border-radius: ${dt('panelmenu.panel.border.radius')};
padding: ${dt('panelmenu.panel.padding')};
}
.p-panelmenu-panel:first-child {
border-width: ${dt('panelmenu.panel.first.border.width')};
border-top-left-radius: ${dt('panelmenu.panel.first.top.border.radius')};
border-top-right-radius: ${dt('panelmenu.panel.first.top.border.radius')};
}
.p-panelmenu-panel:last-child {
border-width: ${dt('panelmenu.panel.last.border.width')};
border-bottom-left-radius: ${dt('panelmenu.panel.last.bottom.border.radius')};
border-bottom-right-radius: ${dt('panelmenu.panel.last.bottom.border.radius')};
}
.p-panelmenu-header {
outline: 0 none;
}
.p-panelmenu-header-content {
2024-05-11 12:42:19 +00:00
border-radius: ${dt('panelmenu.item.border.radius')};
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
outline-color: transparent;
2024-05-11 12:42:19 +00:00
color: ${dt('panelmenu.item.color')};
}
.p-panelmenu-header-link {
display: flex;
2024-05-11 12:42:19 +00:00
gap: ${dt('panelmenu.item.gap')};
padding: ${dt('panelmenu.item.padding')};
align-items: center;
user-select: none;
cursor: pointer;
position: relative;
text-decoration: none;
color: inherit;
}
.p-panelmenu-header-icon,
2024-05-11 12:42:19 +00:00
.p-panelmenu-item-icon {
color: ${dt('panelmenu.item.icon.color')};
}
2024-05-11 12:42:19 +00:00
.p-panelmenu-submenu-icon {
color: ${dt('panelmenu.submenu.icon.color')};
}
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content {
2024-05-05 15:51:29 +00:00
background: ${dt('panelmenu.item.focus.background')};
color: ${dt('panelmenu.item.focus.color')};
}
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-header-icon {
2024-05-11 12:42:19 +00:00
color: ${dt('panelmenu.item.icon.focus.color')};
}
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-submenu-icon {
color: ${dt('panelmenu.submenu.icon.focus.color')};
}
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover {
2024-05-05 15:51:29 +00:00
background: ${dt('panelmenu.item.focus.background')};
color: ${dt('panelmenu.item.focus.color')};
}
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-header-icon {
2024-05-11 12:42:19 +00:00
color: ${dt('panelmenu.item.icon.focus.color')};
}
2024-05-11 12:42:19 +00:00
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-submenu-icon {
color: ${dt('panelmenu.submenu.icon.focus.color')};
}
.p-panelmenu-submenu {
2024-05-11 12:42:19 +00:00
margin: 0;
padding: 0 0 0 ${dt('panelmenu.submenu.indent')};
2024-05-02 10:56:41 +00:00
outline: 0;
list-style: none;
}
.p-panelmenu-item-link {
display: flex;
2024-05-11 12:42:19 +00:00
gap: ${dt('panelmenu.item.gap')};
padding: ${dt('panelmenu.item.padding')};
align-items: center;
user-select: none;
cursor: pointer;
text-decoration: none;
color: inherit;
position: relative;
overflow: hidden;
}
.p-panelmenu-item-label {
line-height: 1;
}
.p-panelmenu-item-content {
2024-05-11 12:42:19 +00:00
border-radius: ${dt('panelmenu.item.border.radius')};
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
color: ${dt('panelmenu.item.color')};
2024-05-11 12:42:19 +00:00
outline-color: transparent;
}
.p-panelmenu-item.p-focus > .p-panelmenu-item-content {
2024-05-05 15:51:29 +00:00
background: ${dt('panelmenu.item.focus.background')};
color: ${dt('panelmenu.item.focus.color')};
}
.p-panelmenu-item.p-focus > .p-panelmenu-item-icon {
2024-05-05 15:51:29 +00:00
color: ${dt('panelmenu.item.focus.color')};
}
2024-05-11 12:42:19 +00:00
.p-panelmenu-item.p-focus > .p-panelmenu-submenu-icon {
color: ${dt('panelmenu.submenu.icon.focus.color')};
}
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover {
2024-05-05 15:51:29 +00:00
background: ${dt('panelmenu.item.focus.background')};
color: ${dt('panelmenu.item.focus.color')};
}
2024-05-11 12:42:19 +00:00
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-item-icon {
color: ${dt('panelmenu.item.icon.focus.color')};
}
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-submenu-icon {
2024-05-11 12:42:19 +00:00
color: ${dt('panelmenu.submenu.icon.focus.color')};
}
`;
const classes = {
root: 'p-panelmenu p-component',
panel: 'p-panelmenu-panel',
header: ({ instance, item }) => [
'p-panelmenu-header',
{
2024-04-09 14:27:13 +00:00
'p-panelmenu-header-active': instance.isItemActive(item) && !!item.items,
'p-disabled': instance.isItemDisabled(item)
}
],
headerContent: 'p-panelmenu-header-content',
headerLink: 'p-panelmenu-header-link',
2024-04-09 14:27:13 +00:00
headerIcon: 'p-panelmenu-header-icon',
headerLabel: 'p-panelmenu-header-label',
contentContainer: 'p-panelmenu-content-container',
content: 'p-panelmenu-content',
rootList: 'p-panelmenu-root-list',
item: ({ instance, processedItem }) => [
2024-04-09 14:27:13 +00:00
'p-panelmenu-item',
{
'p-focus': instance.isItemFocused(processedItem),
'p-disabled': instance.isItemDisabled(processedItem)
}
],
itemContent: 'p-panelmenu-item-content',
itemLink: 'p-panelmenu-item-link',
itemIcon: 'p-panelmenu-item-icon',
2024-05-06 13:10:13 +00:00
itemLabel: 'p-panelmenu-item-label',
2024-04-09 14:27:13 +00:00
submenuIcon: 'p-panelmenu-submenu-icon',
submenu: 'p-panelmenu-submenu',
separator: 'p-menuitem-separator'
};
export default BaseStyle.extend({
name: 'panelmenu',
theme,
classes
});