From 71feaae8493fb683919967bdf52de161a4e4fbf2 Mon Sep 17 00:00:00 2001 From: Andrea Delgado <114981520+andreadlgdo@users.noreply.github.com> Date: Mon, 27 May 2024 18:28:42 +0200 Subject: [PATCH 1/2] feat: Replace `layoutsmixin` by `useLayouts` composable (#1480) --- .../src/components/index.ts | 1 + .../src/components/test-use-layouts.vue | 36 ++++++++++++ packages/_vue3-migration-test/src/router.ts | 8 ++- .../fixed-header-and-asides-layout.vue | 58 ++++++++++++------- .../src/components/layouts/layouts.mixin.ts | 37 ------------ .../layouts/multi-column-max-width-layout.vue | 50 ++++++++++------ .../layouts/single-column-layout.vue | 50 ++++++++++------ .../src/components/layouts/use-layouts.ts | 32 ++++++++++ 8 files changed, 180 insertions(+), 92 deletions(-) create mode 100644 packages/_vue3-migration-test/src/components/test-use-layouts.vue delete mode 100644 packages/x-components/src/components/layouts/layouts.mixin.ts create mode 100644 packages/x-components/src/components/layouts/use-layouts.ts diff --git a/packages/_vue3-migration-test/src/components/index.ts b/packages/_vue3-migration-test/src/components/index.ts index f07a2bc521..ad01a69b24 100644 --- a/packages/_vue3-migration-test/src/components/index.ts +++ b/packages/_vue3-migration-test/src/components/index.ts @@ -3,3 +3,4 @@ export { default as TestBaseColumnPickerDropdown } from './column-picker/test-ba export { default as TestBaseColumnPickerList } from './column-picker/test-base-column-picker-list.vue'; export { default as TestBaseDropdown } from './test-base-dropdown.vue'; export { default as TestBaseEventButton } from './test-base-event-button.vue'; +export { default as TestUseLayouts } from './test-use-layouts.vue'; diff --git a/packages/_vue3-migration-test/src/components/test-use-layouts.vue b/packages/_vue3-migration-test/src/components/test-use-layouts.vue new file mode 100644 index 0000000000..c925c8c5eb --- /dev/null +++ b/packages/_vue3-migration-test/src/components/test-use-layouts.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/packages/_vue3-migration-test/src/router.ts b/packages/_vue3-migration-test/src/router.ts index 743e969b07..9909441e69 100644 --- a/packages/_vue3-migration-test/src/router.ts +++ b/packages/_vue3-migration-test/src/router.ts @@ -16,7 +16,8 @@ import { TestSortList, TestSortPickerList, TestBaseScroll, - TestSearchBox + TestSearchBox, + TestUseLayouts } from './'; const routes = [ @@ -104,6 +105,11 @@ const routes = [ path: '/elements-list', name: 'ElementsList', component: TestElementsList + }, + { + path: '/test-use-layouts', + name: 'TestUseLayouts', + component: TestUseLayouts } ]; diff --git a/packages/x-components/src/components/layouts/fixed-header-and-asides-layout.vue b/packages/x-components/src/components/layouts/fixed-header-and-asides-layout.vue index 1dc5790473..4aed8568ef 100644 --- a/packages/x-components/src/components/layouts/fixed-header-and-asides-layout.vue +++ b/packages/x-components/src/components/layouts/fixed-header-and-asides-layout.vue @@ -86,14 +86,12 @@