Browse Source

rafactor(gui-v2): replace with reactive variable

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3065/head
Pranav C 2 years ago
parent
commit
d64ac24aef
  1. 2
      packages/nc-gui-v2/components/smartsheet-header/Cell.vue
  2. 2
      packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue
  3. 2
      packages/nc-gui-v2/components/smartsheet/Gallery.vue
  4. 2
      packages/nc-gui-v2/components/smartsheet/Grid.vue
  5. 2
      packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue
  6. 2
      packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
  7. 2
      packages/nc-gui-v2/context/index.ts

2
packages/nc-gui-v2/components/smartsheet-header/Cell.vue

@ -11,7 +11,7 @@ const hideMenu = toRef(props, 'hideMenu')
provide(ColumnInj, column)
const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false)
const isForm = inject(IsFormInj, ref(false))
// instantiate column update store
useProvideColumnCreateStore(meta as Ref<TableType>, column)

2
packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue

@ -12,7 +12,7 @@ const hideMenu = toRef(props, 'hideMenu')
provide(ColumnInj, column)
const { metas } = useMetas()
const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false)
const isForm = inject(IsFormInj, ref(false))
const { isLookup, isBt, isRollup, isMm, isHm, isFormula } = useVirtualCell(column)

2
packages/nc-gui-v2/components/smartsheet/Gallery.vue

@ -13,7 +13,7 @@ const view = inject(ActiveViewInj)
const { loadData, paginationData, formattedData: data, loadGalleryData, galleryData, changePage } = useViewData(meta, view as any)
provide(IsFormInj, false)
provide(IsFormInj, ref(false))
provide(IsGridInj, false)
provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage)

2
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -82,7 +82,7 @@ const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useG
onMounted(loadGridViewColumns)
provide(IsFormInj, false)
provide(IsFormInj, ref(false))
provide(IsGridInj, true)
provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage)

2
packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue

@ -59,7 +59,7 @@ if (props.loadRow) {
useProvideSmartsheetStore(ref({}) as any, meta)
provide(IsFormInj, true)
provide(IsFormInj, ref(true))
// accept as a prop
// const row: Row = { row: {}, rowMeta: {}, oldRow: {} }

2
packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue

@ -8,7 +8,7 @@ const props = defineProps<{ modelValue?: boolean }>()
const emit = defineEmits(['update:modelValue', 'attachRecord'])
const vModel = useVModel(props, 'modelValue', emit)
const isForm = ref(inject(IsFormInj, false))
const isForm = inject(IsFormInj, ref(false))
const column = inject(ColumnInj)
const {

2
packages/nc-gui-v2/context/index.ts

@ -14,7 +14,7 @@ export const TabMetaInj: InjectionKey<ComputedRef<TabItem>> = Symbol('tab-meta-i
export const PaginationDataInj: InjectionKey<ReturnType<typeof useViewData>['paginationData']> =
Symbol('pagination-data-injection')
export const ChangePageInj: InjectionKey<ReturnType<typeof useViewData>['changePage']> = Symbol('pagination-data-injection')
export const IsFormInj: InjectionKey<boolean> = Symbol('is-form-injection')
export const IsFormInj: InjectionKey<Ref<boolean>> = Symbol('is-form-injection')
export const IsGridInj: InjectionKey<boolean> = Symbol('is-grid-injection')
export const IsLockedInj: InjectionKey<boolean> = Symbol('is-locked-injection')
export const CellValueInj: InjectionKey<Ref<any>> = Symbol('cell-value-injection')

Loading…
Cancel
Save