From a72f2cf45bfc0bc65f55bd213b6613c92e3a353c Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 7 Jul 2022 23:57:28 +0530 Subject: [PATCH] refactor(gui-v2): introduce typed injection keys Signed-off-by: Pranav C --- .../nc-gui-v2/components/cell/Attachment.vue | 5 +- .../nc-gui-v2/components/cell/Checkbox.vue | 4 +- packages/nc-gui-v2/components/cell/Rating.vue | 3 +- .../components/cell/SingleSelect.vue | 3 +- packages/nc-gui-v2/components/index.ts | 6 ++ .../nc-gui-v2/components/smartsheet/Cell.vue | 4 +- .../nc-gui-v2/components/smartsheet/Grid.vue | 12 ++- .../components/smartsheet/Pagination.vue | 84 +++++++++++++++++++ .../components/smartsheet/VirtualCell.vue | 3 +- .../nc-gui-v2/components/tabs/Smartsheet.vue | 7 +- .../components/virtual-cell/BelongsTo.vue | 3 +- .../components/virtual-cell/Formula.vue | 4 +- .../components/virtual-cell/HasMany.vue | 4 +- .../components/virtual-cell/ManyToMany.vue | 4 +- 14 files changed, 125 insertions(+), 21 deletions(-) create mode 100644 packages/nc-gui-v2/components/index.ts create mode 100644 packages/nc-gui-v2/components/smartsheet/Pagination.vue diff --git a/packages/nc-gui-v2/components/cell/Attachment.vue b/packages/nc-gui-v2/components/cell/Attachment.vue index 64e4506d81..40dd07b13b 100644 --- a/packages/nc-gui-v2/components/cell/Attachment.vue +++ b/packages/nc-gui-v2/components/cell/Attachment.vue @@ -4,6 +4,7 @@ import type { ColumnType, TableType } from 'nocodb-sdk' import type { Ref } from 'vue' import { useToast } from 'vue-toastification' import { useNuxtApp } from '#app' +import { ColumnInj, MetaInj } from '~/components' import useProject from '~/composables/useProject' // import FileSaver from "file-saver"; import { isImage } from '~/utils/fileUtils' @@ -15,8 +16,8 @@ const emit = defineEmits(['update:modelValue']) const isPublicForm = inject('isPublicForm', false) const isForm = inject('isForm', false) -const meta = inject>('meta') -const column = inject('column') +const meta = inject(MetaInj) +const column = inject(ColumnInj) const editEnabled = inject('editEnabled') const localFilesState = reactive([]) diff --git a/packages/nc-gui-v2/components/cell/Checkbox.vue b/packages/nc-gui-v2/components/cell/Checkbox.vue index e60f27c1be..d9d81437f8 100644 --- a/packages/nc-gui-v2/components/cell/Checkbox.vue +++ b/packages/nc-gui-v2/components/cell/Checkbox.vue @@ -1,10 +1,10 @@ + + + + diff --git a/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue b/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue index 4025fd4d7e..21ea576c91 100644 --- a/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue +++ b/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue @@ -1,12 +1,13 @@