2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-splitter {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
border: 1px solid ${dt('splitter.border.color')};
|
|
|
|
background: ${dt('splitter.background')};
|
2024-05-06 21:18:22 +00:00
|
|
|
border-radius: ${dt('border.radius.md')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('splitter.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-vertical {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-gutter {
|
|
|
|
flex-grow: 0;
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
z-index: 1;
|
|
|
|
background: ${dt('splitter.gutter.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-gutter-handle {
|
2024-05-11 13:34:02 +00:00
|
|
|
border-radius: ${dt('splitter.handle.border.radius')};
|
|
|
|
background: ${dt('splitter.handle.background')};
|
|
|
|
transition: outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-gutter-handle:focus-visible {
|
2024-05-11 13:34:02 +00:00
|
|
|
box-shadow: ${dt('splitter.handle.focus.ring.shadow')};
|
|
|
|
outline: ${dt('splitter.handle.focus.ring.width')} ${dt('splitter.handle.focus.ring.style')} ${dt('splitter.handle.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('splitter.handle.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-horizontal.p-splitter-resizing {
|
|
|
|
cursor: col-resize;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-vertical.p-splitter-resizing {
|
|
|
|
cursor: row-resize;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-horizontal > .p-splitter-gutter > .p-splitter-gutter-handle {
|
2024-05-11 13:34:02 +00:00
|
|
|
height: ${dt('splitter.handle.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle {
|
2024-05-11 13:34:02 +00:00
|
|
|
width: ${dt('splitter.handle.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-horizontal > .p-splitter-gutter {
|
|
|
|
cursor: col-resize;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-splitter-vertical > .p-splitter-gutter {
|
|
|
|
cursor: row-resize;
|
|
|
|
}
|
|
|
|
|
2024-05-21 07:15:51 +00:00
|
|
|
.p-splitterpanel {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
2024-05-21 07:15:51 +00:00
|
|
|
.p-splitterpanel-nested {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
2024-05-21 07:15:51 +00:00
|
|
|
.p-splitterpanel .p-splitter {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
border: 0 none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => ['p-splitter p-component', 'p-splitter-' + props.layout],
|
|
|
|
gutter: 'p-splitter-gutter',
|
2024-04-30 14:09:49 +00:00
|
|
|
gutterHandle: 'p-splitter-gutter-handle'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const inlineStyles = {
|
|
|
|
root: ({ props }) => [{ display: 'flex', 'flex-wrap': 'nowrap' }, props.layout === 'vertical' ? { 'flex-direction': 'column' } : '']
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'splitter',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|