import type { ColumnType, FilterType, SourceType, TableType, ViewType } from 'nocodb-sdk' import type { ComputedRef, InjectionKey, Ref } from 'vue' import type { EventHook } from '@vueuse/core' import type { PageSidebarNode } from '#imports' export const ActiveCellInj: InjectionKey> = Symbol('active-cell') export const IsPublicInj: InjectionKey> = Symbol('is-public') export const RowInj: InjectionKey> = Symbol('row') export const ColumnInj: InjectionKey> = Symbol('column-injection') export const MetaInj: InjectionKey | Ref> = Symbol('meta-injection') export const TabMetaInj: InjectionKey | Ref> = Symbol('tab-meta-injection') export const IsFormInj: InjectionKey> = Symbol('is-form-injection') export const IsCalendarInj: InjectionKey> = Symbol('is-calendar-injection') export const IsSurveyFormInj: InjectionKey> = Symbol('is-survey-form-injection') export const IsGridInj: InjectionKey> = Symbol('is-grid-injection') export const IsGroupByInj: InjectionKey> = Symbol('is-group-by-injection') export const IsGroupByLabelInj: InjectionKey> = Symbol('is-group-by-label-injection') export const IsGalleryInj: InjectionKey> = Symbol('is-gallery-injection') export const IsKanbanInj: InjectionKey> = Symbol('is-kanban-injection') export const IsLockedInj: InjectionKey> = Symbol('is-locked-injection') export const IsExpandedFormOpenInj: InjectionKey> = Symbol('is-expanded-form-open-injection') export const IsExpandedBulkUpdateFormOpenInj: InjectionKey> = Symbol('is-expanded-bulk-update-form-open-injection') export const CellValueInj: InjectionKey> = Symbol('cell-value-injection') export const ActiveViewInj: InjectionKey> = Symbol('active-view-injection') export const ReadonlyInj: InjectionKey> = Symbol('readonly-injection') export const RowHeightInj: InjectionKey> = Symbol('row-height-injection') export const ScrollParentInj: InjectionKey> = Symbol('scroll-parent-injection') /** when shouldShowLoading bool is passed, it indicates if a loading spinner should be visible while reloading */ export const ReloadViewDataHookInj: InjectionKey< EventHook<{ shouldShowLoading?: boolean; offset?: number; isFormFieldFilters?: boolean } | void> > = Symbol('reload-view-data-injection') export const ReloadViewMetaHookInj: InjectionKey> = Symbol('reload-view-meta-injection') export const ReloadVisibleDataHookInj: InjectionKey> = Symbol('reload-visible-data-injection') export const ReloadRowDataHookInj: InjectionKey> = Symbol('reload-row-data-injection') export const ReloadAggregateHookInj: InjectionKey< EventHook< | { fields: { title: string aggregation?: string }[] } | undefined > > = Symbol('reload-aggregate-data-injection') export const OpenNewRecordFormHookInj: InjectionKey> = Symbol('open-new-record-form-injection') export const FieldsInj: InjectionKey> = Symbol('fields-injection') export const EditModeInj: InjectionKey> = Symbol('edit-mode-injection') export const SharedViewPasswordInj: InjectionKey> = Symbol('shared-view-password-injection') export const CellUrlDisableOverlayInj: InjectionKey> = Symbol('cell-url-disable-url') export const DropZoneRef: InjectionKey> = Symbol('drop-zone-ref') export const CellClickHookInj: InjectionKey | undefined> = Symbol('cell-click-injection') export const SaveRowInj: InjectionKey<(() => void) | undefined> = Symbol('save-row-injection') export const CurrentCellInj: InjectionKey> = Symbol('current-cell-injection') export const IsUnderLookupInj: InjectionKey> = Symbol('is-under-lookup-injection') export const DocsLocalPageInj: InjectionKey> = Symbol('docs-local-page-injection') export const ProjectRoleInj: InjectionKey> = Symbol('base-roles-injection') export const ProjectStarredModeInj: InjectionKey> = Symbol('base-starred-injection') export const ProjectInj: InjectionKey> = Symbol('base-injection') export const ProjectIdInj: InjectionKey> = Symbol('base-id-injection') export const EditColumnInj: InjectionKey> = Symbol('edit-column-injection') export const SidebarTableInj: InjectionKey> = Symbol('sidebar-table-injection') export const TreeViewInj: InjectionKey<{ setMenuContext: (type: 'base' | 'base' | 'table' | 'main' | 'layout', value?: any) => void duplicateTable: (table: TableType) => void openRenameTableDialog: (table: TableType, rightClick: boolean) => void openViewDescriptionDialog: (view: ViewType) => void openTableDescriptionDialog: (table: TableType) => void contextMenuTarget: { type?: 'base' | 'base' | 'table' | 'main' | 'layout'; value?: any } }> = Symbol('tree-view-functions-injection') export const CalendarViewTypeInj: InjectionKey> = Symbol('calendar-view-type-injection') export const JsonExpandInj: InjectionKey> = Symbol('json-expand-injection') export const AllFiltersInj: InjectionKey>> = Symbol('all-filters-injection') export const IsAdminPanelInj: InjectionKey> = Symbol('is-admin-panel-injection') /** * `ActiveSourceInj` is an injection key for providing the active source context to Vue components. * This is mainly used in useRoles composable to get source level restriction configuration in GUI. */ export const ActiveSourceInj: InjectionKey< ComputedRef< SourceType & { meta?: Record } > > = Symbol('active-source-injection') export const IsToolbarIconMode: InjectionKey> = Symbol('toolbar-icon-mode-injection') export const FieldNameAlias: InjectionKey> | Ref>> = Symbol('field-name-alias')