2023-02-09 14:07:27 +00:00
|
|
|
import { ref } from 'vue';
|
|
|
|
import { defineStore } from 'pinia';
|
|
|
|
|
|
|
|
export const useStateStore = defineStore('stateStore', () => {
|
|
|
|
const isMounted = ref(false);
|
|
|
|
const leftDrawer = ref(false);
|
|
|
|
const rightDrawer = ref(false);
|
2024-01-03 08:59:27 +00:00
|
|
|
const subToolbar = ref(false);
|
2023-02-09 14:07:27 +00:00
|
|
|
|
|
|
|
function toggleLeftDrawer() {
|
|
|
|
leftDrawer.value = !leftDrawer.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleRightDrawer() {
|
|
|
|
rightDrawer.value = !rightDrawer.value;
|
|
|
|
}
|
|
|
|
|
2024-01-03 08:59:27 +00:00
|
|
|
function toggleSubToolbar() {
|
|
|
|
subToolbar.value = !subToolbar.value;
|
|
|
|
}
|
|
|
|
|
2023-02-09 14:07:27 +00:00
|
|
|
function setMounted() {
|
|
|
|
isMounted.value = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isHeaderMounted() {
|
|
|
|
return isMounted.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isLeftDrawerShown() {
|
|
|
|
return leftDrawer.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isRightDrawerShown() {
|
|
|
|
return rightDrawer.value;
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:04:16 +00:00
|
|
|
function isSubToolbarShown() {
|
2024-01-03 08:59:27 +00:00
|
|
|
return subToolbar.value;
|
2023-08-16 13:04:16 +00:00
|
|
|
}
|
|
|
|
|
2023-02-09 14:07:27 +00:00
|
|
|
return {
|
|
|
|
leftDrawer,
|
|
|
|
rightDrawer,
|
|
|
|
setMounted,
|
|
|
|
isHeaderMounted,
|
|
|
|
toggleLeftDrawer,
|
|
|
|
toggleRightDrawer,
|
|
|
|
isLeftDrawerShown,
|
|
|
|
isRightDrawerShown,
|
2023-08-16 13:04:16 +00:00
|
|
|
isSubToolbarShown,
|
2024-01-03 08:59:27 +00:00
|
|
|
toggleSubToolbar,
|
2023-02-09 14:07:27 +00:00
|
|
|
};
|
|
|
|
});
|