Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Use vue-portal for VTeleport #1716

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const config: NuxtConfig = {
'@pinia/nuxt',
],
modules: [
'portal-vue/nuxt',
'@nuxtjs/i18n',
'@nuxtjs/redirect-module',
'@nuxtjs/sentry',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"node-html-parser": "^5.3.3",
"nuxt": "^2.15.4",
"pinia": "^2.0.16",
"portal-vue": "^2.1.7",
"postcss-focus-visible": "^6.0.4",
"prom-client": "^14.0.1",
"rfdc": "^1.3.0",
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/VContentSwitcher/VSearchTypeButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
>
<VIcon :icon-path="icon" />
<span
class="md:block md:truncate md:text-left md:ms-2"
:class="isHeaderScrolled ? 'hidden' : 'block truncate text-left ms-2'"
class="md:block md:truncate md:ms-2 md:text-start"
:class="isHeaderScrolled ? 'hidden' : 'block truncate ms-2 text-start'"
Comment on lines -16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, surprised the change didn't require updating snapshot tests though 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I caught myself using left and right classes a couple of days ago 🙈

>{{ buttonLabel }}</span
>
<VIcon
Expand Down
2 changes: 1 addition & 1 deletion src/components/VHeader/VHeaderFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
inject,
Ref,
} from '@nuxtjs/composition-api'
import { Portal as VTeleport } from 'portal-vue'

import { useBodyScrollLock } from '~/composables/use-body-scroll-lock'
import { useI18n } from '~/composables/use-i18n'
Expand All @@ -44,7 +45,6 @@ import { useFocusFilters } from '~/composables/use-focus-filters'
import { Focus } from '~/utils/focus-management'
import { defineEvent } from '~/types/emits'

import VTeleport from '~/components/VTeleport/VTeleport.vue'
import VFilterButton from '~/components/VHeader/VFilterButton.vue'
import VSearchGridFilter from '~/components/VFilters/VSearchGridFilter.vue'

Expand Down
2 changes: 1 addition & 1 deletion src/components/VHeader/VSidebarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<script>
import { defineComponent } from '@nuxtjs/composition-api'
import { Portal as VTeleport } from 'portal-vue'

import VTeleport from '~/components/VTeleport/VTeleport.vue'
import VSearchGridFilter from '~/components/VFilters/VSearchGridFilter.vue'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/VModal/VModalContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
<script>
import { defineComponent, toRefs, ref, computed } from '@nuxtjs/composition-api'
import { FocusTrap } from 'focus-trap-vue'
import { Portal as VTeleport } from 'portal-vue'

import { useDialogContent } from '~/composables/use-dialog-content'
import { warn } from '~/utils/console'

import VTeleport from '~/components/VTeleport/VTeleport.vue'
import VButton from '~/components/VButton.vue'
import VIcon from '~/components/VIcon/VIcon.vue'
import VLogoButton from '~/components/VHeader/VLogoButton.vue'
Expand Down
7 changes: 3 additions & 4 deletions src/components/VModal/VModalTarget.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template>
<VTeleportTarget name="modal" />
<PortalTarget name="modal" />
</template>

<script>
import { defineComponent } from '@nuxtjs/composition-api'

import VTeleportTarget from '~/components/VTeleport/VTeleportTarget.vue'
import { PortalTarget } from 'portal-vue'

export default defineComponent({
name: 'VModalTarget',
components: { VTeleportTarget },
components: { PortalTarget },
})
</script>
3 changes: 1 addition & 2 deletions src/components/VModal/VSidebarTarget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

<script>
import { defineComponent } from '@nuxtjs/composition-api'

import VTeleportTarget from '~/components/VTeleport/VTeleportTarget.vue'
import { PortalTarget as VTeleportTarget } from 'portal-vue'

export default defineComponent({
name: 'VSidebarTarget',
Expand Down
2 changes: 1 addition & 1 deletion src/components/VSkipToContentContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

<script>
import { defineComponent, ref } from '@nuxtjs/composition-api'
import { Portal as VTeleport } from 'portal-vue'

import { ensureFocus, getFirstTabbableIn } from '~/utils/reakit-utils/focus'

import VTeleport from '~/components/VTeleport/VTeleport.vue'
import VButton from '~/components/VButton.vue'

/**
Expand Down
3 changes: 0 additions & 3 deletions src/components/VTeleport/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/VTeleport/VTeleport.vue

This file was deleted.

48 changes: 0 additions & 48 deletions src/components/VTeleport/VTeleportTarget.vue

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/VTeleport/meta/targets.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</template>
<script>
import { computed, provide, ref, watch } from '@nuxtjs/composition-api'
import { PortalTarget as VTeleportTarget } from 'portal-vue'

import { useWindowScroll } from '~/composables/use-window-scroll'
import { useMatchSearchRoutes } from '~/composables/use-match-routes'
Expand All @@ -34,7 +35,6 @@ import VHeader from '~/components/VHeader/VHeader.vue'
import VModalTarget from '~/components/VModal/VModalTarget.vue'
import VSidebarTarget from '~/components/VModal/VSidebarTarget.vue'
import VGlobalAudioSection from '~/components/VGlobalAudioSection/VGlobalAudioSection.vue'
import VTeleportTarget from '~/components/VTeleport/VTeleportTarget.vue'

const embeddedPage = {
name: 'embedded',
Expand Down