2022-09-06 12:03:37 +00:00
|
|
|
<template>
|
2023-03-27 07:13:31 +00:00
|
|
|
<div ref="container" :class="containerClass" v-bind="ptm('root')">
|
2022-09-06 12:03:37 +00:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-03-31 21:51:41 +00:00
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-03-27 07:13:31 +00:00
|
|
|
|
2022-09-06 12:03:37 +00:00
|
|
|
export default {
|
|
|
|
name: 'SplitterPanel',
|
2023-03-31 21:51:41 +00:00
|
|
|
extends: BaseComponent,
|
2022-09-06 12:03:37 +00:00
|
|
|
props: {
|
|
|
|
size: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
minSize: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
containerClass() {
|
2022-09-14 11:26:01 +00:00
|
|
|
return ['p-splitter-panel', { 'p-splitter-panel-nested': this.isNested }];
|
2022-09-06 12:03:37 +00:00
|
|
|
},
|
|
|
|
isNested() {
|
2022-09-14 11:26:01 +00:00
|
|
|
return this.$slots.default().some((child) => {
|
2022-09-06 12:03:37 +00:00
|
|
|
return child.type.name === 'Splitter';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2022-09-14 11:26:01 +00:00
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
</script>
|