-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate PartialQueryButton and PartialResultsList (#1501)
- Loading branch information
1 parent
df925a2
commit 5e87123
Showing
6 changed files
with
160 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/_vue3-migration-test/src/x-modules/search/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { default as TestSortDropdown } from './test-sort-dropdown.vue'; | ||
export { default as TestSortList } from './test-sort-list.vue'; | ||
export { default as TestSortPickerList } from './test-sort-picker-list.vue'; | ||
export { default as TestPartialResultsList } from './test-partial-results-list.vue'; |
50 changes: 50 additions & 0 deletions
50
packages/_vue3-migration-test/src/x-modules/search/components/test-partial-results-list.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<PartialResultsList> | ||
<template #default="{ partialResult }"> | ||
<span data-test="partial-query">{{ partialResult.query }}</span> | ||
<BaseGrid #result="{ item }" :columns="4" :items="partialResult.results"> | ||
{{ item.id }} | ||
</BaseGrid> | ||
<PartialQueryButton :query="partialResult.query"> | ||
<template #default="{ query }">Ver todos {{ query }}</template> | ||
</PartialQueryButton> | ||
</template> | ||
</PartialResultsList> | ||
|
||
<div v-if="clickPartialQueryButton" class="text-content"> | ||
<span>The user has clicked on a partial query button!!</span> | ||
<button @click="restartParialQueryButton" class="text-button">Restart</button> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
import PartialQueryButton from '../../../../../x-components/src/x-modules/search/components/partial-query-button.vue'; | ||
import BaseGrid from '../../../../../x-components/src/components/base-grid.vue'; | ||
import PartialResultsList from '../../../../../x-components/src/x-modules/search/components/partial-results-list.vue'; | ||
import { use$x } from '../../../../../x-components/src/composables/use-$x'; | ||
const _x = use$x(); | ||
const clickPartialQueryButton = ref(false); | ||
const restartParialQueryButton = () => (clickPartialQueryButton.value = false); | ||
_x.on('UserClickedPartialQuery', false).subscribe(() => (clickPartialQueryButton.value = true)); | ||
</script> | ||
|
||
<style> | ||
.x-partial-results-list { | ||
gap: 12px; | ||
} | ||
.text-content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 4px; | ||
} | ||
.text-button { | ||
max-width: fit-content; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters