@empathyco/x-components 6.0.0-alpha.16 → 6.0.0-alpha.17

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 (117) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/design-system/deprecated-full-theme.css +1261 -1261
  3. package/docs/API-reference/api/x-components.animationprop.md +6 -1
  4. package/docs/API-reference/api/x-components.bannerslist.md +3 -3
  5. package/docs/API-reference/api/x-components.basedropdown.md +3 -3
  6. package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
  7. package/docs/API-reference/api/x-components.basegrid.md +3 -3
  8. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +3 -3
  9. package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
  10. package/docs/API-reference/api/x-components.baseidtogglepanel.md +3 -3
  11. package/docs/API-reference/api/x-components.basemodal.md +6 -6
  12. package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
  13. package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
  14. package/docs/API-reference/api/x-components.basetabspanel.md +6 -6
  15. package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
  16. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
  17. package/docs/API-reference/api/x-components.empathize.md +3 -3
  18. package/docs/API-reference/api/x-components.facets.md +3 -3
  19. package/docs/API-reference/api/x-components.filterslist.md +3 -3
  20. package/docs/API-reference/api/x-components.hierarchicalfilter.md +2 -2
  21. package/docs/API-reference/api/x-components.identifierresults.md +3 -3
  22. package/docs/API-reference/api/x-components.itemslist.md +3 -3
  23. package/docs/API-reference/api/x-components.mainmodal.md +2 -2
  24. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +3 -3
  25. package/docs/API-reference/api/x-components.myhistory.md +3 -3
  26. package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
  27. package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
  28. package/docs/API-reference/api/x-components.promotedslist.md +3 -3
  29. package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
  30. package/docs/API-reference/api/x-components.recommendations.md +3 -3
  31. package/docs/API-reference/api/x-components.relatedpromptslist.md +3 -3
  32. package/docs/API-reference/api/x-components.relatedpromptsmutations.md +2 -0
  33. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
  34. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
  35. package/docs/API-reference/api/x-components.relatedpromptsstate.md +2 -0
  36. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
  37. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
  38. package/docs/API-reference/api/x-components.relatedtags.md +3 -3
  39. package/docs/API-reference/api/x-components.resultslist.md +3 -3
  40. package/docs/API-reference/api/x-components.scrolltotop.md +3 -3
  41. package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
  42. package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
  43. package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
  44. package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
  45. package/docs/API-reference/components/common/x-components.items-list.md +1 -1
  46. package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
  47. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
  48. package/docs/API-reference/components/search/x-components.results-list.md +1 -1
  49. package/js/components/items-list.vue.js.map +1 -1
  50. package/js/components/items-list.vue2.js +2 -2
  51. package/js/components/items-list.vue2.js.map +1 -1
  52. package/js/components/result/base-result-image.vue.js.map +1 -1
  53. package/js/components/result/base-result-image.vue2.js +3 -3
  54. package/js/components/result/base-result-image.vue2.js.map +1 -1
  55. package/js/types/animation-prop.js +5 -0
  56. package/js/types/animation-prop.js.map +1 -1
  57. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  58. package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
  59. package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
  60. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  61. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
  62. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
  63. package/js/x-modules/related-prompts/store/module.js +10 -0
  64. package/js/x-modules/related-prompts/store/module.js.map +1 -1
  65. package/js/x-modules/related-prompts/wiring.js +14 -0
  66. package/js/x-modules/related-prompts/wiring.js.map +1 -1
  67. package/js/x-modules/search/components/results-list.vue.js +2 -2
  68. package/js/x-modules/search/components/results-list.vue.js.map +1 -1
  69. package/package.json +2 -2
  70. package/report/x-components.api.json +1723 -7412
  71. package/report/x-components.api.md +143 -133
  72. package/types/components/base-dropdown.vue.d.ts +3 -3
  73. package/types/components/base-grid.vue.d.ts +3 -3
  74. package/types/components/base-variable-column-grid.vue.d.ts +3 -3
  75. package/types/components/items-list.vue.d.ts +3 -3
  76. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +3 -3
  77. package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
  78. package/types/components/modals/base-events-modal.vue.d.ts +2 -2
  79. package/types/components/modals/base-id-modal.vue.d.ts +2 -2
  80. package/types/components/modals/base-modal.vue.d.ts +6 -6
  81. package/types/components/modals/main-modal.vue.d.ts +2 -2
  82. package/types/components/panels/base-header-toggle-panel.vue.d.ts +3 -3
  83. package/types/components/panels/base-id-toggle-panel.vue.d.ts +3 -3
  84. package/types/components/panels/base-tabs-panel.vue.d.ts +6 -6
  85. package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
  86. package/types/components/result/base-result-image.vue.d.ts +10 -10
  87. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  88. package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
  89. package/types/types/animation-prop.d.ts +6 -2
  90. package/types/types/animation-prop.d.ts.map +1 -1
  91. package/types/x-modules/empathize/components/empathize.vue.d.ts +3 -3
  92. package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
  93. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +2 -2
  94. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
  95. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
  96. package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
  97. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
  98. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
  99. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
  100. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
  101. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +3 -3
  102. package/types/x-modules/related-prompts/store/module.d.ts.map +1 -1
  103. package/types/x-modules/related-prompts/store/types.d.ts +16 -0
  104. package/types/x-modules/related-prompts/store/types.d.ts.map +1 -1
  105. package/types/x-modules/related-prompts/wiring.d.ts +6 -0
  106. package/types/x-modules/related-prompts/wiring.d.ts.map +1 -1
  107. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
  108. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +3 -3
  109. package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
  110. package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
  111. package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
  112. package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
  113. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
  114. package/js/utils/options-api.js +0 -4
  115. package/js/utils/options-api.js.map +0 -1
  116. package/types/utils/options-api.d.ts +0 -3
  117. package/types/utils/options-api.d.ts.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, provide, ref, computed, watch, h } from 'vue';
