From 183faf85277bf0ade92a7be62cb8ff5c28ebdf3e Mon Sep 17 00:00:00 2001 From: mesqueeb Date: Sat, 22 Jul 2023 09:20:03 +0900 Subject: [PATCH] feat(ui): several improvements --- packages/ui/src/components/MagnetarTable.vue | 138 ++++++++++--------- packages/ui/src/components/TableFilter.vue | 12 +- packages/ui/src/components/TableTh.vue | 4 +- packages/ui/src/components/TestTable.vue | 1 - packages/ui/src/style.css | 1 - packages/ui/src/types.ts | 14 +- packages/ui/src/utils.ts | 51 ++++--- 7 files changed, 126 insertions(+), 95 deletions(-) diff --git a/packages/ui/src/components/MagnetarTable.vue b/packages/ui/src/components/MagnetarTable.vue index c949007b..5328ac4c 100644 --- a/packages/ui/src/components/MagnetarTable.vue +++ b/packages/ui/src/components/MagnetarTable.vue @@ -161,10 +161,7 @@ async function setFilter(filterIndex: number, payload: null | FilterState): Prom await fetchMore() } -async function setOrderBy( - fieldPath: OPaths, - direction: 'asc' | 'desc' | undefined -): Promise { +async function setOrderBy(fieldPath: OPaths, direction: 'asc' | 'desc' | null): Promise { clearAllRecords() if (!direction) orderByState.value.delete(fieldPath) if (direction) orderByState.value.set(fieldPath, direction) @@ -172,54 +169,63 @@ async function setOrderBy( await new Promise((resolve) => setTimeout(resolve, 200)) await fetchMore() } + +const showingFiltersCode = ref(false)