@empathyco/x-components 3.0.0-alpha.82 → 3.0.0-alpha.85

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 (76) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/core/index.js.map +1 -1
  3. package/design-system/full-theme.css +64 -64
  4. package/docs/API-reference/api/x-components.md +0 -3
  5. package/docs/API-reference/api/x-components.xmoduleoptions.md +1 -1
  6. package/docs/API-reference/api/x-components.xstoremoduleoptions.md +1 -1
  7. package/docs/API-reference/components/history-queries/x-components.clear-history-queries.md +29 -4
  8. package/docs/API-reference/components/history-queries/x-components.history-queries.md +51 -23
  9. package/docs/API-reference/components/history-queries/x-components.history-query.md +67 -17
  10. package/docs/API-reference/components/next-queries/x-components.next-queries-list.md +2 -2
  11. package/docs/API-reference/components/next-queries/x-components.next-queries.md +107 -26
  12. package/docs/API-reference/components/next-queries/x-components.next-query.md +57 -9
  13. package/docs/API-reference/components/popular-searches/x-components.popular-search.md +54 -11
  14. package/docs/API-reference/components/popular-searches/x-components.popular-searches.md +87 -23
  15. package/docs/API-reference/components/query-suggestions/x-components.query-suggestion.md +6 -6
  16. package/docs/API-reference/components/query-suggestions/x-components.query-suggestions.md +15 -14
  17. package/docs/API-reference/components/related-tags/x-components.related-tag.md +14 -20
  18. package/docs/API-reference/components/related-tags/x-components.related-tags.md +25 -23
  19. package/docs/API-reference/components/search-box/x-components.clear-search-input.md +26 -21
  20. package/docs/API-reference/components/search-box/x-components.search-button.md +39 -17
  21. package/docs/API-reference/components/search-box/x-components.search-input.md +18 -18
  22. package/js/index.js +0 -1
  23. package/js/index.js.map +1 -1
  24. package/js/x-installer/x-installer/x-installer.js.map +1 -1
  25. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  26. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  27. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  28. package/js/x-modules/next-queries/components/next-queries-list.vue.js.map +1 -1
  29. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  30. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  31. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  32. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  33. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
  34. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
  35. package/js/x-modules/related-tags/components/related-tag.vue.js +2 -2
  36. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  37. package/js/x-modules/related-tags/components/related-tags.vue.js +2 -2
  38. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  39. package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
  40. package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
  41. package/js/x-modules/search-box/components/search-input.vue.js +2 -2
  42. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  43. package/js/x-modules/tagging/store/actions/track.action.js +1 -2
  44. package/js/x-modules/tagging/store/actions/track.action.js.map +1 -1
  45. package/js/x-modules/tagging/wiring.js +1 -1
  46. package/js/x-modules/tagging/wiring.js.map +1 -1
  47. package/package.json +5 -6
  48. package/report/x-components.api.json +5 -380
  49. package/report/x-components.api.md +6 -30
  50. package/tagging/index.js +0 -1
  51. package/types/plugins/x-plugin.types.d.ts +2 -1
  52. package/types/plugins/x-plugin.types.d.ts.map +1 -1
  53. package/types/utils/types.d.ts +1 -10
  54. package/types/utils/types.d.ts.map +1 -1
  55. package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
  56. package/types/x-modules/tagging/service/index.d.ts +0 -1
  57. package/types/x-modules/tagging/service/index.d.ts.map +1 -1
  58. package/types/x-modules/tagging/service/types.d.ts +0 -20
  59. package/types/x-modules/tagging/service/types.d.ts.map +1 -1
  60. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  61. package/docs/API-reference/api/x-components.deeppartial.md +0 -17
  62. package/docs/API-reference/api/x-components.defaultsessionservice._constructor_.md +0 -21
  63. package/docs/API-reference/api/x-components.defaultsessionservice.clearsessionid.md +0 -17
  64. package/docs/API-reference/api/x-components.defaultsessionservice.getsessionid.md +0 -19
  65. package/docs/API-reference/api/x-components.defaultsessionservice.instance.md +0 -13
  66. package/docs/API-reference/api/x-components.defaultsessionservice.md +0 -37
  67. package/docs/API-reference/api/x-components.defaultsessionservice.session_id_key.md +0 -13
  68. package/docs/API-reference/api/x-components.defaultsessionservice.storageservice.md +0 -11
  69. package/docs/API-reference/api/x-components.defaultsessionservice.ttlms.md +0 -11
  70. package/docs/API-reference/api/x-components.sessionservice.clearsessionid.md +0 -17
  71. package/docs/API-reference/api/x-components.sessionservice.getsessionid.md +0 -23
  72. package/docs/API-reference/api/x-components.sessionservice.md +0 -21
  73. package/js/x-modules/tagging/service/session.service.js +0 -48
  74. package/js/x-modules/tagging/service/session.service.js.map +0 -1
  75. package/types/x-modules/tagging/service/session.service.d.ts +0 -37
  76. package/types/x-modules/tagging/service/session.service.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
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.85](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.84...@empathyco/x-components@3.0.0-alpha.85) (2022-04-14)
7
+
8
+ ### Features
9
+
10
+ - extract SessionService to x-utils package
11
+ ([5268808](https://github.com/empathyco/x/commit/52688087e577dfd7ce9b0669b21ada75ae67053c))
12
+
13
+ # Change Log
14
+
15
+ All notable changes to this project will be documented in this file. See
16
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
17
+
18
+ ## [3.0.0-alpha.84](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.83...@empathyco/x-components@3.0.0-alpha.84) (2022-04-07)
19
+
20
+ **Note:** Version bump only for package @empathyco/x-components
21
+
22
+ # Change Log
23
+
24
+ All notable changes to this project will be documented in this file. See
25
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
26
+
27
+ ## [3.0.0-alpha.83](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.82...@empathyco/x-components@3.0.0-alpha.83) (2022-04-07)
28
+
29
+ ### Code Refactoring
30
+
31
+ - move DeepPartial type from x-components to x-utils
32
+ ([a26f0c5](https://github.com/empathyco/x/commit/a26f0c54317f17144b4262c60b0a0dc086883eb9)),
33
+ closes [EX-5835](https://searchbroker.atlassian.net/browse/EX-5835)
34
+
35
+ ### Documentation
36
+
37
+ - activating ready live-examples
38
+ ([953e6c2](https://github.com/empathyco/x/commit/953e6c2ead73cd464fbb861bcc917134eac478a1)),
39
+ closes [EX-5705](https://searchbroker.atlassian.net/browse/EX-5705)
40
+
41
+ # Change Log
42
+
43
+ All notable changes to this project will be documented in this file. See
44
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
45
+
6
46
  ## [3.0.0-alpha.82](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.81...@empathyco/x-components@3.0.0-alpha.82) (2022-04-05)
7
47
 
8
48
  **Note:** Version bump only for package @empathyco/x-components
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6234,70 +6234,6 @@
6234
6234
  .x-border-width--left-10 {
6235
6235
  border-style: solid !important;
6236
6236
  }
6237
- .x-shadow--none {
6238
- box-shadow: none !important;
6239
- }
6240
-
6241
- .x-shadow--01 {
6242
- box-shadow: var(--x-string-box-shadow-01) !important;
6243
- }
6244
- .x-shadow--bottom-01 {
6245
- box-shadow: var(--x-string-box-shadow-bottom-01) !important;
6246
- }
6247
- .x-shadow--02 {
6248
- box-shadow: var(--x-string-box-shadow-02) !important;
6249
- }
6250
- .x-shadow--bottom-02 {
6251
- box-shadow: var(--x-string-box-shadow-bottom-02) !important;
6252
- }
6253
- .x-shadow--03 {
6254
- box-shadow: var(--x-string-box-shadow-03) !important;
6255
- }
6256
- .x-shadow--bottom-03 {
6257
- box-shadow: var(--x-string-box-shadow-bottom-03) !important;
6258
- }
6259
- .x-shadow--04 {
6260
- box-shadow: var(--x-string-box-shadow-04) !important;
6261
- }
6262
- .x-shadow--bottom-04 {
6263
- box-shadow: var(--x-string-box-shadow-bottom-04) !important;
6264
- }
6265
- .x-shadow--05 {
6266
- box-shadow: var(--x-string-box-shadow-05) !important;
6267
- }
6268
- .x-shadow--bottom-05 {
6269
- box-shadow: var(--x-string-box-shadow-bottom-05) !important;
6270
- }
6271
- .x-shadow--06 {
6272
- box-shadow: var(--x-string-box-shadow-06) !important;
6273
- }
6274
- .x-shadow--bottom-06 {
6275
- box-shadow: var(--x-string-box-shadow-bottom-06) !important;
6276
- }
6277
- .x-shadow--07 {
6278
- box-shadow: var(--x-string-box-shadow-07) !important;
6279
- }
6280
- .x-shadow--bottom-07 {
6281
- box-shadow: var(--x-string-box-shadow-bottom-07) !important;
6282
- }
6283
- .x-shadow--08 {
6284
- box-shadow: var(--x-string-box-shadow-08) !important;
6285
- }
6286
- .x-shadow--bottom-08 {
6287
- box-shadow: var(--x-string-box-shadow-bottom-08) !important;
6288
- }
6289
- .x-shadow--09 {
6290
- box-shadow: var(--x-string-box-shadow-09) !important;
6291
- }
6292
- .x-shadow--bottom-09 {
6293
- box-shadow: var(--x-string-box-shadow-bottom-09) !important;
6294
- }
6295
- .x-shadow--10 {
6296
- box-shadow: var(--x-string-box-shadow-10) !important;
6297
- }
6298
- .x-shadow--bottom-10 {
6299
- box-shadow: var(--x-string-box-shadow-bottom-10) !important;
6300
- }
6301
6237
  /* Material Elevations extracted from:
6302
6238
  https://gist.github.com/serglo/f9f0be9a66fd6755a0bda85f9c64e85f
6303
6239
  */
@@ -6464,6 +6400,70 @@
6464
6400
  .x-font-color--transparent {
6465
6401
  color: var(--x-color-base-transparent) !important;
6466
6402
  }
6403
+ .x-shadow--none {
6404
+ box-shadow: none !important;
6405
+ }
6406
+
6407
+ .x-shadow--01 {
6408
+ box-shadow: var(--x-string-box-shadow-01) !important;
6409
+ }
6410
+ .x-shadow--bottom-01 {
6411
+ box-shadow: var(--x-string-box-shadow-bottom-01) !important;
6412
+ }
6413
+ .x-shadow--02 {
6414
+ box-shadow: var(--x-string-box-shadow-02) !important;
6415
+ }
6416
+ .x-shadow--bottom-02 {
6417
+ box-shadow: var(--x-string-box-shadow-bottom-02) !important;
6418
+ }
6419
+ .x-shadow--03 {
6420
+ box-shadow: var(--x-string-box-shadow-03) !important;
6421
+ }
6422
+ .x-shadow--bottom-03 {
6423
+ box-shadow: var(--x-string-box-shadow-bottom-03) !important;
6424
+ }
6425
+ .x-shadow--04 {
6426
+ box-shadow: var(--x-string-box-shadow-04) !important;
6427
+ }
6428
+ .x-shadow--bottom-04 {
6429
+ box-shadow: var(--x-string-box-shadow-bottom-04) !important;
6430
+ }
6431
+ .x-shadow--05 {
6432
+ box-shadow: var(--x-string-box-shadow-05) !important;
6433
+ }
6434
+ .x-shadow--bottom-05 {
6435
+ box-shadow: var(--x-string-box-shadow-bottom-05) !important;
6436
+ }
6437
+ .x-shadow--06 {
6438
+ box-shadow: var(--x-string-box-shadow-06) !important;
6439
+ }
6440
+ .x-shadow--bottom-06 {
6441
+ box-shadow: var(--x-string-box-shadow-bottom-06) !important;
6442
+ }
6443
+ .x-shadow--07 {
6444
+ box-shadow: var(--x-string-box-shadow-07) !important;
6445
+ }
6446
+ .x-shadow--bottom-07 {
6447
+ box-shadow: var(--x-string-box-shadow-bottom-07) !important;
6448
+ }
6449
+ .x-shadow--08 {
6450
+ box-shadow: var(--x-string-box-shadow-08) !important;
6451
+ }
6452
+ .x-shadow--bottom-08 {
6453
+ box-shadow: var(--x-string-box-shadow-bottom-08) !important;
6454
+ }
6455
+ .x-shadow--09 {
6456
+ box-shadow: var(--x-string-box-shadow-09) !important;
6457
+ }
6458
+ .x-shadow--bottom-09 {
6459
+ box-shadow: var(--x-string-box-shadow-bottom-09) !important;
6460
+ }
6461
+ .x-shadow--10 {
6462
+ box-shadow: var(--x-string-box-shadow-10) !important;
6463
+ }
6464
+ .x-shadow--bottom-10 {
6465
+ box-shadow: var(--x-string-box-shadow-bottom-10) !important;
6466
+ }
6467
6467
  .x-font-size--01 {
6468
6468
  font-size: var(--x-size-base-01) !important;
6469
6469
  line-height: 1.5;
@@ -58,7 +58,6 @@ X-Components is a library usable everywhere not only for search experiences.
58
58
  | [CrossFade](./x-components.crossfade.md) | Renders a transition wrapping the element passed in the default slo. The transition fades between the two toggled elements at the same time. |
59
59
  | [DefaultFacetsService](./x-components.defaultfacetsservice.md) | Default implementation for the [FacetsService](./x-components.facetsservice.md)<!-- -->. |
60
60
  | [DefaultPDPAddToCartService](./x-components.defaultpdpaddtocartservice.md) | Default implementation for the [PDPAddToCartService](./x-components.pdpaddtocartservice.md)<!-- -->. |
61
- | [DefaultSessionService](./x-components.defaultsessionservice.md) | Default implementation for the [SessionService](./x-components.sessionservice.md)<!-- -->. |
62
61
  | [DeviceDetector](./x-components.devicedetector.md) | This component helps detecting or setting a device, that can be used later to create different layouts optimized for different devices. This detected device is available under the [XComponentAliasAPI.device](./x-components.xcomponentaliasapi.device.md) property. |
63
62
  | [DirectionalFocusNavigationService](./x-components.directionalfocusnavigationservice.md) | Implementation of [SpatialNavigation](./x-components.spatialnavigation.md) using directional focus. |
64
63
  | [EditableNumberRangeFilter](./x-components.editablenumberrangefilter.md) | Renders an editable number range filter. It has two input fields to handle min and max values, emitting the needed events when clicked.<!-- -->It provides a default slot, with some utils bind, to customize the whole component; and two named slots <code>apply-content</code> and <code>clear-content</code> to override each button content.<!-- -->If <code>instant</code> prop is true, the needed events are emitted immediately; else, apply button is rendered to confirm to do it. False by default.<!-- -->If <code>clear</code> prop is true, clear button, which sets to null component min and max values, is rendered. True by default. |
@@ -302,7 +301,6 @@ X-Components is a library usable everywhere not only for search experiences.
302
301
  | [SearchMutations](./x-components.searchmutations.md) | Search store mutations. |
303
302
  | [SearchState](./x-components.searchstate.md) | Search store state. |
304
303
  | [SearchXEvents](./x-components.searchxevents.md) | Dictionary of the events of Search XModule, where each key is the event name, and the value is the event payload type or <code>void</code> if it has no payload. |
305
- | [SessionService](./x-components.sessionservice.md) | Service to manage the session id. |
306
304
  | [SnippetConfig](./x-components.snippetconfig.md) | Interface with the possible parameters to receive through the snippet integration. |
307
305
  | [SpatialNavigation](./x-components.spatialnavigation.md) | Interface for SpatialNavigation services based on [CSSWK specification](https://www.w3.org/TR/css-nav-1/)<!-- -->. |
308
306
  | [StateSelector](./x-components.stateselector.md) | Composition type of [SimpleStateSelector](./x-components.simplestateselector.md) which allows to indicate if the state selector should be executed in first instance (first assignment of values). Selector is the [SimpleStateSelector](./x-components.simplestateselector.md) and immediate flags if the selector should be executed when it is initialized for first time. |
@@ -575,7 +573,6 @@ X-Components is a library usable everywhere not only for search experiences.
575
573
  | [AnyXStoreModuleOption](./x-components.anyxstoremoduleoption.md) | Alias for any store module option. Use only when you don't care about the module concrete type. |
576
574
  | [ArrowKey](./x-components.arrowkey.md) | Union type containing the existing arrow keys. |
577
575
  | [DecoratorFor](./x-components.decoratorfor.md) | Creates a decorator that will only work for properties of the type passed. The decorator will only work if the property is public. |
578
- | [DeepPartial](./x-components.deeppartial.md) | Makes all the properties of the T type optional in depth. |
579
576
  | [DeviceXModule](./x-components.devicexmodule.md) | Device [XModule](./x-components.xmodule.md) alias. |
580
577
  | [DeviceXStoreModule](./x-components.devicexstoremodule.md) | Device type safe store module. |
581
578
  | [DocumentDirection](./x-components.documentdirection.md) | The HTML document direction orientation. Possible values: ltr (left to right) or rtl (right to left). |
@@ -16,6 +16,6 @@ export interface XModuleOptions<ModuleName extends XModuleName>
16
16
 
17
17
  | Property | Type | Description |
18
18
  | --- | --- | --- |
19
- | [config?](./x-components.xmoduleoptions.config.md) | [DeepPartial](./x-components.deeppartial.md)<!-- -->&lt;[ExtractState](./x-components.extractstate.md)<!-- -->&lt;ModuleName&gt; extends { config: infer Config; } ? Config : never&gt; | <i>(Optional)</i> The options to override the default config state for the module. |
19
+ | [config?](./x-components.xmoduleoptions.config.md) | DeepPartial&lt;[ExtractState](./x-components.extractstate.md)<!-- -->&lt;ModuleName&gt; extends { config: infer Config; } ? Config : never&gt; | <i>(Optional)</i> The options to override the default config state for the module. |
20
20
  | [wiring?](./x-components.xmoduleoptions.wiring.md) | Partial&lt;[Wiring](./x-components.wiring.md)<!-- -->&gt; | <i>(Optional)</i> The options to override the default wiring configuration for the module. |
21
21
 
@@ -16,5 +16,5 @@ export declare type XStoreModuleOptions<StoreModule extends AnyXStoreModule> = S
16
16
  mutations?: DeepPartial<MutationsTree<State, Mutations>>;
17
17
  } : never;
18
18
  ```
19
- <b>References:</b> [AnyXStoreModule](./x-components.anyxstoremodule.md)<!-- -->, [XStoreModule](./x-components.xstoremodule.md)<!-- -->, [DeepPartial](./x-components.deeppartial.md)<!-- -->, [ActionsTree](./x-components.actionstree.md)<!-- -->, [GettersTree](./x-components.getterstree.md)<!-- -->, [MutationsTree](./x-components.mutationstree.md)
19
+ <b>References:</b> [AnyXStoreModule](./x-components.anyxstoremodule.md)<!-- -->, [XStoreModule](./x-components.xstoremodule.md)<!-- -->, [ActionsTree](./x-components.actionstree.md)<!-- -->, [GettersTree](./x-components.getterstree.md)<!-- -->, [MutationsTree](./x-components.mutationstree.md)
20
20
 
@@ -22,10 +22,35 @@ intention to clear the whole history of queries.
22
22
 
23
23
  The component exposes a single default slot, where you can add icons or text.
24
24
 
25
- ```vue
26
- <ClearHistoryQueries>
27
- <img class="x-history-query__icon" src="./my-icon.svg"/>
28
- </ClearHistoryQueries>
25
+ ```vue live
26
+ <template>
27
+ <div>
28
+ <SearchInput />
29
+ <ClearHistoryQueries>Clear history queries</ClearHistoryQueries>
30
+ <HistoryQueries :animation="'FadeAndSlide'" :maxItemsToRender="10" />
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import Vue from "vue";
36
+ import { SearchInput } from "@empathyco/x-components/search-box";
37
+ import {
38
+ HistoryQueries,
39
+ ClearHistoryQueries
40
+ } from "@empathyco/x-components/history-queries";
41
+ import { FadeAndSlide } from "@empathyco/x-components";
42
+
43
+ // Registering the animation as a global component
44
+ Vue.component("FadeAndSlide", FadeAndSlide);
45
+ export default {
46
+ name: "ClearHistoryQueriesDemo",
47
+ components: {
48
+ SearchInput,
49
+ HistoryQueries,
50
+ ClearHistoryQueries
51
+ }
52
+ };
53
+ </script>
29
54
  ```
30
55
 
31
56
  ## Events
@@ -35,17 +35,22 @@ This component doesn't emit events.
35
35
 
36
36
  Here you have a basic example of how the HistoryQueries is rendered.
37
37
 
38
- ```vue
38
+ ```vue live
39
39
  <template>
40
- <HistoryQueries />
40
+ <div>
41
+ <SearchInput />
42
+ <HistoryQueries />
43
+ </div>
41
44
  </template>
42
45
 
43
46
  <script>
47
+ import { SearchInput } from "@empathyco/x-components/search-box";
44
48
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
45
49
 
46
50
  export default {
47
51
  name: "HistoryQueriesDemo",
48
52
  components: {
53
+ SearchInput,
49
54
  HistoryQueries
50
55
  }
51
56
  };
@@ -57,17 +62,22 @@ export default {
57
62
  In this example, the history queries have been limited to render a maximum of 10 queries (by default
58
63
  it is 5).
59
64
 
60
- ```vue
65
+ ```vue live
61
66
  <template>
62
- <HistoryQueries :maxItemsToRender="10" />
67
+ <div>
68
+ <SearchInput />
69
+ <HistoryQueries :maxItemsToRender="10" />
70
+ </div>
63
71
  </template>
64
72
 
65
73
  <script>
74
+ import { SearchInput } from "@empathyco/x-components/search-box";
66
75
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
67
76
 
68
77
  export default {
69
78
  name: "HistoryQueriesDemo",
70
79
  components: {
80
+ SearchInput,
71
81
  HistoryQueries
72
82
  }
73
83
  };
@@ -76,24 +86,27 @@ export default {
76
86
 
77
87
  ### Play with the animation
78
88
 
79
- ```vue
89
+ ```vue live
80
90
  <template>
81
- <HistoryQueries :animation="fadeAndSlide" />
91
+ <div>
92
+ <SearchInput />
93
+ <HistoryQueries :animation="'FadeAndSlide'" />
94
+ </div>
82
95
  </template>
83
96
 
84
97
  <script>
98
+ import Vue from "vue";
99
+ import { SearchInput } from "@empathyco/x-components/search-box";
85
100
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
86
101
  import { FadeAndSlide } from "@empathyco/x-components";
87
102
 
103
+ // Registering the animation as a global component
104
+ Vue.component("FadeAndSlide", FadeAndSlide);
88
105
  export default {
89
106
  name: "HistoryQueriesDemo",
90
107
  components: {
108
+ SearchInput,
91
109
  HistoryQueries
92
- },
93
- data() {
94
- return {
95
- fadeAndSlide: FadeAndSlide
96
- };
97
110
  }
98
111
  };
99
112
  </script>
@@ -104,14 +117,18 @@ export default {
104
117
  In this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the
105
118
  `suggestion` slot (although any other component could potentially be passed).
106
119
 
107
- ```vue
120
+ ```vue live
108
121
  <template>
109
- <HistoryQueries #suggestion="{ suggestion }">
110
- <HistoryQuery :suggestion="suggestion"></HistoryQuery>
111
- </HistoryQueries>
122
+ <div>
123
+ <SearchInput />
124
+ <HistoryQueries #suggestion="{ suggestion }">
125
+ <HistoryQuery :suggestion="suggestion" />
126
+ </HistoryQueries>
127
+ </div>
112
128
  </template>
113
129
 
114
130
  <script>
131
+ import { SearchInput } from "@empathyco/x-components/search-box";
115
132
  import {
116
133
  HistoryQueries,
117
134
  HistoryQuery
@@ -120,6 +137,7 @@ import {
120
137
  export default {
121
138
  name: "HistoryQueriesDemo",
122
139
  components: {
140
+ SearchInput,
123
141
  HistoryQueries,
124
142
  HistoryQuery
125
143
  }
@@ -133,19 +151,24 @@ To continue the previous example, the [`HistoryQuery`](./x-components.history-qu
133
151
  passed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also
134
152
  passed.
135
153
 
136
- ```vue
154
+ ```vue live
137
155
  <template>
138
- <HistoryQueries #suggestion-content="{ suggestion }">
139
- <span>{{ suggestion.query }}</span>
140
- </HistoryQueries>
156
+ <div>
157
+ <SearchInput />
158
+ <HistoryQueries #suggestion-content="{ suggestion }">
159
+ <span>{{ suggestion.query }}</span>
160
+ </HistoryQueries>
161
+ </div>
141
162
  </template>
142
163
 
143
164
  <script>
165
+ import { SearchInput } from "@empathyco/x-components/search-box";
144
166
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
145
167
 
146
168
  export default {
147
169
  name: "HistoryQueriesDemo",
148
170
  components: {
171
+ SearchInput,
149
172
  HistoryQueries
150
173
  }
151
174
  };
@@ -158,20 +181,25 @@ To continue the previous example, the [`HistoryQuery`](./x-components.history-qu
158
181
  passed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the
159
182
  icon to remove the history query.
160
183
 
161
- ```vue
184
+ ```vue live
162
185
  <template>
163
- <HistoryQueries #suggestion-content-remove="{ suggestion }">
164
- <CrossIcon />
165
- </HistoryQueries>
186
+ <div>
187
+ <SearchInput />
188
+ <HistoryQueries #suggestion-remove-content="{ suggestion }">
189
+ <CrossIcon />
190
+ </HistoryQueries>
191
+ </div>
166
192
  </template>
167
193
 
168
194
  <script>
195
+ import { SearchInput } from "@empathyco/x-components/search-box";
169
196
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
170
197
  import { CrossIcon } from "@empathyco/x-components";
171
198
 
172
199
  export default {
173
200
  name: "HistoryQueriesDemo",
174
201
  components: {
202
+ SearchInput,
175
203
  HistoryQueries,
176
204
  CrossIcon
177
205
  }
@@ -29,8 +29,29 @@ history queries.
29
29
 
30
30
  This component only requires a prop called `suggestion`
31
31
 
32
- ```vue
33
- <HistoryQuery :suggestion="historyQuery" />
32
+ ```vue live
33
+ <template>
34
+ <HistoryQuery :suggestion="suggestion" />
35
+ </template>
36
+
37
+ <script>
38
+ import { HistoryQuery } from "@empathyco/x-components/history-queries";
39
+ export default {
40
+ name: "HistoryQueryDemo",
41
+ components: {
42
+ HistoryQuery
43
+ },
44
+ data() {
45
+ return {
46
+ suggestion: {
47
+ modelName: "HistoryQuery",
48
+ query: "trousers",
49
+ facets: []
50
+ }
51
+ };
52
+ }
53
+ };
54
+ </script>
34
55
  ```
35
56
 
36
57
  ### Customizing slots content
@@ -43,18 +64,47 @@ the suggestion itself, and a `string` of HTML with the matched query.
43
64
  The other slot is called `remove-button-content`, and allows you to set the content of the button
44
65
  that serves to remove this query from the history. This slot only has one property, the suggestion.
45
66
 
46
- ````vue
47
- <HistoryQuery :suggestion="historyQuery">
48
- <template #default="{ suggestion, queryHTML }">
49
- <img class="x-history-query__history-icon" src="./history-icon.svg"/>
50
- <span class="x-history-query__matching-part" v-html="queryHTML"/>
51
- </template>
52
-
53
- <template #remove-button-content="{ suggestion }">
54
- <img class="x-history-query__remove-icon" src="./remove-icon.svg"/>
55
- </template>
56
- </HistoryQuery>
57
- ``` ## Events A list of events that the component will emit: -
58
- `UserSelectedAHistoryQuery`: the event is emitted after the user clicks the
59
- button. The event payload is the history query data.
60
- ````
67
+ ```vue live
68
+ <template>
69
+ <HistoryQuery :suggestion="suggestion">
70
+ <template #default="{ suggestion, queryHTML }">
71
+ <HistoryIcon />
72
+ <span class="x-history-query__matching-part" v-html="queryHTML" />
73
+ </template>
74
+
75
+ <template #remove-button-content="{ suggestion }">
76
+ <CrossIcon />
77
+ </template>
78
+ </HistoryQuery>
79
+ </template>
80
+
81
+ <script>
82
+ import { HistoryQuery } from "@empathyco/x-components/history-queries";
83
+ import { HistoryIcon, CrossIcon } from "@empathyco/x-components";
84
+
85
+ export default {
86
+ name: "HistoryQueryDemo",
87
+ components: {
88
+ HistoryQuery,
89
+ HistoryIcon,
90
+ CrossIcon
91
+ },
92
+ data() {
93
+ return {
94
+ suggestion: {
95
+ modelName: "HistoryQuery",
96
+ query: "trousers",
97
+ facets: []
98
+ }
99
+ };
100
+ }
101
+ };
102
+ </script>
103
+ ```
104
+
105
+ ## Events
106
+
107
+ A list of events that the component will emit:
108
+
109
+ - `UserSelectedAHistoryQuery`: the event is emitted after the user clicks the button. The event
110
+ payload is the history query data.
@@ -42,7 +42,7 @@ Usually, this component is going to be used together with the `ResultsList` one.
42
42
  will be inserted between the results, guiding users to discover new searches directly from the
43
43
  results list.
44
44
 
45
- ```vue
45
+ ```vue live
46
46
  <template>
47
47
  <div>
48
48
  <SearchInput />
@@ -77,7 +77,7 @@ Finally, a third group will be inserted at index `192`. Because `maxGroups` is c
77
77
  more groups will be inserted. Each one of this groups will have up to `6` next queries
78
78
  (`maxNextQueriesPerGroup`).
79
79
 
80
- ```vue
80
+ ```vue live
81
81
  <template>
82
82
  <div>
83
83
  <SearchInput />