2023-05-19 10:33:07 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
2023-09-26 09:14:27 +00:00
|
|
|
@layer primevue {
|
2023-09-25 19:11:55 +00:00
|
|
|
.p-panel-header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panel-title {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panel-header-icon {
|
|
|
|
display: inline-flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
|
|
text-decoration: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
}
|
2023-05-19 10:33:07 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-panel p-component',
|
|
|
|
{
|
|
|
|
'p-panel-toggleable': props.toggleable
|
|
|
|
}
|
|
|
|
],
|
|
|
|
header: 'p-panel-header',
|
|
|
|
title: 'p-panel-title',
|
|
|
|
icons: 'p-panel-icons',
|
|
|
|
toggler: 'p-panel-header-icon p-panel-toggler p-link',
|
|
|
|
toggleablecontent: 'p-toggleable-content',
|
|
|
|
content: 'p-panel-content',
|
|
|
|
footer: 'p-panel-footer'
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:20:35 +00:00
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'panel', manual: true });
|
2023-05-19 10:33:07 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BasePanel',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
header: String,
|
|
|
|
toggleable: Boolean,
|
|
|
|
collapsed: Boolean,
|
|
|
|
toggleButtonProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-05-19 11:19:50 +00:00
|
|
|
css: {
|
2023-05-30 09:59:17 +00:00
|
|
|
classes,
|
|
|
|
loadStyle
|
2023-05-19 10:33:07 +00:00
|
|
|
},
|
2023-05-30 09:59:17 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-19 10:33:07 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|