Browse Source

refactor(gui-v2): tailwind classes for url overlay, interface at the top of the file

pull/3381/head
Denis 2 years ago
parent
commit
dab2ce16b2
  1. 11
      packages/nc-gui/components/cell/Url.vue
  2. 9
      packages/nc-gui/context/index.ts

11
packages/nc-gui/components/cell/Url.vue

@ -81,7 +81,7 @@ watch(
</nuxt-link>
<nuxt-link
v-else-if="isValid && !disableOverlay && urlOptions?.overlay"
class="z-3 url-overlay hover:opacity-75"
class="z-3 w-full h-full text-center !no-underline hover:opacity-75"
:to="url"
:target="urlOptions?.behavior === 'replace' ? undefined : '_blank'"
>{{ urlOptions.overlay }}
@ -100,15 +100,6 @@ watch(
</div>
</template>
<style scoped lang="scss">
.url-overlay {
width: 100%;
height: 100%;
text-align: center;
text-decoration-line: none !important;
}
</style>
<!--
/**
* @copyright Copyright (c) 2021, Xgene Cloud Ltd

9
packages/nc-gui/context/index.ts

@ -5,6 +5,11 @@ import type { useViewData } from '#imports'
import type { Row } from '~/composables'
import type { TabItem } from '~/composables/useTabs'
export interface CellUrlOptions {
behavior?: string
overlay?: string
}
export const ActiveCellInj: InjectionKey<Ref<boolean>> = Symbol('active-cell')
export const IsPublicInj: InjectionKey<Ref<boolean>> = Symbol('is-public')
export const RowInj: InjectionKey<Ref<Row>> = Symbol('row')
@ -27,10 +32,6 @@ export const FieldsInj: InjectionKey<Ref<any[]>> = Symbol('fields-injection')
export const ViewListInj: InjectionKey<Ref<ViewType[]>> = Symbol('view-list-injection')
export const EditModeInj: InjectionKey<Ref<boolean>> = Symbol('edit-mode-injection')
export const SharedViewPasswordInj: InjectionKey<Ref<string | null>> = Symbol('shared-view-password-injection')
interface CellUrlOptions {
behavior?: string
overlay?: string
}
export const CellUrlConfigInj: InjectionKey<CellUrlOptions & { rules?: Array<[RegExp, CellUrlOptions]> }> =
Symbol('cell-url-config')
export const CellUrlDisableOverlayInj: InjectionKey<Ref<boolean>> = Symbol('cell-url-disable-url')

Loading…
Cancel
Save