@empathyco/x-components 3.0.0-alpha.151 → 3.0.0-alpha.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/design-system/default-theme.css +10 -10
- package/docs/API-reference/api/x-components.md +1 -0
- package/docs/API-reference/api/x-components.nextquerypreview.maxitemstorender.md +13 -0
- package/docs/API-reference/api/x-components.nextquerypreview.md +2 -1
- package/docs/API-reference/api/x-components.nextquerypreview.suggestionresults.md +1 -1
- package/docs/API-reference/api/x-components.querypreview.md +21 -0
- package/docs/API-reference/api/x-components.querypreview.query.md +13 -0
- package/docs/API-reference/api/x-components.querypreview.title.md +13 -0
- package/docs/API-reference/api/x-components.snippetconfig.md +1 -0
- package/docs/API-reference/api/x-components.snippetconfig.queriespreview.md +13 -0
- package/docs/API-reference/api/x-types.md +1 -0
- package/docs/API-reference/api/x-types.result.identifier.md +1 -1
- package/docs/API-reference/api/x-types.result.images.md +1 -1
- package/docs/API-reference/api/x-types.result.iswishlisted.md +1 -1
- package/docs/API-reference/api/x-types.result.md +9 -8
- package/docs/API-reference/api/x-types.result.name.md +1 -1
- package/docs/API-reference/api/x-types.result.price.md +1 -1
- package/docs/API-reference/api/x-types.result.rating.md +1 -1
- package/docs/API-reference/api/x-types.result.type.md +1 -1
- package/docs/API-reference/api/x-types.result.url.md +1 -1
- package/docs/API-reference/api/x-types.result.variants.md +13 -0
- package/docs/API-reference/api/x-types.resultvariant.md +15 -0
- package/docs/API-reference/components/extra-params/x-components.snippet-config-extra-params.md +4 -4
- package/docs/API-reference/components/next-queries/x-components.next-query-preview.md +53 -3
- package/js/components/result/base-result-current-price.vue.js.map +1 -1
- package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js +1 -1
- package/js/components/result/base-result-current-price.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue.js +2 -2
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js +2 -2
- package/js/components/result/base-result-image.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js +5 -4
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-result.vue.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-result.vue_rollup-plugin-vue_script.vue.js +1 -1
- package/js/x-modules/identifier-results/components/identifier-result.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue_rollup-plugin-vue_script.vue.js +10 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/package.json +4 -4
- package/report/x-components.api.json +174 -2
- package/report/x-components.api.md +11 -2
- package/report/x-types.api.json +85 -16
- package/types/x-installer/api/api.types.d.ts +16 -1
- package/types/x-installer/api/api.types.d.ts.map +1 -1
- package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts.map +1 -1
- package/types/x-modules/next-queries/components/next-query-preview.vue.d.ts +7 -1
- package/types/x-modules/next-queries/components/next-query-preview.vue.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport { forEach, Dictionary } from '@empathyco/x-utils';\nimport Vue from 'vue';\nimport { Component, Watch, Inject, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { SnippetConfig } from '../../../x-installer/api/api.types';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config to exclude from the\n * extra params object.\n *\n * @public\n */\n @Prop({\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency',\n 'filters'\n ]\n })\n protected excludedExtraParams!: Array<keyof SnippetConfig>;\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...this.values, ...snippetConfig }, (name, value) => {\n if (this.excludedExtraParams.includes(name)) {\n
|
|
1
|
+
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport { forEach, Dictionary } from '@empathyco/x-utils';\nimport Vue from 'vue';\nimport { Component, Watch, Inject, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { SnippetConfig } from '../../../x-installer/api/api.types';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config to exclude from the\n * extra params object.\n *\n * @public\n */\n @Prop({\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency',\n 'filters',\n 'isSpa',\n 'queriesPreview'\n ]\n })\n protected excludedExtraParams!: Array<keyof SnippetConfig>;\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...this.values, ...snippetConfig }, (name, value) => {\n if (!this.excludedExtraParams.includes(name)) {\n this.$set(this.extraParams, name, value);\n }\n });\n }\n}\n"],"names":["ExtraParams"],"mappings":";;;;;;;;AAaA;;;;;;AAUA,IAAqB,wBAAwB,GAA7C,MAAqB,wBAAyB,SAAQ,GAAG;IAAzD;;;;;;;;;;QAyBY,gBAAW,GAAwB,EAAE,CAAC;KAsCjD;;;;;;;;IAPC,eAAe,CAAC,aAA4B;QAC1C,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK;YACxD,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;aAC1C;SACF,CAAC,CAAC;KACJ;CACF,CAAA;AAxDC;IADC,MAAM,CAAC,eAAe,CAAC;+DACa;AAQrC;IADC,IAAI,EAAE;wDACgC;AA+BvC;IAbC,IAAI,CAAC;QACJ,OAAO,EAAE,MAAkC;YACzC,WAAW;YACX,WAAW;YACX,YAAY;YACZ,SAAS;YACT,mBAAmB;YACnB,UAAU;YACV,SAAS;YACT,OAAO;YACP,gBAAgB;SACjB;KACF,CAAC;qEACyD;AAU3D;IADC,KAAK,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+DAOvD;AA9DkB,wBAAwB;IAJ5C,SAAS,CAAC;QACT,UAAU,EAAE,eAAEA,iBAAW,EAAE;QAC3B,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,wBAAwB,CA+D5C;aA/DoB,wBAAwB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-result.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-result.vue"],"sourcesContent":["<template>\n <span\n v-if=\"query\"\n v-html=\"highlightedQueryHTML\"\n class=\"x-identifier-result\"\n data-test=\"identifier-result\"\n ></span>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Getter, State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { identifierResultsXModule } from '../x-module';\n\n /**\n * This component renders an identifier result value and highlights its matching part with the\n * query from the state. Receives as prop the {@link @empathyco/x-types#Result | result data}.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(identifierResultsXModule)]\n })\n export default class IdentifierResult extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Query from the module state.\n *\n * @public\n */\n @State('identifierResults', 'query')\n public query!: string;\n\n /**\n * The RegExp with the current query from the state adding the separatorChars after each\n * matching character.\n *\n * @public\n */\n @Getter('identifierResults', 'identifierHighlightRegexp')\n public identifierHighlightRegexp!: RegExp;\n\n /**\n * Highlights the matching part of the identifier result with the query from the state.\n *\n * @returns String - The identifier result s query with the matching part inside a `<span>` tag.\n * @public\n */\n protected get highlightedQueryHTML(): string {\n const identifierValue = this.result.identifier
|
|
1
|
+
{"version":3,"file":"identifier-result.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-result.vue"],"sourcesContent":["<template>\n <span\n v-if=\"query\"\n v-html=\"highlightedQueryHTML\"\n class=\"x-identifier-result\"\n data-test=\"identifier-result\"\n ></span>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Getter, State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { identifierResultsXModule } from '../x-module';\n\n /**\n * This component renders an identifier result value and highlights its matching part with the\n * query from the state. Receives as prop the {@link @empathyco/x-types#Result | result data}.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(identifierResultsXModule)]\n })\n export default class IdentifierResult extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Query from the module state.\n *\n * @public\n */\n @State('identifierResults', 'query')\n public query!: string;\n\n /**\n * The RegExp with the current query from the state adding the separatorChars after each\n * matching character.\n *\n * @public\n */\n @Getter('identifierResults', 'identifierHighlightRegexp')\n public identifierHighlightRegexp!: RegExp;\n\n /**\n * Highlights the matching part of the identifier result with the query from the state.\n *\n * @returns String - The identifier result s query with the matching part inside a `<span>` tag.\n * @public\n */\n protected get highlightedQueryHTML(): string {\n const identifierValue = this.result.identifier?.value ?? '';\n if (identifierValue && this.identifierHighlightRegexp) {\n return identifierValue.replace(\n this.identifierHighlightRegexp,\n '<span class=\"x-identifier-result__matching-part\">$1</span>'\n );\n }\n return identifierValue;\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders an identifier result value and highlights its matching part with the query\nfrom the state. Receives as prop the result data\n\n### Basic usage:\n\n```vue\n<IdentifierResult v-bind=\"{ result }\" />\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,7 +19,7 @@ let IdentifierResult = class IdentifierResult extends Vue {
|
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
get highlightedQueryHTML() {
|
|
22
|
-
const identifierValue = this.result.identifier
|
|
22
|
+
const identifierValue = this.result.identifier?.value ?? '';
|
|
23
23
|
if (identifierValue && this.identifierHighlightRegexp) {
|
|
24
24
|
return identifierValue.replace(this.identifierHighlightRegexp, '<span class="x-identifier-result__matching-part">$1</span>');
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-result.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-result.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\nimport { Result } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter, State } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { identifierResultsXModule } from '../x-module';\n\n/**\n * This component renders an identifier result value and highlights its matching part with the\n * query from the state. Receives as prop the {@link @empathyco/x-types#Result | result data}.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(identifierResultsXModule)]\n})\nexport default class IdentifierResult extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Query from the module state.\n *\n * @public\n */\n @State('identifierResults', 'query')\n public query!: string;\n\n /**\n * The RegExp with the current query from the state adding the separatorChars after each\n * matching character.\n *\n * @public\n */\n @Getter('identifierResults', 'identifierHighlightRegexp')\n public identifierHighlightRegexp!: RegExp;\n\n /**\n * Highlights the matching part of the identifier result with the query from the state.\n *\n * @returns String - The identifier result s query with the matching part inside a `<span>` tag.\n * @public\n */\n protected get highlightedQueryHTML(): string {\n const identifierValue = this.result.identifier
|
|
1
|
+
{"version":3,"file":"identifier-result.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/identifier-results/components/identifier-result.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\nimport { Result } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter, State } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { identifierResultsXModule } from '../x-module';\n\n/**\n * This component renders an identifier result value and highlights its matching part with the\n * query from the state. Receives as prop the {@link @empathyco/x-types#Result | result data}.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(identifierResultsXModule)]\n})\nexport default class IdentifierResult extends Vue {\n /**\n * (Required) The {@link @empathyco/x-types#Result | result} information.\n *\n * @public\n */\n @Prop({ required: true })\n protected result!: Result;\n\n /**\n * Query from the module state.\n *\n * @public\n */\n @State('identifierResults', 'query')\n public query!: string;\n\n /**\n * The RegExp with the current query from the state adding the separatorChars after each\n * matching character.\n *\n * @public\n */\n @Getter('identifierResults', 'identifierHighlightRegexp')\n public identifierHighlightRegexp!: RegExp;\n\n /**\n * Highlights the matching part of the identifier result with the query from the state.\n *\n * @returns String - The identifier result s query with the matching part inside a `<span>` tag.\n * @public\n */\n protected get highlightedQueryHTML(): string {\n const identifierValue = this.result.identifier?.value ?? '';\n if (identifierValue && this.identifierHighlightRegexp) {\n return identifierValue.replace(\n this.identifierHighlightRegexp,\n '<span class=\"x-identifier-result__matching-part\">$1</span>'\n );\n }\n return identifierValue;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAiBA;;;;;;AASA,IAAqB,gBAAgB,GAArC,MAAqB,gBAAiB,SAAQ,GAAG;;;;;;;IAgC/C,IAAc,oBAAoB;QAChC,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC;QAC5D,IAAI,eAAe,IAAI,IAAI,CAAC,yBAAyB,EAAE;YACrD,OAAO,eAAe,CAAC,OAAO,CAC5B,IAAI,CAAC,yBAAyB,EAC9B,4DAA4D,CAC7D,CAAC;SACH;QACD,OAAO,eAAe,CAAC;KACxB;CACF,CAAA;AAnCC;IADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gDACC;AAQ1B;IADC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC;+CACd;AAStB;IADC,MAAM,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;mEACf;AAxBvB,gBAAgB;IAHpC,SAAS,CAAC;QACT,MAAM,EAAE,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;KACpD,CAAC;GACmB,gBAAgB,CA0CpC;aA1CoB,gBAAgB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-query-preview.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"suggestionResults\" data-test=\"next-query-preview\" class=\"x-next-query-preview\">\n <!--\n @slot Next Query Preview default slot.\n @binding {NextQuery} suggestion - Next Query suggestion data\n @binding {Result[]} results - The results preview of the next query\n @binding {number} totalResults - The total results of the search request\n -->\n <slot\n :suggestion=\"suggestion\"\n :results=\"suggestionResults.items\"\n :totalResults=\"suggestionResults.totalResults\"\n >\n <li\n v-for=\"result in suggestionResults.items\"\n :key=\"result.id\"\n class=\"x-next-query-preview__item\"\n data-test=\"next-query-preview-item\"\n >\n <!--\n @slot Next Query Preview result slot.\n @binding {Result} result - A Next Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </slot>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { NextQuery, PreviewResults } from '@empathyco/x-types';\n import { Dictionary } from '@empathyco/x-utils';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import { State } from '../../../components/decorators/store.decorators';\n\n /**\n * Retrieves a preview of the results of a next query and exposes them in the default slot,\n * along with the next query and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueryPreview extends Vue {\n /**\n * The next query to retrieve the results preview.\n *\n * @public\n */\n @Prop({\n required: true\n })\n protected suggestion!: NextQuery;\n\n /**\n * The results preview of the next queries mounted.\n * It is a dictionary, indexed by the next query query.\n */\n @State('nextQueries', 'resultsPreview')\n public previewResults!: Dictionary<PreviewResults>;\n\n /**\n * The component emits the NextQueryPreviewMounted event to retrieve the results preview\n * of the next query.\n */\n mounted(): void {\n this.$x.emit('NextQueryPreviewMounted', this.suggestion.query);\n }\n\n /**\n * Gets from the state the results preview of the next query.\n *\n * @returns The results preview of the actual next query.\n */\n public get suggestionResults(): PreviewResults {\n
|
|
1
|
+
{"version":3,"file":"next-query-preview.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"suggestionResults\" data-test=\"next-query-preview\" class=\"x-next-query-preview\">\n <!--\n @slot Next Query Preview default slot.\n @binding {NextQuery} suggestion - Next Query suggestion data\n @binding {Result[]} results - The results preview of the next query\n @binding {number} totalResults - The total results of the search request\n -->\n <slot\n :suggestion=\"suggestion\"\n :results=\"suggestionResults.items\"\n :totalResults=\"suggestionResults.totalResults\"\n >\n <li\n v-for=\"result in suggestionResults.items\"\n :key=\"result.id\"\n class=\"x-next-query-preview__item\"\n data-test=\"next-query-preview-item\"\n >\n <!--\n @slot Next Query Preview result slot.\n @binding {Result} result - A Next Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </slot>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { NextQuery, PreviewResults } from '@empathyco/x-types';\n import { Dictionary } from '@empathyco/x-utils';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import { State } from '../../../components/decorators/store.decorators';\n\n /**\n * Retrieves a preview of the results of a next query and exposes them in the default slot,\n * along with the next query and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueryPreview extends Vue {\n /**\n * The next query to retrieve the results preview.\n *\n * @public\n */\n @Prop({\n required: true\n })\n protected suggestion!: NextQuery;\n\n /**\n * Number of suggestion results to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The results preview of the next queries mounted.\n * It is a dictionary, indexed by the next query query.\n */\n @State('nextQueries', 'resultsPreview')\n public previewResults!: Dictionary<PreviewResults>;\n\n /**\n * The component emits the NextQueryPreviewMounted event to retrieve the results preview\n * of the next query.\n */\n mounted(): void {\n this.$x.emit('NextQueryPreviewMounted', this.suggestion.query);\n }\n\n /**\n * Gets from the state the results preview of the next query.\n *\n * @returns The results preview of the actual next query.\n */\n public get suggestionResults(): PreviewResults | undefined {\n const previewResults = this.previewResults[this.suggestion.query];\n\n return previewResults\n ? {\n ...previewResults,\n items: previewResults.items.slice(0, this.maxItemsToRender)\n }\n : undefined;\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the `NextQueryPreviewMounted` when it is mounted.\n\n## See it in action\n\nHere you have a basic example of how the NextQueryPreview is rendered. Keep in mind that this\ncomponent is intended to be used overriding its default slot. By default it will only render the\nnames of the results.\n\n```vue live\n<template>\n <NextQueryPreview :suggestion=\"suggestion\" />\n</template>\n\n<script>\n import { NextQueryPreview } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueryPreviewDemo',\n components: {\n NextQueryPreview\n },\n data() {\n return {\n suggestion: {\n modelName: 'NextQuery',\n query: 'tshirt',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, the results will be rendered inside a sliding panel.\n\n```vue live\n<template>\n <NextQueryPreview :suggestion=\"suggestion\" #default=\"{ totalResults, results }\">\n <p>Total results: {{ totalResults }}</p>\n <SlidingPanel :resetOnContentChange=\"false\">\n <article\n v-for=\"result in results\"\n :key=\"result.id\"\n class=\"x-result\"\n style=\"max-width: 300px; overflow: hidden\"\n >\n <BaseResultLink :result=\"result\">\n <BaseResultImage :result=\"result\" class=\"x-result__picture\" />\n </BaseResultLink>\n <div class=\"x-result__description\">\n <BaseResultLink :result=\"result\">\n <h1 class=\"x-title3\">{{ result.name }}</h1>\n </BaseResultLink>\n </div>\n </article>\n </SlidingPanel>\n </NextQueryPreview>\n</template>\n\n<script>\n import { NextQueryPreview } from '@empathyco/x-components/next-queries';\n import { SlidingPanel, BaseResultLink, BaseResultImage } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueryPreviewDemoOverridingSlot',\n components: {\n NextQueryPreview,\n SlidingPanel,\n BaseResultLink,\n BaseResultImage\n },\n data() {\n return {\n suggestion: {\n modelName: 'NextQuery',\n query: 'tshirt',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with the result slot\n\nThe component exposes a slot to override the result content, without modifying the list.\n\nIn this example, the ID of the results will be rendered along with the name.\n\n```vue\n<template>\n <NextQueryPreview :suggestion=\"suggestion\" #result=\"{ result }\">\n <span>{{ result.id }}</span>\n <span>{{ result.name }}</span>\n </NextQueryPreview>\n</template>\n\n<script>\n import { NextQueryPreview } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueryPreviewDemoOverridingResultSlot',\n components: {\n NextQueryPreview\n },\n data() {\n return {\n suggestion: {\n modelName: 'NextQuery',\n query: 'tshirt',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the suggestions has been limited to render a maximum of 4 items.\n\n```vue\n<template>\n <NextQueryPreview\n :maxItemsToRender=\"maxItemsToRender\"\n :suggestion=\"suggestion\"\n #default=\"{ results }\"\n >\n <BaseGrid #default=\"{ item }\" :items=\"results\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n </BaseResultLink>\n </BaseGrid>\n </NextQueryPreview>\n</template>\n\n<script>\n import { BaseGrid, BaseResultImage, BaseResultLink } from '@empathyco/x-components';\n import { NextQueryPreview } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueryPreviewDemo',\n components: {\n BaseGrid,\n BaseResultImage,\n BaseResultLink,\n NextQueryPreview\n },\n data() {\n return {\n maxItemsToRender: 4,\n suggestion: {\n modelName: 'NextQuery',\n query: 'tshirt',\n facets: []\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/next-queries/components/next-query-preview.vue_rollup-plugin-vue_script.vue.js
CHANGED
|
@@ -26,7 +26,13 @@ let NextQueryPreview = class NextQueryPreview extends Vue {
|
|
|
26
26
|
* @returns The results preview of the actual next query.
|
|
27
27
|
*/
|
|
28
28
|
get suggestionResults() {
|
|
29
|
-
|
|
29
|
+
const previewResults = this.previewResults[this.suggestion.query];
|
|
30
|
+
return previewResults
|
|
31
|
+
? {
|
|
32
|
+
...previewResults,
|
|
33
|
+
items: previewResults.items.slice(0, this.maxItemsToRender)
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
__decorate([
|
|
@@ -34,6 +40,9 @@ __decorate([
|
|
|
34
40
|
required: true
|
|
35
41
|
})
|
|
36
42
|
], NextQueryPreview.prototype, "suggestion", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Prop()
|
|
45
|
+
], NextQueryPreview.prototype, "maxItemsToRender", void 0);
|
|
37
46
|
__decorate([
|
|
38
47
|
State('nextQueries', 'resultsPreview')
|
|
39
48
|
], NextQueryPreview.prototype, "previewResults", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-query-preview.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query-preview.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NextQuery, PreviewResults } from '@empathyco/x-types';\nimport { Dictionary } from '@empathyco/x-utils';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { nextQueriesXModule } from '../x-module';\nimport { State } from '../../../components/decorators/store.decorators';\n\n/**\n * Retrieves a preview of the results of a next query and exposes them in the default slot,\n * along with the next query and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQueryPreview extends Vue {\n /**\n * The next query to retrieve the results preview.\n *\n * @public\n */\n @Prop({\n required: true\n })\n protected suggestion!: NextQuery;\n\n /**\n * The results preview of the next queries mounted.\n * It is a dictionary, indexed by the next query query.\n */\n @State('nextQueries', 'resultsPreview')\n public previewResults!: Dictionary<PreviewResults>;\n\n /**\n * The component emits the NextQueryPreviewMounted event to retrieve the results preview\n * of the next query.\n */\n mounted(): void {\n this.$x.emit('NextQueryPreviewMounted', this.suggestion.query);\n }\n\n /**\n * Gets from the state the results preview of the next query.\n *\n * @returns The results preview of the actual next query.\n */\n public get suggestionResults(): PreviewResults {\n
|
|
1
|
+
{"version":3,"file":"next-query-preview.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query-preview.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NextQuery, PreviewResults } from '@empathyco/x-types';\nimport { Dictionary } from '@empathyco/x-utils';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { nextQueriesXModule } from '../x-module';\nimport { State } from '../../../components/decorators/store.decorators';\n\n/**\n * Retrieves a preview of the results of a next query and exposes them in the default slot,\n * along with the next query and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQueryPreview extends Vue {\n /**\n * The next query to retrieve the results preview.\n *\n * @public\n */\n @Prop({\n required: true\n })\n protected suggestion!: NextQuery;\n\n /**\n * Number of suggestion results to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The results preview of the next queries mounted.\n * It is a dictionary, indexed by the next query query.\n */\n @State('nextQueries', 'resultsPreview')\n public previewResults!: Dictionary<PreviewResults>;\n\n /**\n * The component emits the NextQueryPreviewMounted event to retrieve the results preview\n * of the next query.\n */\n mounted(): void {\n this.$x.emit('NextQueryPreviewMounted', this.suggestion.query);\n }\n\n /**\n * Gets from the state the results preview of the next query.\n *\n * @returns The results preview of the actual next query.\n */\n public get suggestionResults(): PreviewResults | undefined {\n const previewResults = this.previewResults[this.suggestion.query];\n\n return previewResults\n ? {\n ...previewResults,\n items: previewResults.items.slice(0, this.maxItemsToRender)\n }\n : undefined;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAwCA;;;;;;;AAUA,IAAqB,gBAAgB,GAArC,MAAqB,gBAAiB,SAAQ,GAAG;;;;;IA8B/C,OAAO;QACL,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KAChE;;;;;;IAOD,IAAW,iBAAiB;QAC1B,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAElE,OAAO,cAAc;cACjB;gBACE,GAAG,cAAc;gBACjB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC;aAC5D;cACD,SAAS,CAAC;KACf;CACF,CAAA;AAxCC;IAHC,IAAI,CAAC;QACJ,QAAQ,EAAE,IAAI;KACf,CAAC;oDAC+B;AAQjC;IADC,IAAI,EAAE;0DAC6B;AAOpC;IADC,KAAK,CAAC,aAAa,EAAE,gBAAgB,CAAC;wDACY;AAxBhC,gBAAgB;IAHpC,SAAS,CAAC;QACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,gBAAgB,CAiDpC;aAjDoB,gBAAgB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.154",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@empathyco/x-deep-merge": "^1.3.0-alpha.19",
|
|
64
64
|
"@empathyco/x-logger": "^1.2.0-alpha.3",
|
|
65
65
|
"@empathyco/x-storage-service": "^2.0.0-alpha.2",
|
|
66
|
-
"@empathyco/x-types": "^10.0.0-alpha.
|
|
66
|
+
"@empathyco/x-types": "^10.0.0-alpha.31",
|
|
67
67
|
"@empathyco/x-utils": "^1.0.0-alpha.5",
|
|
68
68
|
"@types/resize-observer-browser": "~0.1.5",
|
|
69
69
|
"rxjs": "~7.4.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@cypress/vue": "~2.2.4",
|
|
80
80
|
"@cypress/webpack-dev-server": "~1.8.4",
|
|
81
|
-
"@empathyco/x-adapter-platform": "^1.0.0-alpha.
|
|
81
|
+
"@empathyco/x-adapter-platform": "^1.0.0-alpha.30",
|
|
82
82
|
"@microsoft/api-documenter": "~7.15.3",
|
|
83
83
|
"@microsoft/api-extractor": "~7.19.4",
|
|
84
84
|
"@rollup/plugin-commonjs": "~21.0.1",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"access": "public",
|
|
126
126
|
"directory": "dist"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "2b7cac6055cfecd1d120bb541e2b4fda0494b2cd"
|
|
129
129
|
}
|
|
@@ -27845,6 +27845,33 @@
|
|
|
27845
27845
|
"releaseTag": "Public",
|
|
27846
27846
|
"name": "NextQueryPreview",
|
|
27847
27847
|
"members": [
|
|
27848
|
+
{
|
|
27849
|
+
"kind": "Property",
|
|
27850
|
+
"canonicalReference": "@empathyco/x-components!NextQueryPreview#maxItemsToRender:member",
|
|
27851
|
+
"docComment": "/**\n * Number of suggestion results to be rendered.\n *\n * @public\n */\n",
|
|
27852
|
+
"excerptTokens": [
|
|
27853
|
+
{
|
|
27854
|
+
"kind": "Content",
|
|
27855
|
+
"text": "protected maxItemsToRender?: "
|
|
27856
|
+
},
|
|
27857
|
+
{
|
|
27858
|
+
"kind": "Content",
|
|
27859
|
+
"text": "number"
|
|
27860
|
+
},
|
|
27861
|
+
{
|
|
27862
|
+
"kind": "Content",
|
|
27863
|
+
"text": ";"
|
|
27864
|
+
}
|
|
27865
|
+
],
|
|
27866
|
+
"isOptional": true,
|
|
27867
|
+
"releaseTag": "Public",
|
|
27868
|
+
"name": "maxItemsToRender",
|
|
27869
|
+
"propertyTypeTokenRange": {
|
|
27870
|
+
"startIndex": 1,
|
|
27871
|
+
"endIndex": 2
|
|
27872
|
+
},
|
|
27873
|
+
"isStatic": false
|
|
27874
|
+
},
|
|
27848
27875
|
{
|
|
27849
27876
|
"kind": "Method",
|
|
27850
27877
|
"canonicalReference": "@empathyco/x-components!NextQueryPreview#mounted:member(1)",
|
|
@@ -27957,6 +27984,10 @@
|
|
|
27957
27984
|
"text": "PreviewResults",
|
|
27958
27985
|
"canonicalReference": "@empathyco/x-components!PreviewResults:interface"
|
|
27959
27986
|
},
|
|
27987
|
+
{
|
|
27988
|
+
"kind": "Content",
|
|
27989
|
+
"text": " | undefined"
|
|
27990
|
+
},
|
|
27960
27991
|
{
|
|
27961
27992
|
"kind": "Content",
|
|
27962
27993
|
"text": ";"
|
|
@@ -27967,7 +27998,7 @@
|
|
|
27967
27998
|
"name": "suggestionResults",
|
|
27968
27999
|
"propertyTypeTokenRange": {
|
|
27969
28000
|
"startIndex": 1,
|
|
27970
|
-
"endIndex":
|
|
28001
|
+
"endIndex": 3
|
|
27971
28002
|
},
|
|
27972
28003
|
"isStatic": false
|
|
27973
28004
|
}
|
|
@@ -30508,6 +30539,116 @@
|
|
|
30508
30539
|
"endIndex": 7
|
|
30509
30540
|
}
|
|
30510
30541
|
},
|
|
30542
|
+
{
|
|
30543
|
+
"kind": "Interface",
|
|
30544
|
+
"canonicalReference": "@empathyco/x-components!QueryPreview:interface",
|
|
30545
|
+
"docComment": "/**\n * Information to render a query preview with.\n *\n * @public\n */\n",
|
|
30546
|
+
"excerptTokens": [
|
|
30547
|
+
{
|
|
30548
|
+
"kind": "Content",
|
|
30549
|
+
"text": "export interface QueryPreview "
|
|
30550
|
+
}
|
|
30551
|
+
],
|
|
30552
|
+
"releaseTag": "Public",
|
|
30553
|
+
"name": "QueryPreview",
|
|
30554
|
+
"members": [
|
|
30555
|
+
{
|
|
30556
|
+
"kind": "IndexSignature",
|
|
30557
|
+
"canonicalReference": "@empathyco/x-components!QueryPreview:index(1)",
|
|
30558
|
+
"docComment": "/**\n * Any other additional information to render the preview with.\n */\n",
|
|
30559
|
+
"excerptTokens": [
|
|
30560
|
+
{
|
|
30561
|
+
"kind": "Content",
|
|
30562
|
+
"text": "[extra: "
|
|
30563
|
+
},
|
|
30564
|
+
{
|
|
30565
|
+
"kind": "Content",
|
|
30566
|
+
"text": "string"
|
|
30567
|
+
},
|
|
30568
|
+
{
|
|
30569
|
+
"kind": "Content",
|
|
30570
|
+
"text": "]: "
|
|
30571
|
+
},
|
|
30572
|
+
{
|
|
30573
|
+
"kind": "Content",
|
|
30574
|
+
"text": "unknown"
|
|
30575
|
+
},
|
|
30576
|
+
{
|
|
30577
|
+
"kind": "Content",
|
|
30578
|
+
"text": ";"
|
|
30579
|
+
}
|
|
30580
|
+
],
|
|
30581
|
+
"returnTypeTokenRange": {
|
|
30582
|
+
"startIndex": 3,
|
|
30583
|
+
"endIndex": 4
|
|
30584
|
+
},
|
|
30585
|
+
"releaseTag": "Public",
|
|
30586
|
+
"overloadIndex": 1,
|
|
30587
|
+
"parameters": [
|
|
30588
|
+
{
|
|
30589
|
+
"parameterName": "extra",
|
|
30590
|
+
"parameterTypeTokenRange": {
|
|
30591
|
+
"startIndex": 1,
|
|
30592
|
+
"endIndex": 2
|
|
30593
|
+
}
|
|
30594
|
+
}
|
|
30595
|
+
]
|
|
30596
|
+
},
|
|
30597
|
+
{
|
|
30598
|
+
"kind": "PropertySignature",
|
|
30599
|
+
"canonicalReference": "@empathyco/x-components!QueryPreview#query:member",
|
|
30600
|
+
"docComment": "/**\n * The query to search for.\n */\n",
|
|
30601
|
+
"excerptTokens": [
|
|
30602
|
+
{
|
|
30603
|
+
"kind": "Content",
|
|
30604
|
+
"text": "query: "
|
|
30605
|
+
},
|
|
30606
|
+
{
|
|
30607
|
+
"kind": "Content",
|
|
30608
|
+
"text": "string"
|
|
30609
|
+
},
|
|
30610
|
+
{
|
|
30611
|
+
"kind": "Content",
|
|
30612
|
+
"text": ";"
|
|
30613
|
+
}
|
|
30614
|
+
],
|
|
30615
|
+
"isOptional": false,
|
|
30616
|
+
"releaseTag": "Public",
|
|
30617
|
+
"name": "query",
|
|
30618
|
+
"propertyTypeTokenRange": {
|
|
30619
|
+
"startIndex": 1,
|
|
30620
|
+
"endIndex": 2
|
|
30621
|
+
}
|
|
30622
|
+
},
|
|
30623
|
+
{
|
|
30624
|
+
"kind": "PropertySignature",
|
|
30625
|
+
"canonicalReference": "@empathyco/x-components!QueryPreview#title:member",
|
|
30626
|
+
"docComment": "/**\n * An optional title for the container.\n */\n",
|
|
30627
|
+
"excerptTokens": [
|
|
30628
|
+
{
|
|
30629
|
+
"kind": "Content",
|
|
30630
|
+
"text": "title?: "
|
|
30631
|
+
},
|
|
30632
|
+
{
|
|
30633
|
+
"kind": "Content",
|
|
30634
|
+
"text": "string"
|
|
30635
|
+
},
|
|
30636
|
+
{
|
|
30637
|
+
"kind": "Content",
|
|
30638
|
+
"text": ";"
|
|
30639
|
+
}
|
|
30640
|
+
],
|
|
30641
|
+
"isOptional": true,
|
|
30642
|
+
"releaseTag": "Public",
|
|
30643
|
+
"name": "title",
|
|
30644
|
+
"propertyTypeTokenRange": {
|
|
30645
|
+
"startIndex": 1,
|
|
30646
|
+
"endIndex": 2
|
|
30647
|
+
}
|
|
30648
|
+
}
|
|
30649
|
+
],
|
|
30650
|
+
"extendsTokenRanges": []
|
|
30651
|
+
},
|
|
30511
30652
|
{
|
|
30512
30653
|
"kind": "Class",
|
|
30513
30654
|
"canonicalReference": "@empathyco/x-components!QuerySuggestion:class",
|
|
@@ -43333,7 +43474,7 @@
|
|
|
43333
43474
|
},
|
|
43334
43475
|
{
|
|
43335
43476
|
"kind": "Content",
|
|
43336
|
-
"text": "
|
|
43477
|
+
"text": "unknown"
|
|
43337
43478
|
},
|
|
43338
43479
|
{
|
|
43339
43480
|
"kind": "Content",
|
|
@@ -43618,6 +43759,37 @@
|
|
|
43618
43759
|
"endIndex": 2
|
|
43619
43760
|
}
|
|
43620
43761
|
},
|
|
43762
|
+
{
|
|
43763
|
+
"kind": "PropertySignature",
|
|
43764
|
+
"canonicalReference": "@empathyco/x-components!SnippetConfig#queriesPreview:member",
|
|
43765
|
+
"docComment": "/**\n * List of queries to preview.\n */\n",
|
|
43766
|
+
"excerptTokens": [
|
|
43767
|
+
{
|
|
43768
|
+
"kind": "Content",
|
|
43769
|
+
"text": "queriesPreview?: "
|
|
43770
|
+
},
|
|
43771
|
+
{
|
|
43772
|
+
"kind": "Reference",
|
|
43773
|
+
"text": "QueryPreview",
|
|
43774
|
+
"canonicalReference": "@empathyco/x-components!QueryPreview:interface"
|
|
43775
|
+
},
|
|
43776
|
+
{
|
|
43777
|
+
"kind": "Content",
|
|
43778
|
+
"text": "[]"
|
|
43779
|
+
},
|
|
43780
|
+
{
|
|
43781
|
+
"kind": "Content",
|
|
43782
|
+
"text": ";"
|
|
43783
|
+
}
|
|
43784
|
+
],
|
|
43785
|
+
"isOptional": true,
|
|
43786
|
+
"releaseTag": "Public",
|
|
43787
|
+
"name": "queriesPreview",
|
|
43788
|
+
"propertyTypeTokenRange": {
|
|
43789
|
+
"startIndex": 1,
|
|
43790
|
+
"endIndex": 3
|
|
43791
|
+
}
|
|
43792
|
+
},
|
|
43621
43793
|
{
|
|
43622
43794
|
"kind": "PropertySignature",
|
|
43623
43795
|
"canonicalReference": "@empathyco/x-components!SnippetConfig#scope:member",
|
|
@@ -2600,10 +2600,11 @@ export class NextQuery extends Vue_2 {
|
|
|
2600
2600
|
|
|
2601
2601
|
// @public
|
|
2602
2602
|
export class NextQueryPreview extends Vue_2 {
|
|
2603
|
+
protected maxItemsToRender?: number;
|
|
2603
2604
|
mounted(): void;
|
|
2604
2605
|
previewResults: Dictionary<PreviewResults>;
|
|
2605
2606
|
protected suggestion: NextQuery_2;
|
|
2606
|
-
get suggestionResults(): PreviewResults;
|
|
2607
|
+
get suggestionResults(): PreviewResults | undefined;
|
|
2607
2608
|
}
|
|
2608
2609
|
|
|
2609
2610
|
// @public
|
|
@@ -2867,6 +2868,13 @@ export type QueryOrigin = `${QueryFeature}:${FeatureLocation}`;
|
|
|
2867
2868
|
// @public
|
|
2868
2869
|
export type QueryOriginInit = Partial<Pick<WireMetadata, 'feature' | 'location'>>;
|
|
2869
2870
|
|
|
2871
|
+
// @public
|
|
2872
|
+
export interface QueryPreview {
|
|
2873
|
+
[extra: string]: unknown;
|
|
2874
|
+
query: string;
|
|
2875
|
+
title?: string;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2870
2878
|
// @public
|
|
2871
2879
|
export class QuerySuggestion extends Vue_3 {
|
|
2872
2880
|
// @internal
|
|
@@ -4176,7 +4184,7 @@ export class SnippetCallbacks extends Vue_2 {
|
|
|
4176
4184
|
|
|
4177
4185
|
// @public
|
|
4178
4186
|
export interface SnippetConfig {
|
|
4179
|
-
[extra: string]:
|
|
4187
|
+
[extra: string]: unknown;
|
|
4180
4188
|
callbacks?: XEventListeners;
|
|
4181
4189
|
consent?: boolean;
|
|
4182
4190
|
currency?: string;
|
|
@@ -4187,6 +4195,7 @@ export interface SnippetConfig {
|
|
|
4187
4195
|
isSpa?: boolean;
|
|
4188
4196
|
lang: string;
|
|
4189
4197
|
productId?: string;
|
|
4198
|
+
queriesPreview?: QueryPreview[];
|
|
4190
4199
|
scope: string;
|
|
4191
4200
|
searchLang?: string;
|
|
4192
4201
|
}
|