@empathyco/x-components 3.0.0-alpha.30 → 3.0.0-alpha.31
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.
- package/CHANGELOG.md +37 -0
- package/core/index.js.map +1 -1
- package/design-system/default-theme.css +6 -1
- package/design-system/full-theme.css +6 -1
- package/design-system/list-default.css +3 -0
- package/design-system/suggestion-default.css +3 -1
- package/docs/API-reference/api/x-components.identifierresultsactions.md +0 -1
- package/docs/API-reference/api/x-components.identifierresultsmutations.md +1 -0
- package/docs/API-reference/api/x-components.identifierresultsmutations.setparams.md +24 -0
- package/docs/API-reference/api/x-components.identifierresultsstate.md +1 -0
- package/docs/API-reference/api/x-components.identifierresultsstate.params.md +13 -0
- package/docs/API-reference/api/x-components.md +3 -0
- package/docs/API-reference/api/x-components.setconsent.md +1 -1
- package/docs/API-reference/api/x-components.setidentifierresultsextraparams.md +13 -0
- package/docs/API-reference/api/x-components.setquerytaggingdebounce.md +1 -1
- package/docs/API-reference/api/x-components.setsessionduration.md +1 -1
- package/docs/API-reference/api/x-components.taggingactions.md +7 -0
- package/docs/API-reference/api/x-components.taggingactions.track.md +24 -0
- package/docs/API-reference/api/x-components.track.md +13 -0
- package/docs/API-reference/api/x-components.trackwire.md +13 -0
- package/docs/build-search-ui/README.md +113 -0
- package/docs/build-search-ui/web-archetype-integration-guide.md +183 -0
- package/docs/build-search-ui/web-use-x-components-guide.md +170 -0
- package/docs/build-search-ui/web-x-components-integration-guide.md +197 -0
- package/docs/build-search-ui/x-architecture/README.md +133 -0
- package/docs/sidebar.json +1 -1
- package/identifier-results/index.js +1 -1
- package/js/index.js +3 -2
- package/js/index.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/identifier-results/store/actions/save-query.action.js +4 -0
- package/js/x-modules/identifier-results/store/actions/save-query.action.js.map +1 -1
- package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js +4 -8
- package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js.map +1 -1
- package/js/x-modules/identifier-results/store/module.js +5 -3
- package/js/x-modules/identifier-results/store/module.js.map +1 -1
- package/js/x-modules/identifier-results/wiring.js +14 -2
- package/js/x-modules/identifier-results/wiring.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query.vue.js +2 -1
- package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-search.vue.js +2 -1
- package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-search.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +2 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue.js +2 -2
- package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js +15 -7
- package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/partial-query-button.vue.js.map +1 -1
- package/js/x-modules/search/components/partial-query-button.vue_rollup-plugin-vue=script.js +14 -6
- package/js/x-modules/search/components/partial-query-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/spellcheck-button.vue.js.map +1 -1
- package/js/x-modules/search/components/spellcheck-button.vue_rollup-plugin-vue=script.js +14 -6
- package/js/x-modules/search/components/spellcheck-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/store/emitters.js +8 -1
- package/js/x-modules/search/store/emitters.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue_rollup-plugin-vue=script.js +14 -6
- package/js/x-modules/search-box/components/search-button.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search-box/components/search-input.vue.js +2 -2
- package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue=script.js +10 -9
- package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/tagging/store/actions/track.action.js +43 -0
- package/js/x-modules/tagging/store/actions/track.action.js.map +1 -0
- package/js/x-modules/tagging/store/module.js +6 -2
- package/js/x-modules/tagging/store/module.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +26 -2
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
- package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js +2 -2
- package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +234 -49
- package/report/x-components.api.md +34 -6
- package/tagging/index.js +2 -1
- package/types/adapter/mocked-adapter.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/history-query.vue.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/actions/save-query.action.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/getters/identifier-results-request.getter.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/module.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/types.d.ts +9 -7
- package/types/x-modules/identifier-results/store/types.d.ts.map +1 -1
- package/types/x-modules/identifier-results/wiring.d.ts +10 -1
- package/types/x-modules/identifier-results/wiring.d.ts.map +1 -1
- package/types/x-modules/next-queries/components/next-query.vue.d.ts.map +1 -1
- package/types/x-modules/popular-searches/components/popular-search.vue.d.ts.map +1 -1
- package/types/x-modules/query-suggestions/components/query-suggestion.vue.d.ts.map +1 -1
- package/types/x-modules/related-tags/components/related-tag.vue.d.ts +8 -0
- package/types/x-modules/related-tags/components/related-tag.vue.d.ts.map +1 -1
- package/types/x-modules/search/components/partial-query-button.vue.d.ts +8 -0
- package/types/x-modules/search/components/partial-query-button.vue.d.ts.map +1 -1
- package/types/x-modules/search/components/spellcheck-button.vue.d.ts +8 -0
- package/types/x-modules/search/components/spellcheck-button.vue.d.ts.map +1 -1
- package/types/x-modules/search/store/emitters.d.ts +4 -1
- package/types/x-modules/search/store/emitters.d.ts.map +1 -1
- package/types/x-modules/search-box/components/search-button.vue.d.ts +8 -0
- package/types/x-modules/search-box/components/search-button.vue.d.ts.map +1 -1
- package/types/x-modules/search-box/components/search-input.vue.d.ts +1 -1
- package/types/x-modules/search-box/components/search-input.vue.d.ts.map +1 -1
- package/types/x-modules/tagging/store/actions/index.d.ts +2 -0
- package/types/x-modules/tagging/store/actions/index.d.ts.map +1 -0
- package/types/x-modules/tagging/store/actions/track.action.d.ts +12 -0
- package/types/x-modules/tagging/store/actions/track.action.d.ts.map +1 -0
- package/types/x-modules/tagging/store/index.d.ts +1 -0
- package/types/x-modules/tagging/store/index.d.ts.map +1 -1
- package/types/x-modules/tagging/store/module.d.ts.map +1 -1
- package/types/x-modules/tagging/store/types.d.ts +7 -0
- package/types/x-modules/tagging/store/types.d.ts.map +1 -1
- package/types/x-modules/tagging/wiring.d.ts +17 -7
- package/types/x-modules/tagging/wiring.d.ts.map +1 -1
- package/docs/API-reference/api/x-components.identifierresultsactions.seturlparams.md +0 -24
- package/docs/css/global.scss +0 -1
- package/docs/css/utils/utils.scss +0 -35
- package/docs/css/xcomponents/clear-search-input.scss +0 -9
- package/docs/css/xcomponents/index.scss +0 -16
- package/docs/css/xcomponents/search-input.scss +0 -10
- package/docs/css/xcomponents/suggestions.scss +0 -19
- package/docs/guide/getting-started/components/clear-search-input.md +0 -98
- package/docs/guide/getting-started/components/live-examples.md +0 -100
- package/docs/guide/getting-started/components/query-suggestions.md +0 -76
- package/docs/guide/getting-started/components/search-button.md +0 -98
- package/docs/guide/getting-started/components/search-input.md +0 -105
- package/docs/guide/getting-started/install-xplugin.md +0 -72
- package/docs/guide/getting-started/use-components.md +0 -75
- package/docs/guide/install.md +0 -30
- package/docs/react-components/ReactComponents.jsx +0 -46
- package/docs/react-components/Utils.jsx +0 -34
- package/js/x-modules/identifier-results/store/actions/set-url-params.action.js +0 -17
- package/js/x-modules/identifier-results/store/actions/set-url-params.action.js.map +0 -1
- package/types/x-modules/identifier-results/store/actions/set-url-params.action.d.ts +0 -12
- package/types/x-modules/identifier-results/store/actions/set-url-params.action.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue"],"sourcesContent":["<template>\n <div class=\"x-suggestion-group x-history-query\">\n <BaseSuggestion\n class=\"x-history-query__suggestion\"\n v-bind=\"{ suggestion, suggestionSelectedEvents, query }\"\n data-test=\"history-query\"\n >\n <template #default=\"{ suggestion, queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {string} queryHTML - Suggestion's query with the matching part inside a span tag\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ suggestion, queryHTML }\" />\n </template>\n </BaseSuggestion>\n <RemoveHistoryQuery\n class=\"x-history-query__remove\"\n :historyQuery=\"suggestion\"\n data-test=\"remove-history-query\"\n >\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n -->\n <slot name=\"remove-button-content\" v-bind=\"{ suggestion }\">✕</slot>\n </RemoveHistoryQuery>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Getter } from '../../../components/decorators/store.decorators';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import RemoveHistoryQuery from './remove-history-query.vue';\n\n /**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { RemoveHistoryQuery, BaseSuggestion }\n })\n export default class HistoryQuery extends Vue {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: HistoryQueryModel;\n\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n @Getter('historyQueries', 'normalizedQuery')\n public query!: string;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent | XEvents} to emit.\n */\n protected get suggestionSelectedEvents(): Partial<XEventsTypes> {\n return {\n UserSelectedAHistoryQuery: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\n## Basic usage\n\nThis component only requires a prop called `suggestion`\n\n```vue\n<HistoryQuery :suggestion=\"historyQuery\" />\n```\n\n## Customizing slots content\n\nSuggestion and remove buttons contents can be customized.\n\nThe default slot allows you to replace the content of the suggestion button. It has two properties,\nthe suggestion itself, and a `string` of HTML with the matched query.\n\nThe other slot is called `remove-button-content`, and allows you to set the content of the button\nthat serves to remove this query from the history. This slot only has one property, the suggestion.\n\n````vue\n<HistoryQuery :suggestion=\"historyQuery\">\n <template #default=\"{ suggestion, queryHTML }\">\n <img class=\"x-history-query__history-icon\" src=\"./history-icon.svg\"/>\n <span class=\"x-history-query__matching-part\" v-html=\"queryHTML\"/>\n </template>\n\n <template #remove-button-content=\"{ suggestion }\">\n <img class=\"x-history-query__remove-icon\" src=\"./remove-icon.svg\"/>\n </template>\n</HistoryQuery>\n``` ## Events A list of events that the component will emit: - `UserSelectedAHistoryQuery`: the\nevent is emitted after the user clicks the button. The event payload is the history query data.\n````\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"history-query.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue"],"sourcesContent":["<template>\n <div class=\"x-suggestion-group x-history-query\">\n <BaseSuggestion\n class=\"x-history-query__suggestion\"\n v-bind=\"{ suggestion, suggestionSelectedEvents, query }\"\n data-test=\"history-query\"\n feature=\"history_query\"\n >\n <template #default=\"{ suggestion, queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Suggestion} suggestion - History Query suggestion data\n @binding {string} queryHTML - Suggestion's query with the matching part inside a span tag\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ suggestion, queryHTML }\" />\n </template>\n </BaseSuggestion>\n <RemoveHistoryQuery\n class=\"x-history-query__remove\"\n :historyQuery=\"suggestion\"\n data-test=\"remove-history-query\"\n >\n <!--\n @slot History Query remove button content\n @binding {Suggestion} suggestion - History Query suggestion data\n -->\n <slot name=\"remove-button-content\" v-bind=\"{ suggestion }\">✕</slot>\n </RemoveHistoryQuery>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { Getter } from '../../../components/decorators/store.decorators';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import RemoveHistoryQuery from './remove-history-query.vue';\n\n /**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { RemoveHistoryQuery, BaseSuggestion }\n })\n export default class HistoryQuery extends Vue {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: HistoryQueryModel;\n\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n @Getter('historyQueries', 'normalizedQuery')\n public query!: string;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent | XEvents} to emit.\n */\n protected get suggestionSelectedEvents(): Partial<XEventsTypes> {\n return {\n UserSelectedAHistoryQuery: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\n## Basic usage\n\nThis component only requires a prop called `suggestion`\n\n```vue\n<HistoryQuery :suggestion=\"historyQuery\" />\n```\n\n## Customizing slots content\n\nSuggestion and remove buttons contents can be customized.\n\nThe default slot allows you to replace the content of the suggestion button. It has two properties,\nthe suggestion itself, and a `string` of HTML with the matched query.\n\nThe other slot is called `remove-button-content`, and allows you to set the content of the button\nthat serves to remove this query from the history. This slot only has one property, the suggestion.\n\n````vue\n<HistoryQuery :suggestion=\"historyQuery\">\n <template #default=\"{ suggestion, queryHTML }\">\n <img class=\"x-history-query__history-icon\" src=\"./history-icon.svg\"/>\n <span class=\"x-history-query__matching-part\" v-html=\"queryHTML\"/>\n </template>\n\n <template #remove-button-content=\"{ suggestion }\">\n <img class=\"x-history-query__remove-icon\" src=\"./remove-icon.svg\"/>\n </template>\n</HistoryQuery>\n``` ## Events A list of events that the component will emit: - `UserSelectedAHistoryQuery`: the\nevent is emitted after the user clicks the button. The event payload is the history query data.\n````\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/history-queries/components/history-query.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-query.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { historyQueriesXModule } from '../x-module';\nimport RemoveHistoryQuery from './remove-history-query.vue';\n\n/**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { RemoveHistoryQuery, BaseSuggestion }\n})\nexport default class HistoryQuery extends Vue {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: HistoryQueryModel;\n\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n @Getter('historyQueries', 'normalizedQuery')\n public query!: string;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent | XEvents} to emit.\n */\n protected get suggestionSelectedEvents(): Partial<XEventsTypes> {\n return {\n UserSelectedAHistoryQuery: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"history-query.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/history-queries/components/history-query.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { historyQueriesXModule } from '../x-module';\nimport RemoveHistoryQuery from './remove-history-query.vue';\n\n/**\n * This component renders a history query suggestion combining two buttons: one for selecting this\n * suggestion as the search query, and another one to remove this query suggestion from the\n * history queries.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(historyQueriesXModule)],\n components: { RemoveHistoryQuery, BaseSuggestion }\n})\nexport default class HistoryQuery extends Vue {\n /**\n * The history query suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: HistoryQueryModel;\n\n /**\n * The normalized query of the history-queries module.\n *\n * @internal\n */\n @Getter('historyQueries', 'normalizedQuery')\n public query!: string;\n\n /**\n * The list of events that are going to be emitted when the suggestion button is pressed.\n *\n * @internal\n * @returns The {@link XEvent | XEvents} to emit.\n */\n protected get suggestionSelectedEvents(): Partial<XEventsTypes> {\n return {\n UserSelectedAHistoryQuery: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AA4CA;;;;;;;AAWA;IAA0C,gCAAG;IAA7C;;KA4BC;IALC,sBAAc,kDAAwB;;;;;;;aAAtC;YACE,OAAO;gBACL,yBAAyB,EAAE,IAAI,CAAC,UAAU;aAC3C,CAAC;SACH;;;OAAA;IApBD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;oDACgB;IAQzC;QADC,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;+CACtB;IAfH,YAAY;QAJhC,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;YAChD,UAAU,EAAE,EAAE,kBAAkB,oBAAA,EAAE,cAAc,gBAAA,EAAE;SACnD,CAAC;OACmB,YAAY,CA4BhC;IAAD,mBAAC;CAAA,CA5ByC,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-query.action.js","sources":["../../../../../../src/x-modules/identifier-results/store/actions/save-query.action.ts"],"sourcesContent":["import { IdentifierResultsXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link IdentifierResultsActions.saveQuery}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param query - The query to try to add to the store.\n *\n * @public\n */\nexport const saveQuery: IdentifierResultsXStoreModule['actions']['saveQuery'] = (\n { commit, getters },\n query: string\n) => {\n if (getters.identifierDetectionRegexp.test(query)) {\n commit('setQuery', query);\n }\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;;IASa,SAAS,GAA0D,UAC9E,EAAmB,EACnB,KAAa;QADX,MAAM,YAAA,EAAE,OAAO,aAAA;IAGjB,IAAI,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACjD,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;KAC3B;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"save-query.action.js","sources":["../../../../../../src/x-modules/identifier-results/store/actions/save-query.action.ts"],"sourcesContent":["import { IdentifierResultsXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link IdentifierResultsActions.saveQuery}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param query - The query to try to add to the store.\n *\n * @public\n */\nexport const saveQuery: IdentifierResultsXStoreModule['actions']['saveQuery'] = (\n { commit, getters },\n query: string\n) => {\n if (getters.identifierDetectionRegexp.test(query)) {\n commit('setQuery', query);\n } else {\n commit('setQuery', '');\n commit('setIdentifierResults', []);\n }\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;;IASa,SAAS,GAA0D,UAC9E,EAAmB,EACnB,KAAa;QADX,MAAM,YAAA,EAAE,OAAO,aAAA;IAGjB,IAAI,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACjD,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;KAC3B;SAAM;QACL,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;KACpC;AACH;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Default implementation for the {@link IdentifierResultsGetters.identifierResultsRequest} getter.
|
|
3
5
|
*
|
|
@@ -9,16 +11,10 @@
|
|
|
9
11
|
*/
|
|
10
12
|
// eslint-disable-next-line max-len
|
|
11
13
|
var identifierResultsRequest = function (_a) {
|
|
12
|
-
var config = _a.config, origin = _a.origin, query = _a.query;
|
|
14
|
+
var config = _a.config, origin = _a.origin, query = _a.query, params = _a.params;
|
|
13
15
|
var newOrigin = origin === null ? undefined : origin;
|
|
14
16
|
return query.trim()
|
|
15
|
-
? {
|
|
16
|
-
query: query,
|
|
17
|
-
rows: config.maxItemsToRequest,
|
|
18
|
-
start: 0,
|
|
19
|
-
origin: newOrigin
|
|
20
|
-
}
|
|
21
|
-
: null;
|
|
17
|
+
? __assign(__assign({ query: query }, params), { rows: config.maxItemsToRequest, start: 0, origin: newOrigin }) : null;
|
|
22
18
|
};
|
|
23
19
|
|
|
24
20
|
export { identifierResultsRequest };
|
package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-results-request.getter.js","sources":["../../../../../../src/x-modules/identifier-results/store/getters/identifier-results-request.getter.ts"],"sourcesContent":["import { IdentifierResultsXStoreModule } from '../types';\n/**\n * Default implementation for the {@link IdentifierResultsGetters.identifierResultsRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the identifier\n * results module.\n * @returns The identifier results request to fetch data from the API.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const identifierResultsRequest: IdentifierResultsXStoreModule['getters']['identifierResultsRequest'] =\n ({ config, origin, query }) => {\n const newOrigin = origin === null ? undefined : origin;\n return query.trim()\n ? {\n query,\n rows: config.maxItemsToRequest,\n start: 0,\n origin: newOrigin\n }\n : null;\n };\n"],"names":[],"mappings":"AACA;;;;;;;;;AASA;IACa,wBAAwB,GACnC,UAAC,
|
|
1
|
+
{"version":3,"file":"identifier-results-request.getter.js","sources":["../../../../../../src/x-modules/identifier-results/store/getters/identifier-results-request.getter.ts"],"sourcesContent":["import { IdentifierResultsXStoreModule } from '../types';\n/**\n * Default implementation for the {@link IdentifierResultsGetters.identifierResultsRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the identifier\n * results module.\n * @returns The identifier results request to fetch data from the API.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const identifierResultsRequest: IdentifierResultsXStoreModule['getters']['identifierResultsRequest'] =\n ({ config, origin, query, params }) => {\n const newOrigin = origin === null ? undefined : origin;\n return query.trim()\n ? {\n query,\n ...params,\n rows: config.maxItemsToRequest,\n start: 0,\n origin: newOrigin\n }\n : null;\n };\n"],"names":[],"mappings":";;AACA;;;;;;;;;AASA;IACa,wBAAwB,GACnC,UAAC,EAAiC;QAA/B,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA;IAC9B,IAAM,SAAS,GAAG,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,OAAO,KAAK,CAAC,IAAI,EAAE;8BAEb,KAAK,OAAA,IACF,MAAM,KACT,IAAI,EAAE,MAAM,CAAC,iBAAiB,EAC9B,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,SAAS,MAEnB,IAAI,CAAC;AACX;;;;"}
|
|
@@ -2,7 +2,6 @@ import { setStatus } from '../../../store/utils/status-store.utils.js';
|
|
|
2
2
|
import { cancelFetchAndSaveIdentifierResults, fetchAndSaveIdentifierResults } from './actions/fetch-and-save-identifier-results.action.js';
|
|
3
3
|
import { fetchIdentifierResults } from './actions/fetch-identifier-results.action.js';
|
|
4
4
|
import { saveOrigin } from './actions/save-origin.action.js';
|
|
5
|
-
import { setUrlParams } from './actions/set-url-params.action.js';
|
|
6
5
|
import { saveQuery } from './actions/save-query.action.js';
|
|
7
6
|
import { identifierDetectionRegexp } from './getters/identifier-detection-regexp.getter.js';
|
|
8
7
|
import { identifierHighlightRegexp } from './getters/identifier-highlight-regexp.getter.js';
|
|
@@ -24,6 +23,7 @@ var identifierResultsXStoreModule = {
|
|
|
24
23
|
identifierResults: [],
|
|
25
24
|
origin: null,
|
|
26
25
|
query: '',
|
|
26
|
+
params: {},
|
|
27
27
|
status: 'initial'
|
|
28
28
|
}); },
|
|
29
29
|
getters: {
|
|
@@ -39,6 +39,9 @@ var identifierResultsXStoreModule = {
|
|
|
39
39
|
if (origin === void 0) { origin = null; }
|
|
40
40
|
state.origin = origin;
|
|
41
41
|
},
|
|
42
|
+
setParams: function (state, params) {
|
|
43
|
+
state.params = params;
|
|
44
|
+
},
|
|
42
45
|
setQuery: function (state, query) {
|
|
43
46
|
state.query = query;
|
|
44
47
|
},
|
|
@@ -49,8 +52,7 @@ var identifierResultsXStoreModule = {
|
|
|
49
52
|
fetchIdentifierResults: fetchIdentifierResults,
|
|
50
53
|
fetchAndSaveIdentifierResults: fetchAndSaveIdentifierResults,
|
|
51
54
|
saveOrigin: saveOrigin,
|
|
52
|
-
saveQuery: saveQuery
|
|
53
|
-
setUrlParams: setUrlParams
|
|
55
|
+
saveQuery: saveQuery
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/identifier-results/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveIdentifierResults,\n fetchAndSaveIdentifierResults\n} from './actions/fetch-and-save-identifier-results.action';\nimport { fetchIdentifierResults } from './actions/fetch-identifier-results.action';\nimport { saveOrigin } from './actions/save-origin.action';\nimport {
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/identifier-results/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport {\n cancelFetchAndSaveIdentifierResults,\n fetchAndSaveIdentifierResults\n} from './actions/fetch-and-save-identifier-results.action';\nimport { fetchIdentifierResults } from './actions/fetch-identifier-results.action';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { saveQuery } from './actions/save-query.action';\nimport { identifierDetectionRegexp } from './getters/identifier-detection-regexp.getter';\nimport { identifierHighlightRegexp } from './getters/identifier-highlight-regexp.getter';\nimport { identifierResultsRequest } from './getters/identifier-results-request.getter';\nimport { IdentifierResultsXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the identifier results module.\n *\n * @internal\n */\nexport const identifierResultsXStoreModule: IdentifierResultsXStoreModule = {\n state: () => ({\n config: {\n debounceInMs: 600,\n maxItemsToRequest: 10,\n identifierDetectionRegexp: '^[0-9]{2,}$',\n separatorChars: '-/ '\n },\n identifierResults: [],\n origin: null,\n query: '',\n params: {},\n status: 'initial'\n }),\n getters: {\n identifierResultsRequest,\n identifierHighlightRegexp,\n identifierDetectionRegexp\n },\n mutations: {\n setIdentifierResults(state, identifierResults) {\n state.identifierResults = identifierResults;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setParams(state, params) {\n state.params = params;\n },\n setQuery(state, query) {\n state.query = query;\n },\n setStatus\n },\n actions: {\n cancelFetchAndSaveIdentifierResults,\n fetchIdentifierResults,\n fetchAndSaveIdentifierResults,\n saveOrigin,\n saveQuery\n }\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA;;;;;IAKa,6BAA6B,GAAkC;IAC1E,KAAK,EAAE,cAAM,QAAC;QACZ,MAAM,EAAE;YACN,YAAY,EAAE,GAAG;YACjB,iBAAiB,EAAE,EAAE;YACrB,yBAAyB,EAAE,aAAa;YACxC,cAAc,EAAE,KAAK;SACtB;QACD,iBAAiB,EAAE,EAAE;QACrB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,SAAS;KAClB,IAAC;IACF,OAAO,EAAE;QACP,wBAAwB,0BAAA;QACxB,yBAAyB,2BAAA;QACzB,yBAAyB,2BAAA;KAC1B;IACD,SAAS,EAAE;QACT,oBAAoB,YAAC,KAAK,EAAE,iBAAiB;YAC3C,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;SAC7C;QACD,SAAS,YAAC,KAAK,EAAE,MAAa;YAAb,uBAAA,EAAA,aAAa;YAC5B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,SAAS,YAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,QAAQ,YAAC,KAAK,EAAE,KAAK;YACnB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;SACrB;QACD,SAAS,WAAA;KACV;IACD,OAAO,EAAE;QACP,mCAAmC,qCAAA;QACnC,sBAAsB,wBAAA;QACtB,6BAA6B,+BAAA;QAC7B,UAAU,YAAA;QACV,SAAS,WAAA;KACV;;;;;"}
|
|
@@ -43,7 +43,10 @@ var clearIdentifierResultsQuery = wireCommit('setQuery', '');
|
|
|
43
43
|
*
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
|
-
var setUrlParams = wireDispatch('
|
|
46
|
+
var setUrlParams = wireDispatch('saveQuery', function (_a) {
|
|
47
|
+
var query = _a.eventPayload.query;
|
|
48
|
+
return query;
|
|
49
|
+
});
|
|
47
50
|
/**
|
|
48
51
|
* Requests and stores a new set of identifier results for the {@link IdentifierResultsState.query}.
|
|
49
52
|
*
|
|
@@ -65,6 +68,12 @@ var saveIdentifierResultsOriginWire = wireDispatch('saveOrigin', function (_a) {
|
|
|
65
68
|
var metadata = _a.metadata;
|
|
66
69
|
return metadata;
|
|
67
70
|
});
|
|
71
|
+
/**
|
|
72
|
+
* Sets the identifier result state `params`.
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
var setIdentifierResultsExtraParams = wireCommit('setParams');
|
|
68
77
|
/**
|
|
69
78
|
* Debounce function for the module.
|
|
70
79
|
*/
|
|
@@ -94,8 +103,11 @@ var identifierResultsWiring = createWiring({
|
|
|
94
103
|
},
|
|
95
104
|
ParamsLoadedFromUrl: {
|
|
96
105
|
setUrlParams: setUrlParams
|
|
106
|
+
},
|
|
107
|
+
ExtraParamsChanged: {
|
|
108
|
+
setIdentifierResultsExtraParams: setIdentifierResultsExtraParams
|
|
97
109
|
}
|
|
98
110
|
});
|
|
99
111
|
|
|
100
|
-
export { cancelFetchAndSaveIdentifierResultsWire, clearIdentifierResultsQuery, fetchAndSaveIdentifierResultsWire, identifierResultsWiring, saveIdentifierResultsOriginWire, setIdentifierResultsQuery };
|
|
112
|
+
export { cancelFetchAndSaveIdentifierResultsWire, clearIdentifierResultsQuery, fetchAndSaveIdentifierResultsWire, identifierResultsWiring, saveIdentifierResultsOriginWire, setIdentifierResultsExtraParams, setIdentifierResultsQuery };
|
|
101
113
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/identifier-results/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 * `identifierResults` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'identifierResults';\n/**\n * WireCommit for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the identifier-results module query.\n *\n * @public\n */\nexport const setIdentifierResultsQuery = wireDispatch('saveQuery');\n\n/**\n * Clears the identifier-results module query.\n *\n * @public\n */\nexport const clearIdentifierResultsQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the identifier results state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/identifier-results/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 * `identifierResults` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'identifierResults';\n/**\n * WireCommit for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link IdentifierResultsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the identifier-results module query.\n *\n * @public\n */\nexport const setIdentifierResultsQuery = wireDispatch('saveQuery');\n\n/**\n * Clears the identifier-results module query.\n *\n * @public\n */\nexport const clearIdentifierResultsQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the identifier results state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('saveQuery', ({ eventPayload: { query } }) => query);\n\n/**\n * Requests and stores a new set of identifier results for the {@link IdentifierResultsState.query}.\n *\n * @public\n */\nexport const fetchAndSaveIdentifierResultsWire = wireDispatch('fetchAndSaveIdentifierResults');\n\n/**\n * Cancels the {@link IdentifierResultsActions.fetchAndSaveIdentifierResults} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveIdentifierResultsWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveIdentifierResults'\n);\n\n/**\n * Sets the identifier results state `origin`.\n *\n * @public\n */\nexport const saveIdentifierResultsOriginWire = wireDispatch(\n 'saveOrigin',\n ({ metadata }) => metadata\n);\n\n/**\n * Sets the identifier result state `params`.\n *\n * @public\n */\nexport const setIdentifierResultsExtraParams = wireCommit('setParams');\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link IdentifierResultsXModule} module.\n *\n * @internal\n */\nexport const identifierResultsWiring = createWiring({\n UserIsTypingAQuery: {\n setIdentifierResultsQueryDebounce: moduleDebounce(\n setIdentifierResultsQuery,\n ({ state }) => state.config.debounceInMs,\n 'UserAcceptedAQuery'\n )\n },\n UserAcceptedAQuery: {\n setIdentifierResultsQuery,\n saveIdentifierResultsOriginWire\n },\n UserClearedQuery: {\n clearIdentifierResultsQuery,\n cancelFetchAndSaveIdentifierResultsWire\n },\n IdentifierResultsRequestChanged: {\n fetchAndSaveIdentifierResultsWire\n },\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n ExtraParamsChanged: {\n setIdentifierResultsExtraParams\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;;AAKA,IAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC;;;;;AAKA,IAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;AAKA,IAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;;AAKA,IAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;;IAKa,yBAAyB,GAAG,YAAY,CAAC,WAAW,EAAE;AAEnE;;;;;IAKa,2BAA2B,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAEtE;;;;;AAKA,IAAM,YAAY,GAAG,YAAY,CAAC,WAAW,EAAE,UAAC,EAA2B;QAAT,KAAK,wBAAA;IAAS,OAAA,KAAK;AAAL,CAAK,CAAC,CAAC;AAEvF;;;;;IAKa,iCAAiC,GAAG,YAAY,CAAC,+BAA+B,EAAE;AAE/F;;;;;IAKa,uCAAuC,GAAG,0BAA0B,CAC/E,qCAAqC,EACrC;AAEF;;;;;IAKa,+BAA+B,GAAG,YAAY,CACzD,YAAY,EACZ,UAAC,EAAY;QAAV,QAAQ,cAAA;IAAO,OAAA,QAAQ;AAAR,CAAQ,EAC1B;AAEF;;;;;IAKa,+BAA+B,GAAG,UAAU,CAAC,WAAW,EAAE;AAEvE;;;AAGA,IAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;IAKa,uBAAuB,GAAG,YAAY,CAAC;IAClD,kBAAkB,EAAE;QAClB,iCAAiC,EAAE,cAAc,CAC/C,yBAAyB,EACzB,UAAC,EAAS;gBAAP,KAAK,WAAA;YAAO,OAAA,KAAK,CAAC,MAAM,CAAC,YAAY;SAAA,EACxC,oBAAoB,CACrB;KACF;IACD,kBAAkB,EAAE;QAClB,yBAAyB,2BAAA;QACzB,+BAA+B,iCAAA;KAChC;IACD,gBAAgB,EAAE;QAChB,2BAA2B,6BAAA;QAC3B,uCAAuC,yCAAA;KACxC;IACD,+BAA+B,EAAE;QAC/B,iCAAiC,mCAAA;KAClC;IACD,mBAAmB,EAAE;QACnB,YAAY,cAAA;KACb;IACD,kBAAkB,EAAE;QAClB,+BAA+B,iCAAA;KAChC;CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-query.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n class=\"x-next-query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"events\"\n data-test=\"next-query\"\n >\n <template #default=\"{ suggestion }\">\n <!--\n @slot Next Query content\n @binding {Suggestion} suggestion - Next Query suggestion data\n -->\n <slot :suggestion=\"suggestion\">{{ suggestion.query }}</slot>\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { nextQueriesXModule } from '../x-module';\n\n /**\n * Renders a next query item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the next query content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQuery extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: NextQueryModel;\n\n /**\n * Events list which are going to be emitted when a next query is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedANextQuery: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis components expects just a suggestion as a prop to be rendered. It has a slot to override the\ncontent. By default, it renders the suggestion query of the next query.\n\n## Basic Usage\n\nUsing default slot:\n\n```vue\n<NextQuery :suggestion=\"suggestion\" />\n```\n\n## Overriding default slot.\n\nThe default slot allows you to replace the content of the suggestion button.\n\n```vue\n<NextQuery :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <img class=\"x-next-query__icon\" src=\"./next-query.svg\" />\n <span class=\"x-next-query__query\" :aria-label=\"suggestion.query\">{{ suggestion.query }}</span>\n </template>\n</NextQuery>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserSelectedANextQuery`: the event is emitted after the user clicks the button. The event payload\n is the next query data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA
|
|
1
|
+
{"version":3,"file":"next-query.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n class=\"x-next-query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"events\"\n data-test=\"next-query\"\n feature=\"next_query\"\n >\n <template #default=\"{ suggestion }\">\n <!--\n @slot Next Query content\n @binding {Suggestion} suggestion - Next Query suggestion data\n -->\n <slot :suggestion=\"suggestion\">{{ suggestion.query }}</slot>\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { nextQueriesXModule } from '../x-module';\n\n /**\n * Renders a next query item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the next query content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQuery extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: NextQueryModel;\n\n /**\n * Events list which are going to be emitted when a next query is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedANextQuery: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis components expects just a suggestion as a prop to be rendered. It has a slot to override the\ncontent. By default, it renders the suggestion query of the next query.\n\n## Basic Usage\n\nUsing default slot:\n\n```vue\n<NextQuery :suggestion=\"suggestion\" />\n```\n\n## Overriding default slot.\n\nThe default slot allows you to replace the content of the suggestion button.\n\n```vue\n<NextQuery :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <img class=\"x-next-query__icon\" src=\"./next-query.svg\" />\n <span class=\"x-next-query__query\" :aria-label=\"suggestion.query\">{{ suggestion.query }}</span>\n </template>\n</NextQuery>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserSelectedANextQuery`: the event is emitted after the user clicks the button. The event payload\n is the next query data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-query.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/next-queries/components/next-query.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { NextQuery as NextQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { nextQueriesXModule } from '../x-module';\n\n/**\n * Renders a next query item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the next query content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQuery extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: NextQueryModel;\n\n /**\n * Events list which are going to be emitted when a next query is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedANextQuery: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"next-query.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/next-queries/components/next-query.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { NextQuery as NextQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { nextQueriesXModule } from '../x-module';\n\n/**\n * Renders a next query item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the next query content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQuery extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: NextQueryModel;\n\n /**\n * Events list which are going to be emitted when a next query is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedANextQuery: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA2BA;;;;;;;AAWA;IAAuC,6BAAG;IAA1C;;KAoBC;IALC,sBAAc,6BAAM;;;;;;;aAApB;YACE,OAAO;gBACL,sBAAsB,EAAE,IAAI,CAAC,UAAU;aACxC,CAAC;SACH;;;OAAA;IAZD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;iDACa;IAPnB,SAAS;QAJ7B,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,cAAc,gBAAA,EAAE;YAC9B,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SAC9C,CAAC;OACmB,SAAS,CAoB7B;IAAD,gBAAC;CAAA,CApBsC,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popular-search.vue.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-search.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n class=\"x-popular-search\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"events\"\n data-test=\"popular-search\"\n >\n <template #default=\"{ suggestion }\">\n <!--\n @slot Popular Search's content\n @binding {Suggestion} suggestion - Popular Search suggestion data\n -->\n <slot :suggestion=\"suggestion\">{{ suggestion.query }}</slot>\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { popularSearchesXModule } from '../x-module';\n\n /**\n * Renders a popular search item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the popular search content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(popularSearchesXModule)]\n })\n export default class PopularSearch extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Events list which are going to be emitted when a popular search is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedAPopularSearch: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis components expects just a suggestion as a prop to be rendered. It has a slot to override the\ncontent. By default, it renders the suggestion query of the popular search.\n\n## Basic Usage\n\n```vue\n<PopularSearch :suggestion=\"suggestion\" />\n```\n\n## Custom Usage\n\n```vue\n<PopularSearch :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <svg height=\"10\" width=\"10\">\n <circle cx=\"5\" cy=\"5\" r=\"4\" stroke=\"black\" />\n </svg>\n <span :aria-label=\"suggestion.query\">{{ suggestion.query }}</span>\n </template>\n</PopularSearch>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserSelectedAPopularSearch`: the event is emitted after the user clicks the button. The event\n payload is the popular search data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA
|
|
1
|
+
{"version":3,"file":"popular-search.vue.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-search.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n class=\"x-popular-search\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"events\"\n data-test=\"popular-search\"\n feature=\"popular_search\"\n >\n <template #default=\"{ suggestion }\">\n <!--\n @slot Popular Search's content\n @binding {Suggestion} suggestion - Popular Search suggestion data\n -->\n <slot :suggestion=\"suggestion\">{{ suggestion.query }}</slot>\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { popularSearchesXModule } from '../x-module';\n\n /**\n * Renders a popular search item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the popular search content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(popularSearchesXModule)]\n })\n export default class PopularSearch extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Events list which are going to be emitted when a popular search is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedAPopularSearch: this.suggestion\n };\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis components expects just a suggestion as a prop to be rendered. It has a slot to override the\ncontent. By default, it renders the suggestion query of the popular search.\n\n## Basic Usage\n\n```vue\n<PopularSearch :suggestion=\"suggestion\" />\n```\n\n## Custom Usage\n\n```vue\n<PopularSearch :suggestion=\"suggestion\">\n <template #default=\"{ suggestion }\">\n <svg height=\"10\" width=\"10\">\n <circle cx=\"5\" cy=\"5\" r=\"4\" stroke=\"black\" />\n </svg>\n <span :aria-label=\"suggestion.query\">{{ suggestion.query }}</span>\n </template>\n</PopularSearch>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserSelectedAPopularSearch`: the event is emitted after the user clicks the button. The event\n payload is the popular search data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/popular-searches/components/popular-search.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popular-search.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-search.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Suggestion } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { popularSearchesXModule } from '../x-module';\n\n/**\n * Renders a popular search item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the popular search content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(popularSearchesXModule)]\n})\nexport default class PopularSearch extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Events list which are going to be emitted when a popular search is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedAPopularSearch: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"popular-search.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/popular-searches/components/popular-search.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Suggestion } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { popularSearchesXModule } from '../x-module';\n\n/**\n * Renders a popular search item which receives the suggestion that will be rendered as a prop. It\n * exposes a default slot to change the popular search content. If the slot is not overridden,\n * it will render the suggestion query by default.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(popularSearchesXModule)]\n})\nexport default class PopularSearch extends Vue {\n /**\n * The suggestion to render and use in the default slot.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Events list which are going to be emitted when a popular search is selected.\n *\n * @returns The {@link XEvent | XEvents} to emit.\n * @public\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserSelectedAPopularSearch: this.suggestion\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA2BA;;;;;;;AAWA;IAA2C,iCAAG;IAA9C;;KAoBC;IALC,sBAAc,iCAAM;;;;;;;aAApB;YACE,OAAO;gBACL,0BAA0B,EAAE,IAAI,CAAC,UAAU;aAC5C,CAAC;SACH;;;OAAA;IAZD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;qDACS;IAPf,aAAa;QAJjC,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,cAAc,gBAAA,EAAE;YAC9B,MAAM,EAAE,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;SAClD,CAAC;OACmB,aAAa,CAoBjC;IAAD,oBAAC;CAAA,CApB0C,GAAG;;;;"}
|
|
@@ -16,7 +16,8 @@ var __vue_render__ = function() {
|
|
|
16
16
|
staticClass: "x-query-suggestion",
|
|
17
17
|
attrs: {
|
|
18
18
|
"aria-label": _vm.suggestion.query,
|
|
19
|
-
"data-test": "query-suggestion"
|
|
19
|
+
"data-test": "query-suggestion",
|
|
20
|
+
feature: "query_suggestion"
|
|
20
21
|
},
|
|
21
22
|
scopedSlots: _vm._u(
|
|
22
23
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-suggestion.vue.js","sources":["../../../../../src/x-modules/query-suggestions/components/query-suggestion.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n v-bind=\"{ query, suggestion, suggestionSelectedEvents: event }\"\n :aria-label=\"suggestion.query\"\n class=\"x-query-suggestion\"\n data-test=\"query-suggestion\"\n >\n <template #default=\"{ suggestion, queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Custom content that replaces the `QuerySuggestion` default content\n @binding {Suggestion} suggestion - Query Suggestion data\n @binding {string} queryHTML - Suggestion’s query with the matching part wrapped in a HTML span tag\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ suggestion, queryHTML }\" />\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import { Component, Prop, Vue } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { querySuggestionsXModule } from '../x-module';\n\n /**\n * This component renders a suggestion for a query. A query suggestion is a recommended query\n * based on previous search queries. It contains the query itself and a set of filters associated.\n * For example, if you're searching for _shirt_, a query suggestion could be _long sleeve shirt_.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(querySuggestionsXModule)]\n })\n export default class QuerySuggestion extends Vue {\n /**\n * The normalized query of the query-suggestions module.\n *\n * @internal\n */\n @Getter('querySuggestions', 'normalizedQuery')\n public query!: string;\n\n /**\n * The suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Emits {@link QuerySuggestionsXEvents.UserSelectedAQuerySuggestion} with the suggestion as\n * payload when selecting the query suggestion.\n *\n * @internal\n */\n protected event: Partial<XEventsTypes> = {\n UserSelectedAQuerySuggestion: this.suggestion\n };\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserSelectedAQuerySuggestion`] (./../../api/x-components.querysuggestionsxevents.md)\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend microservice required\nTo use this component, the <b>Empathize</b> microservice must be\nimplemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you can see how a single query suggestion is rendered using the `suggestion` prop.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" />\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with default slot\n\nIn this example, the query suggestion is painted in blue by passing a color style in the HTML span\nelement.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" #default=\"{ queryHTML }\">\n <span v-html=\"queryHTML\" style=\"color: blue;\" />\n </QuerySuggestion>\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, when you click on the query suggestion, a message is displayed to illustrate that\nthe `UserSelectedAQuerySuggestion` event has been triggered.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" @UserSelectedAQuerySuggestion=\"alertSuggestion\" />\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n },\n methods: {\n alertSuggestion(querySuggestion) {\n alert(`You have clicked the query suggestion: ${querySuggestion.query}`);\n }\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA
|
|
1
|
+
{"version":3,"file":"query-suggestion.vue.js","sources":["../../../../../src/x-modules/query-suggestions/components/query-suggestion.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n v-bind=\"{ query, suggestion, suggestionSelectedEvents: event }\"\n :aria-label=\"suggestion.query\"\n class=\"x-query-suggestion\"\n data-test=\"query-suggestion\"\n feature=\"query_suggestion\"\n >\n <template #default=\"{ suggestion, queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot Custom content that replaces the `QuerySuggestion` default content\n @binding {Suggestion} suggestion - Query Suggestion data\n @binding {string} queryHTML - Suggestion’s query with the matching part wrapped in a HTML span tag\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ suggestion, queryHTML }\" />\n </template>\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { Suggestion } from '@empathyco/x-types';\n import { Component, Prop, Vue } from 'vue-property-decorator';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { querySuggestionsXModule } from '../x-module';\n\n /**\n * This component renders a suggestion for a query. A query suggestion is a recommended query\n * based on previous search queries. It contains the query itself and a set of filters associated.\n * For example, if you're searching for _shirt_, a query suggestion could be _long sleeve shirt_.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(querySuggestionsXModule)]\n })\n export default class QuerySuggestion extends Vue {\n /**\n * The normalized query of the query-suggestions module.\n *\n * @internal\n */\n @Getter('querySuggestions', 'normalizedQuery')\n public query!: string;\n\n /**\n * The suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Emits {@link QuerySuggestionsXEvents.UserSelectedAQuerySuggestion} with the suggestion as\n * payload when selecting the query suggestion.\n *\n * @internal\n */\n protected event: Partial<XEventsTypes> = {\n UserSelectedAQuerySuggestion: this.suggestion\n };\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserSelectedAQuerySuggestion`] (./../../api/x-components.querysuggestionsxevents.md)\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend microservice required\nTo use this component, the <b>Empathize</b> microservice must be\nimplemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you can see how a single query suggestion is rendered using the `suggestion` prop.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" />\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with default slot\n\nIn this example, the query suggestion is painted in blue by passing a color style in the HTML span\nelement.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" #default=\"{ queryHTML }\">\n <span v-html=\"queryHTML\" style=\"color: blue;\" />\n </QuerySuggestion>\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, when you click on the query suggestion, a message is displayed to illustrate that\nthe `UserSelectedAQuerySuggestion` event has been triggered.\n\n```vue\n<template>\n <QuerySuggestion :suggestion=\"suggestion\" @UserSelectedAQuerySuggestion=\"alertSuggestion\" />\n</template>\n\n<script>\n import { QuerySuggestion } from '@empathyco/x-components/query-suggestions';\n export default {\n name: 'QuerySuggestionDemo',\n components: {\n QuerySuggestion\n },\n data() {\n return {\n suggestion: {\n modelName: 'QuerySuggestion',\n query: 'beer',\n facets: []\n }\n };\n },\n methods: {\n alertSuggestion(querySuggestion) {\n alert(`You have clicked the query suggestion: ${querySuggestion.query}`);\n }\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-suggestion.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/query-suggestions/components/query-suggestion.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Suggestion } from '@empathyco/x-types';\nimport { Component, Prop, Vue } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { querySuggestionsXModule } from '../x-module';\n\n/**\n * This component renders a suggestion for a query. A query suggestion is a recommended query\n * based on previous search queries. It contains the query itself and a set of filters associated.\n * For example, if you're searching for _shirt_, a query suggestion could be _long sleeve shirt_.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(querySuggestionsXModule)]\n})\nexport default class QuerySuggestion extends Vue {\n /**\n * The normalized query of the query-suggestions module.\n *\n * @internal\n */\n @Getter('querySuggestions', 'normalizedQuery')\n public query!: string;\n\n /**\n * The suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Emits {@link QuerySuggestionsXEvents.UserSelectedAQuerySuggestion} with the suggestion as\n * payload when selecting the query suggestion.\n *\n * @internal\n */\n protected event: Partial<XEventsTypes> = {\n UserSelectedAQuerySuggestion: this.suggestion\n };\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"query-suggestion.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/query-suggestions/components/query-suggestion.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Suggestion } from '@empathyco/x-types';\nimport { Component, Prop, Vue } from 'vue-property-decorator';\nimport BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { XEventsTypes } from '../../../wiring/events.types';\nimport { querySuggestionsXModule } from '../x-module';\n\n/**\n * This component renders a suggestion for a query. A query suggestion is a recommended query\n * based on previous search queries. It contains the query itself and a set of filters associated.\n * For example, if you're searching for _shirt_, a query suggestion could be _long sleeve shirt_.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestion },\n mixins: [xComponentMixin(querySuggestionsXModule)]\n})\nexport default class QuerySuggestion extends Vue {\n /**\n * The normalized query of the query-suggestions module.\n *\n * @internal\n */\n @Getter('querySuggestions', 'normalizedQuery')\n public query!: string;\n\n /**\n * The suggestion to render.\n *\n * @public\n */\n @Prop({ required: true })\n protected suggestion!: Suggestion;\n\n /**\n * Emits {@link QuerySuggestionsXEvents.UserSelectedAQuerySuggestion} with the suggestion as\n * payload when selecting the query suggestion.\n *\n * @internal\n */\n protected event: Partial<XEventsTypes> = {\n UserSelectedAQuerySuggestion: this.suggestion\n };\n}\n"],"names":[],"mappings":";;;;;;;AA8BA;;;;;;;AAWA;IAA6C,mCAAG;IAAhD;QAAA,qEA0BC;;;;;;;QAHW,WAAK,GAA0B;YACvC,4BAA4B,EAAE,KAAI,CAAC,UAAU;SAC9C,CAAC;;KACH;IAnBC;QADC,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;kDACxB;IAQtB;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;uDACS;IAff,eAAe;QAJnC,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,cAAc,gBAAA,EAAE;YAC9B,MAAM,EAAE,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;SACnD,CAAC;OACmB,eAAe,CA0BnC;IAAD,sBAAC;CAAA,CA1B4C,GAAG;;;;"}
|
|
@@ -37,11 +37,11 @@ __vue_render__._withStripped = true;
|
|
|
37
37
|
/* style */
|
|
38
38
|
var __vue_inject_styles__ = function (inject) {
|
|
39
39
|
if (!inject) { return }
|
|
40
|
-
inject("data-v-
|
|
40
|
+
inject("data-v-0dfb94a8_0", { source: ".x-related-tag[data-v-0dfb94a8] {\n white-space: nowrap;\n}\n.x-related-tag--is-selected[data-v-0dfb94a8] {\n background: lightgrey;\n}", map: undefined, media: undefined });
|
|
41
41
|
|
|
42
42
|
};
|
|
43
43
|
/* scoped */
|
|
44
|
-
var __vue_scope_id__ = "data-v-
|
|
44
|
+
var __vue_scope_id__ = "data-v-0dfb94a8";
|
|
45
45
|
/* module identifier */
|
|
46
46
|
var __vue_module_identifier__ = undefined;
|
|
47
47
|
/* functional template */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-tag.vue.js","sources":["../../../../../src/x-modules/related-tags/components/related-tag.vue"],"sourcesContent":["<template>\n <button\n @click=\"emitEvents\"\n class=\"x-tag x-related-tag\"\n data-test=\"related-tag\"\n :class=\"dynamicClasses\"\n >\n <!--\n @slot Custom content that replaces the RelatedTag default content.\n @binding {RelatedTag} relatedTag - Related tag data.\n @binding {boolean} isSelected - Related tag status.\n -->\n <slot v-bind=\"{ relatedTag, isSelected }\">{{ relatedTag.tag }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { RelatedTag as RelatedTagModel } from '@empathyco/x-types';\n import { State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { VueCSSClasses } from '../../../utils/types';\n import { relatedTagsXModule } from '../x-module';\n\n /**\n * This component renders a related tag for a query. A related tag is a descriptive keyword\n * related to the current query to fine-tune the search. For example, if you are searching\n * for *lego*, a related tag could be *city*, refining the search with *lego city*.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(relatedTagsXModule)]\n })\n export default class RelatedTag extends Vue {\n /**\n * The related tag model data.\n *\n * @public\n */\n @Prop({ required: true })\n protected relatedTag!: RelatedTagModel;\n /**\n * The selected related tags.\n *\n * @internal\n */\n @State('relatedTags', 'selectedRelatedTags')\n public selectedRelatedTags!: RelatedTagModel[];\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n // We have to emit this events first to avoid the UserPickedARelatedTag wires to change the\n // isSelected value before
|
|
1
|
+
{"version":3,"file":"related-tag.vue.js","sources":["../../../../../src/x-modules/related-tags/components/related-tag.vue"],"sourcesContent":["<template>\n <button\n @click=\"emitEvents\"\n class=\"x-tag x-related-tag\"\n data-test=\"related-tag\"\n :class=\"dynamicClasses\"\n >\n <!--\n @slot Custom content that replaces the RelatedTag default content.\n @binding {RelatedTag} relatedTag - Related tag data.\n @binding {boolean} isSelected - Related tag status.\n -->\n <slot v-bind=\"{ relatedTag, isSelected }\">{{ relatedTag.tag }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { RelatedTag as RelatedTagModel } from '@empathyco/x-types';\n import { State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { VueCSSClasses } from '../../../utils/types';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { relatedTagsXModule } from '../x-module';\n\n /**\n * This component renders a related tag for a query. A related tag is a descriptive keyword\n * related to the current query to fine-tune the search. For example, if you are searching\n * for *lego*, a related tag could be *city*, refining the search with *lego city*.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(relatedTagsXModule)]\n })\n export default class RelatedTag extends Vue {\n /**\n * The related tag model data.\n *\n * @public\n */\n @Prop({ required: true })\n protected relatedTag!: RelatedTagModel;\n /**\n * The selected related tags.\n *\n * @internal\n */\n @State('relatedTags', 'selectedRelatedTags')\n public selectedRelatedTags!: RelatedTagModel[];\n\n /**\n * Generates the {@link WireMetadata | event metadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n protected createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: this.$el as HTMLElement,\n feature: 'related_tag'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n // We have to emit this events first to avoid the UserPickedARelatedTag wires to change the\n // isSelected value before emitting this selection events.\n this.$x.emit(\n this.isSelected ? 'UserDeselectedARelatedTag' : 'UserSelectedARelatedTag',\n this.relatedTag,\n this.createEventMetadata()\n );\n this.$x.emit('UserPickedARelatedTag', this.relatedTag, this.createEventMetadata());\n }\n\n /**\n * Check if the related tag is selected or not.\n *\n * @returns If the related tag is selected.\n *\n * @internal\n */\n protected get isSelected(): boolean {\n return this.selectedRelatedTags.includes(this.relatedTag);\n }\n\n /**\n * Adds the dynamic css classes to the component.\n *\n * @returns The class to be added to the component.\n *\n * @internal\n */\n protected get dynamicClasses(): VueCSSClasses {\n return {\n 'x-tag--is-selected': this.isSelected,\n 'x-related-tag--is-selected': this.isSelected\n };\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-related-tag {\n white-space: nowrap;\n\n &--is-selected {\n background: lightgrey;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Dynamic classes\n\n`RelatedTag` uses the `x-related-tag--is-selected` dynamic CSS class so you can style it when is\nselected.\n\n## Events\n\nThis component emits the following events:\n\n- [`UserDeselectedARelatedTag`](./../../api/x-components.relatedtagsxevents.md)\n- [`UserPickedARelatedTag`](./../../api/x-components.relatedtagsxevents.md)\n- [`UserSelectedARelatedTag`](./../../api/x-components.relatedtagsxevents.md)\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nThe QuerySignals microservice must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nIn this example related tag data is passed as a prop.\n\n_Here you can see how the RelatedTag component is rendered._\n\n```vue\n<template>\n <RelatedTag :relatedTag=\"tag\"></RelatedTag>\n</template>\n\n<script>\n import { RelatedTag } from '@empathyco/x-components/related-tags';\n\n export default {\n name: 'RelatedTagDemo',\n components: {\n RelatedTag\n },\n data() {\n return {\n tag: {\n modelName: 'RelatedTag',\n previous: 'toy',\n query: 'toy story',\n selected: false,\n tag: 'story'\n }\n };\n }\n };\n</script>\n```\n\n### Play with default slot\n\nIn this example, an HTML span element is passed in the `default` slot.\n\n_See how the related tag can be rendered._\n\n```vue\n<template>\n <RelatedTag :relatedTag=\"tag\" #default=\"{ relatedTag }\">\n <span :aria-label=\"relatedTag.tag\">{{ relatedTag.tag }}</span>\n </RelatedTag>\n</template>\n\n<script>\n import { RelatedTag } from '@empathyco/x-components/related-tags';\n\n export default {\n name: 'RelatedTagDemo',\n components: {\n RelatedTag\n },\n data() {\n return {\n tag: {\n modelName: 'RelatedTag',\n previous: 'toy',\n query: 'toy story',\n selected: false,\n tag: 'story'\n }\n };\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, the [`UserSelectedARelatedTag`](./../../api/x-components.relatedtagsxevents.md)\nevent is implemented, as illustrated by the “Tag” message returned.\n\n_See how the event is triggered when the related tag is clicked._\n\n```vue\n<template>\n <RelatedTag :relatedTag=\"tag\" @UserSelectedARelatedTag=\"alertRelatedTag\"></RelatedTag>\n</template>\n\n<script>\n import { RelatedTag } from '@empathyco/x-components/related-tags';\n\n export default {\n name: 'RelatedTagDemo',\n components: {\n RelatedTag\n },\n data() {\n return {\n tag: {\n modelName: 'RelatedTag',\n previous: 'toy',\n query: 'toy story',\n selected: false,\n tag: 'story'\n }\n };\n },\n methods: {\n alertRelatedTag(relatedTag) {\n alert(`You have clicked the related tag: ${relatedTag.query}`);\n }\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,6 +17,18 @@ var RelatedTag = /** @class */ (function (_super) {
|
|
|
17
17
|
function RelatedTag() {
|
|
18
18
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Generates the {@link WireMetadata | event metadata} object omitting the moduleName.
|
|
22
|
+
*
|
|
23
|
+
* @returns The {@link WireMetadata} object omitting the moduleName.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
RelatedTag.prototype.createEventMetadata = function () {
|
|
27
|
+
return {
|
|
28
|
+
target: this.$el,
|
|
29
|
+
feature: 'related_tag'
|
|
30
|
+
};
|
|
31
|
+
};
|
|
20
32
|
/**
|
|
21
33
|
* Emits events when the button is clicked.
|
|
22
34
|
*
|
|
@@ -24,13 +36,9 @@ var RelatedTag = /** @class */ (function (_super) {
|
|
|
24
36
|
*/
|
|
25
37
|
RelatedTag.prototype.emitEvents = function () {
|
|
26
38
|
// We have to emit this events first to avoid the UserPickedARelatedTag wires to change the
|
|
27
|
-
// isSelected value before
|
|
28
|
-
this.$x.emit(this.isSelected ? 'UserDeselectedARelatedTag' : 'UserSelectedARelatedTag', this.relatedTag,
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
this.$x.emit('UserPickedARelatedTag', this.relatedTag, {
|
|
32
|
-
target: this.$el
|
|
33
|
-
});
|
|
39
|
+
// isSelected value before emitting this selection events.
|
|
40
|
+
this.$x.emit(this.isSelected ? 'UserDeselectedARelatedTag' : 'UserSelectedARelatedTag', this.relatedTag, this.createEventMetadata());
|
|
41
|
+
this.$x.emit('UserPickedARelatedTag', this.relatedTag, this.createEventMetadata());
|
|
34
42
|
};
|
|
35
43
|
Object.defineProperty(RelatedTag.prototype, "isSelected", {
|
|
36
44
|
/**
|
package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-tag.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/related-tags/components/related-tag.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { RelatedTag as RelatedTagModel } from '@empathyco/x-types';\nimport { State } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { VueCSSClasses } from '../../../utils/types';\nimport { relatedTagsXModule } from '../x-module';\n\n/**\n * This component renders a related tag for a query. A related tag is a descriptive keyword\n * related to the current query to fine-tune the search. For example, if you are searching\n * for *lego*, a related tag could be *city*, refining the search with *lego city*.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(relatedTagsXModule)]\n})\nexport default class RelatedTag extends Vue {\n /**\n * The related tag model data.\n *\n * @public\n */\n @Prop({ required: true })\n protected relatedTag!: RelatedTagModel;\n /**\n * The selected related tags.\n *\n * @internal\n */\n @State('relatedTags', 'selectedRelatedTags')\n public selectedRelatedTags!: RelatedTagModel[];\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n // We have to emit this events first to avoid the UserPickedARelatedTag wires to change the\n // isSelected value before
|
|
1
|
+
{"version":3,"file":"related-tag.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/related-tags/components/related-tag.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { RelatedTag as RelatedTagModel } from '@empathyco/x-types';\nimport { State } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { VueCSSClasses } from '../../../utils/types';\nimport { WireMetadata } from '../../../wiring/wiring.types';\nimport { relatedTagsXModule } from '../x-module';\n\n/**\n * This component renders a related tag for a query. A related tag is a descriptive keyword\n * related to the current query to fine-tune the search. For example, if you are searching\n * for *lego*, a related tag could be *city*, refining the search with *lego city*.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(relatedTagsXModule)]\n})\nexport default class RelatedTag extends Vue {\n /**\n * The related tag model data.\n *\n * @public\n */\n @Prop({ required: true })\n protected relatedTag!: RelatedTagModel;\n /**\n * The selected related tags.\n *\n * @internal\n */\n @State('relatedTags', 'selectedRelatedTags')\n public selectedRelatedTags!: RelatedTagModel[];\n\n /**\n * Generates the {@link WireMetadata | event metadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n protected createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: this.$el as HTMLElement,\n feature: 'related_tag'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n // We have to emit this events first to avoid the UserPickedARelatedTag wires to change the\n // isSelected value before emitting this selection events.\n this.$x.emit(\n this.isSelected ? 'UserDeselectedARelatedTag' : 'UserSelectedARelatedTag',\n this.relatedTag,\n this.createEventMetadata()\n );\n this.$x.emit('UserPickedARelatedTag', this.relatedTag, this.createEventMetadata());\n }\n\n /**\n * Check if the related tag is selected or not.\n *\n * @returns If the related tag is selected.\n *\n * @internal\n */\n protected get isSelected(): boolean {\n return this.selectedRelatedTags.includes(this.relatedTag);\n }\n\n /**\n * Adds the dynamic css classes to the component.\n *\n * @returns The class to be added to the component.\n *\n * @internal\n */\n protected get dynamicClasses(): VueCSSClasses {\n return {\n 'x-tag--is-selected': this.isSelected,\n 'x-related-tag--is-selected': this.isSelected\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA0BA;;;;;;;AAUA;IAAwC,8BAAG;IAA3C;;KAqEC;;;;;;;IA/CW,wCAAmB,GAA7B;QACE,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,GAAkB;YAC/B,OAAO,EAAE,aAAa;SACvB,CAAC;KACH;;;;;;IAOS,+BAAU,GAApB;;;QAGE,IAAI,CAAC,EAAE,CAAC,IAAI,CACV,IAAI,CAAC,UAAU,GAAG,2BAA2B,GAAG,yBAAyB,EACzE,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,mBAAmB,EAAE,CAC3B,CAAC;QACF,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;KACpF;IASD,sBAAc,kCAAU;;;;;;;;aAAxB;YACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC3D;;;OAAA;IASD,sBAAc,sCAAc;;;;;;;;aAA5B;YACE,OAAO;gBACL,oBAAoB,EAAE,IAAI,CAAC,UAAU;gBACrC,4BAA4B,EAAE,IAAI,CAAC,UAAU;aAC9C,CAAC;SACH;;;OAAA;IA7DD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACc;IAOvC;QADC,KAAK,CAAC,aAAa,EAAE,qBAAqB,CAAC;2DACG;IAd5B,UAAU;QAH9B,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SAC9C,CAAC;OACmB,UAAU,CAqE9B;IAAD,iBAAC;CAAA,CArEuC,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-query-button.vue.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue"],"sourcesContent":["<template>\n <button\n @click=\"emitEvents\"\n class=\"x-button x-partial-query-button\"\n data-test=\"partial-query-button\"\n >\n <slot v-bind=\"{ query }\">{{ query }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { searchXModule } from '../x-module';\n\n /**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(searchXModule)]\n })\n export default class PartialQueryButton extends Vue {\n /**\n * The query property.\n *\n * @public\n */\n @Prop({ required: true })\n public query!: string;\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.query,
|
|
1
|
+
{"version":3,"file":"partial-query-button.vue.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue"],"sourcesContent":["<template>\n <button\n @click=\"emitEvents\"\n class=\"x-button x-partial-query-button\"\n data-test=\"partial-query-button\"\n >\n <slot v-bind=\"{ query }\">{{ query }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { searchXModule } from '../x-module';\n\n /**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(searchXModule)]\n })\n export default class PartialQueryButton extends Vue {\n /**\n * The query property.\n *\n * @public\n */\n @Prop({ required: true })\n public query!: string;\n\n /**\n * Generates the {@link WireMetadata | event metadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n protected createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: this.$el as HTMLElement,\n feature: 'partial_result'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.query, this.createEventMetadata());\n this.$x.emit('UserClickedPartialQuery', this.query, this.createEventMetadata());\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\n## Basic example\n\nA button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery} and {@link\nSearchXEvents.UserClickedPartialQuery} events, expressing the user intention to set the partial\nquery.\n\nThe component sets the current query as the new query and emits the `UserAcceptedAQuery` and\n`UserClickedPartialQuery` events when is clicked.\n\n```vue\n<template>\n <PartialQueryButton :query=\"query\" />\n</template>\n```\n\n## Customizing its contents\n\n```vue\n<template>\n <PartialQueryButton>\n <template #default=\"{ query }\">\n <span class=\"x-partial-query-button__text\">\n Set the Partial query as the new query: {{ query }}!\n </span>\n </template>\n </PartialQueryButton>\n</template>\n\n<script>\n import { PartialQueryButton } from '@empathyco/x-components/search';\n\n export default {\n components: {\n PartialQueryButton\n }\n };\n</script>\n```\n\n## Events\n\nThis component emits 2 different events:\n\n- UserAcceptedAQuery: the event is emitted after the user clicks the partial query. The event\n payload is the partial query data.\n- UserClickedPartialQuery: the event is emitted after the user clicks the partial query. The event\n payload is the partial query data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -16,18 +16,26 @@ var PartialQueryButton = /** @class */ (function (_super) {
|
|
|
16
16
|
function PartialQueryButton() {
|
|
17
17
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Generates the {@link WireMetadata | event metadata} object omitting the moduleName.
|
|
21
|
+
*
|
|
22
|
+
* @returns The {@link WireMetadata} object omitting the moduleName.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
PartialQueryButton.prototype.createEventMetadata = function () {
|
|
26
|
+
return {
|
|
27
|
+
target: this.$el,
|
|
28
|
+
feature: 'partial_result'
|
|
29
|
+
};
|
|
30
|
+
};
|
|
19
31
|
/**
|
|
20
32
|
* Emits events when the button is clicked.
|
|
21
33
|
*
|
|
22
34
|
* @public
|
|
23
35
|
*/
|
|
24
36
|
PartialQueryButton.prototype.emitEvents = function () {
|
|
25
|
-
this.$x.emit('UserAcceptedAQuery', this.query,
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
this.$x.emit('UserClickedPartialQuery', this.query, {
|
|
29
|
-
target: this.$el
|
|
30
|
-
});
|
|
37
|
+
this.$x.emit('UserAcceptedAQuery', this.query, this.createEventMetadata());
|
|
38
|
+
this.$x.emit('UserClickedPartialQuery', this.query, this.createEventMetadata());
|
|
31
39
|
};
|
|
32
40
|
__decorate([
|
|
33
41
|
Prop({ required: true })
|
package/js/x-modules/search/components/partial-query-button.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-query-button.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { searchXModule } from '../x-module';\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(searchXModule)]\n})\nexport default class PartialQueryButton extends Vue {\n /**\n * The query property.\n *\n * @public\n */\n @Prop({ required: true })\n public query!: string;\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.query,
|
|
1
|
+
{"version":3,"file":"partial-query-button.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { WireMetadata } from '../../../wiring/wiring.types';\nimport { searchXModule } from '../x-module';\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(searchXModule)]\n})\nexport default class PartialQueryButton extends Vue {\n /**\n * The query property.\n *\n * @public\n */\n @Prop({ required: true })\n public query!: string;\n\n /**\n * Generates the {@link WireMetadata | event metadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n protected createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: this.$el as HTMLElement,\n feature: 'partial_result'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.query, this.createEventMetadata());\n this.$x.emit('UserClickedPartialQuery', this.query, this.createEventMetadata());\n }\n}\n"],"names":[],"mappings":";;;;;;AAiBA;;;;;;;AAUA;IAAgD,sCAAG;IAAnD;;KA+BC;;;;;;;IAhBW,gDAAmB,GAA7B;QACE,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,GAAkB;YAC/B,OAAO,EAAE,gBAAgB;SAC1B,CAAC;KACH;;;;;;IAOS,uCAAU,GAApB;QACE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;QAC3E,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;KACjF;IAvBD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;qDACH;IAPH,kBAAkB;QAHtC,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACzC,CAAC;OACmB,kBAAkB,CA+BtC;IAAD,yBAAC;CAAA,CA/B+C,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spellcheck-button.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck-button.vue"],"sourcesContent":["<template>\n <button\n v-if=\"spellcheckedQuery\"\n @click=\"emitEvents\"\n class=\"x-spellcheck-button\"\n data-test=\"set-spellcheck\"\n >\n <slot v-bind=\"{ spellcheckedQuery }\">{{ spellcheckedQuery }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import { State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { searchXModule } from '../x-module';\n /**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link XEventsTypes.UserAcceptedSpellcheckQuery} events, expressing the user\n * intention to set the spellchecked query.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(searchXModule)]\n })\n export default class SpellcheckButton extends Vue {\n /**\n * The spellcheckedQuery from the search state.\n *\n * @public\n */\n @State('search', 'spellcheckedQuery')\n public spellcheckedQuery!: string;\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.spellcheckedQuery,
|
|
1
|
+
{"version":3,"file":"spellcheck-button.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck-button.vue"],"sourcesContent":["<template>\n <button\n v-if=\"spellcheckedQuery\"\n @click=\"emitEvents\"\n class=\"x-spellcheck-button\"\n data-test=\"set-spellcheck\"\n >\n <slot v-bind=\"{ spellcheckedQuery }\">{{ spellcheckedQuery }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import { State } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { searchXModule } from '../x-module';\n /**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link XEventsTypes.UserAcceptedSpellcheckQuery} events, expressing the user\n * intention to set the spellchecked query.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(searchXModule)]\n })\n export default class SpellcheckButton extends Vue {\n /**\n * The spellcheckedQuery from the search state.\n *\n * @public\n */\n @State('search', 'spellcheckedQuery')\n public spellcheckedQuery!: string;\n\n /**\n * Generates the {@link WireMetadata | event metadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n protected createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: this.$el as HTMLElement,\n feature: 'spellcheck'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n protected emitEvents(): void {\n this.$x.emit('UserAcceptedAQuery', this.spellcheckedQuery, this.createEventMetadata());\n this.$x.emit(\n 'UserAcceptedSpellcheckQuery',\n this.spellcheckedQuery,\n this.createEventMetadata()\n );\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\n## Basic example\n\nThe component sets the current spellcheckedQuery as the new query and emits the `UserAcceptedAQuery`\nand `UserAcceptedSpellcheckQuery` events.\n\n```vue\n<SpellcheckButton />\n```\n\n## Customizing its contents\n\n```vue\n<SpellcheckButton>\n <template #default=\"{ spellcheckedQuery }\">\n <span class=\"x-spellcheck__text\">\n Set the Spellcheck as the new query: {{ spellcheckedQuery}}!\n </span>\n </template>\n</SpellcheckButton>\n```\n\n## Events\n\nThis component emits 2 different events:\n\n- UserAcceptedAQuery: the event is emitted after the user clicks the button. The event payload is\n the spellchecked query data.\n- UserAcceptedSpellcheckQuery: the event is emitted after the user clicks the button. The event\n payload is the spellchecked query data.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,18 +17,26 @@ var SpellcheckButton = /** @class */ (function (_super) {
|
|
|
17
17
|
function SpellcheckButton() {
|
|
18
18
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Generates the {@link WireMetadata | event metadata} object omitting the moduleName.
|
|
22
|
+
*
|
|
23
|
+
* @returns The {@link WireMetadata} object omitting the moduleName.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
SpellcheckButton.prototype.createEventMetadata = function () {
|
|
27
|
+
return {
|
|
28
|
+
target: this.$el,
|
|
29
|
+
feature: 'spellcheck'
|
|
30
|
+
};
|
|
31
|
+
};
|
|
20
32
|
/**
|
|
21
33
|
* Emits events when the button is clicked.
|
|
22
34
|
*
|
|
23
35
|
* @public
|
|
24
36
|
*/
|
|
25
37
|
SpellcheckButton.prototype.emitEvents = function () {
|
|
26
|
-
this.$x.emit('UserAcceptedAQuery', this.spellcheckedQuery,
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
this.$x.emit('UserAcceptedSpellcheckQuery', this.spellcheckedQuery, {
|
|
30
|
-
target: this.$el
|
|
31
|
-
});
|
|
38
|
+
this.$x.emit('UserAcceptedAQuery', this.spellcheckedQuery, this.createEventMetadata());
|
|
39
|
+
this.$x.emit('UserAcceptedSpellcheckQuery', this.spellcheckedQuery, this.createEventMetadata());
|
|
32
40
|
};
|
|
33
41
|
__decorate([
|
|
34
42
|
State('search', 'spellcheckedQuery')
|