mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
import { defineStore } from 'pinia' |
|
|
|
export const useSidebarStore = defineStore('sidebarStore', () => { |
|
const isLeftSidebarOpen = ref(true) |
|
const isRightSidebarOpen = ref(true) |
|
const leftSidebarWidthPercent = ref(20) |
|
|
|
const leftSideBarSize = ref({ |
|
old: leftSidebarWidthPercent.value, |
|
current: leftSidebarWidthPercent.value, |
|
}) |
|
|
|
const rightSidebarSize = ref({ |
|
old: 17.5, |
|
current: 17.5, |
|
}) |
|
|
|
const leftSidebarState = ref< |
|
'openStart' | 'openEnd' | 'hiddenStart' | 'hiddenEnd' | 'peekOpenStart' | 'peekOpenEnd' | 'peekCloseOpen' | 'peekCloseEnd' |
|
>(isLeftSidebarOpen.value ? 'openEnd' : 'hiddenEnd') |
|
|
|
const rightSidebarState = ref< |
|
'openStart' | 'openEnd' | 'hiddenStart' | 'hiddenEnd' | 'peekOpenStart' | 'peekOpenEnd' | 'peekCloseOpen' | 'peekCloseEnd' |
|
>(isRightSidebarOpen.value ? 'openEnd' : 'hiddenEnd') |
|
|
|
return { |
|
isLeftSidebarOpen, |
|
isRightSidebarOpen, |
|
rightSidebarSize, |
|
leftSidebarWidthPercent, |
|
leftSideBarSize, |
|
leftSidebarState, |
|
rightSidebarState, |
|
} |
|
})
|
|
|