@empathyco/x-components 3.0.0-alpha.233 → 3.0.0-alpha.235

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/docs/API-reference/api/x-components.popularsearchesconfig.md +0 -1
  3. package/docs/API-reference/api/x-components.querysuggestionsconfig.md +0 -1
  4. package/docs/API-reference/components/common/suggestions/x-components.base-suggestions.md +1 -1
  5. package/docs/API-reference/components/next-queries/x-components.next-queries.md +1 -1
  6. package/docs/API-reference/components/popular-searches/x-components.popular-searches.md +1 -1
  7. package/docs/API-reference/components/recommendations/x-components.recommendations.md +102 -67
  8. package/js/components/suggestions/base-suggestions.vue.js +1 -1
  9. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  10. package/js/components/suggestions/base-suggestions.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  11. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  12. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  13. package/js/x-modules/popular-searches/store/module.js +1 -2
  14. package/js/x-modules/popular-searches/store/module.js.map +1 -1
  15. package/js/x-modules/query-suggestions/store/module.js +0 -1
  16. package/js/x-modules/query-suggestions/store/module.js.map +1 -1
  17. package/js/x-modules/recommendations/components/recommendations.vue.js +1 -1
  18. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  19. package/js/x-modules/recommendations/components/recommendations.vue_rollup-plugin-vue_styles.0.vue.js +1 -1
  20. package/package.json +2 -2
  21. package/report/x-components.api.json +0 -52
  22. package/report/x-components.api.md +0 -2
  23. package/types/x-modules/popular-searches/config.types.d.ts +0 -20
  24. package/types/x-modules/popular-searches/config.types.d.ts.map +1 -1
  25. package/types/x-modules/popular-searches/store/module.d.ts.map +1 -1
  26. package/types/x-modules/query-suggestions/config.types.d.ts +0 -23
  27. package/types/x-modules/query-suggestions/config.types.d.ts.map +1 -1
  28. package/types/x-modules/query-suggestions/store/module.d.ts.map +1 -1
  29. package/docs/API-reference/api/x-components.popularsearchesconfig.showextrasuggestionwithoutfilter.md +0 -34
  30. package/docs/API-reference/api/x-components.querysuggestionsconfig.showextrasuggestionwithoutfilter.md +0 -38
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.0.0-alpha.235](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.234...@empathyco/x-components@3.0.0-alpha.235) (2022-11-29)
7
+
8
+ **Note:** Version bump only for package @empathyco/x-components
9
+
10
+ # Change Log
11
+
12
+ All notable changes to this project will be documented in this file. See
13
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
14
+
15
+ ## [3.0.0-alpha.234](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.233...@empathyco/x-components@3.0.0-alpha.234) (2022-11-29)
16
+
17
+ **Note:** Version bump only for package @empathyco/x-components
18
+
19
+ # Change Log
20
+
21
+ All notable changes to this project will be documented in this file. See
22
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
23
+
6
24
  ## [3.0.0-alpha.233](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.232...@empathyco/x-components@3.0.0-alpha.233) (2022-11-28)
7
25
 
8
26
  **Note:** Version bump only for package @empathyco/x-components
@@ -27,6 +45,10 @@ All notable changes to this project will be documented in this file. See
27
45
 
28
46
  ## [3.0.0-alpha.231](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.230...@empathyco/x-components@3.0.0-alpha.231) (2022-11-28)
29
47
 
48
+ ### ⚠ BREAKING CHANGES
49
+
50
+ - **components:** Renamed prop `animation` of `BaseResultImage` to `loadAnimation`.
51
+
30
52
  ### Features
31
53
 
