2023-05-19 10:44:25 +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-fieldset-legend > a,
|
|
|
|
.p-fieldset-legend > span {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-toggleable .p-fieldset-legend a {
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fieldset-legend-text {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
2023-05-19 10:44:25 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-fieldset p-component',
|
|
|
|
{
|
|
|
|
'p-fieldset-toggleable': props.toggleable
|
|
|
|
}
|
|
|
|
],
|
|
|
|
legend: 'p-fieldset-legend',
|
|
|
|
legendtitle: 'p-fieldset-legend-text',
|
|
|
|
togglericon: 'p-fieldset-toggler',
|
|
|
|
legendtitle: 'p-fieldset-legend-text',
|
|
|
|
toggleablecontent: 'p-toggleable-content',
|
|
|
|
content: 'p-fieldset-content'
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:20:35 +00:00
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'fieldset', manual: true });
|
2023-05-19 10:44:25 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseFieldset',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
legend: String,
|
|
|
|
toggleable: Boolean,
|
|
|
|
collapsed: Boolean,
|
|
|
|
toggleButtonProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-05-19 11:19:50 +00:00
|
|
|
css: {
|
2023-05-30 11:03:42 +00:00
|
|
|
classes,
|
|
|
|
loadStyle
|
2023-05-19 10:44:25 +00:00
|
|
|
},
|
2023-05-30 11:03:42 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-19 10:44:25 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|