From b9b01cb787c93bed473199628425fca1579d9a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vi=CC=81ctor=20CG?= Date: Mon, 17 Jun 2024 14:41:54 +0200 Subject: [PATCH] refactor(staggered-fade-and-slide): use Vue native staggered transition --- .../test-staggered-fade-and-slide.vue | 61 +++++++ .../src/components/index.ts | 1 + .../src/components/test-search.vue | 32 ++++ packages/_vue3-migration-test/src/main.ts | 5 +- packages/_vue3-migration-test/src/router.ts | 8 +- .../src/x-modules/test-elements-list.vue | 3 +- .../animations/staggered-fade-and-slide.vue | 136 +++++++++++---- packages/x-components/src/router.ts | 5 + .../src/views/home/animations-test.vue | 157 ++++++++++++++++++ 9 files changed, 371 insertions(+), 37 deletions(-) create mode 100644 packages/_vue3-migration-test/src/components/test-search.vue create mode 100644 packages/x-components/src/views/home/animations-test.vue diff --git a/packages/_vue3-migration-test/src/components/animations/test-staggered-fade-and-slide.vue b/packages/_vue3-migration-test/src/components/animations/test-staggered-fade-and-slide.vue index 1d04d4334e..3bcc3bab5d 100644 --- a/packages/_vue3-migration-test/src/components/animations/test-staggered-fade-and-slide.vue +++ b/packages/_vue3-migration-test/src/components/animations/test-staggered-fade-and-slide.vue @@ -1,4 +1,25 @@ diff --git a/packages/_vue3-migration-test/src/components/index.ts b/packages/_vue3-migration-test/src/components/index.ts index 45c4690d74..df329b3f14 100644 --- a/packages/_vue3-migration-test/src/components/index.ts +++ b/packages/_vue3-migration-test/src/components/index.ts @@ -14,3 +14,4 @@ export { default as TestBasePanel } from './panels/test-base-panel.vue'; export { default as TestBaseKeyboardNavigation } from './test-base-keyboard-navigation.vue'; export { default as TestBaseEventsModal } from './modals/test-base-events-modal.vue'; export { default as TestBaseIdModal } from './modals/test-base-id-modal.vue'; +export { default as TestSearch } from './test-search.vue'; diff --git a/packages/_vue3-migration-test/src/components/test-search.vue b/packages/_vue3-migration-test/src/components/test-search.vue new file mode 100644 index 0000000000..e11588ae70 --- /dev/null +++ b/packages/_vue3-migration-test/src/components/test-search.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/packages/_vue3-migration-test/src/main.ts b/packages/_vue3-migration-test/src/main.ts index 4f762a760f..3b44c1fdb9 100644 --- a/packages/_vue3-migration-test/src/main.ts +++ b/packages/_vue3-migration-test/src/main.ts @@ -1,7 +1,8 @@ -import { XComponentsAdapter } from '@empathyco/x-types'; import { Component, configureCompat, createApp } from 'vue'; import { createStore } from 'vuex'; +import { platformAdapter } from '../../x-adapter-platform/src/platform.adapter'; import { xPlugin } from '../../x-components/src/plugins/x-plugin'; + import App from './App.vue'; import router from './router'; import { facetsXModule, nextQueriesXModule, scrollXModule, searchXModule } from './'; @@ -25,7 +26,7 @@ if (VUE_COMPAT_MODE === 2) { }); } -const adapter = {} as XComponentsAdapter; +const adapter = platformAdapter; const store = createStore({}); diff --git a/packages/_vue3-migration-test/src/router.ts b/packages/_vue3-migration-test/src/router.ts index 78f49ea78a..b771d529b1 100644 --- a/packages/_vue3-migration-test/src/router.ts +++ b/packages/_vue3-migration-test/src/router.ts @@ -31,10 +31,16 @@ import { TestPartialResultsList, TestBaseEventsModal, TestBaseIdModal, - TestStaggeredFadeAndSlide + TestStaggeredFadeAndSlide, + TestSearch } from './'; const routes = [ + { + path: '/', + name: 'Home', + component: TestSearch + }, { path: '/animate-width', name: 'AnimateWidth', diff --git a/packages/_vue3-migration-test/src/x-modules/test-elements-list.vue b/packages/_vue3-migration-test/src/x-modules/test-elements-list.vue index 6312c90e66..3eea582ac1 100644 --- a/packages/_vue3-migration-test/src/x-modules/test-elements-list.vue +++ b/packages/_vue3-migration-test/src/x-modules/test-elements-list.vue @@ -4,7 +4,7 @@ - + @@ -36,4 +36,5 @@ import BaseGrid from '../../../x-components/src/components/base-grid.vue'; import LocationProvider from '../../../x-components/src/components/location-provider.vue'; import NextQueriesList from '../../../x-components/src/x-modules/next-queries/components/next-queries-list.vue'; + import StaggeredFadeAndSlide from '../../../x-components/src/components/animations/staggered-fade-and-slide.vue'; diff --git a/packages/x-components/src/components/animations/staggered-fade-and-slide.vue b/packages/x-components/src/components/animations/staggered-fade-and-slide.vue index 19ec77f23c..2ac72150da 100644 --- a/packages/x-components/src/components/animations/staggered-fade-and-slide.vue +++ b/packages/x-components/src/components/animations/staggered-fade-and-slide.vue @@ -1,19 +1,20 @@ - diff --git a/packages/x-components/src/router.ts b/packages/x-components/src/router.ts index 3a948b9096..54141d0268 100644 --- a/packages/x-components/src/router.ts +++ b/packages/x-components/src/router.ts @@ -9,6 +9,11 @@ const routes: RouteConfig[] = [ name: 'Home', component: () => import('./views/home/Home.vue') }, + { + path: '/animations', + name: 'Animations Test', + component: () => import('./views/home/animations-test.vue') + }, { path: '/products/:id', name: 'Product page', diff --git a/packages/x-components/src/views/home/animations-test.vue b/packages/x-components/src/views/home/animations-test.vue new file mode 100644 index 0000000000..7b53a524cb --- /dev/null +++ b/packages/x-components/src/views/home/animations-test.vue @@ -0,0 +1,157 @@ + + + +