32
54
  - show next result image on hover (#863)
@@ -18,5 +18,4 @@ export interface PopularSearchesConfig
18
18
  | --- | --- | --- |
19
19
  | [hideSessionQueries](./x-components.popularsearchesconfig.hidesessionqueries.md) | boolean | Hides the popular searches that have been already searched during the session. |
20
20
  | [maxItemsToRequest](./x-components.popularsearchesconfig.maxitemstorequest.md) | number | Number of popular searches to request. |
21
- | [showExtraSuggestionWithoutFilter](./x-components.popularsearchesconfig.showextrasuggestionwithoutfilter.md) | boolean | Show the extra suggestion that has filters without the filter. |
22
21
 
@@ -19,5 +19,4 @@ export interface QuerySuggestionsConfig
19
19
  | [debounceInMs](./x-components.querysuggestionsconfig.debounceinms.md) | number | Debounce time measured in milliseconds used to store the query suggestions module query while the user is typing a query. |
20
20
  | [hideIfEqualsQuery](./x-components.querysuggestionsconfig.hideifequalsquery.md) | boolean | Hides the suggestion if it is equal to the current query. |
21
21
  | [maxItemsToRequest](./x-components.querysuggestionsconfig.maxitemstorequest.md) | number | Maximum number of query suggestions to request. |
22
- | [showExtraSuggestionWithoutFilter](./x-components.querysuggestionsconfig.showextrasuggestionwithoutfilter.md) | boolean | Show the extra suggestion that has filters without the filter. |
23
22
 
@@ -70,7 +70,7 @@ another toy in the input field to try it out!_
70
70
 
71
71
  ```vue
72
72
  <template>
73
- <BaseSuggestions :suggestions="suggestions" :maxItemToRender="3" />
73
+ <BaseSuggestions :suggestions="suggestions" :maxItemsToRender="3" />
74
74
  </template>
75
75
 
76
76
  <script>
@@ -66,7 +66,7 @@ export default {
66
66
  ```
67
67
 
68
68
  The component has three optional props. `animation` to render the component with an animation,
69
- `maxItemToRender` to limit the number of next queries will be rendered (by default it is 5) and
69
+ `maxItemsToRender` to limit the number of next queries will be rendered (by default it is 5) and
70
70
  `highlightCurated` to indicate if the curated Next Queries inside the list should be highlighted.
71
71
 
72
72
  ```vue live
@@ -52,7 +52,7 @@ export default {
52
52
  ```
53
53
 
54
54
  The component has two optional props. `animation` to render the component with an animation and
55
- `maxItemToRender` to limit the number of popular searches will be rendered (by default it is 5).
55
+ `maxItemsToRender` to limit the number of popular searches will be rendered (by default it is 5).
56
56
 
57
57
  ```vue live
58
58
  <template>
@@ -27,96 +27,131 @@ represented by a {@link BaseResultLink | result link component} besides any othe
27
27
  | <code>layout</code> | Customized Recommendations layout. | **animation** <code>Vue</code> - Animation to animate the elements.<br />**recommendations** <code>Result[]</code> - Recommendations to render. |
28
28
  | <code>default</code> | (Required) Recommendation content. | **recommendation** <code>recommendation</code> - Recommendation data. |
29
29
 
30
- ## Examples
30
+ ## Events
31
+
32
+ This component emits no events, but it makes components such as `BaseResultLink` emit additional
33
+ events:
31
34
 
32
- It renders a list of recommendations from recommendations state by default. The component provides
33
- the slot layout which wraps the whole component with the recommendations bound. It also provides the
34
- default slot to customize the item, which is within the layout slot, with the recommendation bound.
35
- Each recommendation should be represented by a BaseResultLink component besides any other component.
35
+ - `UserClickedARecommendation`: the event is emitted after the user clicks the link of a
36
+ recommendation.
36
37
 
37
- ### Basic example
38
+ ## See it in action
38
39
 
39
- ### Adding a custom BaseResultLink component
40
+ <!-- prettier-ignore-start -->
41
+ :::warning Backend service required
42
+ To use this component, the Topclicked service must be implemented.
43
+ :::
44
+ <!-- prettier-ignore-end -->
40
45
 
41
- A BaseResultLink **must** be used inside the Recommendations component. In the example below the
42
- BaseResultLink default slot is filled with an image of the result and a span for the title. Besides
43
- that, an additional button has been added.
46
+ Here you have a basic example on how the recommendations are rendered. You can customize how each
47
+ result is rendered by using the `default` slot. It is highly recommended to use base components such
48
+ as the `BaseResultLink` or the `BaseResultAddToCart`, as they provides integration with other
49
+ modules such like the `tagging` one.
44
50
 
45
- ```vue
46
- <Recommendations>
47
- <template #default="{ recommendation }">
51
+ ```vue live
52
+ <template>
53
+ <Recommendations #default="{ recommendation }">
48
54
  <BaseResultLink :result="recommendation" class="x-recommendations__link">
49
- <template #default="{ result }">
50
- <img :src="result.images[0]" class="x-recommendations__image"/>
51
- <span class="x-recommendations__title">{{ result.name }}</span>
52
- </template>
55
+ <img :src="recommendation.images[0]" class="x-recommendations__image" />
56
+ <span class="x-recommendations__title">{{ recommendation.name }}</span>
53
57
  </BaseResultLink>
54
- <button>Custom Behaviour</button>
55
- </template>
56
- </Recommendations>
57
- ```
58
-
59
- ### Overriding layout content
60
-
61
- It renders a list of recommendations customizing the layout slot. In the example below, instead of
62
- using the default Recommendations content, a BaseGrid component is used to render the
63
- recommendations.
58
+ <BaseResultAddToCart>Add to cart</BaseResultAddToCart>
59
+ </Recommendations>
60
+ </template>
61
+ <script>
62
+ import { Recommendations } from "@empathyco/x-components/recommendations";
63
+ import { BaseResultLink, BaseResultAddToCart } from "@empathyco/x-components";
64
64
 
65
- ```vue
66
- <Recommendations :animation="staggeredFadeAndSlide">
67
- <template #layout="{ recommendations, animation }">
68
- <BaseGrid :items="recommendations" :animation="animation">
69
- <template #result="{ item }">
70
- <BaseResultLink :result="item">
71
- <BaseResultImage :result="item" />
72
- <span class="x-result__title">{{ item.name }}</span>
73
- </BaseResultLink>
74
- </template>
75
- </BaseGrid>
76
- </template>
77
- </Recommendations>
65
+ export default {
66
+ name: "RecommendationsDemo",
67
+ components: {
68
+ Recommendations,
69
+ BaseResultLink,
70
+ BaseResultAddToCart
71
+ }
72
+ };
73
+ </script>
78
74
  ```
79
75
 
80
76
  ### Play with props
81
77
 
82
- In this example, the suggestions has been limited to render a maximum of 3 items.
83
-
84
- _Type “puzzle” or another toy in the input field to try it out!_
78
+ In this example, the component will render a maximum of 4 result recommendations, and will use the
79
+ `StaggeredFadeAndSlide` animation for the results, smoothing the entrance.
85
80
 
86
- ```vue
81
+ ```vue live
87
82
  <template>
88
- <BaseSuggestions :suggestions="suggestions" :maxItemToRender="3" />
83
+ <Recommendations
84
+ #default="{ recommendation }"
85
+ :maxItemsToRender="4"
86
+ animation="StaggeredFadeAndSlide"
87
+ >
88
+ <BaseResultLink :result="recommendation" class="x-recommendations__link">
89
+ <img :src="recommendation.images[0]" class="x-recommendations__image" />
90
+ <span class="x-recommendations__title">{{ recommendation.name }}</span>
91
+ </BaseResultLink>
92
+ <BaseResultAddToCart>Add to cart</BaseResultAddToCart>
93
+ </Recommendations>
89
94
  </template>
90
-
91
95
  <script>
92
- import { BaseSuggestions } from "@empathyco/x-components";
96
+ import Vue from "vue";
97
+ import { Recommendations } from "@empathyco/x-components/recommendations";
98
+ import { BaseResultLink, BaseResultAddToCart } from "@empathyco/x-components";
93
99
 
100
+ Vue.component("StaggeredFadeAndSlide", StaggeredFadeAndSlide);
94
101
  export default {
95
- name: "BaseSuggestionsDemo",
102
+ name: "RecommendationsDemo",
96
103
  components: {
97
- BaseSuggestions
98
- },
99
- data() {
100
- return {
101
- suggestions: [
102
- {
103
- facets: [],
104
- key: "chips",
105
- query: "Chips",
106
- totalResults: 10,
107
- results: [],
108
- modelName: "PopularSearch"
109
- }
110
- ]
111
- };
104
+ Recommendations,
105
+ BaseResultLink,
106
+ BaseResultAddToCart
112
107
  }
113
108
  };
114
109
  </script>
115
110
  ```
116
111
 
117
- ## Events
112
+ ### Play with the layout
118
113
 
119
- A list of events that the component will emit:
114
+ In this example you can build your own layout, and the `Recommendations` component will just act as
115
+ a provider of the result recommendations data. Using the component this way, and due to Vue 2
116
+ limitations you will only be allowed to render a single element inside the `layout` slot.
120
117
 
121
- - `UserClickedARecommendation`: the event is emitted after the user clicks the button.
122
- - A list of events emitted by the `BaseResultLink`.
118
+ ```vue live
119
+ <template>
120
+ <Recommendations #layout="{ recommendations }">
121
+ <div class="x-recommendations">
122
+ <article
123
+ class="x-recommendations-list"
124
+ v-for="recommendation in recommendations"
125
+ :key="recommendation.id"
126
+ >
127
+ <BaseResultLink
128
+ :result="recommendation"
129
+ class="x-recommendations__link"
130
+ >
131
+ <img
132
+ :src="recommendation.images[0]"
133
+ class="x-recommendations__image"
134
+ />
135
+ <span class="x-recommendations__title">{{
136
+ recommendation.name
137
+ }}</span>
138
+ </BaseResultLink>
139
+ <BaseResultAddToCart>Add to cart</BaseResultAddToCart>
140
+ </article>
141
+ </div>
142
+ </Recommendations>
143
+ </template>
144
+ <script>
145
+ import { Recommendations } from "@empathyco/x-components/recommendations";
146
+ import { BaseResultLink, BaseResultAddToCart } from "@empathyco/x-components";
147
+
148
+ export default {
149
+ name: "RecommendationsDemo",
150
+ components: {
151
+ Recommendations,
152
+ BaseResultLink,
153
+ BaseResultAddToCart
154
+ }
155
+ };
156
+ </script>
157
+ ```
@@ -45,7 +45,7 @@ __vue_render__._withStripped = true;
45
45
  /* style */
46
46
  const __vue_inject_styles__ = undefined;
47
47
  /* scoped */
48
- const __vue_scope_id__ = "data-v-10f146a0";
48
+ const __vue_scope_id__ = "data-v-43ea023e";
49
49
  /* module identifier */
50
50
  const __vue_module_identifier__ = undefined;
51
51
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-suggestions.vue.js","sources":["../../../../src/components/suggestions/base-suggestions.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"suggestions.length\" tag=\"ul\" class=\"x-list x-suggestions\">\n <li\n v-for=\"(suggestion, index) in suggestionsToRender\"\n :key=\"suggestionsKeys[index]\"\n class=\"x-list x-suggestions__item\"\n data-test=\"suggestion-item\"\n >\n <!--\n @slot (Required) List item content\n @binding {Suggestion} suggestion - Suggestion data\n @binding {number} index - Suggestion index\n @binding {Filter | undefined} filter - Suggestion's filter\n -->\n <slot v-bind=\"{ suggestion, index, filter: getSuggestionFilter(suggestion) }\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Suggestion, Facet, Filter } from '@empathyco/x-types';\n import { isArrayEmpty } from '../../utils/array';\n\n /**\n * Paints a list of suggestions passed in by prop. Requires a component for a single suggestion\n * in the default slot for working.\n *\n * @public\n */\n @Component\n export default class BaseSuggestions extends Vue {\n /**\n * The list of suggestions to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestions!: Suggestion[];\n\n /**\n * Animation component that will be used to animate the suggestion.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * Number of suggestions to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * Boolean value to indicate if the facets should be rendered.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected showFacets!: boolean;\n\n /**\n * When {@link BaseSuggestions.showFacets} is true, it indicates if the suggestion without\n * filter should be rendered.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected showPlainSuggestion!: boolean;\n\n /**\n * An array with the unique keys for each suggestion. Required by the `v-for` loop.\n *\n * @returns An array with the unique keys of the suggestions.\n * @internal\n */\n protected get suggestionsKeys(): string[] {\n return this.suggestionsToRender.map(suggestion =>\n isArrayEmpty(suggestion.facets)\n ? suggestion.query\n : `${suggestion.query}-in-${this.getFacetsKey(suggestion.facets)}`\n );\n }\n\n /**\n * Generates a string from the given facets.\n *\n * @param facets - The list of facets to reduce to a string.\n * @returns - A string representing the list of facets.\n * @internal\n */\n protected getFacetsKey(facets: Facet[]): string {\n // Component methods are bound by Vue:\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return facets.map(this.getFacetKey).join('&');\n }\n\n /**\n * Generates a string from the given facet.\n *\n * @param facet - The facet to reduce to a string.\n * @returns - A string representing the facet.\n * @internal\n */\n protected getFacetKey(facet: Facet): string {\n return facet.filters.map(filter => filter.id).join('&');\n }\n\n /**\n * Creates a list of suggestions to render based on the configuration of this component.\n *\n * @returns - The list of suggestions to be rendered by this component.\n *\n * @internal\n */\n protected get suggestionsToRender(): Suggestion[] {\n return this.suggestions\n .flatMap(suggestion =>\n this.showFacets && suggestion.facets?.length\n ? this.showPlainSuggestion\n ? [{ ...suggestion, facets: [] }, ...this.expandSuggestionFilters(suggestion)]\n : this.expandSuggestionFilters(suggestion)\n : { ...suggestion, facets: [] }\n )\n .slice(0, this.maxItemsToRender);\n }\n\n /**\n * Creates a suggestion for each one of the filter inside each facet.\n *\n * @param suggestion - Suggestion to expand.\n * @returns A list of suggestions, each one with a single filter.\n *\n * @internal\n */\n protected expandSuggestionFilters(suggestion: Suggestion): Suggestion[] {\n return (\n suggestion.facets?.flatMap(facet =>\n facet.filters.map(filter => ({\n ...suggestion,\n facets: [{ ...facet, filters: [filter] }]\n }))\n ) ?? []\n );\n }\n\n /**\n * Returns the filter contained by the suggestion.\n *\n * @param suggestion - Suggestion containing the filter.\n * @returns The suggestion filter.\n * @internal\n */\n protected getSuggestionFilter(suggestion: Suggestion): Filter | undefined {\n return suggestion.facets?.[0]?.filters[0];\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-suggestions {\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nFor this component to work, you will need to set a list of suggestions as prop, and also to\nimplement the component for single suggestion, which handles the click event. In the following\nexample, the suggestions are retrieved from a property called `suggestions`, and the implementation\nof the suggestion component is a simple `button`, that calls the `emitSuggestionSelected` method\nwhen clicked.\n\n```vue\n<BaseSuggestions :suggestions=\"suggestions\">\n <template #default=\"{ suggestion }\">\n <button @click=\"emitSuggestionSelected($event, suggestion)\">\n {{ suggestion.query }}\n </button>\n </template>\n</BaseSuggestions>\n```\n\nFollowing the previous example, the component options object could be something like this:\n\n```js\nexport default {\n computed: {\n ...mapGetters(['x', 'querySuggestions'], { suggestions: 'suggestions' })\n },\n methods: {\n emitSuggestionSelected(event, suggestion) {\n this.$x.emit('UserAcceptedAQuery', suggestion.query, { target: event.target });\n this.$x.emit('UserSelectedAQuerySuggestion', suggestion, { target: event.target });\n }\n }\n};\n```\n\n### Play with props\n\nIn this example, the suggestions has been limited to render a maximum of 3 items. _Type \"puzzle\" or\nanother toy in the input field to try it out!_\n\n```vue\n<template>\n <BaseSuggestions :suggestions=\"suggestions\" :maxItemToRender=\"3\" />\n</template>\n\n<script>\n import { BaseSuggestions } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSuggestionsDemo',\n components: {\n BaseSuggestions\n },\n data() {\n return {\n suggestions: [\n {\n facets: [],\n key: 'chips',\n query: 'Chips',\n totalResults: 10,\n results: [],\n modelName: 'PopularSearch'\n }\n ]\n };\n }\n };\n</script>\n```\n\nIn this example, the filters of the suggestion will be rendered along with the query.\n\nThe `showPlainSuggestion` prop can be used to indicate if the suggestion without filter must be\nrendered along with the suggestion with filters.\n\nThis will render:\n\n- Chips //If `showPlainSuggestion` is true\n- Chips EXAMPLE\n\n```vue\n<template>\n <BaseSuggestions :suggestions=\"suggestions\" showFacets showPlainSuggestion />\n</template>\n\n<script>\n import { BaseSuggestions } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSuggestionsDemo',\n components: {\n BaseSuggestions\n },\n data() {\n return {\n suggestions: [\n {\n facets: [\n {\n id: 'exampleFacet',\n label: 'exampleFacet',\n modelName: 'SimpleFacet',\n filters: [\n {\n facetId: 'exampleFacet',\n id: '{!tag=exampleFacet}exampleFacet_60361120_64009600:\"EXAMPLE\"',\n label: 'EXAMPLE',\n selected: false,\n totalResults: 10,\n modelName: 'SimpleFilter'\n }\n ]\n }\n ],\n key: 'chips',\n query: 'Chips',\n totalResults: 10,\n results: [],\n modelName: 'PopularSearch'\n }\n ]\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-suggestions.vue.js","sources":["../../../../src/components/suggestions/base-suggestions.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"suggestions.length\" tag=\"ul\" class=\"x-list x-suggestions\">\n <li\n v-for=\"(suggestion, index) in suggestionsToRender\"\n :key=\"suggestionsKeys[index]\"\n class=\"x-list x-suggestions__item\"\n data-test=\"suggestion-item\"\n >\n <!--\n @slot (Required) List item content\n @binding {Suggestion} suggestion - Suggestion data\n @binding {number} index - Suggestion index\n @binding {Filter | undefined} filter - Suggestion's filter\n -->\n <slot v-bind=\"{ suggestion, index, filter: getSuggestionFilter(suggestion) }\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Suggestion, Facet, Filter } from '@empathyco/x-types';\n import { isArrayEmpty } from '../../utils/array';\n\n /**\n * Paints a list of suggestions passed in by prop. Requires a component for a single suggestion\n * in the default slot for working.\n *\n * @public\n */\n @Component\n export default class BaseSuggestions extends Vue {\n /**\n * The list of suggestions to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestions!: Suggestion[];\n\n /**\n * Animation component that will be used to animate the suggestion.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * Number of suggestions to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * Boolean value to indicate if the facets should be rendered.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected showFacets!: boolean;\n\n /**\n * When {@link BaseSuggestions.showFacets} is true, it indicates if the suggestion without\n * filter should be rendered.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected showPlainSuggestion!: boolean;\n\n /**\n * An array with the unique keys for each suggestion. Required by the `v-for` loop.\n *\n * @returns An array with the unique keys of the suggestions.\n * @internal\n */\n protected get suggestionsKeys(): string[] {\n return this.suggestionsToRender.map(suggestion =>\n isArrayEmpty(suggestion.facets)\n ? suggestion.query\n : `${suggestion.query}-in-${this.getFacetsKey(suggestion.facets)}`\n );\n }\n\n /**\n * Generates a string from the given facets.\n *\n * @param facets - The list of facets to reduce to a string.\n * @returns - A string representing the list of facets.\n * @internal\n */\n protected getFacetsKey(facets: Facet[]): string {\n // Component methods are bound by Vue:\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return facets.map(this.getFacetKey).join('&');\n }\n\n /**\n * Generates a string from the given facet.\n *\n * @param facet - The facet to reduce to a string.\n * @returns - A string representing the facet.\n * @internal\n */\n protected getFacetKey(facet: Facet): string {\n return facet.filters.map(filter => filter.id).join('&');\n }\n\n /**\n * Creates a list of suggestions to render based on the configuration of this component.\n *\n * @returns - The list of suggestions to be rendered by this component.\n *\n * @internal\n */\n protected get suggestionsToRender(): Suggestion[] {\n return this.suggestions\n .flatMap(suggestion =>\n this.showFacets && suggestion.facets?.length\n ? this.showPlainSuggestion\n ? [{ ...suggestion, facets: [] }, ...this.expandSuggestionFilters(suggestion)]\n : this.expandSuggestionFilters(suggestion)\n : { ...suggestion, facets: [] }\n )\n .slice(0, this.maxItemsToRender);\n }\n\n /**\n * Creates a suggestion for each one of the filter inside each facet.\n *\n * @param suggestion - Suggestion to expand.\n * @returns A list of suggestions, each one with a single filter.\n *\n * @internal\n */\n protected expandSuggestionFilters(suggestion: Suggestion): Suggestion[] {\n return (\n suggestion.facets?.flatMap(facet =>\n facet.filters.map(filter => ({\n ...suggestion,\n facets: [{ ...facet, filters: [filter] }]\n }))\n ) ?? []\n );\n }\n\n /**\n * Returns the filter contained by the suggestion.\n *\n * @param suggestion - Suggestion containing the filter.\n * @returns The suggestion filter.\n * @internal\n */\n protected getSuggestionFilter(suggestion: Suggestion): Filter | undefined {\n return suggestion.facets?.[0]?.filters[0];\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-suggestions {\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nFor this component to work, you will need to set a list of suggestions as prop, and also to\nimplement the component for single suggestion, which handles the click event. In the following\nexample, the suggestions are retrieved from a property called `suggestions`, and the implementation\nof the suggestion component is a simple `button`, that calls the `emitSuggestionSelected` method\nwhen clicked.\n\n```vue\n<BaseSuggestions :suggestions=\"suggestions\">\n <template #default=\"{ suggestion }\">\n <button @click=\"emitSuggestionSelected($event, suggestion)\">\n {{ suggestion.query }}\n </button>\n </template>\n</BaseSuggestions>\n```\n\nFollowing the previous example, the component options object could be something like this:\n\n```js\nexport default {\n computed: {\n ...mapGetters(['x', 'querySuggestions'], { suggestions: 'suggestions' })\n },\n methods: {\n emitSuggestionSelected(event, suggestion) {\n this.$x.emit('UserAcceptedAQuery', suggestion.query, { target: event.target });\n this.$x.emit('UserSelectedAQuerySuggestion', suggestion, { target: event.target });\n }\n }\n};\n```\n\n### Play with props\n\nIn this example, the suggestions has been limited to render a maximum of 3 items. _Type \"puzzle\" or\nanother toy in the input field to try it out!_\n\n```vue\n<template>\n <BaseSuggestions :suggestions=\"suggestions\" :maxItemsToRender=\"3\" />\n</template>\n\n<script>\n import { BaseSuggestions } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSuggestionsDemo',\n components: {\n BaseSuggestions\n },\n data() {\n return {\n suggestions: [\n {\n facets: [],\n key: 'chips',\n query: 'Chips',\n totalResults: 10,\n results: [],\n modelName: 'PopularSearch'\n }\n ]\n };\n }\n };\n</script>\n```\n\nIn this example, the filters of the suggestion will be rendered along with the query.\n\nThe `showPlainSuggestion` prop can be used to indicate if the suggestion without filter must be\nrendered along with the suggestion with filters.\n\nThis will render:\n\n- Chips //If `showPlainSuggestion` is true\n- Chips EXAMPLE\n\n```vue\n<template>\n <BaseSuggestions :suggestions=\"suggestions\" showFacets showPlainSuggestion />\n</template>\n\n<script>\n import { BaseSuggestions } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSuggestionsDemo',\n components: {\n BaseSuggestions\n },\n data() {\n return {\n suggestions: [\n {\n facets: [\n {\n id: 'exampleFacet',\n label: 'exampleFacet',\n modelName: 'SimpleFacet',\n filters: [\n {\n facetId: 'exampleFacet',\n id: '{!tag=exampleFacet}exampleFacet_60361120_64009600:\"EXAMPLE\"',\n label: 'EXAMPLE',\n selected: false,\n totalResults: 10,\n modelName: 'SimpleFilter'\n }\n ]\n }\n ],\n key: 'chips',\n query: 'Chips',\n totalResults: 10,\n results: [],\n modelName: 'PopularSearch'\n }\n ]\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { createInjector, createInjectorSSR } from 'vue-runtime-helpers';
2
2
 
3
- var css = ".x-suggestions[data-v-10f146a0] {\n list-style-type: none;\n}";
3
+ var css = ".x-suggestions[data-v-43ea023e] {\n list-style-type: none;\n}";
4
4
  const isBrowser = /*#__PURE__*/ (function () {
5
5
  return (
6
6
  Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) !==
@@ -1 +1 @@
1
- {"version":3,"file":"next-queries.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"renderedNextQueries\"\n data-test=\"next-queries\"\n class=\"x-next-queries\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Next Query item\n @binding {Object} v-bind - Next Query suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Next Query suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Next Query suggestion index\n @binding {boolean} highlightCurated - True if the curated NQs should be highlighted\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props, highlightCurated }\">\n <NextQuery\n #default=\"{ shouldHighlightCurated }\"\n :suggestion=\"props.suggestion\"\n :highlightCurated=\"highlightCurated\"\n class=\"x-next-queries__suggestion\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Next Query content\n @binding {Object} v-bind - Next Query suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Next Query suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Next Query suggestion index\n @binding {boolean} shouldHighlightCurated - True if the curated NQ should be highlighted\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props, shouldHighlightCurated }\" />\n </NextQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import NextQuery from './next-query.vue';\n\n /**\n * Simple next-queries component that renders a list of\n * [`BaseSuggestions`](./x-components.base-suggestions.md),\n * allowing the user to select one of them, and emitting the needed events. A next query is a\n * suggestion for a new search, related to your previous query. I.e. If people normally search\n * for `shirts`, and then `trousers`, `trousers` would be a next query of `shirts`.\n *\n * @public\n */\n @Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueries extends Vue {\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n public highlightCurated!: boolean;\n\n /**\n * NextQueries list to be used instead of state NextQueries.\n *\n * @public\n */\n @Prop()\n public suggestions?: NextQueryModel[];\n\n /**\n * The list of next queries from the state.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public stateNextQueries!: NextQueryModel[];\n\n /**.\n * The list of next queries finally rendered\n *\n * @internal\n */\n protected get renderedNextQueries(): NextQueryModel[] {\n return this.suggestions ?? this.stateNextQueries;\n }\n }\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ----------------------------- | ----------------------------------------------------------------- | ------------------- | --------------- |\n| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code>ul</code> |\n| <code>maxItemsToRender</code> | Number of next queries to be rendered. | <code>number</code> | <code></code> |\n\n## Examples\n\n### Basic example\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any next\nqueries it will show them\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\nThe component has three optional props. `animation` to render the component with an animation,\n`maxItemToRender` to limit the number of next queries will be rendered (by default it is 5) and\n`highlightCurated` to indicate if the curated Next Queries inside the list should be highlighted.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" :highlightCurated=\"true\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\n### Overriding Next Queries' Content\n\nYou can use your custom implementation of the Next Query's content. In the example below, instead of\nusing the default Next Query's content, an icon is added, as well as a span with the query of the\nNext Query suggestion.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion-content=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n Nq1Icon\n }\n };\n</script>\n```\n\n### Adding a custom next query component\n\nYou can use your custom implementation of a next query component. To work correctly, it should use\nthe `emitNextQuerySelected` function when the next query is selected. In the example below, instead\nof using the default `button` tag for a next query, an icon is added, and the text of the next query\nis wrapped in a `span`\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion=\"{ suggestion }\">\n <NextQuery :suggestion=\"suggestion\" class=\"x-next-queries__suggestion\">\n <template #default=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQuery>\n <button>Custom Behaviour</button>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries, NextQuery } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n NextQuery,\n Nq1Icon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next-queries.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"renderedNextQueries\"\n data-test=\"next-queries\"\n class=\"x-next-queries\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Next Query item\n @binding {Object} v-bind - Next Query suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Next Query suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Next Query suggestion index\n @binding {boolean} highlightCurated - True if the curated NQs should be highlighted\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props, highlightCurated }\">\n <NextQuery\n #default=\"{ shouldHighlightCurated }\"\n :suggestion=\"props.suggestion\"\n :highlightCurated=\"highlightCurated\"\n class=\"x-next-queries__suggestion\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Next Query content\n @binding {Object} v-bind - Next Query suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Next Query suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Next Query suggestion index\n @binding {boolean} shouldHighlightCurated - True if the curated NQ should be highlighted\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props, shouldHighlightCurated }\" />\n </NextQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import NextQuery from './next-query.vue';\n\n /**\n * Simple next-queries component that renders a list of\n * [`BaseSuggestions`](./x-components.base-suggestions.md),\n * allowing the user to select one of them, and emitting the needed events. A next query is a\n * suggestion for a new search, related to your previous query. I.e. If people normally search\n * for `shirts`, and then `trousers`, `trousers` would be a next query of `shirts`.\n *\n * @public\n */\n @Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueries extends Vue {\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n public highlightCurated!: boolean;\n\n /**\n * NextQueries list to be used instead of state NextQueries.\n *\n * @public\n */\n @Prop()\n public suggestions?: NextQueryModel[];\n\n /**\n * The list of next queries from the state.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public stateNextQueries!: NextQueryModel[];\n\n /**.\n * The list of next queries finally rendered\n *\n * @internal\n */\n protected get renderedNextQueries(): NextQueryModel[] {\n return this.suggestions ?? this.stateNextQueries;\n }\n }\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ----------------------------- | ----------------------------------------------------------------- | ------------------- | --------------- |\n| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code>ul</code> |\n| <code>maxItemsToRender</code> | Number of next queries to be rendered. | <code>number</code> | <code></code> |\n\n## Examples\n\n### Basic example\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any next\nqueries it will show them\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\nThe component has three optional props. `animation` to render the component with an animation,\n`maxItemsToRender` to limit the number of next queries will be rendered (by default it is 5) and\n`highlightCurated` to indicate if the curated Next Queries inside the list should be highlighted.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" :highlightCurated=\"true\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\n### Overriding Next Queries' Content\n\nYou can use your custom implementation of the Next Query's content. In the example below, instead of\nusing the default Next Query's content, an icon is added, as well as a span with the query of the\nNext Query suggestion.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion-content=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n Nq1Icon\n }\n };\n</script>\n```\n\n### Adding a custom next query component\n\nYou can use your custom implementation of a next query component. To work correctly, it should use\nthe `emitNextQuerySelected` function when the next query is selected. In the example below, instead\nof using the default `button` tag for a next query, an icon is added, and the text of the next query\nis wrapped in a `span`\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion=\"{ suggestion }\">\n <NextQuery :suggestion=\"suggestion\" class=\"x-next-queries__suggestion\">\n <template #default=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQuery>\n <button>Custom Behaviour</button>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries, NextQuery } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n NextQuery,\n Nq1Icon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"popular-searches.vue.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-searches.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"popularSearches\"\n class=\"x-popular-searches\"\n data-test=\"popular-searches\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Popular Search item\n @binding {Object} v-bind - Popular Search suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Popular Search suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Popular Search suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props }\">\n <PopularSearch :suggestion=\"props.suggestion\" class=\"x-popular-searches__suggestion\">\n <template #default=\"{ ...props }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Popular Search content\n @binding {Object} v-bind - Popular Search suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Popular Search suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Popular Search suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props }\" />\n </template>\n </PopularSearch>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { popularSearchesXModule } from '../x-module';\n import PopularSearch from './popular-search.vue';\n\n /**\n * Simple popular-searches component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A popular search is just a query that has been searched a lot in a certain period and may\n * optionally have associated a set of filters.\n *\n * @public\n */\n @Component({\n components: { PopularSearch, BaseSuggestions },\n mixins: [xComponentMixin(popularSearchesXModule)]\n })\n export default class PopularSearches extends Vue {\n /**\n * The list of popular searches.\n *\n * @internal\n */\n @Getter('popularSearches', 'popularSearches')\n public popularSearches!: Suggestion[];\n }\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ----------------------------- | ----------------------------------------------------------------- | ------------------- | --------------- |\n| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code>ul</code> |\n| <code>maxItemsToRender</code> | Number of popular searches to be rendered. | <code>number</code> | <code></code> |\n\n## Examples\n\n### Default Usage\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any popular\nsearches it will show them.\n\n```vue live\n<template>\n <PopularSearches />\n</template>\n\n<script>\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches\n }\n };\n</script>\n```\n\nThe component has two optional props. `animation` to render the component with an animation and\n`maxItemToRender` to limit the number of popular searches will be rendered (by default it is 5).\n\n```vue live\n<template>\n <PopularSearches :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" />\n</template>\n\n<script>\n import Vue from 'vue';\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n import FadeAndSlide from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n FadeAndSlide\n }\n };\n</script>\n```\n\n### Overriding Popular Search's Content\n\nYou can use your custom implementation of the Popular Search's content. In the example below,\ninstead of using the default Popular Search's content, an icon is added, as well as a span with the\nquery of the Popular Search's suggestion.\n\n```vue live\n<template>\n <PopularSearches>\n <template #suggestion-content=\"{ suggestion }\">\n <TrendingIcon />\n <span class=\"x-popular-search__query\">{{ suggestion.query }}</span>\n </template>\n </PopularSearches>\n</template>\n\n<script>\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n import { TrendingIcon } from '@empathyco/x-components';\n\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n TrendingIcon\n }\n };\n</script>\n```\n\n### Adding a Custom Popular Search Item\n\nYou can use your custom implementation for the whole Popular Search item. In the example below, we\nchange the default implementation of the Popular Search in Popular Searches. A custom Popular Search\nimplementation is added, it has an image and a span as content (as in the previous example). Also, a\nbutton with a user customized behaviour is added at the same hierarchical level as the Popular\nSearch component.\n\n```vue live\n<template>\n <PopularSearches>\n <template #suggestion=\"{ suggestion }\">\n <PopularSearch :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <TrendingIcon />\n <span class=\"x-popular-search__query\">{{ suggestion.query }}</span>\n </template>\n </PopularSearch>\n <button>Custom Behaviour</button>\n </template>\n </PopularSearches>\n</template>\n\n<script>\n import { PopularSearches, PopularSearch } from '@empathyco/x-components/popular-searches';\n import { TrendingIcon } from '@empathyco/x-components';\n\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n PopularSearch,\n TrendingIcon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"popular-searches.vue.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-searches.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"popularSearches\"\n class=\"x-popular-searches\"\n data-test=\"popular-searches\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Popular Search item\n @binding {Object} v-bind - Popular Search suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Popular Search suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Popular Search suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props }\">\n <PopularSearch :suggestion=\"props.suggestion\" class=\"x-popular-searches__suggestion\">\n <template #default=\"{ ...props }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Popular Search content\n @binding {Object} v-bind - Popular Search suggestion attributes:<br />&nbsp;&nbsp;- **suggestion** <code>Suggestion</code> - Popular Search suggestion data<br />&nbsp;&nbsp;- **index** <code>number</code> - Popular Search suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props }\" />\n </template>\n </PopularSearch>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { popularSearchesXModule } from '../x-module';\n import PopularSearch from './popular-search.vue';\n\n /**\n * Simple popular-searches component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A popular search is just a query that has been searched a lot in a certain period and may\n * optionally have associated a set of filters.\n *\n * @public\n */\n @Component({\n components: { PopularSearch, BaseSuggestions },\n mixins: [xComponentMixin(popularSearchesXModule)]\n })\n export default class PopularSearches extends Vue {\n /**\n * The list of popular searches.\n *\n * @internal\n */\n @Getter('popularSearches', 'popularSearches')\n public popularSearches!: Suggestion[];\n }\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ----------------------------- | ----------------------------------------------------------------- | ------------------- | --------------- |\n| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code>ul</code> |\n| <code>maxItemsToRender</code> | Number of popular searches to be rendered. | <code>number</code> | <code></code> |\n\n## Examples\n\n### Default Usage\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any popular\nsearches it will show them.\n\n```vue live\n<template>\n <PopularSearches />\n</template>\n\n<script>\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches\n }\n };\n</script>\n```\n\nThe component has two optional props. `animation` to render the component with an animation and\n`maxItemsToRender` to limit the number of popular searches will be rendered (by default it is 5).\n\n```vue live\n<template>\n <PopularSearches :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" />\n</template>\n\n<script>\n import Vue from 'vue';\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n import FadeAndSlide from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n FadeAndSlide\n }\n };\n</script>\n```\n\n### Overriding Popular Search's Content\n\nYou can use your custom implementation of the Popular Search's content. In the example below,\ninstead of using the default Popular Search's content, an icon is added, as well as a span with the\nquery of the Popular Search's suggestion.\n\n```vue live\n<template>\n <PopularSearches>\n <template #suggestion-content=\"{ suggestion }\">\n <TrendingIcon />\n <span class=\"x-popular-search__query\">{{ suggestion.query }}</span>\n </template>\n </PopularSearches>\n</template>\n\n<script>\n import { PopularSearches } from '@empathyco/x-components/popular-searches';\n import { TrendingIcon } from '@empathyco/x-components';\n\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n TrendingIcon\n }\n };\n</script>\n```\n\n### Adding a Custom Popular Search Item\n\nYou can use your custom implementation for the whole Popular Search item. In the example below, we\nchange the default implementation of the Popular Search in Popular Searches. A custom Popular Search\nimplementation is added, it has an image and a span as content (as in the previous example). Also, a\nbutton with a user customized behaviour is added at the same hierarchical level as the Popular\nSearch component.\n\n```vue live\n<template>\n <PopularSearches>\n <template #suggestion=\"{ suggestion }\">\n <PopularSearch :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <TrendingIcon />\n <span class=\"x-popular-search__query\">{{ suggestion.query }}</span>\n </template>\n </PopularSearch>\n <button>Custom Behaviour</button>\n </template>\n </PopularSearches>\n</template>\n\n<script>\n import { PopularSearches, PopularSearch } from '@empathyco/x-components/popular-searches';\n import { TrendingIcon } from '@empathyco/x-components';\n\n export default {\n name: 'PopularSearchesDemo',\n components: {\n PopularSearches,\n PopularSearch,\n TrendingIcon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,8 +16,7 @@ const popularSearchesXStoreModule = {
16
16
  status: 'initial',
17
17
  config: {
18
18
  hideSessionQueries: true,
19
- maxItemsToRequest: 20,
20
- showExtraSuggestionWithoutFilter: false
19
+ maxItemsToRequest: 20
21
20
  },
22
21
  params: {}
23
22
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/popular-searches/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveSuggestions,\n fetchAndSaveSuggestions\n} from './actions/fetch-and-save-suggestions.action';\nimport { fetchSuggestions } from './actions/fetch-suggestions.action';\nimport { popularSearches } from './getters/popular-searches.getter';\nimport { request } from './getters/request.getter';\nimport { PopularSearchesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the next-queries module.\n *\n * @internal\n */\nexport const popularSearchesXStoreModule: PopularSearchesXStoreModule = {\n state: () => ({\n popularSearches: [],\n searchedQueries: [],\n status: 'initial',\n config: {\n hideSessionQueries: true,\n maxItemsToRequest: 20,\n showExtraSuggestionWithoutFilter: false\n },\n params: {}\n }),\n getters: {\n request,\n popularSearches\n },\n mutations: {\n setSuggestions(state, suggestions) {\n state.popularSearches = suggestions;\n },\n setSearchedQueries(state, searchedQueries) {\n state.searchedQueries = searchedQueries;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n }\n },\n actions: {\n cancelFetchAndSaveSuggestions,\n fetchSuggestions,\n fetchAndSaveSuggestions\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;;MAKa,2BAA2B,GAAgC;IACtE,KAAK,EAAE,OAAO;QACZ,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN,kBAAkB,EAAE,IAAI;YACxB,iBAAiB,EAAE,EAAE;YACrB,gCAAgC,EAAE,KAAK;SACxC;QACD,MAAM,EAAE,EAAE;KACX,CAAC;IACF,OAAO,EAAE;QACP,OAAO;QACP,eAAe;KAChB;IACD,SAAS,EAAE;QACT,cAAc,CAAC,KAAK,EAAE,WAAW;YAC/B,KAAK,CAAC,eAAe,GAAG,WAAW,CAAC;SACrC;QACD,kBAAkB,CAAC,KAAK,EAAE,eAAe;YACvC,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;SACzC;QACD,SAAS;QACT,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B;QAC7B,gBAAgB;QAChB,uBAAuB;KACxB;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/popular-searches/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveSuggestions,\n fetchAndSaveSuggestions\n} from './actions/fetch-and-save-suggestions.action';\nimport { fetchSuggestions } from './actions/fetch-suggestions.action';\nimport { popularSearches } from './getters/popular-searches.getter';\nimport { request } from './getters/request.getter';\nimport { PopularSearchesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the next-queries module.\n *\n * @internal\n */\nexport const popularSearchesXStoreModule: PopularSearchesXStoreModule = {\n state: () => ({\n popularSearches: [],\n searchedQueries: [],\n status: 'initial',\n config: {\n hideSessionQueries: true,\n maxItemsToRequest: 20\n },\n params: {}\n }),\n getters: {\n request,\n popularSearches\n },\n mutations: {\n setSuggestions(state, suggestions) {\n state.popularSearches = suggestions;\n },\n setSearchedQueries(state, searchedQueries) {\n state.searchedQueries = searchedQueries;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n }\n },\n actions: {\n cancelFetchAndSaveSuggestions,\n fetchSuggestions,\n fetchAndSaveSuggestions\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;;MAKa,2BAA2B,GAAgC;IACtE,KAAK,EAAE,OAAO;QACZ,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN,kBAAkB,EAAE,IAAI;YACxB,iBAAiB,EAAE,EAAE;SACtB;QACD,MAAM,EAAE,EAAE;KACX,CAAC;IACF,OAAO,EAAE;QACP,OAAO;QACP,eAAe;KAChB;IACD,SAAS,EAAE;QACT,cAAc,CAAC,KAAK,EAAE,WAAW;YAC/B,KAAK,CAAC,eAAe,GAAG,WAAW,CAAC;SACrC;QACD,kBAAkB,CAAC,KAAK,EAAE,eAAe;YACvC,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;SACzC;QACD,SAAS;QACT,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B;QAC7B,gBAAgB;QAChB,uBAAuB;KACxB;;;;;"}
@@ -20,7 +20,6 @@ const querySuggestionsXStoreModule = {
20
20
  config: {
21
21
  debounceInMs: 200,
22
22
  maxItemsToRequest: 10,
23
- showExtraSuggestionWithoutFilter: true,
24
23
  hideIfEqualsQuery: true
25
24
  },
26
25
  params: {}
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/query-suggestions/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveSuggestions,\n fetchAndSaveSuggestions\n} from './actions/fetch-and-save-suggestions.action';\nimport { fetchSuggestions } from './actions/fetch-suggestions.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { querySuggestions } from './getters/query-suggestions.getter';\nimport { request } from './getters/request.getter';\nimport { QuerySuggestionsXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the query-suggestions module.\n *\n * @internal\n */\nexport const querySuggestionsXStoreModule: QuerySuggestionsXStoreModule = {\n state: () => ({\n query: '',\n suggestions: [],\n status: 'initial',\n config: {\n debounceInMs: 200,\n maxItemsToRequest: 10,\n showExtraSuggestionWithoutFilter: true,\n hideIfEqualsQuery: true\n },\n params: {}\n }),\n getters: {\n request,\n normalizedQuery,\n querySuggestions\n },\n mutations: {\n setQuery,\n setSuggestions(state, suggestions) {\n state.suggestions = suggestions;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n }\n },\n actions: {\n cancelFetchAndSaveSuggestions,\n fetchSuggestions,\n fetchAndSaveSuggestions,\n setUrlParams\n }\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA;;;;;MAKa,4BAA4B,GAAiC;IACxE,KAAK,EAAE,OAAO;QACZ,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN,YAAY,EAAE,GAAG;YACjB,iBAAiB,EAAE,EAAE;YACrB,gCAAgC,EAAE,IAAI;YACtC,iBAAiB,EAAE,IAAI;SACxB;QACD,MAAM,EAAE,EAAE;KACX,CAAC;IACF,OAAO,EAAE;QACP,OAAO;QACP,eAAe;QACf,gBAAgB;KACjB;IACD,SAAS,EAAE;QACT,QAAQ;QACR,cAAc,CAAC,KAAK,EAAE,WAAW;YAC/B,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;SACjC;QACD,SAAS;QACT,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B;QAC7B,gBAAgB;QAChB,uBAAuB;QACvB,YAAY;KACb;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/query-suggestions/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveSuggestions,\n fetchAndSaveSuggestions\n} from './actions/fetch-and-save-suggestions.action';\nimport { fetchSuggestions } from './actions/fetch-suggestions.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { querySuggestions } from './getters/query-suggestions.getter';\nimport { request } from './getters/request.getter';\nimport { QuerySuggestionsXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the query-suggestions module.\n *\n * @internal\n */\nexport const querySuggestionsXStoreModule: QuerySuggestionsXStoreModule = {\n state: () => ({\n query: '',\n suggestions: [],\n status: 'initial',\n config: {\n debounceInMs: 200,\n maxItemsToRequest: 10,\n hideIfEqualsQuery: true\n },\n params: {}\n }),\n getters: {\n request,\n normalizedQuery,\n querySuggestions\n },\n mutations: {\n setQuery,\n setSuggestions(state, suggestions) {\n state.suggestions = suggestions;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n }\n },\n actions: {\n cancelFetchAndSaveSuggestions,\n fetchSuggestions,\n fetchAndSaveSuggestions,\n setUrlParams\n }\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA;;;;;MAKa,4BAA4B,GAAiC;IACxE,KAAK,EAAE,OAAO;QACZ,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN,YAAY,EAAE,GAAG;YACjB,iBAAiB,EAAE,EAAE;YACrB,iBAAiB,EAAE,IAAI;SACxB;QACD,MAAM,EAAE,EAAE;KACX,CAAC;IACF,OAAO,EAAE;QACP,OAAO;QACP,eAAe;QACf,gBAAgB;KACjB;IACD,SAAS,EAAE;QACT,QAAQ;QACR,cAAc,CAAC,KAAK,EAAE,WAAW;YAC/B,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;SACjC;QACD,SAAS;QACT,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B;QAC7B,gBAAgB;QAChB,uBAAuB;QACvB,YAAY;KACb;;;;;"}
@@ -58,7 +58,7 @@ __vue_render__._withStripped = true;
58
58
  /* style */
59
59
  const __vue_inject_styles__ = undefined;
60
60
  /* scoped */
61
- const __vue_scope_id__ = "data-v-29f8953e";
61
+ const __vue_scope_id__ = "data-v-231be26d";
62
62
  /* module identifier */
63
63
  const __vue_module_identifier__ = undefined;
64
64
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"recommendations.vue.js","sources":["../../../../../src/x-modules/recommendations/components/recommendations.vue"],"sourcesContent":["<template>\n <NoElement v-if=\"recommendations.length\">\n <!--\n @slot Customized Recommendations layout.\n @binding {Result[]} recommendations - Recommendations to render.\n @binding {Vue} animation - Animation to animate the elements.\n -->\n <slot name=\"layout\" v-bind=\"{ animation, recommendations }\">\n <component\n :is=\"animation\"\n tag=\"ul\"\n data-test=\"recommendations\"\n class=\"x-list x-recommendations\"\n >\n <li\n v-for=\"recommendation in recommendations\"\n :key=\"recommendation.id\"\n class=\"x-recommendations__item\"\n data-test=\"recommendation-item\"\n >\n <!--\n @slot (Required) Recommendation content.\n @binding {recommendation} recommendation - Recommendation data.\n -->\n <slot :recommendation=\"recommendation\" />\n </li>\n </component>\n </slot>\n </NoElement>\n</template>\n\n<script lang=\"ts\">\n import { Component, Prop, Provide } from 'vue-property-decorator';\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { State } from '../../../components/decorators/store.decorators';\n import { NoElement } from '../../../components/no-element';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { PropsWithType } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { recommendationsXModule } from '../x-module';\n\n /**\n * It renders a list of recommendations from the\n * {@link RecommendationsState.recommendations | Recommendations} state by default.\n * The component provides the slot layout which wraps the whole component with the\n * recommendations bounded. It also provides the default slot to customize the item, which is\n * within the layout slot, with the recommendation bounded. Each recommendation should be\n * represented by a {@link BaseResultLink | result link component} besides any other component.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(recommendationsXModule)],\n components: {\n NoElement\n }\n })\n export default class Recommendations extends Vue {\n /**\n * The module's list of recommendations.\n *\n * @public\n */\n @State('recommendations', 'recommendations')\n public storedRecommendations!: Result[];\n\n /**\n * Animation component that will be used to animate the recommendations.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue;\n\n /**\n * Number of recommendations to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The additional events to be emitted by the mandatory {@link BaseResultLink} component.\n *\n * @public\n */\n @Provide()\n protected resultClickExtraEvents: PropsWithType<XEventsTypes, Result>[] = [\n 'UserClickedARecommendation'\n ];\n\n /**\n * Slices the recommendations from the state.\n *\n * @returns - The list of recommendations slice by the number of items to render.\n *\n * @internal\n */\n protected get recommendations(): Result[] {\n return this.storedRecommendations.slice(0, this.maxItemsToRender);\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-recommendations {\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nIt renders a list of recommendations from recommendations state by default. The component provides\nthe slot layout which wraps the whole component with the recommendations bound. It also provides the\ndefault slot to customize the item, which is within the layout slot, with the recommendation bound.\nEach recommendation should be represented by a BaseResultLink component besides any other component.\n\n### Basic example\n\n### Adding a custom BaseResultLink component\n\nA BaseResultLink **must** be used inside the Recommendations component. In the example below the\nBaseResultLink default slot is filled with an image of the result and a span for the title. Besides\nthat, an additional button has been added.\n\n```vue\n<Recommendations>\n <template #default=\"{ recommendation }\">\n <BaseResultLink :result=\"recommendation\" class=\"x-recommendations__link\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" class=\"x-recommendations__image\"/>\n <span class=\"x-recommendations__title\">{{ result.name }}</span>\n </template>\n </BaseResultLink>\n <button>Custom Behaviour</button>\n </template>\n</Recommendations>\n```\n\n### Overriding layout content\n\nIt renders a list of recommendations customizing the layout slot. In the example below, instead of\nusing the default Recommendations content, a BaseGrid component is used to render the\nrecommendations.\n\n```vue\n<Recommendations :animation=\"staggeredFadeAndSlide\">\n <template #layout=\"{ recommendations, animation }\">\n <BaseGrid :items=\"recommendations\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n <span class=\"x-result__title\">{{ item.name }}</span>\n </BaseResultLink>\n </template>\n </BaseGrid>\n </template>\n</Recommendations>\n```\n\n### Play with props\n\nIn this example, the suggestions has been limited to render a maximum of 3 items.\n\n_Type “puzzle” or another toy in the input field to try it out!_\n\n```vue\n<template>\n <BaseSuggestions :suggestions=\"suggestions\" :maxItemToRender=\"3\" />\n</template>\n\n<script>\n import { BaseSuggestions } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSuggestionsDemo',\n components: {\n BaseSuggestions\n },\n data() {\n return {\n suggestions: [\n {\n facets: [],\n key: 'chips',\n query: 'Chips',\n totalResults: 10,\n results: [],\n modelName: 'PopularSearch'\n }\n ]\n };\n }\n };\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserClickedARecommendation`: the event is emitted after the user clicks the button.\n- A list of events emitted by the `BaseResultLink`.\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"recommendations.vue.js","sources":["../../../../../src/x-modules/recommendations/components/recommendations.vue"],"sourcesContent":["<template>\n <NoElement v-if=\"recommendations.length\">\n <!--\n @slot Customized Recommendations layout.\n @binding {Result[]} recommendations - Recommendations to render.\n @binding {Vue} animation - Animation to animate the elements.\n -->\n <slot name=\"layout\" v-bind=\"{ animation, recommendations }\">\n <component\n :is=\"animation\"\n tag=\"ul\"\n data-test=\"recommendations\"\n class=\"x-list x-recommendations\"\n >\n <li\n v-for=\"recommendation in recommendations\"\n :key=\"recommendation.id\"\n class=\"x-recommendations__item\"\n data-test=\"recommendation-item\"\n >\n <!--\n @slot (Required) Recommendation content.\n @binding {recommendation} recommendation - Recommendation data.\n -->\n <slot :recommendation=\"recommendation\" />\n </li>\n </component>\n </slot>\n </NoElement>\n</template>\n\n<script lang=\"ts\">\n import { Component, Prop, Provide } from 'vue-property-decorator';\n import { Result } from '@empathyco/x-types';\n import Vue from 'vue';\n import { State } from '../../../components/decorators/store.decorators';\n import { NoElement } from '../../../components/no-element';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { PropsWithType } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { recommendationsXModule } from '../x-module';\n\n /**\n * It renders a list of recommendations from the\n * {@link RecommendationsState.recommendations | Recommendations} state by default.\n * The component provides the slot layout which wraps the whole component with the\n * recommendations bounded. It also provides the default slot to customize the item, which is\n * within the layout slot, with the recommendation bounded. Each recommendation should be\n * represented by a {@link BaseResultLink | result link component} besides any other component.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(recommendationsXModule)],\n components: {\n NoElement\n }\n })\n export default class Recommendations extends Vue {\n /**\n * The module's list of recommendations.\n *\n * @public\n */\n @State('recommendations', 'recommendations')\n public storedRecommendations!: Result[];\n\n /**\n * Animation component that will be used to animate the recommendations.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue;\n\n /**\n * Number of recommendations to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The additional events to be emitted by the mandatory {@link BaseResultLink} component.\n *\n * @public\n */\n @Provide()\n protected resultClickExtraEvents: PropsWithType<XEventsTypes, Result>[] = [\n 'UserClickedARecommendation'\n ];\n\n /**\n * Slices the recommendations from the state.\n *\n * @returns - The list of recommendations slice by the number of items to render.\n *\n * @internal\n */\n protected get recommendations(): Result[] {\n return this.storedRecommendations.slice(0, this.maxItemsToRender);\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-recommendations {\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events, but it makes components such as `BaseResultLink` emit additional\nevents:\n\n- `UserClickedARecommendation`: the event is emitted after the user clicks the link of a\n recommendation.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Topclicked service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example on how the recommendations are rendered. You can customize how each\nresult is rendered by using the `default` slot. It is highly recommended to use base components such\nas the `BaseResultLink` or the `BaseResultAddToCart`, as they provides integration with other\nmodules such like the `tagging` one.\n\n```vue live\n<template>\n <Recommendations #default=\"{ recommendation }\">\n <BaseResultLink :result=\"recommendation\" class=\"x-recommendations__link\">\n <img :src=\"recommendation.images[0]\" class=\"x-recommendations__image\" />\n <span class=\"x-recommendations__title\">{{ recommendation.name }}</span>\n </BaseResultLink>\n <BaseResultAddToCart>Add to cart</BaseResultAddToCart>\n </Recommendations>\n</template>\n<script>\n import { Recommendations } from '@empathyco/x-components/recommendations';\n import { BaseResultLink, BaseResultAddToCart } from '@empathyco/x-components';\n\n export default {\n name: 'RecommendationsDemo',\n components: {\n Recommendations,\n BaseResultLink,\n BaseResultAddToCart\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the component will render a maximum of 4 result recommendations, and will use the\n`StaggeredFadeAndSlide` animation for the results, smoothing the entrance.\n\n```vue live\n<template>\n <Recommendations\n #default=\"{ recommendation }\"\n :maxItemsToRender=\"4\"\n animation=\"StaggeredFadeAndSlide\"\n >\n <BaseResultLink :result=\"recommendation\" class=\"x-recommendations__link\">\n <img :src=\"recommendation.images[0]\" class=\"x-recommendations__image\" />\n <span class=\"x-recommendations__title\">{{ recommendation.name }}</span>\n </BaseResultLink>\n <BaseResultAddToCart>Add to cart</BaseResultAddToCart>\n </Recommendations>\n</template>\n<script>\n import Vue from 'vue';\n import { Recommendations } from '@empathyco/x-components/recommendations';\n import { BaseResultLink, BaseResultAddToCart } from '@empathyco/x-components';\n\n Vue.component('StaggeredFadeAndSlide', StaggeredFadeAndSlide);\n export default {\n name: 'RecommendationsDemo',\n components: {\n Recommendations,\n BaseResultLink,\n BaseResultAddToCart\n }\n };\n</script>\n```\n\n### Play with the layout\n\nIn this example you can build your own layout, and the `Recommendations` component will just act as\na provider of the result recommendations data. Using the component this way, and due to Vue 2\nlimitations you will only be allowed to render a single element inside the `layout` slot.\n\n```vue live\n<template>\n <Recommendations #layout=\"{ recommendations }\">\n <div class=\"x-recommendations\">\n <article\n class=\"x-recommendations-list\"\n v-for=\"recommendation in recommendations\"\n :key=\"recommendation.id\"\n >\n <BaseResultLink :result=\"recommendation\" class=\"x-recommendations__link\">\n <img :src=\"recommendation.images[0]\" class=\"x-recommendations__image\" />\n <span class=\"x-recommendations__title\">{{ recommendation.name }}</span>\n </BaseResultLink>\n <BaseResultAddToCart>Add to cart</BaseResultAddToCart>\n </article>\n </div>\n </Recommendations>\n</template>\n<script>\n import { Recommendations } from '@empathyco/x-components/recommendations';\n import { BaseResultLink, BaseResultAddToCart } from '@empathyco/x-components';\n\n export default {\n name: 'RecommendationsDemo',\n components: {\n Recommendations,\n BaseResultLink,\n BaseResultAddToCart\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { createInjector, createInjectorSSR } from 'vue-runtime-helpers';
2
2
 
3
- var css = ".x-recommendations[data-v-29f8953e] {\n list-style-type: none;\n}";
3
+ var css = ".x-recommendations[data-v-231be26d] {\n list-style-type: none;\n}";
4
4
  const isBrowser = /*#__PURE__*/ (function () {
5
5
  return (
6
6
  Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) !==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.233",
3
+ "version": "3.0.0-alpha.235",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -135,5 +135,5 @@
135
135
  "access": "public",
136
136
  "directory": "dist"
137
137
  },
138
- "gitHead": "46d1486940127536c55fd400fabb508a49b5633a"
138
+ "gitHead": "eb0a1bae0d70f58a757706bf7b215322e6ad83e5"
139
139
  }
@@ -30175,32 +30175,6 @@
30175
30175
  "startIndex": 1,
30176
30176
  "endIndex": 2
30177
30177
  }
30178
- },
30179
- {
30180
- "kind": "PropertySignature",
30181
- "canonicalReference": "@empathyco/x-components!PopularSearchesConfig#showExtraSuggestionWithoutFilter:member",
30182
- "docComment": "/**\n * Show the extra suggestion that has filters without the filter.\n *\n * @example\n *\n * When set to true:\n * ```\n * query = 'trou';\n * suggestions = ['trousers in man', 'trousers in woman'];\n * // Suggests ['trousers', 'trousers in man', 'trousers in woman']\n * ```\n *\n * @example\n *\n * When set to false:\n * ```\n * query = 'trou';\n * suggestions = ['trousers in man', 'trousers in woman'];\n * // Suggests ['trousers in man', 'trousers in woman']\n * ```\n *\n */\n",
30183
- "excerptTokens": [
30184
- {
30185
- "kind": "Content",
30186
- "text": "showExtraSuggestionWithoutFilter: "
30187
- },
30188
- {
30189
- "kind": "Content",
30190
- "text": "boolean"
30191
- },
30192
- {
30193
- "kind": "Content",
30194
- "text": ";"
30195
- }
30196
- ],
30197
- "isOptional": false,
30198
- "releaseTag": "Public",
30199
- "name": "showExtraSuggestionWithoutFilter",
30200
- "propertyTypeTokenRange": {
30201
- "startIndex": 1,
30202
- "endIndex": 2
30203
- }
30204
30178
  }
30205
30179
  ],
30206
30180
  "extendsTokenRanges": []
@@ -33279,32 +33253,6 @@
33279
33253
  "startIndex": 1,
33280
33254
  "endIndex": 2
33281
33255
  }
33282
- },
33283
- {
33284
- "kind": "PropertySignature",
33285
- "canonicalReference": "@empathyco/x-components!QuerySuggestionsConfig#showExtraSuggestionWithoutFilter:member",
33286
- "docComment": "/**\n * Show the extra suggestion that has filters without the filter.\n *\n * @remarks\n *\n * Remember this property might be affected by {@link QuerySuggestionsConfig.hideIfEqualsQuery}\n *\n * @example\n *\n * When set to true:\n * ```\n * query = 'trou';\n * suggestions = ['trousers in man', 'trousers in woman'];\n * // Suggests ['trousers', 'trousers in man', 'trousers in woman']\n * ```\n *\n * @example\n *\n * When set to false:\n * ```\n * query = 'trou';\n * suggestions = ['trousers in man', 'trousers in woman'];\n * // Suggests ['trousers in man', 'trousers in woman']\n * ```\n *\n */\n",
33287
- "excerptTokens": [
33288
- {
33289
- "kind": "Content",
33290
- "text": "showExtraSuggestionWithoutFilter: "
33291
- },
33292
- {
33293
- "kind": "Content",
33294
- "text": "boolean"
33295
- },
33296
- {
33297
- "kind": "Content",
33298
- "text": ";"
33299
- }
33300
- ],
33301
- "isOptional": false,
33302
- "releaseTag": "Public",
33303
- "name": "showExtraSuggestionWithoutFilter",
33304
- "propertyTypeTokenRange": {
33305
- "startIndex": 1,
33306
- "endIndex": 2
33307
- }
33308
33256
  }
33309
33257
  ],
33310
33258
  "extendsTokenRanges": []
@@ -2869,7 +2869,6 @@ export interface PopularSearchesActions {
2869
2869
  export interface PopularSearchesConfig {
2870
2870
  hideSessionQueries: boolean;
2871
2871
  maxItemsToRequest: number;
2872
- showExtraSuggestionWithoutFilter: boolean;
2873
2872
  }
2874
2873
 
2875
2874
  // @internal
@@ -3135,7 +3134,6 @@ export interface QuerySuggestionsConfig {
3135
3134
  debounceInMs: number;
3136
3135
  hideIfEqualsQuery: boolean;
3137
3136
  maxItemsToRequest: number;
3138
- showExtraSuggestionWithoutFilter: boolean;
3139
3137
  }
3140
3138
 
3141
3139
  // @internal
@@ -30,25 +30,5 @@ export interface PopularSearchesConfig {
30
30
  * ```
31
31
  */
32
32
  hideSessionQueries: boolean;
33
- /**
34
- * Show the extra suggestion that has filters without the filter.
35
- *
36
- * @example
37
- * When set to true:
38
- * ```
39
- * query = 'trou';
40
- * suggestions = ['trousers in man', 'trousers in woman'];
41
- * // Suggests ['trousers', 'trousers in man', 'trousers in woman']
42
- * ```
43
- *
44
- * @example
45
- * When set to false:
46
- * ```
47
- * query = 'trou';
48
- * suggestions = ['trousers in man', 'trousers in woman'];
49
- * // Suggests ['trousers in man', 'trousers in woman']
50
- * ```
51
- */
52
- showExtraSuggestionWithoutFilter: boolean;
53
33
  }
54
34
  //# sourceMappingURL=config.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/popular-searches/config.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,gCAAgC,EAAE,OAAO,CAAC;CAC3C"}
1
+ {"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/popular-searches/config.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/popular-searches/store/module.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,2BAiCzC,CAAC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/popular-searches/store/module.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,2BAgCzC,CAAC"}
@@ -13,29 +13,6 @@ export interface QuerySuggestionsConfig {
13
13
  * Maximum number of query suggestions to request.
14
14
  */
15
15
  maxItemsToRequest: number;
16
- /**
17
- * Show the extra suggestion that has filters without the filter.
18
- *
19
- * @remarks
20
- * Remember this property might be affected by {@link QuerySuggestionsConfig.hideIfEqualsQuery}
21
- *
22
- * @example
23
- * When set to true:
24
- * ```
25
- * query = 'trou';
26
- * suggestions = ['trousers in man', 'trousers in woman'];
27
- * // Suggests ['trousers', 'trousers in man', 'trousers in woman']
28
- * ```
29
- *
30
- * @example
31
- * When set to false:
32
- * ```
33
- * query = 'trou';
34
- * suggestions = ['trousers in man', 'trousers in woman'];
35
- * // Suggests ['trousers in man', 'trousers in woman']
36
- * ```
37
- */
38
- showExtraSuggestionWithoutFilter: boolean;
39
16
  /**
40
17
  * Hides the suggestion if it is equal to the current query.
41
18
  *
@@ -1 +1 @@
1
- {"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/query-suggestions/config.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,gCAAgC,EAAE,OAAO,CAAC;IAC1C;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/query-suggestions/config.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/query-suggestions/store/module.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAkC1C,CAAC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/query-suggestions/store/module.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAiC1C,CAAC"}
@@ -1,34 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [PopularSearchesConfig](./x-components.popularsearchesconfig.md) &gt; [showExtraSuggestionWithoutFilter](./x-components.popularsearchesconfig.showextrasuggestionwithoutfilter.md)
4
-
5
- ## PopularSearchesConfig.showExtraSuggestionWithoutFilter property
6
-
7
- Show the extra suggestion that has filters without the filter.
8
-
9
- <b>Signature:</b>
10
-
11
- ```typescript
12
- showExtraSuggestionWithoutFilter: boolean;
13
- ```
14
-
15
- ## Example 1
16
-
17
- When set to true:
18
-
19
- ```
20
- query = 'trou';
21
- suggestions = ['trousers in man', 'trousers in woman'];
22
- // Suggests ['trousers', 'trousers in man', 'trousers in woman']
23
- ```
24
-
25
- ## Example 2
26
-
27
- When set to false:
28
-
29
- ```
30
- query = 'trou';
31
- suggestions = ['trousers in man', 'trousers in woman'];
32
- // Suggests ['trousers in man', 'trousers in woman']
33
- ```
34
-
@@ -1,38 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [QuerySuggestionsConfig](./x-components.querysuggestionsconfig.md) &gt; [showExtraSuggestionWithoutFilter](./x-components.querysuggestionsconfig.showextrasuggestionwithoutfilter.md)
4
-
5
- ## QuerySuggestionsConfig.showExtraSuggestionWithoutFilter property
6
-
7
- Show the extra suggestion that has filters without the filter.
8
-
9
- <b>Signature:</b>
10
-
11
- ```typescript
12
- showExtraSuggestionWithoutFilter: boolean;
13
- ```
14
-
15
- ## Remarks
16
-
17
- Remember this property might be affected by [QuerySuggestionsConfig.hideIfEqualsQuery](./x-components.querysuggestionsconfig.hideifequalsquery.md)
18
-
19
- ## Example 1
20
-
21
- When set to true:
22
-
23
- ```
24
- query = 'trou';
25
- suggestions = ['trousers in man', 'trousers in woman'];
26
- // Suggests ['trousers', 'trousers in man', 'trousers in woman']
27
- ```
28
-
29
- ## Example 2
30
-
31
- When set to false:
32
-
33
- ```
34
- query = 'trou';
35
- suggestions = ['trousers in man', 'trousers in woman'];
36
- // Suggests ['trousers in man', 'trousers in woman']
37
- ```
38
-