@empathyco/x-components 3.0.0-alpha.130 → 3.0.0-alpha.131

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 (40) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/core/index.js.map +1 -1
  3. package/docs/API-reference/api/x-components.historyqueriesswitch.md +15 -0
  4. package/docs/API-reference/api/x-components.historyqueriesxevents.historyqueriesdisplayed.md +1 -1
  5. package/docs/API-reference/api/x-components.historyqueriesxevents.historyqueriesquerychanged.md +1 -1
  6. package/docs/API-reference/api/x-components.historyqueriesxevents.historyqueriesstoragekeychanged.md +1 -1
  7. package/docs/API-reference/api/x-components.historyqueriesxevents.md +10 -8
  8. package/docs/API-reference/api/x-components.historyqueriesxevents.sessionhistoryquerieschanged.md +1 -1
  9. package/docs/API-reference/api/x-components.historyqueriesxevents.userclickedconfirmdisablehistoryqueries.md +13 -0
  10. package/docs/API-reference/api/x-components.historyqueriesxevents.userclickeddisablehistoryqueries.md +13 -0
  11. package/docs/API-reference/api/x-components.historyqueriesxevents.userclickedenablehistoryqueries.md +13 -0
  12. package/docs/API-reference/api/x-components.historyqueriesxevents.userpressedclearhistoryqueries.md +1 -1
  13. package/docs/API-reference/api/x-components.historyqueriesxevents.userpressedremovehistoryquery.md +1 -1
  14. package/docs/API-reference/api/x-components.historyqueriesxevents.userselectedahistoryquery.md +1 -1
  15. package/docs/API-reference/api/x-components.md +3 -1
  16. package/docs/API-reference/api/x-components.sethistoryqueriesdisabled.md +13 -0
  17. package/docs/API-reference/api/x-components.sethistoryqueriesenabled.md +13 -0
  18. package/docs/API-reference/components/history-queries/x-components.history-queries-switch.md +96 -0
  19. package/history-queries/index.js +2 -1
  20. package/js/index.js +2 -1
  21. package/js/index.js.map +1 -1
  22. package/js/x-modules/history-queries/components/history-queries-switch.vue.js +50 -0
  23. package/js/x-modules/history-queries/components/history-queries-switch.vue.js.map +1 -0
  24. package/js/x-modules/history-queries/components/history-queries-switch.vue_rollup-plugin-vue_script.vue.js +37 -0
  25. package/js/x-modules/history-queries/components/history-queries-switch.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  26. package/js/x-modules/history-queries/wiring.js +14 -5
  27. package/js/x-modules/history-queries/wiring.js.map +1 -1
  28. package/package.json +2 -2
  29. package/report/x-components.api.json +157 -55
  30. package/report/x-components.api.md +22 -6
  31. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts +22 -0
  32. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts.map +1 -0
  33. package/types/x-modules/history-queries/components/index.d.ts +1 -0
  34. package/types/x-modules/history-queries/components/index.d.ts.map +1 -1
  35. package/types/x-modules/history-queries/events.types.d.ts +20 -10
  36. package/types/x-modules/history-queries/events.types.d.ts.map +1 -1
  37. package/types/x-modules/history-queries/wiring.d.ts +13 -4
  38. package/types/x-modules/history-queries/wiring.d.ts.map +1 -1
  39. package/docs/API-reference/api/x-components.historyqueriesxevents.usertoggledhistoryqueries.md +0 -13
  40. package/docs/API-reference/api/x-components.togglehistoryqueries.md +0 -13
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
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.131](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.130...@empathyco/x-components@3.0.0-alpha.131) (2022-07-13)
7
+
8
+ ### Features
9
+
10
+ - **history-queries:** add `HistoryQueriesSwitch` component (#593)
11
+ ([8c87cc3](https://github.com/empathyco/x/commit/8c87cc3a35336720d3da79ab7347e52caa4cd922)),
12
+ closes [EX-6515](https://searchbroker.atlassian.net/browse/EX-6515)
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
+
6
19
  ## [3.0.0-alpha.130](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.129...@empathyco/x-components@3.0.0-alpha.130) (2022-07-12)
7
20
 
8
21
  ### Features
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,15 @@
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; [HistoryQueriesSwitch](./x-components.historyqueriesswitch.md)
4
+
5
+ ## HistoryQueriesSwitch class
6
+
7
+ History Queries Switch is a component to enable or disable the history queries. This component emits events depending on the `isEnabled` value.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ export default class HistoryQueriesSwitch extends Vue
13
+ ```
14
+ <b>Extends:</b> Vue
15
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.HistoryQueriesDisplayed property
6
6
 
7
- The current history queries have been displayed to the user. \* Payload: The displayed history queries.
7
+ The current history queries have been displayed to the user. Payload: The displayed history queries.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.HistoryQueriesQueryChanged property
6
6
 
7
- The query for searching inside the history-queries has changed. \* Payload: The history-queries query.
7
+ The query for searching inside the history-queries has changed. Payload: The history-queries query.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.HistoryQueriesStorageKeyChanged property
6
6
 
7
- The key for saving the history queries in to the browser storage has changed. \* Payload: The new history-queries storage key.
7
+ The key for saving the history queries in to the browser storage has changed. Payload: The new history-queries storage key.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -16,12 +16,14 @@ export interface HistoryQueriesXEvents
16
16
 
17
17
  | Property | Type | Description |
18
18
  | --- | --- | --- |
19
- | [HistoryQueriesDisplayed](./x-components.historyqueriesxevents.historyqueriesdisplayed.md) | HistoryQuery\[\] | The current history queries have been displayed to the user. \* Payload: The displayed history queries. |
20
- | [HistoryQueriesQueryChanged](./x-components.historyqueriesxevents.historyqueriesquerychanged.md) | string | The query for searching inside the history-queries has changed. \* Payload: The history-queries query. |
21
- | [HistoryQueriesStorageKeyChanged](./x-components.historyqueriesxevents.historyqueriesstoragekeychanged.md) | string | The key for saving the history queries in to the browser storage has changed. \* Payload: The new history-queries storage key. |
22
- | [SessionHistoryQueriesChanged](./x-components.historyqueriesxevents.sessionhistoryquerieschanged.md) | HistoryQuery\[\] | The queries made in the current session have changed \* Payload: The session history queries. |
23
- | [UserPressedClearHistoryQueries](./x-components.historyqueriesxevents.userpressedclearhistoryqueries.md) | void | The user pressed the button for clearing all the history queries. \* Payload: none. |
24
- | [UserPressedRemoveHistoryQuery](./x-components.historyqueriesxevents.userpressedremovehistoryquery.md) | HistoryQuery | The user pressed the button for removing a single [history query](./x-types.historyquery.md)<!-- -->. \* Payload: The <code>HistoryQuery</code> to remove. |
25
- | [UserSelectedAHistoryQuery](./x-components.historyqueriesxevents.userselectedahistoryquery.md) | HistoryQuery | The user has selected a history-query. \* Payload: The [history query](./x-types.historyquery.md) selected. |
26
- | [UserToggledHistoryQueries](./x-components.historyqueriesxevents.usertoggledhistoryqueries.md) | boolean | The user has toggled the history queries. \* Payload: whether it has been set to enable or disable. |
19
+ | [HistoryQueriesDisplayed](./x-components.historyqueriesxevents.historyqueriesdisplayed.md) | HistoryQuery\[\] | The current history queries have been displayed to the user. Payload: The displayed history queries. |
20
+ | [HistoryQueriesQueryChanged](./x-components.historyqueriesxevents.historyqueriesquerychanged.md) | string | The query for searching inside the history-queries has changed. Payload: The history-queries query. |
21
+ | [HistoryQueriesStorageKeyChanged](./x-components.historyqueriesxevents.historyqueriesstoragekeychanged.md) | string | The key for saving the history queries in to the browser storage has changed. Payload: The new history-queries storage key. |
22
+ | [SessionHistoryQueriesChanged](./x-components.historyqueriesxevents.sessionhistoryquerieschanged.md) | HistoryQuery\[\] | The queries made in the current session have changed Payload: The session history queries. |
23
+ | [UserClickedConfirmDisableHistoryQueries](./x-components.historyqueriesxevents.userclickedconfirmdisablehistoryqueries.md) | void | The user has clicked the confirm button to disable the history queries. Payload: None. |
24
+ | [UserClickedDisableHistoryQueries](./x-components.historyqueriesxevents.userclickeddisablehistoryqueries.md) | void | The user has clicked a control to disable the history queries. Payload: None. |
25
+ | [UserClickedEnableHistoryQueries](./x-components.historyqueriesxevents.userclickedenablehistoryqueries.md) | void | The user has clicked a control to enable the history queries. Payload: None. |
26
+ | [UserPressedClearHistoryQueries](./x-components.historyqueriesxevents.userpressedclearhistoryqueries.md) | void | The user pressed the button for clearing all the history queries. Payload: none. |
27
+ | [UserPressedRemoveHistoryQuery](./x-components.historyqueriesxevents.userpressedremovehistoryquery.md) | HistoryQuery | The user pressed the button for removing a single [history query](./x-types.historyquery.md)<!-- -->. Payload: The <code>HistoryQuery</code> to remove. |
28
+ | [UserSelectedAHistoryQuery](./x-components.historyqueriesxevents.userselectedahistoryquery.md) | HistoryQuery | The user has selected a history-query. Payload: The [history query](./x-types.historyquery.md) selected. |
27
29
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.SessionHistoryQueriesChanged property
6
6
 
7
- The queries made in the current session have changed \* Payload: The session history queries.
7
+ The queries made in the current session have changed Payload: The session history queries.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -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; [HistoryQueriesXEvents](./x-components.historyqueriesxevents.md) &gt; [UserClickedConfirmDisableHistoryQueries](./x-components.historyqueriesxevents.userclickedconfirmdisablehistoryqueries.md)
4
+
5
+ ## HistoryQueriesXEvents.UserClickedConfirmDisableHistoryQueries property
6
+
7
+ The user has clicked the confirm button to disable the history queries. Payload: None.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ UserClickedConfirmDisableHistoryQueries: 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; [HistoryQueriesXEvents](./x-components.historyqueriesxevents.md) &gt; [UserClickedDisableHistoryQueries](./x-components.historyqueriesxevents.userclickeddisablehistoryqueries.md)
4
+
5
+ ## HistoryQueriesXEvents.UserClickedDisableHistoryQueries property
6
+
7
+ The user has clicked a control to disable the history queries. Payload: None.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ UserClickedDisableHistoryQueries: 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; [HistoryQueriesXEvents](./x-components.historyqueriesxevents.md) &gt; [UserClickedEnableHistoryQueries](./x-components.historyqueriesxevents.userclickedenablehistoryqueries.md)
4
+
5
+ ## HistoryQueriesXEvents.UserClickedEnableHistoryQueries property
6
+
7
+ The user has clicked a control to enable the history queries. Payload: None.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ UserClickedEnableHistoryQueries: void;
13
+ ```
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.UserPressedClearHistoryQueries property
6
6
 
7
- The user pressed the button for clearing all the history queries. \* Payload: none.
7
+ The user pressed the button for clearing all the history queries. Payload: none.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.UserPressedRemoveHistoryQuery property
6
6
 
7
- The user pressed the button for removing a single [history query](./x-types.historyquery.md)<!-- -->. \* Payload: The `HistoryQuery` to remove.
7
+ The user pressed the button for removing a single [history query](./x-types.historyquery.md)<!-- -->. Payload: The `HistoryQuery` to remove.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HistoryQueriesXEvents.UserSelectedAHistoryQuery property
6
6
 
7
- The user has selected a history-query. \* Payload: The [history query](./x-types.historyquery.md) selected.
7
+ The user has selected a history-query. Payload: The [history query](./x-types.historyquery.md) selected.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -77,6 +77,7 @@ X-Components is a library usable everywhere not only for search experiences.
77
77
  | [HierarchicalFilter](./x-components.hierarchicalfilter.md) | Renders a hierarchical filter recursively, emitting the needed events when clicked. |
78
78
  | [HistoryQueries](./x-components.historyqueries.md) | This component renders a list of suggestions coming from the user queries history. |
79
79
  | [HistoryQueriesGetter](./x-components.historyqueriesgetter.md) | Class implementation for the [HistoryQueriesGetters.historyQueries](./x-components.historyqueriesgetters.historyqueries.md) getter. |
80
+ | [HistoryQueriesSwitch](./x-components.historyqueriesswitch.md) | History Queries Switch is a component to enable or disable the history queries. This component emits events depending on the <code>isEnabled</code> value. |
80
81
  | [HistoryQuery](./x-components.historyquery.md) | This component renders a history query suggestion combining two buttons: one for selecting this suggestion as the search query, and another one to remove this query suggestion from the history queries. |
81
82
  | [IdentifierResult](./x-components.identifierresult.md) | This component renders an identifier result value and highlights its matching part with the query from the state. Receives as prop the [result data](./x-types.result.md)<!-- -->. |
82
83
  | [IdentifierResults](./x-components.identifierresults.md) | Paints the list of identifier results stored in the state. Each identifier result should be represented by a [identifier result component](./x-components.identifierresult.md) besides any other component. |
@@ -500,6 +501,8 @@ X-Components is a library usable everywhere not only for search experiences.
500
501
  | [setConsent](./x-components.setconsent.md) | Sets the tagging state <code>consent</code>. |
501
502
  | [setExtraParams](./x-components.setextraparams.md) | Sets the extra params of the [ExtraParamsXModule](./x-components.extraparamsxmodule.md)<!-- -->. |
502
503
  | [setHistoryQueries](./x-components.sethistoryqueries.md) | Default implementation for the [HistoryQueriesActions.setHistoryQueries()](./x-components.historyqueriesactions.sethistoryqueries.md)<!-- -->. |
504
+ | [setHistoryQueriesDisabled](./x-components.sethistoryqueriesdisabled.md) | Disables history queries. |
505
+ | [setHistoryQueriesEnabled](./x-components.sethistoryqueriesenabled.md) | Enables history queries. |
503
506
  | [setHistoryQueriesQuery](./x-components.sethistoryqueriesquery.md) | Sets the query of the history queries module. Used for searching into the history queries. |
504
507
  | [setIdentifierResultsExtraParams](./x-components.setidentifierresultsextraparams.md) | Sets the identifier result state <code>params</code>. |
505
508
  | [setIdentifierResultsQuery](./x-components.setidentifierresultsquery.md) | Sets the identifier-results module query. |
@@ -548,7 +551,6 @@ X-Components is a library usable everywhere not only for search experiences.
548
551
  | [taggingXModule](./x-components.taggingxmodule.md) | Tagging [XModule](./x-components.xmodule.md) implementation. This module is auto-registered as soon as you import any component from the <code>empathize</code> entry point. |
549
552
  | [TagIcon](./x-components.tagicon.md) | |
550
553
  | [throttleFunction](./x-components.throttlefunction.md) | Util function that returns a throttled version of the function passed as parameter. |
551
- | [toggleHistoryQueries](./x-components.togglehistoryqueries.md) | Enables or disables history queries. |
552
554
  | [toggleRelatedTag](./x-components.togglerelatedtag.md) | Default implementation for the [RelatedTagsActions.toggleRelatedTag()](./x-components.relatedtagsactions.togglerelatedtag.md)<!-- -->. |
553
555
  | [toggleRelatedTagWire](./x-components.togglerelatedtagwire.md) | Sets the selected related tags. |
554
556
  | [track](./x-components.track.md) | Default implementation for the [TaggingActions.track()](./x-components.taggingactions.track.md)<!-- -->. |
@@ -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; [setHistoryQueriesDisabled](./x-components.sethistoryqueriesdisabled.md)
4
+
5
+ ## setHistoryQueriesDisabled variable
6
+
7
+ Disables history queries.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ setHistoryQueriesDisabled: import("../..").AnyWire
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; [setHistoryQueriesEnabled](./x-components.sethistoryqueriesenabled.md)
4
+
5
+ ## setHistoryQueriesEnabled variable
6
+
7
+ Enables history queries.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ setHistoryQueriesEnabled: import("../..").AnyWire
13
+ ```
@@ -0,0 +1,96 @@
1
+ ---
2
+
3
+ title: HistoryQueriesSwitch
4
+
5
+ ---
6
+
7
+ # HistoryQueriesSwitch
8
+
9
+ History Queries Switch is a component to enable or disable the history queries.
10
+ This component emits events depending on the `isEnabled` value.
11
+
12
+ ## Events
13
+
14
+ A list of events that the component will emit:
15
+
16
+ - [`UserClickedEnableHistoryQueries`](x-components.historyqueriesxevents.userclickedenablehistoryqueries.md): the event is emitted
17
+ whenever the user clicks the switch and the history queries are disabled.
18
+ - [`UserClickedDisableHistoryQueries`](x-components.historyqueriesxevents.userclickeddisablehistoryqueries.md): the event is emitted
19
+ whenever the user clicks the switch and the history queries are enabled.
20
+
21
+ ## See it in action
22
+
23
+ Here you have a basic example of how the switch is rendered.
24
+
25
+ _Try clicking it to see how it changes its state_
26
+
27
+ ```vue live
28
+ <template>
29
+ <HistoryQueriesSwitch />
30
+ </template>
31
+
32
+ <script>
33
+ import { HistoryQueriesSwitch } from "@empathyco/x-components";
34
+
35
+ export default {
36
+ name: "HistoryQueriesSwitchDemo",
37
+ components: {
38
+ HistoryQueriesSwitch
39
+ }
40
+ };
41
+ </script>
42
+ ```
43
+
44
+ Here you have a more complex example.
45
+
46
+ ```vue live
47
+ <template>
48
+ <div>
49
+ <div>
50
+ <SearchInput :instant="false" />
51
+ <SearchButton>Search</SearchButton>
52
+ </div>
53
+ <label>
54
+ History queries:
55
+ <HistoryQueriesSwitch />
56
+ <HistoryQueries />
57
+ <BaseEventsModal :eventsToOpenModal="eventsToOpenModal">
58
+ <BaseEventButton :events="disableEvents">Disable</BaseEventButton>
59
+ <BaseEventButton :events="cancelEvents">Cancel</BaseEventButton>
60
+ </BaseEventsModal>
61
+ </label>
62
+ </div>
63
+ </template>
64
+
65
+ <script>
66
+ import { BaseEventButton, BaseEventsModal } from "@empathyco/x-components";
67
+ import {
68
+ HistoryQueriesSwitch,
69
+ HistoryQueries
70
+ } from "@empathyco/x-components/history-queries";
71
+ import { SearchInput, SearchButton } from "@empathyco/x-components/search";
72
+ export default {
73
+ name: "HistoryQueriesSwitchDemo",
74
+ components: {
75
+ BaseEventButton,
76
+ BaseEventsModal,
77
+ HistoryQueriesSwitch,
78
+ HistoryQueries,
79
+ SearchInput,
80
+ SearchButton
81
+ },
82
+ data() {
83
+ return {
84
+ eventsToOpenModal: ["UserClickedDisableHistoryQueries"],
85
+ disableEvents: {
86
+ UserClickedConfirmDisableHistoryQueries: undefined,
87
+ UserClickedCloseEventsModal: undefined
88
+ },
89
+ cancelEvents: {
90
+ UserClickedCloseEventsModal: undefined
91
+ }
92
+ };
93
+ }
94
+ };
95
+ </script>
96
+ ```
@@ -1,5 +1,6 @@
1
1
  export { default as ClearHistoryQueries } from '../js/x-modules/history-queries/components/clear-history-queries.vue.js';
2
2
  export { default as HistoryQueries } from '../js/x-modules/history-queries/components/history-queries.vue.js';
3
+ export { default as HistoryQueriesSwitch } from '../js/x-modules/history-queries/components/history-queries-switch.vue.js';
3
4
  export { default as HistoryQuery } from '../js/x-modules/history-queries/components/history-query.vue.js';
4
5
  export { default as MyHistory } from '../js/x-modules/history-queries/components/my-history.vue.js';
5
6
  export { default as RemoveHistoryQuery } from '../js/x-modules/history-queries/components/remove-history-query.vue.js';
@@ -13,5 +14,5 @@ export { HistoryQueriesGetter, historyQueries } from '../js/x-modules/history-qu
13
14
  export { sessionHistoryQueries } from '../js/x-modules/history-queries/store/getters/session-history-queries.getter.js';
14
15
  export { storageKey } from '../js/x-modules/history-queries/store/getters/storage-key.getter.js';
15
16
  export { historyQueriesXStoreModule } from '../js/x-modules/history-queries/store/module.js';
16
- export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesQuery, toggleHistoryQueries } from '../js/x-modules/history-queries/wiring.js';
17
+ export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery } from '../js/x-modules/history-queries/wiring.js';
17
18
  export { historyQueriesXModule } from '../js/x-modules/history-queries/x-module.js';
package/js/index.js CHANGED
@@ -208,6 +208,7 @@ export { isNewQuery } from './x-modules/facets/utils.js';
208
208
  export { default as FacetsMixin } from './x-modules/facets/components/facets.mixin.js';
209
209
  export { default as ClearHistoryQueries } from './x-modules/history-queries/components/clear-history-queries.vue.js';
210
210
  export { default as HistoryQueries } from './x-modules/history-queries/components/history-queries.vue.js';
211
+ export { default as HistoryQueriesSwitch } from './x-modules/history-queries/components/history-queries-switch.vue.js';
211
212
  export { default as HistoryQuery } from './x-modules/history-queries/components/history-query.vue.js';
212
213
  export { default as MyHistory } from './x-modules/history-queries/components/my-history.vue.js';
213
214
  export { default as RemoveHistoryQuery } from './x-modules/history-queries/components/remove-history-query.vue.js';
@@ -221,7 +222,7 @@ export { HistoryQueriesGetter, historyQueries } from './x-modules/history-querie
221
222
  export { sessionHistoryQueries } from './x-modules/history-queries/store/getters/session-history-queries.getter.js';
222
223
  export { storageKey } from './x-modules/history-queries/store/getters/storage-key.getter.js';
223
224
  export { historyQueriesXStoreModule } from './x-modules/history-queries/store/module.js';
224
- export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesQuery, toggleHistoryQueries } from './x-modules/history-queries/wiring.js';
225
+ export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery } from './x-modules/history-queries/wiring.js';
225
226
  export { historyQueriesXModule } from './x-modules/history-queries/x-module.js';
226
227
  export { default as IdentifierResult } from './x-modules/identifier-results/components/identifier-result.vue.js';
227
228
  export { default as IdentifierResults } from './x-modules/identifier-results/components/identifier-results.vue.js';
package/js/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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,50 @@
1
+ import script from './history-queries-switch.vue_rollup-plugin-vue_script.vue.js';
2
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
+
4
+ /* script */
5
+ const __vue_script__ = script;
6
+
7
+ /* template */
8
+ var __vue_render__ = function () {
9
+ var _vm = this;
10
+ var _h = _vm.$createElement;
11
+ var _c = _vm._self._c || _h;
12
+ return _c("BaseSwitch", {
13
+ attrs: { value: _vm.isEnabled },
14
+ on: { change: _vm.toggle },
15
+ })
16
+ };
17
+ var __vue_staticRenderFns__ = [];
18
+ __vue_render__._withStripped = true;
19
+
20
+ /* style */
21
+ const __vue_inject_styles__ = undefined;
22
+ /* scoped */
23
+ const __vue_scope_id__ = undefined;
24
+ /* module identifier */
25
+ const __vue_module_identifier__ = undefined;
26
+ /* functional template */
27
+ const __vue_is_functional_template__ = false;
28
+ /* style inject */
29
+
30
+ /* style inject SSR */
31
+
32
+ /* style inject shadow dom */
33
+
34
+
35
+
36
+ const __vue_component__ = /*#__PURE__*/__vue_normalize__(
37
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
38
+ __vue_inject_styles__,
39
+ __vue_script__,
40
+ __vue_scope_id__,
41
+ __vue_is_functional_template__,
42
+ __vue_module_identifier__,
43
+ false,
44
+ undefined,
45
+ undefined,
46
+ undefined
47
+ );
48
+
49
+ export { __vue_component__ as default };
50
+ //# sourceMappingURL=history-queries-switch.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-queries-switch.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries-switch.vue"],"sourcesContent":["<template>\n <BaseSwitch @change=\"toggle\" :value=\"isEnabled\" />\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import BaseSwitch from '../../../components/base-switch.vue';\n import { State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { historyQueriesXModule } from '../x-module';\n\n /**\n * History Queries Switch is a component to enable or disable the history queries.\n * This component emits events depending on the `isEnabled` value.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { BaseSwitch }\n })\n export default class HistoryQueriesSwitch extends Vue {\n /**\n * A boolean with the isEnabled value coming from the store state.\n *\n * @internal\n */\n @State('historyQueries', 'isEnabled')\n public isEnabled!: boolean;\n\n /**\n * Emits an event based on the switch state.\n *\n * @internal\n */\n protected toggle(): void {\n this.$x.emit(\n this.isEnabled ? 'UserClickedDisableHistoryQueries' : 'UserClickedEnableHistoryQueries'\n );\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedEnableHistoryQueries`]\n (x-components.historyqueriesxevents.userclickedenablehistoryqueries.md): the event is emitted\n whenever the user clicks the switch and the history queries are disabled.\n- [`UserClickedDisableHistoryQueries`]\n (x-components.historyqueriesxevents.userclickeddisablehistoryqueries.md): the event is emitted\n whenever the user clicks the switch and the history queries are enabled.\n\n## See it in action\n\nHere you have a basic example of how the switch is rendered.\n\n_Try clicking it to see how it changes its state_\n\n```vue live\n<template>\n <HistoryQueriesSwitch />\n</template>\n\n<script>\n import { HistoryQueriesSwitch } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueriesSwitchDemo',\n components: {\n HistoryQueriesSwitch\n }\n };\n</script>\n```\n\nHere you have a more complex example.\n\n```vue live\n<template>\n <div>\n <div>\n <SearchInput :instant=\"false\" />\n <SearchButton>Search</SearchButton>\n </div>\n <label>\n History queries:\n <HistoryQueriesSwitch />\n <HistoryQueries />\n <BaseEventsModal :eventsToOpenModal=\"eventsToOpenModal\">\n <BaseEventButton :events=\"disableEvents\">Disable</BaseEventButton>\n <BaseEventButton :events=\"cancelEvents\">Cancel</BaseEventButton>\n </BaseEventsModal>\n </label>\n </div>\n</template>\n\n<script>\n import { BaseEventButton, BaseEventsModal } from '@empathyco/x-components';\n import { HistoryQueriesSwitch, HistoryQueries } from '@empathyco/x-components/history-queries';\n import { SearchInput, SearchButton } from '@empathyco/x-components/search';\n export default {\n name: 'HistoryQueriesSwitchDemo',\n components: {\n BaseEventButton,\n BaseEventsModal,\n HistoryQueriesSwitch,\n HistoryQueries,\n SearchInput,\n SearchButton\n },\n data() {\n return {\n eventsToOpenModal: ['UserClickedDisableHistoryQueries'],\n disableEvents: {\n UserClickedConfirmDisableHistoryQueries: undefined,\n UserClickedCloseEventsModal: undefined\n },\n cancelEvents: {\n UserClickedCloseEventsModal: undefined\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,37 @@
1
+ import { __decorate } from 'tslib';
2
+ import Vue from 'vue';
3
+ import { Component } from 'vue-property-decorator';
4
+ import __vue_component__ from '../../../components/base-switch.vue.js';
5
+ import { State } from '../../../components/decorators/store.decorators.js';
6
+ import { xComponentMixin } from '../../../components/x-component.mixin.js';
7
+ import { historyQueriesXModule } from '../x-module.js';
8
+
9
+ /**
10
+ * History Queries Switch is a component to enable or disable the history queries.
11
+ * This component emits events depending on the `isEnabled` value.
12
+ *
13
+ * @public
14
+ */
15
+ let HistoryQueriesSwitch = class HistoryQueriesSwitch extends Vue {
16
+ /**
17
+ * Emits an event based on the switch state.
18
+ *
19
+ * @internal
20
+ */
21
+ toggle() {
22
+ this.$x.emit(this.isEnabled ? 'UserClickedDisableHistoryQueries' : 'UserClickedEnableHistoryQueries');
23
+ }
24
+ };
25
+ __decorate([
26
+ State('historyQueries', 'isEnabled')
27
+ ], HistoryQueriesSwitch.prototype, "isEnabled", void 0);
28
+ HistoryQueriesSwitch = __decorate([
29
+ Component({
30
+ mixins: [xComponentMixin(historyQueriesXModule)],
31
+ components: { BaseSwitch: __vue_component__ }
32
+ })
33
+ ], HistoryQueriesSwitch);
34
+ var script = HistoryQueriesSwitch;
35
+
36
+ export { script as default };
37
+ //# sourceMappingURL=history-queries-switch.vue_rollup-plugin-vue_script.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-queries-switch.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries-switch.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component } from 'vue-property-decorator';\nimport BaseSwitch from '../../../components/base-switch.vue';\nimport { State } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { historyQueriesXModule } from '../x-module';\n\n/**\n * History Queries Switch is a component to enable or disable the history queries.\n * This component emits events depending on the `isEnabled` value.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { BaseSwitch }\n})\nexport default class HistoryQueriesSwitch extends Vue {\n /**\n * A boolean with the isEnabled value coming from the store state.\n *\n * @internal\n */\n @State('historyQueries', 'isEnabled')\n public isEnabled!: boolean;\n\n /**\n * Emits an event based on the switch state.\n *\n * @internal\n */\n protected toggle(): void {\n this.$x.emit(\n this.isEnabled ? 'UserClickedDisableHistoryQueries' : 'UserClickedEnableHistoryQueries'\n );\n }\n}\n"],"names":["BaseSwitch"],"mappings":";;;;;;;;AAYA;;;;;;AAUA,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,GAAG;;;;;;IAczC,MAAM;QACd,IAAI,CAAC,EAAE,CAAC,IAAI,CACV,IAAI,CAAC,SAAS,GAAG,kCAAkC,GAAG,iCAAiC,CACxF,CAAC;KACH;CACF,CAAA;AAZC;IADC,KAAK,CAAC,gBAAgB,EAAE,WAAW,CAAC;uDACV;AAPR,oBAAoB;IAJxC,SAAS,CAAC;QACT,MAAM,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;QAChD,UAAU,EAAE,cAAEA,iBAAU,EAAE;KAC3B,CAAC;GACmB,oBAAoB,CAmBxC;aAnBoB,oBAAoB;;;;"}
@@ -77,11 +77,17 @@ const clearHistoryQueries = wireDispatch('setHistoryQueries', []);
77
77
  */
78
78
  const removeHistoryQuery = wireDispatch('removeFromHistory');
79
79
  /**
80
- * Enables or disables history queries.
80
+ * Enables history queries.
81
81
  *
82
82
  * @public
83
83
  */
84
- const toggleHistoryQueries = wireDispatch('toggleHistoryQueries');
84
+ const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);
85
+ /**
86
+ * Disables history queries.
87
+ *
88
+ * @public
89
+ */
90
+ const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);
85
91
  /**
86
92
  * Debounce function for the module.
87
93
  */
@@ -117,10 +123,13 @@ const historyQueriesWiring = createWiring({
117
123
  UserPressedRemoveHistoryQuery: {
118
124
  removeHistoryQuery
119
125
  },
120
- UserToggledHistoryQueries: {
121
- toggleHistoryQueries
126
+ UserClickedEnableHistoryQueries: {
127
+ setHistoryQueriesEnabled
128
+ },
129
+ UserClickedConfirmDisableHistoryQueries: {
130
+ setHistoryQueriesDisabled
122
131
  }
123
132
  });
124
133
 
125
- export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesQuery, toggleHistoryQueries };
134
+ export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery };
126
135
  //# sourceMappingURL=wiring.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n/**\n * Enables or disables history queries.\n *\n * @public\n */\nexport const toggleHistoryQueries = wireDispatch('toggleHistoryQueries');\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserToggledHistoryQueries: {\n toggleHistoryQueries\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;;AAKA,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC;;;;;AAKA,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;AAKA,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;;AAKA,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAE1E;;;;;MAKa,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE;AAE7D;;;;;AAKA,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElD;;;;;MAKa,wBAAwB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAEnE;;;;;;MAMa,4BAA4B,GAAG,0BAA0B,CAAC,gBAAgB,EAAE;AAEzF;;;;;;MAMa,wCAAwC,GAAG,0BAA0B,CAChF,sCAAsC,EACtC;AAEF;;;;;MAKa,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,EAAE,EAAE,EAAE;AAEzE;;;;;MAKa,kBAAkB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AACpE;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC,sBAAsB,EAAE;AAEzE;;;AAGA,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC;IAC/C,mBAAmB,EAAE;QACnB,YAAY;KACb;IACD,0BAA0B,EAAE;QAC1B,4BAA4B;KAC7B;IACD,+BAA+B,EAAE;QAC/B,wCAAwC;KACzC;IACD,gBAAgB,EAAE;QAChB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,8BAA8B,EAAE,cAAc,CAC5C,sBAAsB,EACtB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;KACF;IACD,8BAA8B,EAAE;QAC9B,mBAAmB;KACpB;IACD,6BAA6B,EAAE;QAC7B,kBAAkB;KACnB;IACD,yBAAyB,EAAE;QACzB,oBAAoB;KACrB;CACF;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n\n/**\n * Enables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);\n\n/**\n * Disables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserClickedEnableHistoryQueries: {\n setHistoryQueriesEnabled\n },\n UserClickedConfirmDisableHistoryQueries: {\n setHistoryQueriesDisabled\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;;AAKA,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC;;;;;AAKA,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;AAKA,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;;AAKA,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAE1E;;;;;MAKa,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE;AAE7D;;;;;AAKA,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElD;;;;;MAKa,wBAAwB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAEnE;;;;;;MAMa,4BAA4B,GAAG,0BAA0B,CAAC,gBAAgB,EAAE;AAEzF;;;;;;MAMa,wCAAwC,GAAG,0BAA0B,CAChF,sCAAsC,EACtC;AAEF;;;;;MAKa,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,EAAE,EAAE,EAAE;AAEzE;;;;;MAKa,kBAAkB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAEpE;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,sBAAsB,EAAE,IAAI,EAAE;AAEnF;;;;;MAKa,yBAAyB,GAAG,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE;AAErF;;;AAGA,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC;IAC/C,mBAAmB,EAAE;QACnB,YAAY;KACb;IACD,0BAA0B,EAAE;QAC1B,4BAA4B;KAC7B;IACD,+BAA+B,EAAE;QAC/B,wCAAwC;KACzC;IACD,gBAAgB,EAAE;QAChB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,8BAA8B,EAAE,cAAc,CAC5C,sBAAsB,EACtB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;KACF;IACD,8BAA8B,EAAE;QAC9B,mBAAmB;KACpB;IACD,6BAA6B,EAAE;QAC7B,kBAAkB;KACnB;IACD,+BAA+B,EAAE;QAC/B,wBAAwB;KACzB;IACD,uCAAuC,EAAE;QACvC,yBAAyB;KAC1B;CACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.130",