2
2
  import { LIST_ITEMS_KEY, QUERY_KEY, HAS_MORE_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
3
3
  import ItemsList from '../../../components/items-list.vue.js';
4
- import { animationProp } from '../../../utils/options-api.js';
5
4
  import { useState } from '../../../composables/use-state.js';
6
5
  import { searchXModule } from '../x-module.js';
6
+ import { AnimationProp } from '../../../types/animation-prop.js';
7
7
 
8
8
  /**
9
9
  * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by
@@ -22,7 +22,7 @@ var _sfc_main = defineComponent({
22
22
  props: {
23
23
  /** Animation component that will be used to animate the results. */
24
24
  animation: {
25
- type: animationProp,
25
+ type: AnimationProp,
26
26
  default: 'ul'
27
27
  }
28
28
  },
@@ -1 +1 @@
1
- {"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import { animationProp } from '../../../utils/options-api';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n\n /**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\n export default defineComponent({\n name: 'ResultsList',\n xModule: searchXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: animationProp,\n default: 'ul'\n }\n },\n emits: ['UserReachedResultsListEnd'],\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n */\n const items: ComputedRef<Result[]> = useState('search', ['results']).results;\n provide<ComputedRef<Result[]>>(LIST_ITEMS_KEY as string, items);\n\n /** The total number of results, taken from the state. */\n const totalResults: ComputedRef<number> = useState('search', ['totalResults']).totalResults;\n\n /** This query is updated only when the search request has succeeded. */\n let providedQuery = ref('');\n provide<Ref<string>>(QUERY_KEY as string, providedQuery);\n\n /** Indicates if there are more available results that have not been injected. */\n const hasMoreItems = computed(() => items.value.length < totalResults.value);\n provide<ComputedRef<boolean>>(HAS_MORE_ITEMS_KEY as string, hasMoreItems);\n\n /** The status of the search request, taken from the state. */\n const searchStatus: ComputedRef<RequestStatus> = useState('search', ['status']).status;\n\n /** The query of the search request, taken from the state. */\n const searchQuery: ComputedRef<string> = useState('search', ['query']).query;\n\n /**\n * Updates the query to be provided to the child components\n * when the search request has succeeded.\n *\n * @param status - The status of the search request.\n */\n function updateQuery(status: RequestStatus) {\n if (status === 'success') {\n providedQuery.value = searchQuery.value;\n }\n }\n\n /**\n * Watches the searchStatus and triggers updateQuery as callback\n * when it changes.\n *\n * @param status - The status of the search request.\n */\n watch(searchStatus, () => updateQuery(searchStatus.value), { immediate: true });\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation };\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Search service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example of how the ResultsList is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList :animation=\"fadeAndSlide\" />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { FadeAndSlide } from '@empathyco/x-components/animations';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Overriding default content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #default=\"{ items, animation }\">\n <BaseGrid :items=\"items\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <span>Result: {{ item.name }}</span>\n </template>\n <template #default=\"{ item }\">\n <span>Default: {{ item }}</span>\n </template>\n </BaseGrid>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { BaseGrid } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BaseGrid\n }\n };\n</script>\n```\n\n### Overriding result content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #result=\"{ item }\">\n <span class=\"result\">\n {{ item.name }}\n </span>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { SearchInput, ResultsList } from '@empathyco/x-components/search';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Data injection\n\nStarting with the `ResultsList` component as root element, you can concat the list of list items\nusing `BannersList`, `PromotedsList`, `BaseGrid` or any component that injects the `listItems`\nvalue.\n\nThe order in which elements are placed in the template will define the concat strategy of the items,\nso it is important to define it properly; for example, Promoteds will be usually before Banners so\nfirst promoted items are inserted within the results and then banner items are placed on top of\nthat, occupying the rows.\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList>\n <PromotedsList>\n <BannersList>\n <template #result=\"{ item }\">Result: {{ item.id }}</template>\n <template #banner=\"{ item }\">Banner: {{ item.id }}</template>\n <template #promoted=\"{ item }\">Promoted: {{ item.id }}</template>\n </BannersList>\n </PromotedsList>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList, BannersList, PromotedsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BannersList,\n PromotedsList\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;AAcE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAG;AACd,SAAA;AACD,KAAA;IACD,KAAK,EAAE,CAAC,2BAA2B,CAAC;AACpC,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;;;AAME;AACF,QAAA,MAAM,KAAK,GAA0B,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;AAC5E,QAAA,OAAO,CAAwB,cAAwB,EAAE,KAAK,CAAC,CAAA;;AAG/D,QAAA,MAAM,YAAY,GAAwB,QAAQ,CAAC,QAAQ,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAA;;AAG3F,QAAA,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC,CAAA;AAC3B,QAAA,OAAO,CAAc,SAAmB,EAAE,aAAa,CAAC,CAAA;;AAGxD,QAAA,MAAM,YAAa,GAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,MAAK,GAAI,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5E,QAAA,OAAO,CAAuB,kBAA4B,EAAE,YAAY,CAAC,CAAA;;AAGzE,QAAA,MAAM,YAAY,GAA+B,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;;AAGtF,QAAA,MAAM,WAAW,GAAwB,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAE5E;;;;;AAKE;QACF,SAAS,WAAW,CAAC,MAAqB,EAAA;YACxC,IAAI,WAAW,SAAS,EAAE;AACxB,gBAAA,aAAa,CAAC,KAAM,GAAE,WAAW,CAAC,KAAK,CAAA;AACzC,aAAA;SACF;AAEA;;;;;AAKE;AACF,QAAA,KAAK,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAG,EAAG,CAAC,CAAA;AAE/E,QAAA,OAAO,MAAM;AACX,YAAA,MAAM,UAAW,GAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAG,CAAA;;AAErE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAE,IAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAC1E,SAAC,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n\n /**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\n export default defineComponent({\n name: 'ResultsList',\n xModule: searchXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: AnimationProp,\n default: 'ul'\n }\n },\n emits: ['UserReachedResultsListEnd'],\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n */\n const items: ComputedRef<Result[]> = useState('search', ['results']).results;\n provide<ComputedRef<Result[]>>(LIST_ITEMS_KEY as string, items);\n\n /** The total number of results, taken from the state. */\n const totalResults: ComputedRef<number> = useState('search', ['totalResults']).totalResults;\n\n /** This query is updated only when the search request has succeeded. */\n let providedQuery = ref('');\n provide<Ref<string>>(QUERY_KEY as string, providedQuery);\n\n /** Indicates if there are more available results that have not been injected. */\n const hasMoreItems = computed(() => items.value.length < totalResults.value);\n provide<ComputedRef<boolean>>(HAS_MORE_ITEMS_KEY as string, hasMoreItems);\n\n /** The status of the search request, taken from the state. */\n const searchStatus: ComputedRef<RequestStatus> = useState('search', ['status']).status;\n\n /** The query of the search request, taken from the state. */\n const searchQuery: ComputedRef<string> = useState('search', ['query']).query;\n\n /**\n * Updates the query to be provided to the child components\n * when the search request has succeeded.\n *\n * @param status - The status of the search request.\n */\n function updateQuery(status: RequestStatus) {\n if (status === 'success') {\n providedQuery.value = searchQuery.value;\n }\n }\n\n /**\n * Watches the searchStatus and triggers updateQuery as callback\n * when it changes.\n *\n * @param status - The status of the search request.\n */\n watch(searchStatus, () => updateQuery(searchStatus.value), { immediate: true });\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation };\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Search service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example of how the ResultsList is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList :animation=\"fadeAndSlide\" />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { FadeAndSlide } from '@empathyco/x-components/animations';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Overriding default content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #default=\"{ items, animation }\">\n <BaseGrid :items=\"items\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <span>Result: {{ item.name }}</span>\n </template>\n <template #default=\"{ item }\">\n <span>Default: {{ item }}</span>\n </template>\n </BaseGrid>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { BaseGrid } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BaseGrid\n }\n };\n</script>\n```\n\n### Overriding result content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #result=\"{ item }\">\n <span class=\"result\">\n {{ item.name }}\n </span>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { SearchInput, ResultsList } from '@empathyco/x-components/search';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Data injection\n\nStarting with the `ResultsList` component as root element, you can concat the list of list items\nusing `BannersList`, `PromotedsList`, `BaseGrid` or any component that injects the `listItems`\nvalue.\n\nThe order in which elements are placed in the template will define the concat strategy of the items,\nso it is important to define it properly; for example, Promoteds will be usually before Banners so\nfirst promoted items are inserted within the results and then banner items are placed on top of\nthat, occupying the rows.\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList>\n <PromotedsList>\n <BannersList>\n <template #result=\"{ item }\">Result: {{ item.id }}</template>\n <template #banner=\"{ item }\">Banner: {{ item.id }}</template>\n <template #promoted=\"{ item }\">Promoted: {{ item.id }}</template>\n </BannersList>\n </PromotedsList>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList, BannersList, PromotedsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BannersList,\n PromotedsList\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;AAcE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAG;AACd,SAAA;AACD,KAAA;IACD,KAAK,EAAE,CAAC,2BAA2B,CAAC;AACpC,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;;;AAME;AACF,QAAA,MAAM,KAAK,GAA0B,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;AAC5E,QAAA,OAAO,CAAwB,cAAwB,EAAE,KAAK,CAAC,CAAA;;AAG/D,QAAA,MAAM,YAAY,GAAwB,QAAQ,CAAC,QAAQ,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAA;;AAG3F,QAAA,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC,CAAA;AAC3B,QAAA,OAAO,CAAc,SAAmB,EAAE,aAAa,CAAC,CAAA;;AAGxD,QAAA,MAAM,YAAa,GAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,MAAK,GAAI,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5E,QAAA,OAAO,CAAuB,kBAA4B,EAAE,YAAY,CAAC,CAAA;;AAGzE,QAAA,MAAM,YAAY,GAA+B,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;;AAGtF,QAAA,MAAM,WAAW,GAAwB,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAE5E;;;;;AAKE;QACF,SAAS,WAAW,CAAC,MAAqB,EAAA;YACxC,IAAI,WAAW,SAAS,EAAE;AACxB,gBAAA,aAAa,CAAC,KAAM,GAAE,WAAW,CAAC,KAAK,CAAA;AACzC,aAAA;SACF;AAEA;;;;;AAKE;AACF,QAAA,KAAK,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAG,EAAG,CAAC,CAAA;AAE/E,QAAA,OAAO,MAAM;AACX,YAAA,MAAM,UAAW,GAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAG,CAAA;;AAErE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAE,IAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAC1E,SAAC,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "6.0.0-alpha.16",
3
+ "version": "6.0.0-alpha.17",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -138,5 +138,5 @@
138
138
  "access": "public",
139
139
  "directory": "dist"
140
140
  },
141
- "gitHead": "c61339f124b2d0fa6e6dc9dabaa6cb99f57456c1"
141
+ "gitHead": "e977a597bc5442be5341d324c23f290660721d16"
142
142
  }