Skip to content

Commit

Permalink
feat: add identifier results to playground
Browse files Browse the repository at this point in the history
  • Loading branch information
andreadlgdo committed Jun 17, 2024
1 parent 9da68f4 commit 0de1ae4
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/_vue3-migration-test/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
recommendationsXModule,
scrollXModule,
searchXModule,
semanticQueriesXModule
semanticQueriesXModule,
identifierResultsXModule
} from './';

// Warnings that cannot be solved in Vue 2 (a.k.a. breaking changes) are suppressed
Expand Down Expand Up @@ -62,7 +63,8 @@ createApp(App as Component)
search: searchXModule,
queriesPreview: queriesPreviewXModule,
semanticQueries: semanticQueriesXModule,
recommendations: recommendationsXModule
recommendations: recommendationsXModule,
identifierResults: identifierResultsXModule
}
})
.mount('#app');
8 changes: 7 additions & 1 deletion packages/_vue3-migration-test/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import {
TestSpellcheck,
TestQuerySuggestions,
TestSemanticQueries,
TestRecommendations
TestRecommendations,
TestIdentifierResults
} from './';

const routes = [
Expand Down Expand Up @@ -224,6 +225,11 @@ const routes = [
path: '/recommendations',
name: 'Recommendations',
component: TestRecommendations
},
{
path: '/identifier-results',
name: 'IdentifierResults',
component: TestIdentifierResults
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as TestIdentifierResults } from './test-identifier-results.vue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<IdentifierResults #default="{ identifierResult }" :maxItemsToRender="3">
<IdentifierResult :result="identifierResult" />
</IdentifierResults>
</template>

<script setup>
import IdentifierResults from '../../../../../x-components/src/x-modules/identifier-results/components/identifier-results.vue';
import IdentifierResult from '../../../../../x-components/src/x-modules/identifier-results/components/identifier-result.vue';
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './components';
export * from './x-module';
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { PrivateXModuleOptions } from '../../../../x-components/src/plugins/x-plugin.types';
import { IdentifierResultsXModule } from '../../../../x-components/src/x-modules/identifier-results/x-module';
export const identifierResultsXModule: PrivateXModuleOptions<IdentifierResultsXModule> = {
storeModule: {
state: {
config: {
debounceInMs: 600,
maxItemsToRequest: 10,
identifierDetectionRegexp: '^[0-9]{2,}$',
separatorChars: '-/ '
},
identifierResults: [
{
identifier: {
value: '123A'
}
},
{
identifier: {
value: '123B'
}
},
{
identifier: {
value: '123C'
}
},
{
identifier: {
value: '123D'
}
}
],
origin: null,
query: 'test',
params: {},
status: 'initial'
}
}
};
1 change: 1 addition & 0 deletions packages/_vue3-migration-test/src/x-modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from './history-queries';
export * from './query-suggestions';
export * from './semantic-queries';
export * from './recommendations';
export * from './identifier-results';

0 comments on commit 0de1ae4

Please sign in to comment.