11<template >
2- <main class =" container" >
3- <div class =" vue-flow-container" >
4- <div class =" vue-flow-header" >
5- <div class =" header-section" @click =" () => console.log('Models clicked')" >Models</div >
6- <div class =" header-divider" />
7- <div class =" header-section" @click =" () => console.log('Enums clicked')" >Enums</div >
8- </div >
9-
10- <div class =" vue-flow-viewport" >
2+ <div class =" vue-flow-container" >
3+ <div class =" vue-flow-viewport" >
4+ <div class =" viewport-wrapper" >
115 <div class =" toggle-grid-button" @click =" showGrid = !showGrid" >#</div >
12-
136 <VueFlow
147 v-model:nodes =" projectStore.nodes"
158 v-model:edges =" projectStore.edges"
4639 />
4740 <button class =" create-model-btn" @click =" handleCreateClick" >Create</button >
4841 </div >
49-
5042 <div v-if =" !showInput" class =" create-circle" @click =" showInput = true" >+</div >
5143 </div >
5244
6456 </VueFlow >
6557 </div >
6658 </div >
67- </main >
59+ </div >
6860</template >
6961
7062<script setup lang="ts">
@@ -87,7 +79,7 @@ const modalStore = useModalStore()
8779
8880const modelName = ref (" " )
8981const showInput = ref (false )
90- const showGrid = ref (false )
82+ const showGrid = ref (true )
9183
9284const handleCreateClick = () => {
9385 if (modelName .value .trim () === " " ) return
@@ -122,49 +114,20 @@ const openEditRelationModal = (id: string, relation: RelationalRelationField) =>
122114 </script >
123115
124116<style scoped>
125- .container {
126- width : 100% ;
127- height : 100% ;
128- }
129-
130117.vue-flow-container {
131- width : 1000px ;
132- height : 500px ;
133- background-color : #ffffff ;
134- border : 2px solid black ;
135- }
136-
137- .vue-flow-header {
138- height : 40px ;
118+ height : 100% ;
139119 display : flex ;
140- align-items : center ;
141- background-color : var (--color-primary );
142- width : 100% ;
143- border-bottom : 2px solid black ;
144- box-sizing : border-box ;
145120}
146121
147- .header-section {
122+ .vue-flow-viewport {
123+ position : relative ;
148124 flex : 1 ;
149- text-align : center ;
150- cursor : pointer ;
151- font-weight : bold ;
152125 display : flex ;
153- align-items : center ;
154- justify-content : center ;
155- height : 100% ;
156126}
157127
158- .header-divider {
159- width : 2px ;
160- height : 100% ;
161- background-color : black ;
162- }
163-
164- .vue-flow-viewport {
165- position : relative ;
128+ .viewport-wrapper {
166129 width : 100% ;
167- height : calc ( 100% - 42 px ) ;
130+ height : 100% ;
168131}
169132
170133.toggle-grid-button {
@@ -181,9 +144,6 @@ const openEditRelationModal = (id: string, relation: RelationalRelationField) =>
181144 cursor : pointer ;
182145 z-index : 10 ;
183146 box-shadow : 2px 2px 0px rgba (0 , 0 , 0 , 1 );
184- transition :
185- transform 0.1s ease-out ,
186- box-shadow 0.1s ;
187147}
188148
189149.toggle-grid-button :hover {
@@ -215,9 +175,6 @@ const openEditRelationModal = (id: string, relation: RelationalRelationField) =>
215175 font-weight : bold ;
216176 z-index : 10 ;
217177 box-shadow : 2px 2px 0px rgba (0 , 0 , 0 , 1 );
218- transition :
219- transform 0.1s ease-out ,
220- box-shadow 0.1s ;
221178}
222179
223180.create-circle :hover {
@@ -270,9 +227,21 @@ const openEditRelationModal = (id: string, relation: RelationalRelationField) =>
270227 border-radius : 6px ;
271228 cursor : pointer ;
272229 font-weight : bold ;
230+ background-color : var (--color-secondary );
231+ margin-right : 5px ;
273232}
274233
275234.create-model-btn :hover {
276235 background-color : var (--color-success );
277236}
237+
238+ .enums-view {
239+ width : 100% ;
240+ height : 100% ;
241+ display : flex ;
242+ justify-content : center ;
243+ align-items : center ;
244+ font-size : 24px ;
245+ font-weight : bold ;
246+ }
278247 </style >
0 commit comments