3
+ "version": "3.0.0-alpha.131",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -125,5 +125,5 @@
125
125
  "access": "public",
126
126
  "directory": "dist"
127
127
  },
128
- "gitHead": "aca8bfde28f4092cb24f493cc0ea501c9be193f8"
128
+ "gitHead": "6f0c98345eddb2502b7b841c669868a09a4f7762"
129
129
  }
@@ -19822,6 +19822,34 @@
19822
19822
  }
19823
19823
  ]
19824
19824
  },
19825
+ {
19826
+ "kind": "Class",
19827
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesSwitch:class",
19828
+ "docComment": "/**\n * History Queries Switch is a component to enable or disable the history queries. This component emits events depending on the `isEnabled` value.\n *\n * @public\n */\n",
19829
+ "excerptTokens": [
19830
+ {
19831
+ "kind": "Content",
19832
+ "text": "export default class HistoryQueriesSwitch extends "
19833
+ },
19834
+ {
19835
+ "kind": "Reference",
19836
+ "text": "Vue",
19837
+ "canonicalReference": "vue!Vue:interface"
19838
+ },
19839
+ {
19840
+ "kind": "Content",
19841
+ "text": " "
19842
+ }
19843
+ ],
19844
+ "releaseTag": "Public",
19845
+ "name": "HistoryQueriesSwitch",
19846
+ "members": [],
19847
+ "extendsTokenRange": {
19848
+ "startIndex": 1,
19849
+ "endIndex": 3
19850
+ },
19851
+ "implementsTokenRanges": []
19852
+ },
19825
19853
  {
19826
19854
  "kind": "Interface",
19827
19855
  "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents:interface",
@@ -19838,7 +19866,7 @@
19838
19866
  {
19839
19867
  "kind": "PropertySignature",
19840
19868
  "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#HistoryQueriesDisplayed:member",
19841
- "docComment": "/**\n * The current history queries have been displayed to the user. * Payload: The displayed history queries.\n */\n",
19869
+ "docComment": "/**\n * The current history queries have been displayed to the user. Payload: The displayed history queries.\n */\n",
19842
19870
  "excerptTokens": [
19843
19871
  {
19844
19872
  "kind": "Content",
@@ -19869,7 +19897,7 @@
19869
19897
  {
19870
19898
  "kind": "PropertySignature",
19871
19899
  "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#HistoryQueriesQueryChanged:member",
19872
- "docComment": "/**\n * The query for searching inside the history-queries has changed. * Payload: The history-queries query.\n */\n",
19900
+ "docComment": "/**\n * The query for searching inside the history-queries has changed. Payload: The history-queries query.\n */\n",
19873
19901
  "excerptTokens": [
19874
19902
  {
19875
19903
  "kind": "Content",
@@ -19895,7 +19923,7 @@
19895
19923
  {
19896
19924
  "kind": "PropertySignature",
19897
19925
  "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#HistoryQueriesStorageKeyChanged:member",
19898
- "docComment": "/**\n * The key for saving the history queries in to the browser storage has changed. * Payload: The new history-queries storage key.\n */\n",
19926
+ "docComment": "/**\n * The key for saving the history queries in to the browser storage has changed. Payload: The new history-queries storage key.\n */\n",
19899
19927
  "excerptTokens": [
19900
19928
  {
19901
19929
  "kind": "Content",
@@ -19921,7 +19949,7 @@
19921
19949
  {
19922
19950
  "kind": "PropertySignature",
19923
19951
  "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#SessionHistoryQueriesChanged:member",
19924
- "docComment": "/**\n * The queries made in the current session have changed * Payload: The session history queries.\n */\n",
19952
+ "docComment": "/**\n * The queries made in the current session have changed Payload: The session history queries.\n */\n",
19925
19953
  "excerptTokens": [
19926
19954
  {
19927
19955
  "kind": "Content",
@@ -19951,12 +19979,12 @@
19951
19979
  },
19952
19980
  {
19953
19981
  "kind": "PropertySignature",
19954
- "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserPressedClearHistoryQueries:member",
19955
- "docComment": "/**\n * The user pressed the button for clearing all the history queries. * Payload: none.\n */\n",
19982
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserClickedConfirmDisableHistoryQueries:member",
19983
+ "docComment": "/**\n * The user has clicked the confirm button to disable the history queries. Payload: None.\n */\n",
19956
19984
  "excerptTokens": [
19957
19985
  {
19958
19986
  "kind": "Content",
19959
- "text": "UserPressedClearHistoryQueries: "
19987
+ "text": "UserClickedConfirmDisableHistoryQueries: "
19960
19988
  },
19961
19989
  {
19962
19990
  "kind": "Content",
@@ -19969,7 +19997,7 @@
19969
19997
  ],
19970
19998
  "isOptional": false,
19971
19999
  "releaseTag": "Public",
19972
- "name": "UserPressedClearHistoryQueries",
20000
+ "name": "UserClickedConfirmDisableHistoryQueries",
19973
20001
  "propertyTypeTokenRange": {
19974
20002
  "startIndex": 1,
19975
20003
  "endIndex": 2
@@ -19977,17 +20005,16 @@
19977
20005
  },
19978
20006
  {
19979
20007
  "kind": "PropertySignature",
19980
- "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserPressedRemoveHistoryQuery:member",
19981
- "docComment": "/**\n * The user pressed the button for removing a single {@link @empathyco/x-types#HistoryQuery | history query}. * Payload: The `HistoryQuery` to remove.\n */\n",
20008
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserClickedDisableHistoryQueries:member",
20009
+ "docComment": "/**\n * The user has clicked a control to disable the history queries. Payload: None.\n */\n",
19982
20010
  "excerptTokens": [
19983
20011
  {
19984
20012
  "kind": "Content",
19985
- "text": "UserPressedRemoveHistoryQuery: "
20013
+ "text": "UserClickedDisableHistoryQueries: "
19986
20014
  },
19987
20015
  {
19988
- "kind": "Reference",
19989
- "text": "HistoryQuery",
19990
- "canonicalReference": "@empathyco/x-components!HistoryQuery:interface"
20016
+ "kind": "Content",
20017
+ "text": "void"
19991
20018
  },
19992
20019
  {
19993
20020
  "kind": "Content",
@@ -19996,7 +20023,7 @@
19996
20023
  ],
19997
20024
  "isOptional": false,
19998
20025
  "releaseTag": "Public",
19999
- "name": "UserPressedRemoveHistoryQuery",
20026
+ "name": "UserClickedDisableHistoryQueries",
20000
20027
  "propertyTypeTokenRange": {
20001
20028
  "startIndex": 1,
20002
20029
  "endIndex": 2
@@ -20004,12 +20031,64 @@
20004
20031
  },
20005
20032
  {
20006
20033
  "kind": "PropertySignature",
20007
- "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserSelectedAHistoryQuery:member",
20008
- "docComment": "/**\n * The user has selected a history-query. * Payload: The {@link @empathyco/x-types#HistoryQuery | history query} selected.\n */\n",
20034
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserClickedEnableHistoryQueries:member",
20035
+ "docComment": "/**\n * The user has clicked a control to enable the history queries. Payload: None.\n */\n",
20009
20036
  "excerptTokens": [
20010
20037
  {
20011
20038
  "kind": "Content",
20012
- "text": "UserSelectedAHistoryQuery: "
20039
+ "text": "UserClickedEnableHistoryQueries: "
20040
+ },
20041
+ {
20042
+ "kind": "Content",
20043
+ "text": "void"
20044
+ },
20045
+ {
20046
+ "kind": "Content",
20047
+ "text": ";"
20048
+ }
20049
+ ],
20050
+ "isOptional": false,
20051
+ "releaseTag": "Public",
20052
+ "name": "UserClickedEnableHistoryQueries",
20053
+ "propertyTypeTokenRange": {
20054
+ "startIndex": 1,
20055
+ "endIndex": 2
20056
+ }
20057
+ },
20058
+ {
20059
+ "kind": "PropertySignature",
20060
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserPressedClearHistoryQueries:member",
20061
+ "docComment": "/**\n * The user pressed the button for clearing all the history queries. Payload: none.\n */\n",
20062
+ "excerptTokens": [
20063
+ {
20064
+ "kind": "Content",
20065
+ "text": "UserPressedClearHistoryQueries: "
20066
+ },
20067
+ {
20068
+ "kind": "Content",
20069
+ "text": "void"
20070
+ },
20071
+ {
20072
+ "kind": "Content",
20073
+ "text": ";"
20074
+ }
20075
+ ],
20076
+ "isOptional": false,
20077
+ "releaseTag": "Public",
20078
+ "name": "UserPressedClearHistoryQueries",
20079
+ "propertyTypeTokenRange": {
20080
+ "startIndex": 1,
20081
+ "endIndex": 2
20082
+ }
20083
+ },
20084
+ {
20085
+ "kind": "PropertySignature",
20086
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserPressedRemoveHistoryQuery:member",
20087
+ "docComment": "/**\n * The user pressed the button for removing a single {@link @empathyco/x-types#HistoryQuery | history query}. Payload: The `HistoryQuery` to remove.\n */\n",
20088
+ "excerptTokens": [
20089
+ {
20090
+ "kind": "Content",
20091
+ "text": "UserPressedRemoveHistoryQuery: "
20013
20092
  },
20014
20093
  {
20015
20094
  "kind": "Reference",
@@ -20023,7 +20102,7 @@
20023
20102
  ],
20024
20103
  "isOptional": false,
20025
20104
  "releaseTag": "Public",
20026
- "name": "UserSelectedAHistoryQuery",
20105
+ "name": "UserPressedRemoveHistoryQuery",
20027
20106
  "propertyTypeTokenRange": {
20028
20107
  "startIndex": 1,
20029
20108
  "endIndex": 2
@@ -20031,16 +20110,17 @@
20031
20110
  },
20032
20111
  {
20033
20112
  "kind": "PropertySignature",
20034
- "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserToggledHistoryQueries:member",
20035
- "docComment": "/**\n * The user has toggled the history queries. * Payload: whether it has been set to enable or disable.\n */\n",
20113
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesXEvents#UserSelectedAHistoryQuery:member",
20114
+ "docComment": "/**\n * The user has selected a history-query. Payload: The {@link @empathyco/x-types#HistoryQuery | history query} selected.\n */\n",
20036
20115
  "excerptTokens": [
20037
20116
  {
20038
20117
  "kind": "Content",
20039
- "text": "UserToggledHistoryQueries: "
20118
+ "text": "UserSelectedAHistoryQuery: "
20040
20119
  },
20041
20120
  {
20042
- "kind": "Content",
20043
- "text": "boolean"
20121
+ "kind": "Reference",
20122
+ "text": "HistoryQuery",
20123
+ "canonicalReference": "@empathyco/x-components!HistoryQuery:interface"
20044
20124
  },
20045
20125
  {
20046
20126
  "kind": "Content",
@@ -20049,7 +20129,7 @@
20049
20129
  ],
20050
20130
  "isOptional": false,
20051
20131
  "releaseTag": "Public",
20052
- "name": "UserToggledHistoryQueries",
20132
+ "name": "UserSelectedAHistoryQuery",
20053
20133
  "propertyTypeTokenRange": {
20054
20134
  "startIndex": 1,
20055
20135
  "endIndex": 2
@@ -40198,6 +40278,58 @@
40198
40278
  "endIndex": 3
40199
40279
  }
40200
40280
  },
40281
+ {
40282
+ "kind": "Variable",
40283
+ "canonicalReference": "@empathyco/x-components!setHistoryQueriesDisabled:var",
40284
+ "docComment": "/**\n * Disables history queries.\n *\n * @public\n */\n",
40285
+ "excerptTokens": [
40286
+ {
40287
+ "kind": "Content",
40288
+ "text": "setHistoryQueriesDisabled: "
40289
+ },
40290
+ {
40291
+ "kind": "Content",
40292
+ "text": "import(\"../..\")."
40293
+ },
40294
+ {
40295
+ "kind": "Reference",
40296
+ "text": "AnyWire",
40297
+ "canonicalReference": "@empathyco/x-components!AnyWire:type"
40298
+ }
40299
+ ],
40300
+ "releaseTag": "Public",
40301
+ "name": "setHistoryQueriesDisabled",
40302
+ "variableTypeTokenRange": {
40303
+ "startIndex": 1,
40304
+ "endIndex": 3
40305
+ }
40306
+ },
40307
+ {
40308
+ "kind": "Variable",
40309
+ "canonicalReference": "@empathyco/x-components!setHistoryQueriesEnabled:var",
40310
+ "docComment": "/**\n * Enables history queries.\n *\n * @public\n */\n",
40311
+ "excerptTokens": [
40312
+ {
40313
+ "kind": "Content",
40314
+ "text": "setHistoryQueriesEnabled: "
40315
+ },
40316
+ {
40317
+ "kind": "Content",
40318
+ "text": "import(\"../..\")."
40319
+ },
40320
+ {
40321
+ "kind": "Reference",
40322
+ "text": "AnyWire",
40323
+ "canonicalReference": "@empathyco/x-components!AnyWire:type"
40324
+ }
40325
+ ],
40326
+ "releaseTag": "Public",
40327
+ "name": "setHistoryQueriesEnabled",
40328
+ "variableTypeTokenRange": {
40329
+ "startIndex": 1,
40330
+ "endIndex": 3
40331
+ }
40332
+ },
40201
40333
  {
40202
40334
  "kind": "Variable",
40203
40335
  "canonicalReference": "@empathyco/x-components!setHistoryQueriesQuery:var",
@@ -45509,36 +45641,6 @@
45509
45641
  "endIndex": 6
45510
45642
  }
45511
45643
  },
45512
- {
45513
- "kind": "Variable",
45514
- "canonicalReference": "@empathyco/x-components!toggleHistoryQueries:var",
45515
- "docComment": "/**\n * Enables or disables history queries.\n *\n * @public\n */\n",
45516
- "excerptTokens": [
45517
- {
45518
- "kind": "Content",
45519
- "text": "toggleHistoryQueries: "
45520
- },
45521
- {
45522
- "kind": "Content",
45523
- "text": "import(\"../..\")."
45524
- },
45525
- {
45526
- "kind": "Reference",
45527
- "text": "Wire",
45528
- "canonicalReference": "@empathyco/x-components!Wire:type"
45529
- },
45530
- {
45531
- "kind": "Content",
45532
- "text": "<boolean>"
45533
- }
45534
- ],
45535
- "releaseTag": "Public",
45536
- "name": "toggleHistoryQueries",
45537
- "variableTypeTokenRange": {
45538
- "startIndex": 1,
45539
- "endIndex": 4
45540
- }
45541
- },
45542
45644
  {
45543
45645
  "kind": "Variable",
45544
45646
  "canonicalReference": "@empathyco/x-components!toggleRelatedTag:var",
@@ -1909,6 +1909,14 @@ export interface HistoryQueriesState extends QueryState {
1909
1909
  sessionTimeStampInMs: number;
1910
1910
  }
1911
1911
 
1912
+ // @public
1913
+ export class HistoryQueriesSwitch extends Vue_2 {
1914
+ // @internal
1915
+ isEnabled: boolean;
1916
+ // @internal
1917
+ protected toggle(): void;
1918
+ }
1919
+
1912
1920
  // @internal
1913
1921
  export const historyQueriesWiring: {
1914
1922
  ParamsLoadedFromUrl: {
@@ -1936,8 +1944,11 @@ export const historyQueriesWiring: {
1936
1944
  UserPressedRemoveHistoryQuery: {
1937
1945
  removeHistoryQuery: Wire<HistoryQuery_2>;
1938
1946
  };
1939
- UserToggledHistoryQueries: {
1940
- toggleHistoryQueries: Wire<boolean>;
1947
+ UserClickedEnableHistoryQueries: {
1948
+ setHistoryQueriesEnabled: AnyWire;
1949
+ };
1950
+ UserClickedConfirmDisableHistoryQueries: {
1951
+ setHistoryQueriesDisabled: AnyWire;
1941
1952
  };
1942
1953
  };
1943
1954
 
@@ -1947,10 +1958,12 @@ export interface HistoryQueriesXEvents {
1947
1958
  HistoryQueriesQueryChanged: string;
1948
1959
  HistoryQueriesStorageKeyChanged: string;
1949
1960
  SessionHistoryQueriesChanged: HistoryQuery_2[];
1961
+ UserClickedConfirmDisableHistoryQueries: void;
1962
+ UserClickedDisableHistoryQueries: void;
1963
+ UserClickedEnableHistoryQueries: void;
1950
1964
  UserPressedClearHistoryQueries: void;
1951
1965
  UserPressedRemoveHistoryQuery: HistoryQuery_2;
1952
1966
  UserSelectedAHistoryQuery: HistoryQuery_2;
1953
- UserToggledHistoryQueries: boolean;
1954
1967
  }
1955
1968
 
1956
1969
  // @public
@@ -3812,6 +3825,12 @@ export const setExtraParams: Wire<Dictionary<unknown>>;
3812
3825
  // @public
3813
3826
  export const setHistoryQueries: HistoryQueriesXStoreModule['actions']['setHistoryQueries'];
3814
3827
 
3828
+ // @public
3829
+ export const setHistoryQueriesDisabled: AnyWire;
3830
+
3831
+ // @public
3832
+ export const setHistoryQueriesEnabled: AnyWire;
3833
+
3815
3834
  // @public
3816
3835
  export const setHistoryQueriesQuery: Wire<string>;
3817
3836
 
@@ -4407,9 +4426,6 @@ export interface TimedWireOperatorOptions {
4407
4426
  // @public
4408
4427
  export type TimeSelector = (storeModule: Store<RootXStoreState>) => number;
4409
4428
 
4410
- // @public
4411
- export const toggleHistoryQueries: Wire<boolean>;
4412
-
4413
4429
  // @public
4414
4430
  export const toggleRelatedTag: RelatedTagsXStoreModule['actions']['toggleRelatedTag'];
4415
4431
 
@@ -0,0 +1,22 @@
1
+ import Vue from 'vue';
2
+ /**
3
+ * History Queries Switch is a component to enable or disable the history queries.
4
+ * This component emits events depending on the `isEnabled` value.
5
+ *
6
+ * @public
7
+ */
8
+ export default class HistoryQueriesSwitch extends Vue {
9
+ /**
10
+ * A boolean with the isEnabled value coming from the store state.
11
+ *
12
+ * @internal
13
+ */
14
+ isEnabled: boolean;
15
+ /**
16
+ * Emits an event based on the switch state.
17
+ *
18
+ * @internal
19
+ */
20
+ protected toggle(): void;
21
+ }
22
+ //# sourceMappingURL=history-queries-switch.vue?rollup-plugin-vue=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-queries-switch.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/components/history-queries-switch.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAKA,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB;;;;;GAKG;AAKH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,GAAG;IACnD;;;;OAIG;IAEI,SAAS,EAAG,OAAO,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,MAAM,IAAI,IAAI;CAKzB"}
@@ -1,5 +1,6 @@
1
1
  export { default as ClearHistoryQueries } from './clear-history-queries.vue';
2
2
  export { default as HistoryQueries } from './history-queries.vue';
3
+ export { default as HistoryQueriesSwitch } from './history-queries-switch.vue';
3
4
  export { default as HistoryQuery } from './history-query.vue';
4
5
  export { default as MyHistory } from './my-history.vue';
5
6
  export { default as RemoveHistoryQuery } from './remove-history-query.vue';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -8,44 +8,54 @@ import { HistoryQuery } from '@empathyco/x-types';
8
8
  export interface HistoryQueriesXEvents {
9
9
  /**
10
10
  * The current history queries have been displayed to the user.
11
- * * Payload: The displayed history queries.
11
+ * Payload: The displayed history queries.
12
12
  */
13
13
  HistoryQueriesDisplayed: HistoryQuery[];
14
14
  /**
15
15
  * The query for searching inside the history-queries has changed.
16
- * * Payload: The history-queries query.
16
+ * Payload: The history-queries query.
17
17
  */
18
18
  HistoryQueriesQueryChanged: string;
19
19
  /**
20
20
  * The key for saving the history queries in to the browser storage has changed.
21
- * * Payload: The new history-queries storage key.
21
+ * Payload: The new history-queries storage key.
22
22
  */
23
23
  HistoryQueriesStorageKeyChanged: string;
24
24
  /**
25
25
  * The queries made in the current session have changed
26
- * * Payload: The session history queries.
26
+ * Payload: The session history queries.
27
27
  */
28
28
  SessionHistoryQueriesChanged: HistoryQuery[];
29
29
  /**
30
30
  * The user pressed the button for clearing all the history queries.
31
- * * Payload: none.
31
+ * Payload: none.
32
32
  */
33
33
  UserPressedClearHistoryQueries: void;
34
34
  /**
35
35
  * The user pressed the button for removing a single
36
36
  * {@link @empathyco/x-types#HistoryQuery | history query}.
37
- * * Payload: The `HistoryQuery` to remove.
37
+ * Payload: The `HistoryQuery` to remove.
38
38
  */
39
39
  UserPressedRemoveHistoryQuery: HistoryQuery;
40
40
  /**
41
41
  * The user has selected a history-query.
42
- * * Payload: The {@link @empathyco/x-types#HistoryQuery | history query} selected.
42
+ * Payload: The {@link @empathyco/x-types#HistoryQuery | history query} selected.
43
43
  */
44
44
  UserSelectedAHistoryQuery: HistoryQuery;
45
45
  /**
46
- * The user has toggled the history queries.
47
- * * Payload: whether it has been set to enable or disable.
46
+ * The user has clicked a control to enable the history queries.
47
+ * Payload: None.
48
48
  */
49
- UserToggledHistoryQueries: boolean;
49
+ UserClickedEnableHistoryQueries: void;
50
+ /**
51
+ * The user has clicked a control to disable the history queries.
52
+ * Payload: None.
53
+ */
54
+ UserClickedDisableHistoryQueries: void;
55
+ /**
56
+ * The user has clicked the confirm button to disable the history queries.
57
+ * Payload: None.
58
+ */
59
+ UserClickedConfirmDisableHistoryQueries: void;
50
60
  }
51
61
  //# sourceMappingURL=events.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/events.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,uBAAuB,EAAE,YAAY,EAAE,CAAC;IACxC;;;OAGG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,+BAA+B,EAAE,MAAM,CAAC;IACxC;;;OAGG;IACH,4BAA4B,EAAE,YAAY,EAAE,CAAC;IAC7C;;;OAGG;IACH,8BAA8B,EAAE,IAAI,CAAC;IACrC;;;;OAIG;IACH,6BAA6B,EAAE,YAAY,CAAC;IAC5C;;;OAGG;IACH,yBAAyB,EAAE,YAAY,CAAC;IACxC;;;OAGG;IACH,yBAAyB,EAAE,OAAO,CAAC;CACpC"}
1
+ {"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/events.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,uBAAuB,EAAE,YAAY,EAAE,CAAC;IACxC;;;OAGG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,+BAA+B,EAAE,MAAM,CAAC;IACxC;;;OAGG;IACH,4BAA4B,EAAE,YAAY,EAAE,CAAC;IAC7C;;;OAGG;IACH,8BAA8B,EAAE,IAAI,CAAC;IACrC;;;;OAIG;IACH,6BAA6B,EAAE,YAAY,CAAC;IAC5C;;;OAGG;IACH,yBAAyB,EAAE,YAAY,CAAC;IACxC;;;OAGG;IACH,+BAA+B,EAAE,IAAI,CAAC;IACtC;;;OAGG;IACH,gCAAgC,EAAE,IAAI,CAAC;IACvC;;;OAGG;IACH,uCAAuC,EAAE,IAAI,CAAC;CAC/C"}
@@ -43,11 +43,17 @@ export declare const clearHistoryQueries: import("../..").AnyWire;
43
43
  */
44
44
  export declare const removeHistoryQuery: import("../..").Wire<import("@empathyco/x-types").HistoryQuery>;
45
45
  /**
46
- * Enables or disables history queries.
46
+ * Enables history queries.
47
47
  *
48
48
  * @public
49
49
  */
50
- export declare const toggleHistoryQueries: import("../..").Wire<boolean>;
50
+ export declare const setHistoryQueriesEnabled: import("../..").AnyWire;
51
+ /**
52
+ * Disables history queries.
53
+ *
54
+ * @public
55
+ */
56
+ export declare const setHistoryQueriesDisabled: import("../..").AnyWire;
51
57
  /**
52
58
  * Default wiring for the {@link HistoryQueries} module.
53
59
  *
@@ -79,8 +85,11 @@ export declare const historyQueriesWiring: {
79
85
  UserPressedRemoveHistoryQuery: {
80
86
  removeHistoryQuery: import("../..").Wire<import("@empathyco/x-types").HistoryQuery>;
81
87
  };
82
- UserToggledHistoryQueries: {
83
- toggleHistoryQueries: import("../..").Wire<boolean>;
88
+ UserClickedEnableHistoryQueries: {
89
+ setHistoryQueriesEnabled: import("../..").AnyWire;
90
+ };
91
+ UserClickedConfirmDisableHistoryQueries: {
92
+ setHistoryQueriesDisabled: import("../..").AnyWire;
84
93
  };
85
94
  };
86
95
  //# sourceMappingURL=wiring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAS7D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AACpE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+BAAuC,CAAC;AAOzE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC/B,CAAC"}
1
+ {"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAS7D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAA8C,CAAC;AAOrF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC/B,CAAC"}
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [HistoryQueriesXEvents](./x-components.historyqueriesxevents.md) &gt; [UserToggledHistoryQueries](./x-components.historyqueriesxevents.usertoggledhistoryqueries.md)
4
-
5
- ## HistoryQueriesXEvents.UserToggledHistoryQueries property
6
-
7
- The user has toggled the history queries. \* Payload: whether it has been set to enable or disable.
8
-
9
- <b>Signature:</b>
10
-
11
- ```typescript
12
- UserToggledHistoryQueries: boolean;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [toggleHistoryQueries](./x-components.togglehistoryqueries.md)
4
-
5
- ## toggleHistoryQueries variable
6
-
7
- Enables or disables history queries.
8
-
9
- <b>Signature:</b>
10
-
11
- ```typescript
12
- toggleHistoryQueries: import("../..").Wire<boolean>
13
- ```