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) provide(ColumnInj, column)
const meta = inject(MetaInj) const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false) const isForm = inject(IsFormInj, ref(false))
// instantiate column update store // instantiate column update store
useProvideColumnCreateStore(meta as Ref<TableType>, column) 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) provide(ColumnInj, column)
const { metas } = useMetas() const { metas } = useMetas()
const meta = inject(MetaInj) const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false) const isForm = inject(IsFormInj, ref(false))
const { isLookup, isBt, isRollup, isMm, isHm, isFormula } = useVirtualCell(column) 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) const { loadData, paginationData, formattedData: data, loadGalleryData, galleryData, changePage } = useViewData(meta, view as any)
provide(IsFormInj, false) provide(IsFormInj, ref(false))
provide(IsGridInj, false) provide(IsGridInj, false)
provide(PaginationDataInj, paginationData) provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage) provide(ChangePageInj, changePage)

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

@ -82,7 +82,7 @@ const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useG
onMounted(loadGridViewColumns) onMounted(loadGridViewColumns)
provide(IsFormInj, false) provide(IsFormInj, ref(false))
provide(IsGridInj, true) provide(IsGridInj, true)
provide(PaginationDataInj, paginationData) provide(PaginationDataInj, paginationData)
provide(ChangePageInj, changePage) 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) useProvideSmartsheetStore(ref({}) as any, meta)
provide(IsFormInj, true) provide(IsFormInj, ref(true))
// accept as a prop // accept as a prop
// const row: Row = { row: {}, rowMeta: {}, oldRow: {} } // 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 emit = defineEmits(['update:modelValue', 'attachRecord'])
const vModel = useVModel(props, 'modelValue', emit) const vModel = useVModel(props, 'modelValue', emit)
const isForm = ref(inject(IsFormInj, false)) const isForm = inject(IsFormInj, ref(false))
const column = inject(ColumnInj) const column = inject(ColumnInj)
const { 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']> = export const PaginationDataInj: InjectionKey<ReturnType<typeof useViewData>['paginationData']> =
Symbol('pagination-data-injection') Symbol('pagination-data-injection')
export const ChangePageInj: InjectionKey<ReturnType<typeof useViewData>['changePage']> = 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 IsGridInj: InjectionKey<boolean> = Symbol('is-grid-injection')
export const IsLockedInj: InjectionKey<boolean> = Symbol('is-locked-injection') export const IsLockedInj: InjectionKey<boolean> = Symbol('is-locked-injection')
export const CellValueInj: InjectionKey<Ref<any>> = Symbol('cell-value-injection') export const CellValueInj: InjectionKey<Ref<any>> = Symbol('cell-value-injection')

Loading…
Cancel
Save