mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-03 02:52:28 +00:00
feat: locations tree viewer (#248)
* location tree API * test fixes * initial tree location elements * locations tree page * update meta-data * code-gen * store item display preferences * introduce basic table/card view elements * codegen * set parent location during location creation * add item support for tree query * refactor tree view * wip: location selector improvements * type gen * rename items -> search * remove various log statements * fix markdown rendering for description * update location selectors * fix tests * fix currency tests * formatting
This commit is contained in:
parent
4d220cdd9c
commit
3d295b5132
33 changed files with 1119 additions and 79 deletions
17
frontend/components/Location/Tree/tree-state.ts
Normal file
17
frontend/components/Location/Tree/tree-state.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import type { Ref } from "vue";
|
||||
|
||||
type TreeState = Record<string, boolean>;
|
||||
|
||||
const store: Record<string, Ref<TreeState>> = {};
|
||||
|
||||
export function newTreeKey(): string {
|
||||
return Math.random().toString(36).substring(2);
|
||||
}
|
||||
|
||||
export function useTreeState(key: string): Ref<TreeState> {
|
||||
if (!store[key]) {
|
||||
store[key] = ref({});
|
||||
}
|
||||
|
||||
return store[key];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue