@empathyco/x-components 3.0.0-alpha.159 → 3.0.0-alpha.161

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 (90) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/core/index.js +3 -1
  3. package/core/index.js.map +1 -1
  4. package/design-system/full-theme.css +49 -48
  5. package/docs/API-reference/api/x-components.md +2 -0
  6. package/docs/API-reference/api/x-components.resultvariantselector.level.md +13 -0
  7. package/docs/API-reference/api/x-components.resultvariantselector.md +24 -0
  8. package/docs/API-reference/api/x-components.resultvariantselector.result.md +13 -0
  9. package/docs/API-reference/api/x-components.resultvariantselector.selectedvariants.md +13 -0
  10. package/docs/API-reference/api/x-components.resultvariantselector.selectresultvariant.md +13 -0
  11. package/docs/API-reference/api/x-components.resultvariantsprovider.autoselectdepth.md +13 -0
  12. package/docs/API-reference/api/x-components.resultvariantsprovider.md +37 -0
  13. package/docs/API-reference/api/x-components.resultvariantsprovider.render.md +26 -0
  14. package/docs/API-reference/api/x-components.resultvariantsprovider.resetselectedvariants.md +17 -0
  15. package/docs/API-reference/api/x-components.resultvariantsprovider.result.md +13 -0
  16. package/docs/API-reference/api/x-components.resultvariantsprovider.resulttoprovide.md +13 -0
  17. package/docs/API-reference/api/x-components.resultvariantsprovider.selectedvariants.md +13 -0
  18. package/docs/API-reference/api/x-components.resultvariantsprovider.selectfirstvariants.md +24 -0
  19. package/docs/API-reference/api/x-components.resultvariantsprovider.selectresultvariant.md +25 -0
  20. package/docs/API-reference/api/x-components.xeventstypes.md +1 -0
  21. package/docs/API-reference/api/x-components.xeventstypes.userselectedaresultvariant.md +17 -0
  22. package/docs/API-reference/components/common/result/x-components.result-variant-selector.md +300 -0
  23. package/docs/API-reference/components/common/result/x-components.result-variants-provider.md +195 -0
  24. package/js/components/decorators/injection.consts.js +20 -2
  25. package/js/components/decorators/injection.consts.js.map +1 -1
  26. package/js/components/result/result-variant-selector.vue.js +137 -0
  27. package/js/components/result/result-variant-selector.vue.js.map +1 -0
  28. package/js/components/result/result-variant-selector.vue_rollup-plugin-vue_script.vue.js +80 -0
  29. package/js/components/result/result-variant-selector.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  30. package/js/components/result/result-variants-provider.vue.js +39 -0
  31. package/js/components/result/result-variants-provider.vue.js.map +1 -0
  32. package/js/components/result/result-variants-provider.vue_rollup-plugin-vue_script.vue.js +130 -0
  33. package/js/components/result/result-variants-provider.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  34. package/js/index.js +3 -1
  35. package/js/index.js.map +1 -1
  36. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js +2 -0
  37. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  38. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue_script.vue.js +2 -0
  39. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  40. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue_script.vue.js +2 -0
  41. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  42. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js +2 -0
  43. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  44. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue_script.vue.js +2 -0
  45. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  46. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue_script.vue.js +2 -0
  47. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  48. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue_script.vue.js +2 -0
  49. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  50. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue_script.vue.js +2 -0
  51. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  52. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue_script.vue.js +2 -0
  53. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  54. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_script.vue.js +2 -0
  55. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  56. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_script.vue.js +2 -0
  57. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  58. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue_script.vue.js +2 -0
  59. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  60. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue_script.vue.js +2 -0
  61. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  62. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue_script.vue.js +2 -0
  63. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  64. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue_script.vue.js +2 -0
  65. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  66. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue_script.vue.js +2 -0
  67. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  68. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue_script.vue.js +2 -0
  69. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  70. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_script.vue.js +2 -0
  71. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  72. package/js/x-modules/search/components/sort.mixin.js +2 -0
  73. package/js/x-modules/search/components/sort.mixin.js.map +1 -1
  74. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue_script.vue.js +2 -0
  75. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  76. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue_script.vue.js +2 -0
  77. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  78. package/package.json +2 -2
  79. package/report/x-components.api.json +523 -0
  80. package/report/x-components.api.md +43 -0
  81. package/types/components/decorators/injection.consts.d.ts +19 -0
  82. package/types/components/decorators/injection.consts.d.ts.map +1 -1
  83. package/types/components/result/index.d.ts +2 -0
  84. package/types/components/result/index.d.ts.map +1 -1
  85. package/types/components/result/result-variant-selector.vue.d.ts +64 -0
  86. package/types/components/result/result-variant-selector.vue.d.ts.map +1 -0
  87. package/types/components/result/result-variants-provider.vue.d.ts +77 -0
  88. package/types/components/result/result-variants-provider.vue.d.ts.map +1 -0
  89. package/types/wiring/events.types.d.ts +11 -1
  90. package/types/wiring/events.types.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@
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.161](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.160...@empathyco/x-components@3.0.0-alpha.161) (2022-08-26)
7
+
8
+ ### Features
9
+
10
+ - **components:** variants auto selection (#679)
11
+ ([c1c8664](https://github.com/empathyco/x/commit/c1c866481ae8866fec4fd9e2dd5389fcba00e62b)),
12
+ closes [EX-6878](https://searchbroker.atlassian.net/browse/EX-6878)
13
+
14
+ # Change Log
15
+
16
+ All notable changes to this project will be documented in this file. See
17
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
18
+
19
+ ## [3.0.0-alpha.160](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.159...@empathyco/x-components@3.0.0-alpha.160) (2022-08-25)
20
+
21
+ ### Features
22
+
23
+ - **components:** merge a variant with the result (#667)
24
+ ([553d0e5](https://github.com/empathyco/x/commit/553d0e5de8ef5468eb673246f39fbeb826301fa1)),
25
+ closes [EX-6762](https://searchbroker.atlassian.net/browse/EX-6762)
26
+
27
+ # Change Log
28
+
29
+ All notable changes to this project will be documented in this file. See
30
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
31
+
6
32
  ## [3.0.0-alpha.159](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.158...@empathyco/x-components@3.0.0-alpha.159) (2022-08-24)
7
33
 
8
34
  ### Documentation
package/core/index.js CHANGED
@@ -98,6 +98,8 @@ export { default as BaseResultPreviousPrice } from '../js/components/result/base
98
98
  export { default as BaseFallbackImage } from '../js/components/result/base-result-fallback-image.vue.js';
99
99
  export { default as BasePlaceholderImage } from '../js/components/result/base-result-placeholder-image.vue.js';
100
100
  export { default as BaseResultRating } from '../js/components/result/base-result-rating.vue.js';
101
+ export { default as ResultVariantsProvider } from '../js/components/result/result-variants-provider.vue.js';
102
+ export { default as ResultVariantSelector } from '../js/components/result/result-variant-selector.vue.js';
101
103
  export { default as BaseScroll } from '../js/components/scroll/base-scroll.vue.js';
102
104
  export { default as ScrollMixin } from '../js/components/scroll/scroll.mixin.js';
103
105
  export { default as BaseSuggestion } from '../js/components/suggestions/base-suggestion.vue.js';
@@ -118,7 +120,7 @@ export { default as SlidingPanel } from '../js/components/sliding-panel.vue.js';
118
120
  export { default as SnippetCallbacks } from '../js/components/snippet-callbacks.vue.js';
119
121
  export { XEmit, XOn } from '../js/components/decorators/bus.decorators.js';
120
122
  export { Debounce } from '../js/components/decorators/debounce.decorators.js';
121
- export { LIST_ITEMS_KEY, QUERY_KEY } from '../js/components/decorators/injection.consts.js';
123
+ export { LIST_ITEMS_KEY, QUERY_KEY, RESULT_WITH_VARIANTS_KEY, SELECTED_VARIANTS_KEY, SELECT_RESULT_VARIANT_KEY } from '../js/components/decorators/injection.consts.js';
122
124
  export { XInject, XProvide } from '../js/components/decorators/injection.decorators.js';
123
125
  export { Getter, State } from '../js/components/decorators/store.decorators.js';
124
126
  export { ItemsListInjectionMixin } from '../js/components/items-list-injection.mixin.js';
package/core/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1310,47 +1310,6 @@
1310
1310
  [dir="rtl"] .x-input-group > .x-input-group__action:last-child {
1311
1311
  margin-left: calc(var(--x-size-border-width-right-input-group-default) * -1);
1312
1312
  }
1313
- .x-input-group--line .x-input-group,
1314
- .x-input-group--line.x-input-group {
1315
- --x-size-border-width-top-input-group-default: var(--x-size-border-width-top-input-group-line);
1316
- --x-size-border-width-right-input-group-default: var(
1317
- --x-size-border-width-right-input-group-line
1318
- );
1319
- --x-size-border-width-bottom-input-group-default: var(
1320
- --x-size-border-width-bottom-input-group-line
1321
- );
1322
- --x-size-border-width-left-input-group-default: var(--x-size-border-width-left-input-group-line);
1323
- }
1324
- .x-input-group--line .x-input-group > *:not(.x-input-group__action),
1325
- .x-input-group--line.x-input-group > *:not(.x-input-group__action) {
1326
- --x-size-padding-right-input-group-default: var(--x-size-padding-right-input-group-line);
1327
- --x-size-padding-left-input-group-default: var(--x-size-padding-left-input-group-line);
1328
- }
1329
- [dir="ltr"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="ltr"]
1330
- .x-input-group--line.x-input-group > .x-input-group__action {
1331
- margin-right: calc(var(--x-size-border-width-right-input-group-line) * -1) !important;
1332
- }
1333
- [dir="rtl"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="rtl"]
1334
- .x-input-group--line.x-input-group > .x-input-group__action {
1335
- margin-left: calc(var(--x-size-border-width-right-input-group-line) * -1) !important;
1336
- }
1337
- [dir="ltr"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="ltr"]
1338
- .x-input-group--line.x-input-group > .x-input-group__action {
1339
- margin-left: calc(
1340
- var(--x-size-border-width-inline-input-group-line) * -1
1341
- ) !important;
1342
- }
1343
- [dir="rtl"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="rtl"]
1344
- .x-input-group--line.x-input-group > .x-input-group__action {
1345
- margin-right: calc(
1346
- var(--x-size-border-width-inline-input-group-line) * -1
1347
- ) !important;
1348
- }
1349
- .x-input-group--line .x-input-group > .x-input-group__action,
1350
- .x-input-group--line.x-input-group > .x-input-group__action {
1351
- margin-top: calc(var(--x-size-border-width-top-input-group-line) * -1) !important;
1352
- margin-bottom: calc(var(--x-size-border-width-bottom-input-group-line) * -1) !important;
1353
- }
1354
1313
  :root {
1355
1314
  --x-color-background-input-group-default: var(--x-color-background-input-default);
1356
1315
  --x-color-border-input-group-default: var(--x-color-border-input-default);
@@ -1394,6 +1353,47 @@
1394
1353
  );
1395
1354
  --x-number-font-weight-input-group-default-button: var(--x-number-font-weight-base-light);
1396
1355
  }
1356
+ .x-input-group--line .x-input-group,
1357
+ .x-input-group--line.x-input-group {
1358
+ --x-size-border-width-top-input-group-default: var(--x-size-border-width-top-input-group-line);
1359
+ --x-size-border-width-right-input-group-default: var(
1360
+ --x-size-border-width-right-input-group-line
1361
+ );
1362
+ --x-size-border-width-bottom-input-group-default: var(
1363
+ --x-size-border-width-bottom-input-group-line
1364
+ );
1365
+ --x-size-border-width-left-input-group-default: var(--x-size-border-width-left-input-group-line);
1366
+ }
1367
+ .x-input-group--line .x-input-group > *:not(.x-input-group__action),
1368
+ .x-input-group--line.x-input-group > *:not(.x-input-group__action) {
1369
+ --x-size-padding-right-input-group-default: var(--x-size-padding-right-input-group-line);
1370
+ --x-size-padding-left-input-group-default: var(--x-size-padding-left-input-group-line);
1371
+ }
1372
+ [dir="ltr"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="ltr"]
1373
+ .x-input-group--line.x-input-group > .x-input-group__action {
1374
+ margin-right: calc(var(--x-size-border-width-right-input-group-line) * -1) !important;
1375
+ }
1376
+ [dir="rtl"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="rtl"]
1377
+ .x-input-group--line.x-input-group > .x-input-group__action {
1378
+ margin-left: calc(var(--x-size-border-width-right-input-group-line) * -1) !important;
1379
+ }
1380
+ [dir="ltr"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="ltr"]
1381
+ .x-input-group--line.x-input-group > .x-input-group__action {
1382
+ margin-left: calc(
1383
+ var(--x-size-border-width-inline-input-group-line) * -1
1384
+ ) !important;
1385
+ }
1386
+ [dir="rtl"] .x-input-group--line .x-input-group > .x-input-group__action,[dir="rtl"]
1387
+ .x-input-group--line.x-input-group > .x-input-group__action {
1388
+ margin-right: calc(
1389
+ var(--x-size-border-width-inline-input-group-line) * -1
1390
+ ) !important;
1391
+ }
1392
+ .x-input-group--line .x-input-group > .x-input-group__action,
1393
+ .x-input-group--line.x-input-group > .x-input-group__action {
1394
+ margin-top: calc(var(--x-size-border-width-top-input-group-line) * -1) !important;
1395
+ margin-bottom: calc(var(--x-size-border-width-bottom-input-group-line) * -1) !important;
1396
+ }
1397
1397
  :root {
1398
1398
  --x-size-padding-left-input-group-line: 0;
1399
1399
  --x-size-padding-right-input-group-line: 0;
@@ -1560,13 +1560,6 @@
1560
1560
  --x-size-border-radius-bottom-right-input-default: var(--x-size-border-radius-input-pill);
1561
1561
  --x-size-border-radius-bottom-left-input-default: var(--x-size-border-radius-input-pill);
1562
1562
  }
1563
- :root {
1564
- --x-size-border-radius-input-pill: var(--x-size-border-radius-base-pill);
1565
- --x-size-border-radius-top-left-input-pill: var(--x-size-border-radius-input-pill);
1566
- --x-size-border-radius-top-right-input-pill: var(--x-size-border-radius-input-pill);
1567
- --x-size-border-radius-bottom-right-input-pill: var(--x-size-border-radius-input-pill);
1568
- --x-size-border-radius-bottom-left-input-pill: var(--x-size-border-radius-input-pill);
1569
- }
1570
1563
  .x-list {
1571
1564
  display: flex;
1572
1565
  flex-flow: var(--x-string-flow-list);
@@ -7483,3 +7476,11 @@
7483
7476
  .x-normal-case {
7484
7477
  text-transform: none;
7485
7478
  }
7479
+
7480
+ :root {
7481
+ --x-size-border-radius-input-pill: var(--x-size-border-radius-base-pill);
7482
+ --x-size-border-radius-top-left-input-pill: var(--x-size-border-radius-input-pill);
7483
+ --x-size-border-radius-top-right-input-pill: var(--x-size-border-radius-input-pill);
7484
+ --x-size-border-radius-bottom-right-input-pill: var(--x-size-border-radius-input-pill);
7485
+ --x-size-border-radius-bottom-left-input-pill: var(--x-size-border-radius-input-pill);
7486
+ }
@@ -115,6 +115,8 @@ X-Components is a library usable everywhere not only for search experiences.
115
115
  | [RenderlessExtraParams](./x-components.renderlessextraparams.md) | It emits a [ExtraParamsXEvents.UserChangedExtraParams](./x-components.extraparamsxevents.userchangedextraparams.md) when the <code>updateValue</code> is called. |
116
116
  | [RenderlessFilter](./x-components.renderlessfilter.md) | Renders default slot content. It binds to the default slot a [BooleanFilter](./x-types.booleanfilter.md)<!-- -->, the [XEvents](./x-components.xevent.md) that will be emitted when clicking the content, the css classes and if the content should be disabled. |
117
117
  | [ResultsList](./x-components.resultslist.md) | It renders a [ItemsList](./x-components.itemslist.md) list with the results from [SearchState.results](./x-components.searchstate.results.md) by default.<!-- -->The component provides a default slot which wraps the whole component with the <code>results</code> bound.<!-- -->It also provides the slot result to customize the item, which is within the default slot, with the result bound. |
118
+ | [ResultVariantSelector](./x-components.resultvariantselector.md) | Component to show and select the available variants of a product for a given nest level. TODO: Add logger warning on mount when result is not injected. |
119
+ | [ResultVariantsProvider](./x-components.resultvariantsprovider.md) | Component that exposes the result merged with its selected variant in the default slot.<!-- -->It receives the original result and keeps track of the selected variant.<!-- -->It provides the original result, the array containing the selected variants and a callback to set the selected variant to be used from a child. |
118
120
  | [Scroll](./x-components.scroll.md) | Scrollable container that emits scroll related X Events. It exposes all the listeners and props from the [BaseScroll](./x-components.basescroll.md) component. |
119
121
  | [ScrollMixin](./x-components.scrollmixin.md) | Mixin to share Scroll logic. |
120
122
  | [ScrollToTop](./x-components.scrolltotop.md) | The <code>ScrollToTop</code> component is a button that the user can click to make a container scroll up to its initial position. |
@@ -0,0 +1,13 @@
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; [ResultVariantSelector](./x-components.resultvariantselector.md) &gt; [level](./x-components.resultvariantselector.level.md)
4
+
5
+ ## ResultVariantSelector.level property
6
+
7
+ The nest level of the variants to be rendered.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ level: number;
13
+ ```
@@ -0,0 +1,24 @@
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; [ResultVariantSelector](./x-components.resultvariantselector.md)
4
+
5
+ ## ResultVariantSelector class
6
+
7
+ Component to show and select the available variants of a product for a given nest level. TODO: Add logger warning on mount when result is not injected.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ export default class ResultVariantSelector extends Vue
13
+ ```
14
+ <b>Extends:</b> Vue
15
+
16
+ ## Properties
17
+
18
+ | Property | Modifiers | Type | Description |
19
+ | --- | --- | --- | --- |
20
+ | [level](./x-components.resultvariantselector.level.md) | | number | The nest level of the variants to be rendered. |
21
+ | [result](./x-components.resultvariantselector.result.md) | | Result | The original result, used to retrieve the available variants for the level. |
22
+ | [selectedVariants](./x-components.resultvariantselector.selectedvariants.md) | | ResultVariant\[\] | Array containing the selected variants. |
23
+ | [selectResultVariant](./x-components.resultvariantselector.selectresultvariant.md) | | (variant: ResultVariant, level?: number) =&gt; void | Callback to be called when a variant is selected. |
24
+
@@ -0,0 +1,13 @@
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; [ResultVariantSelector](./x-components.resultvariantselector.md) &gt; [result](./x-components.resultvariantselector.result.md)
4
+
5
+ ## ResultVariantSelector.result property
6
+
7
+ The original result, used to retrieve the available variants for the level.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ result: Result;
13
+ ```
@@ -0,0 +1,13 @@
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; [ResultVariantSelector](./x-components.resultvariantselector.md) &gt; [selectedVariants](./x-components.resultvariantselector.selectedvariants.md)
4
+
5
+ ## ResultVariantSelector.selectedVariants property
6
+
7
+ Array containing the selected variants.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ selectedVariants: ResultVariant[];
13
+ ```
@@ -0,0 +1,13 @@
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; [ResultVariantSelector](./x-components.resultvariantselector.md) &gt; [selectResultVariant](./x-components.resultvariantselector.selectresultvariant.md)
4
+
5
+ ## ResultVariantSelector.selectResultVariant property
6
+
7
+ Callback to be called when a variant is selected.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ selectResultVariant: (variant: ResultVariant, level?: number) => void;
13
+ ```
@@ -0,0 +1,13 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [autoSelectDepth](./x-components.resultvariantsprovider.autoselectdepth.md)
4
+
5
+ ## ResultVariantsProvider.autoSelectDepth property
6
+
7
+ The provider by default will auto select the first variants of all levels. This prop allows to limit the number of variants auto selected when the provider is created. Take into account that the depth will be the variants level + 1, so, setting autoSelectDepth to 0 will not select any variant, setting it to 1 will select only the first variant of the first level, and so on.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ autoSelectDepth: number;
13
+ ```
@@ -0,0 +1,37 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md)
4
+
5
+ ## ResultVariantsProvider class
6
+
7
+ Component that exposes the result merged with its selected variant in the default slot.
8
+
9
+ It receives the original result and keeps track of the selected variant.
10
+
11
+ It provides the original result, the array containing the selected variants and a callback to set the selected variant to be used from a child.
12
+
13
+ <b>Signature:</b>
14
+
15
+ ```typescript
16
+ export default class ResultVariantsProvider extends Vue
17
+ ```
18
+ <b>Extends:</b> Vue
19
+
20
+ ## Properties
21
+
22
+ | Property | Modifiers | Type | Description |
23
+ | --- | --- | --- | --- |
24
+ | [autoSelectDepth](./x-components.resultvariantsprovider.autoselectdepth.md) | | number | The provider by default will auto select the first variants of all levels. This prop allows to limit the number of variants auto selected when the provider is created. Take into account that the depth will be the variants level + 1, so, setting autoSelectDepth to 0 will not select any variant, setting it to 1 will select only the first variant of the first level, and so on. |
25
+ | [result](./x-components.resultvariantsprovider.result.md) | | Result | The original result containing the variants. |
26
+ | [resultToProvide](./x-components.resultvariantsprovider.resulttoprovide.md) | | Result | Merges the original result with the selected variant. The merge is done with all the selected variants of the array. |
27
+ | [selectedVariants](./x-components.resultvariantsprovider.selectedvariants.md) | | ResultVariant\[\] | Array to keep track of the selected variants of the result. Each position of the array is a nest level in the variants' hierarchy, so, the second position will contain a variant that is present inside the variant of the first position, and so on. |
28
+
29
+ ## Methods
30
+
31
+ | Method | Modifiers | Description |
32
+ | --- | --- | --- |
33
+ | [render(createElement)](./x-components.resultvariantsprovider.render.md) | | Render function of the provider. It exposes the result with the selected variant merged. |
34
+ | [resetSelectedVariants()](./x-components.resultvariantsprovider.resetselectedvariants.md) | | Resets the selected variants when the result changes. That includes doing the auto selection of the variants when the component is created and when the result is changed. |
35
+ | [selectFirstVariants(variant)](./x-components.resultvariantsprovider.selectfirstvariants.md) | | Adds to the selectedVariants array the variants up to the autoSelectDepth level. |
36
+ | [selectResultVariant(variant, level)](./x-components.resultvariantsprovider.selectresultvariant.md) | | Selects a variant of the result. When called, it slices the array of selected variants to remove the selected child variants. Emits the [XEventsTypes.UserSelectedAResultVariant](./x-components.xeventstypes.userselectedaresultvariant.md) when called. |
37
+
@@ -0,0 +1,26 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [render](./x-components.resultvariantsprovider.render.md)
4
+
5
+ ## ResultVariantsProvider.render() method
6
+
7
+ Render function of the provider. It exposes the result with the selected variant merged.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ render(createElement: CreateElement): VNode;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | createElement | CreateElement | Vue createElement method. |
20
+
21
+ <b>Returns:</b>
22
+
23
+ VNode
24
+
25
+ - The VNode of the first element passed in the slot.
26
+
@@ -0,0 +1,17 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [resetSelectedVariants](./x-components.resultvariantsprovider.resetselectedvariants.md)
4
+
5
+ ## ResultVariantsProvider.resetSelectedVariants() method
6
+
7
+ Resets the selected variants when the result changes. That includes doing the auto selection of the variants when the component is created and when the result is changed.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ resetSelectedVariants(): void;
13
+ ```
14
+ <b>Returns:</b>
15
+
16
+ void
17
+
@@ -0,0 +1,13 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [result](./x-components.resultvariantsprovider.result.md)
4
+
5
+ ## ResultVariantsProvider.result property
6
+
7
+ The original result containing the variants.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ result: Result;
13
+ ```
@@ -0,0 +1,13 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [resultToProvide](./x-components.resultvariantsprovider.resulttoprovide.md)
4
+
5
+ ## ResultVariantsProvider.resultToProvide property
6
+
7
+ Merges the original result with the selected variant. The merge is done with all the selected variants of the array.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ get resultToProvide(): Result;
13
+ ```
@@ -0,0 +1,13 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [selectedVariants](./x-components.resultvariantsprovider.selectedvariants.md)
4
+
5
+ ## ResultVariantsProvider.selectedVariants property
6
+
7
+ Array to keep track of the selected variants of the result. Each position of the array is a nest level in the variants' hierarchy, so, the second position will contain a variant that is present inside the variant of the first position, and so on.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ selectedVariants: ResultVariant[];
13
+ ```
@@ -0,0 +1,24 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [selectFirstVariants](./x-components.resultvariantsprovider.selectfirstvariants.md)
4
+
5
+ ## ResultVariantsProvider.selectFirstVariants() method
6
+
7
+ Adds to the selectedVariants array the variants up to the autoSelectDepth level.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ selectFirstVariants(variant?: ResultVariant): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | variant | ResultVariant | Variant to add to the array. |
20
+
21
+ <b>Returns:</b>
22
+
23
+ void
24
+
@@ -0,0 +1,25 @@
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; [ResultVariantsProvider](./x-components.resultvariantsprovider.md) &gt; [selectResultVariant](./x-components.resultvariantsprovider.selectresultvariant.md)
4
+
5
+ ## ResultVariantsProvider.selectResultVariant() method
6
+
7
+ Selects a variant of the result. When called, it slices the array of selected variants to remove the selected child variants. Emits the [XEventsTypes.UserSelectedAResultVariant](./x-components.xeventstypes.userselectedaresultvariant.md) when called.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ selectResultVariant(variant: ResultVariant, level?: number): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | variant | ResultVariant | The variant to set. |
20
+ | level | number | The nest level where the variant is placed inside the result. |
21
+
22
+ <b>Returns:</b>
23
+
24
+ void
25
+
@@ -45,5 +45,6 @@ Aside from common [XEvents](./x-components.xevent.md)<!-- -->, this interface al
45
45
  | [UserOpenXProgrammatically](./x-components.xeventstypes.useropenxprogrammatically.md) | void | The user opened X programmatically. Payload: none. |
46
46
  | [UserPressedArrowKey](./x-components.xeventstypes.userpressedarrowkey.md) | [ArrowKey](./x-components.arrowkey.md) | The user pressed an [arrow key](./x-components.arrowkey.md) with the focus on the search-box. Payload: the pressed [arrow key](./x-components.arrowkey.md)<!-- -->. |
47
47
  | [UserReachedEmpathizeTop](./x-components.xeventstypes.userreachedempathizetop.md) | void | The user has reached the top of the empathize and keeps navigating in that direction. Payload: none. |
48
+ | [UserSelectedAResultVariant](./x-components.xeventstypes.userselectedaresultvariant.md) | { result: Result; variant: ResultVariant; level: number; } | The user selected a result variant. Payload: And object containing the result, the selected variant and the level of the selected variant. |
48
49
  | [UserSelectedASuggestion](./x-components.xeventstypes.userselectedasuggestion.md) | Suggestion | User selected any kind of suggestion (query-suggestion, popular-search...) Payload: The [suggestion](./x-types.suggestion.md) that the user selected. |
49
50
 
@@ -0,0 +1,17 @@
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; [XEventsTypes](./x-components.xeventstypes.md) &gt; [UserSelectedAResultVariant](./x-components.xeventstypes.userselectedaresultvariant.md)
4
+
5
+ ## XEventsTypes.UserSelectedAResultVariant property
6
+
7
+ The user selected a result variant. Payload: And object containing the result, the selected variant and the level of the selected variant.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ UserSelectedAResultVariant: {
13
+ result: Result;
14
+ variant: ResultVariant;
15
+ level: number;
16
+ };
17
+ ```