From 033b09716edf70ffd50ed42c832cb66f2abc4e9a Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 10 Jul 2022 21:51:06 +0530 Subject: [PATCH] wip(gui-v2): filter and sort Signed-off-by: Pranav C --- packages/nc-gui-v2/components/index.ts | 6 +- .../smartsheet-toolbar/ColumnFilter.vue | 167 +++++++++++++++++- .../smartsheet-toolbar/ColumnFilterMenu.vue | 48 +++-- .../smartsheet-toolbar/FieldsMenu.vue | 9 +- .../smartsheet-toolbar/SortListMenu.vue | 20 +-- .../nc-gui-v2/components/smartsheet/Grid.vue | 10 +- .../components/smartsheet/Toolbar.vue | 2 + .../nc-gui-v2/composables/useViewColumns.ts | 22 ++- .../nc-gui-v2/composables/useViewFilters.ts | 77 ++++++++ .../nc-gui-v2/composables/useViewSorts.ts | 24 +++ packages/nc-gui-v2/utils/filterUtils.ts | 54 ++++++ packages/nocodb-sdk/src/lib/Api.ts | 9 +- scripts/sdk/swagger.json | 19 +- 13 files changed, 400 insertions(+), 67 deletions(-) create mode 100644 packages/nc-gui-v2/composables/useViewFilters.ts create mode 100644 packages/nc-gui-v2/composables/useViewSorts.ts create mode 100644 packages/nc-gui-v2/utils/filterUtils.ts diff --git a/packages/nc-gui-v2/components/index.ts b/packages/nc-gui-v2/components/index.ts index 3cbe799406..4710b5d1be 100644 --- a/packages/nc-gui-v2/components/index.ts +++ b/packages/nc-gui-v2/components/index.ts @@ -1,4 +1,4 @@ -import type { ColumnType, TableType } from 'nocodb-sdk' +import type { ColumnType, FormType, GalleryType, GridType, KanbanType, TableType } from 'nocodb-sdk' import type { InjectionKey, Ref } from 'vue' import type useViewData from '~/composables/useViewData' @@ -10,7 +10,9 @@ export const PaginationDataInj: InjectionKey['pag export const ChangePageInj: InjectionKey['changePage']> = Symbol('pagination-data-injection') export const IsFormInj: InjectionKey = Symbol('is-form-injection') export const IsGridInj: InjectionKey = Symbol('is-grid-injection') +export const IsLockedInj: InjectionKey = Symbol('is-locked-injection') export const ValueInj: InjectionKey = Symbol('value-injection') -export const ActiveViewInj: InjectionKey = Symbol('active-view-injection') +export const ActiveViewInj: InjectionKey> = + Symbol('active-view-injection') export const ReadonlyInj: InjectionKey = Symbol('readonly-injection') export const ReloadViewDataInj: InjectionKey = Symbol('reload-view-data-injection') diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue index 2752ada92e..9ce1a6bad9 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue @@ -1,5 +1,18 @@ - diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue index 55d5978d39..ba2e3a090b 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue @@ -1,5 +1,19 @@ - diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue index 3f05058362..6b24ff743b 100644 --- a/packages/nc-gui-v2/components/smartsheet/Grid.vue +++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue @@ -1,15 +1,7 @@