diff --git a/packages/ui-vue/components/section/src/section.component.tsx b/packages/ui-vue/components/section/src/section.component.tsx index b1df3be..d292c9a 100644 --- a/packages/ui-vue/components/section/src/section.component.tsx +++ b/packages/ui-vue/components/section/src/section.component.tsx @@ -1,16 +1,92 @@ -import { defineComponent, SetupContext } from "vue"; -import { SectionProps, sectionProps } from "./section.props"; +import { computed, defineComponent, ref, SetupContext } from 'vue'; +import { ButtonConfig, SectionProps, sectionProps } from './section.props'; export default defineComponent({ - name:'FSection', - props:sectionProps, - emits:[], - setup(props:SectionProps, context:SetupContext) { - - return ()=>{ - return ( + name: 'FSection', + props: sectionProps, + emits: [], + setup(props: SectionProps, context: SetupContext) { + const shouldShowHeader = computed(() => { + return true; + }); - ) + const shouldShowToolbarInHeader = computed(() => { + return false; + }); + + const shouldShowToolbarInContent = computed(() => { + return false; + }); + + const shouldShowToolbarTemplateInContent = computed(() => { + return false; + }); + + const shouldShowExtendArea = computed(() => { + return false; + }); + + const toolbarButtons = ref([]); + + const headerClass = computed(() => ({})); + + const extendAreaClass = computed(() => ({})); + + const contentClass = computed(() => ({ + 'f-section-content': true, + })); + + function getToolbarState() { + return true; } + + return () => { + return ( + <> + {shouldShowHeader.value && ( +
+ {shouldShowToolbarInHeader.value && ( +
+ {toolbarButtons.value + .filter((toolButton: ButtonConfig) => getToolbarState(toolButton.id, btnVisible, true)) + .forEach((toolButton: ButtonConfig) => { + return ; + })} +
+ )} +
+ )} + {shouldShowToolbarInContent.value && ( +
+ {toolbarButtons.value + .filter((toolButton: ButtonConfig) => getToolbarState(toolButton.id, btnVisible, true)) + .forEach((toolButton: ButtonConfig) => { + return ; + })} +
+ )} + {shouldShowExtendArea.value && ( +
+ {context.slots.extend && context.slots.extend()} +
+ )} + +
+ {shouldShowToolbarTemplateInContent.value && ( +
+ {context.slots.toolbarButtons && + context.slots.toolbarButtons({ + datas: toolbarBtns, + dpHidden: toolbarDpHidden, + dpDatas: inMoreButtonContents, + })} +
+ )} + + {context.slots.default && context.slots.default()} +
+ + ); + }; }, -}) +});