@empathyco/x-components 7.4.0 → 7.5.0
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 +15 -0
- package/browse/index.d.ts +1 -0
- package/browse/index.js +15 -0
- package/core/index.js.map +1 -1
- package/docs/API-reference/api/x-components.baseaddtocart.md +1 -1
- package/docs/API-reference/api/x-components.browseactioncontext.md +15 -0
- package/docs/API-reference/api/x-components.browseactions.cancelfetchandsavebrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.fetchandsavebrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.fetchandsaveresultsenrichment.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.fetchbrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.increasepageappendingresults.md +18 -0
- package/docs/API-reference/api/x-components.browseactions.md +210 -0
- package/docs/API-reference/api/x-components.browseactions.resetrequestonrefinement.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.savebrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.saveorigin.md +13 -0
- package/docs/API-reference/api/x-components.browseactions.seturlparams.md +13 -0
- package/docs/API-reference/api/x-components.browseconfig.md +75 -0
- package/docs/API-reference/api/x-components.browseconfig.pagemode.md +11 -0
- package/docs/API-reference/api/x-components.browseconfig.pagesize.md +13 -0
- package/docs/API-reference/api/x-components.browsegetters.md +58 -0
- package/docs/API-reference/api/x-components.browsegetters.request.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.appendresults.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.md +458 -0
- package/docs/API-reference/api/x-components.browsemutations.resetstate.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.resetstateforreload.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setbanners.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setbrowsetagging.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setdisplaybrowsetagging.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setfacets.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setfromnoresultswithfilters.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setisappendresults.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setisnoresults.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setorigin.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setpage.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setparams.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setpromoteds.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setresults.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setselectedcategory.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setselectedfilters.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setsort.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.setstats.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.settotalresults.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.updateresult.md +13 -0
- package/docs/API-reference/api/x-components.browsemutations.updateresultsfromenrichment.md +13 -0
- package/docs/API-reference/api/x-components.browserequest.md +13 -0
- package/docs/API-reference/api/x-components.browseresultslist.md +31 -0
- package/docs/API-reference/api/x-components.browsesortpickerlist.md +45 -0
- package/docs/API-reference/api/x-components.browsestate.banners.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.browsetagging.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.config.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.displaybrowsetagging.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.facets.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.fromnoresultswithfilters.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.isappendresults.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.isnoresults.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.md +382 -0
- package/docs/API-reference/api/x-components.browsestate.origin.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.page.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.params.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.promoteds.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.results.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.selectedcategory.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.selectedfilters.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.sort.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.stats.md +13 -0
- package/docs/API-reference/api/x-components.browsestate.totalresults.md +13 -0
- package/docs/API-reference/api/x-components.browsexevents.browserequestchanged.md +13 -0
- package/docs/API-reference/api/x-components.browsexevents.browserequestupdated.md +18 -0
- package/docs/API-reference/api/x-components.browsexevents.browseresponsechanged.md +13 -0
- package/docs/API-reference/api/x-components.browsexevents.browsetaggingchanged.md +13 -0
- package/docs/API-reference/api/x-components.browsexevents.md +172 -0
- package/docs/API-reference/api/x-components.browsexevents.selectedbrowsesortprovided.md +18 -0
- package/docs/API-reference/api/x-components.browsexevents.userbrowsedtocategory.md +13 -0
- package/docs/API-reference/api/x-components.browsexevents.userclickedabrowsesort.md +13 -0
- package/docs/API-reference/api/x-components.browsexmodule.md +13 -0
- package/docs/API-reference/api/x-components.browsexstoremodule.md +15 -0
- package/docs/API-reference/api/x-components.cancelfetchandsavebrowseresponse.md +17 -0
- package/docs/API-reference/api/x-components.cancelfetchandsavebrowseresponsewire.md +13 -0
- package/docs/API-reference/api/x-components.clearbrowsequery.md +13 -0
- package/docs/API-reference/api/x-components.fetchandsavebrowseresponse.md +66 -0
- package/docs/API-reference/api/x-components.fetchandsavebrowseresponsewire.md +13 -0
- package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichment.md +66 -0
- package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichmentwire.md +13 -0
- package/docs/API-reference/api/x-components.fetchbrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
- package/docs/API-reference/api/x-components.increasebrowsepageappendingresults.md +13 -0
- package/docs/API-reference/api/x-components.increasebrowsepageappendingresultswire.md +13 -0
- package/docs/API-reference/api/x-components.internalbrowserequest.md +59 -0
- package/docs/API-reference/api/x-components.internalbrowserequest.page.md +13 -0
- package/docs/API-reference/api/x-components.internalbrowseresponse.md +78 -0
- package/docs/API-reference/api/x-components.internalbrowseresponse.request.md +13 -0
- package/docs/API-reference/api/x-components.internalbrowseresponse.status.md +13 -0
- package/docs/API-reference/api/x-components.md +601 -0
- package/docs/API-reference/api/x-components.resetbrowseappending.md +13 -0
- package/docs/API-reference/api/x-components.resetbrowserequestonrefinement.md +13 -0
- package/docs/API-reference/api/x-components.resetbrowserequestonrefinementwire.md +13 -0
- package/docs/API-reference/api/x-components.resetbrowsestateforreloadwire.md +13 -0
- package/docs/API-reference/api/x-components.resetbrowsestateifnorequestwire.md +13 -0
- package/docs/API-reference/api/x-components.resetfromnobrowseresultswithfilters.md +13 -0
- package/docs/API-reference/api/x-components.resetisnobrowseresults.md +13 -0
- package/docs/API-reference/api/x-components.savebrowseorigin.md +13 -0
- package/docs/API-reference/api/x-components.savebrowseoriginwire.md +13 -0
- package/docs/API-reference/api/x-components.savebrowseresponse.md +13 -0
- package/docs/API-reference/api/x-components.setbrowsecategory.md +13 -0
- package/docs/API-reference/api/x-components.setbrowseextraparams.md +13 -0
- package/docs/API-reference/api/x-components.setbrowsepage.md +13 -0
- package/docs/API-reference/api/x-components.setbrowseselectedfilters.md +13 -0
- package/docs/API-reference/api/x-components.setbrowsesort.md +13 -0
- package/docs/API-reference/api/x-components.setbrowseurlparams.md +13 -0
- package/docs/API-reference/api/x-components.setbrowseurlparamswire.md +13 -0
- package/docs/API-reference/api/x-components.setresults.md +13 -0
- package/docs/API-reference/api/x-components.simplefilter.md +1 -0
- package/docs/API-reference/api/x-components.snippetcallbacks.md +4 -3
- package/docs/API-reference/api/x-components.usealiasapi.browsetotalresults.md +1 -1
- package/docs/API-reference/api/x-components.usealiasapi.md +1 -1
- package/docs/API-reference/api/x-components.vendoractions.md +11 -0
- package/docs/API-reference/api/x-components.vendorgetters.md +11 -0
- package/docs/API-reference/api/x-components.vendormutations.md +54 -0
- package/docs/API-reference/api/x-components.vendormutations.setresults.md +11 -0
- package/docs/API-reference/api/x-components.vendorresult.md +57 -0
- package/docs/API-reference/api/x-components.vendorresult.position.md +11 -0
- package/docs/API-reference/api/x-components.vendorresultslist.md +31 -0
- package/docs/API-reference/api/x-components.vendorstate.md +54 -0
- package/docs/API-reference/api/x-components.vendorstate.results.md +11 -0
- package/docs/API-reference/api/x-components.vendorxevents.md +58 -0
- package/docs/API-reference/api/x-components.vendorxevents.vendorresultschanged.md +13 -0
- package/docs/API-reference/api/x-components.vendorxmodule.md +13 -0
- package/docs/API-reference/api/x-components.vendorxstoremodule.md +11 -0
- package/docs/API-reference/api/x-components.watchedinternalbrowserequest.md +73 -0
- package/docs/API-reference/api/x-components.watchedinternalbrowserequest.newrequest.md +11 -0
- package/docs/API-reference/api/x-components.watchedinternalbrowserequest.oldrequest.md +11 -0
- package/docs/API-reference/api/x-components.xeventstypes.md +2 -2
- package/docs/API-reference/api/x-components.xmodulestree.md +18 -1
- package/docs/API-reference/api/x-components.xmodulestree.vendor.md +11 -0
- package/docs/API-reference/api/x-types.result.md +2 -2
- package/docs/API-reference/components/vendor/x-components.vendor-results-list.md +21 -0
- package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue2.js +1 -1
- package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
- package/js/components/result/base-result-link.vue.js +12 -8
- package/js/components/result/base-result-link.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue2.js.map +1 -1
- package/js/index.js +20 -0
- package/js/index.js.map +1 -1
- package/js/wiring/namespaced-wires.factory.js +1 -1
- package/js/x-modules/browse/components/browse-results-list.vue.js +46 -0
- package/js/x-modules/browse/components/browse-results-list.vue.js.map +1 -0
- package/js/x-modules/browse/components/browse-results-list.vue2.js +6 -0
- package/js/x-modules/browse/components/browse-results-list.vue2.js.map +1 -0
- package/js/x-modules/browse/components/browse-sort-picker-list.vue.js +73 -0
- package/js/x-modules/browse/components/browse-sort-picker-list.vue.js.map +1 -0
- package/js/x-modules/browse/components/browse-sort-picker-list.vue2.js +6 -0
- package/js/x-modules/browse/components/browse-sort-picker-list.vue2.js.map +1 -0
- package/js/x-modules/browse/store/actions/fetch-and-save-browse-response.action.js +57 -0
- package/js/x-modules/browse/store/actions/fetch-and-save-browse-response.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js +21 -0
- package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/fetch-browse-response.action.js +16 -0
- package/js/x-modules/browse/store/actions/fetch-browse-response.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/increase-page-apending-results.action.js +18 -0
- package/js/x-modules/browse/store/actions/increase-page-apending-results.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/reset-request-on-refinement.action.js +36 -0
- package/js/x-modules/browse/store/actions/reset-request-on-refinement.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/save-browse-response.action.js +42 -0
- package/js/x-modules/browse/store/actions/save-browse-response.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/save-origin.action.js +16 -0
- package/js/x-modules/browse/store/actions/save-origin.action.js.map +1 -0
- package/js/x-modules/browse/store/actions/set-url-params.action.js +20 -0
- package/js/x-modules/browse/store/actions/set-url-params.action.js.map +1 -0
- package/js/x-modules/browse/store/emitters.js +48 -0
- package/js/x-modules/browse/store/emitters.js.map +1 -0
- package/js/x-modules/browse/store/getters/request.getter.js +27 -0
- package/js/x-modules/browse/store/getters/request.getter.js.map +1 -0
- package/js/x-modules/browse/store/module.js +163 -0
- package/js/x-modules/browse/store/module.js.map +1 -0
- package/js/x-modules/browse/wiring.js +213 -0
- package/js/x-modules/browse/wiring.js.map +1 -0
- package/js/x-modules/browse/x-module.js +21 -0
- package/js/x-modules/browse/x-module.js.map +1 -0
- package/js/x-modules/vendor/components/vendor-results-list.vue.js +81 -0
- package/js/x-modules/vendor/components/vendor-results-list.vue.js.map +1 -0
- package/js/x-modules/vendor/components/vendor-results-list.vue2.js +6 -0
- package/js/x-modules/vendor/components/vendor-results-list.vue2.js.map +1 -0
- package/js/x-modules/vendor/store/emitters.js +13 -0
- package/js/x-modules/vendor/store/emitters.js.map +1 -0
- package/js/x-modules/vendor/store/module.js +15 -0
- package/js/x-modules/vendor/store/module.js.map +1 -0
- package/js/x-modules/vendor/wiring.js +42 -0
- package/js/x-modules/vendor/wiring.js.map +1 -0
- package/js/x-modules/vendor/x-module.js +21 -0
- package/js/x-modules/vendor/x-module.js.map +1 -0
- package/package.json +4 -4
- package/report/x-components.api.json +5304 -752
- package/report/x-components.api.md +456 -11
- package/report/x-types.api.json +1 -1
- package/types/src/components/result/base-result-add-to-cart.vue.d.ts +1 -2
- package/types/src/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
- package/types/src/components/snippet-callbacks.vue.d.ts +4 -3
- package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/src/index.d.ts +2 -0
- package/types/src/index.d.ts.map +1 -1
- package/types/src/wiring/events.types.d.ts +2 -1
- package/types/src/wiring/events.types.d.ts.map +1 -1
- package/types/src/x-modules/browse/components/browse-results-list.vue.d.ts +30 -0
- package/types/src/x-modules/browse/components/browse-results-list.vue.d.ts.map +1 -0
- package/types/src/x-modules/browse/components/browse-sort-picker-list.vue.d.ts +50 -0
- package/types/src/x-modules/browse/components/browse-sort-picker-list.vue.d.ts.map +1 -0
- package/types/src/x-modules/browse/store/actions/index.d.ts +5 -5
- package/types/src/x-modules/browse/store/actions/index.d.ts.map +1 -1
- package/types/src/x-modules/browse/store/module.d.ts +1 -1
- package/types/src/x-modules/browse/store/module.d.ts.map +1 -1
- package/types/src/x-modules/browse/wiring.d.ts +26 -26
- package/types/src/x-modules/browse/wiring.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
- package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
- package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/src/x-modules/vendor/components/index.d.ts +2 -0
- package/types/src/x-modules/vendor/components/index.d.ts.map +1 -0
- package/types/src/x-modules/vendor/components/vendor-results-list.vue.d.ts +30 -0
- package/types/src/x-modules/vendor/components/vendor-results-list.vue.d.ts.map +1 -0
- package/types/src/x-modules/vendor/events.types.d.ts +15 -0
- package/types/src/x-modules/vendor/events.types.d.ts.map +1 -0
- package/types/src/x-modules/vendor/index.d.ts +7 -0
- package/types/src/x-modules/vendor/index.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/emitters.d.ts +7 -0
- package/types/src/x-modules/vendor/store/emitters.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/index.d.ts +4 -0
- package/types/src/x-modules/vendor/store/index.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/module.d.ts +3 -0
- package/types/src/x-modules/vendor/store/module.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/types.d.ts +14 -0
- package/types/src/x-modules/vendor/store/types.d.ts.map +1 -0
- package/types/src/x-modules/vendor/types.d.ts +8 -0
- package/types/src/x-modules/vendor/types.d.ts.map +1 -0
- package/types/src/x-modules/vendor/wiring.d.ts +20 -0
- package/types/src/x-modules/vendor/wiring.d.ts.map +1 -0
- package/types/src/x-modules/vendor/x-module.d.ts +16 -0
- package/types/src/x-modules/vendor/x-module.d.ts.map +1 -0
- package/types/src/x-modules/x-modules.types.d.ts +2 -0
- package/types/src/x-modules/x-modules.types.d.ts.map +1 -1
- package/vendor/index.d.ts +1 -0
- package/vendor/index.js +5 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { namespacedWireCommit, namespacedWireDispatchWithoutPayload, namespacedWireCommitWithoutPayload, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js';
|
|
2
|
+
import { filterTruthyPayload } from '../../wiring/wires.operators.js';
|
|
3
|
+
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `browse` {@link XModuleName | XModule name}.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
const moduleName = 'browse';
|
|
11
|
+
/**
|
|
12
|
+
* WireCommit for {@link BrowseXModule}.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
const wireCommit = namespacedWireCommit(moduleName);
|
|
17
|
+
/**
|
|
18
|
+
* WireCommit without Payload for {@link BrowseXModule}.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
const wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);
|
|
23
|
+
/**
|
|
24
|
+
* WireDispatch for {@link BrowseXModule}.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
const wireDispatch = namespacedWireDispatch(moduleName);
|
|
29
|
+
/**
|
|
30
|
+
* WireDispatchWithoutPayload for {@link BrowseXModule}.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
const wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);
|
|
35
|
+
/**
|
|
36
|
+
* Cancels the {@link BrowseActions.fetchAndSaveBrowseResponse} request promise.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
const cancelFetchAndSaveBrowseResponseWire = wireDispatchWithoutPayload('cancelFetchAndSaveBrowseResponse');
|
|
41
|
+
/**
|
|
42
|
+
* Sets the browse state `origin`.
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
const saveBrowseOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);
|
|
47
|
+
/**
|
|
48
|
+
* Requests and stores the browse response.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
const fetchAndSaveBrowseResponseWire = wireDispatch('fetchAndSaveBrowseResponse');
|
|
53
|
+
/**
|
|
54
|
+
* Requests and stores the enrichment results for the results.
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
const fetchAndSaveBrowseResultsEnrichmentWire = wireDispatch('fetchAndSaveResultsEnrichment');
|
|
59
|
+
/**
|
|
60
|
+
* Sets the browse state `selectedCategory`.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
const setBrowseCategory = wireCommit('setSelectedCategory');
|
|
65
|
+
/**
|
|
66
|
+
* Clears the browse state `selectedCategory`.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
const clearBrowseQuery = wireCommit('setSelectedCategory', {
|
|
71
|
+
browseField: '',
|
|
72
|
+
browseValue: '',
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Sets the browse state `selectedFilters`.
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
const setBrowseSelectedFilters = wireCommit('setSelectedFilters');
|
|
80
|
+
/**
|
|
81
|
+
* Sets the browse state `sort`.
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
const setBrowseSort = wireCommit('setSort');
|
|
86
|
+
/**
|
|
87
|
+
* Sets the browse state `query`.
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
const setBrowseUrlParamsWire = wireDispatch('setUrlParams');
|
|
92
|
+
/**
|
|
93
|
+
* Sets the browse state `page`.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
const setBrowsePage = wireCommit('setPage');
|
|
98
|
+
/**
|
|
99
|
+
* Sets the browse state `params`.
|
|
100
|
+
*
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
const setBrowseExtraParams = wireCommit('setParams');
|
|
104
|
+
/**
|
|
105
|
+
* Resets the browse state to reload the current browse.
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
const resetBrowseStateForReloadWire = wireCommitWithoutPayload('resetStateForReload');
|
|
110
|
+
/**
|
|
111
|
+
* Resets the browse state `isNoResults`.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
const resetIsNoBrowseResults = wireCommit('setIsNoResults', false);
|
|
116
|
+
/**
|
|
117
|
+
* Resets the browse state `fromNoResultsWithFilters`.
|
|
118
|
+
*
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
const resetFromNoBrowseResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false);
|
|
122
|
+
/**
|
|
123
|
+
* Increases the current browse state `page` by one.
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
const increaseBrowsePageAppendingResultsWire = wireDispatchWithoutPayload('increasePageAppendingResults');
|
|
128
|
+
/**
|
|
129
|
+
* Resets the browse state `isAppendingResults`.
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
const resetBrowseAppending = wireCommit('setIsAppendResults', false);
|
|
134
|
+
/**
|
|
135
|
+
* Resets the {@link BrowseGetters.request} parameters when refining request and before the actual
|
|
136
|
+
* request is launched.
|
|
137
|
+
*
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
const resetBrowseRequestOnRefinementWire = wireDispatch('resetRequestOnRefinement', ({ eventPayload: newRequest, metadata: { oldValue } }) => ({
|
|
141
|
+
newRequest,
|
|
142
|
+
oldRequest: oldValue,
|
|
143
|
+
}));
|
|
144
|
+
/**
|
|
145
|
+
* Resets the browse state when the request is changed to null. See the
|
|
146
|
+
* {@link BrowseXStoreModule} for details.
|
|
147
|
+
*
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
const resetBrowseStateIfNoRequestWire = filterTruthyPayload(wireCommitWithoutPayload('resetState'));
|
|
151
|
+
/**
|
|
152
|
+
* Browse wiring.
|
|
153
|
+
*
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
const browseWiring = createWiring({
|
|
157
|
+
ParamsLoadedFromUrl: {
|
|
158
|
+
setBrowseUrlParamsWire,
|
|
159
|
+
saveBrowseOriginWire,
|
|
160
|
+
},
|
|
161
|
+
UserClickedABrowseSort: {
|
|
162
|
+
setBrowseSort,
|
|
163
|
+
},
|
|
164
|
+
UserReachedResultsListEnd: {
|
|
165
|
+
increaseBrowsePageAppendingResultsWire,
|
|
166
|
+
},
|
|
167
|
+
BrowseRequestUpdated: {
|
|
168
|
+
resetBrowseStateIfNoRequestWire,
|
|
169
|
+
fetchAndSaveBrowseResponseWire,
|
|
170
|
+
},
|
|
171
|
+
BrowseRequestChanged: {
|
|
172
|
+
resetBrowseRequestOnRefinementWire,
|
|
173
|
+
},
|
|
174
|
+
SelectedFiltersForRequestChanged: {
|
|
175
|
+
setBrowseSelectedFilters,
|
|
176
|
+
},
|
|
177
|
+
ResultsChanged: {
|
|
178
|
+
resetBrowseAppending,
|
|
179
|
+
fetchAndSaveBrowseResultsEnrichmentWire,
|
|
180
|
+
},
|
|
181
|
+
ReloadBrowseRequested: {
|
|
182
|
+
resetBrowseStateForReloadWire,
|
|
183
|
+
},
|
|
184
|
+
SelectedSortProvided: {
|
|
185
|
+
setBrowseSort,
|
|
186
|
+
},
|
|
187
|
+
ExtraParamsChanged: {
|
|
188
|
+
setBrowseExtraParams,
|
|
189
|
+
},
|
|
190
|
+
UserClickedCloseX: {
|
|
191
|
+
clearBrowseQuery,
|
|
192
|
+
resetBrowseStateForReloadWire,
|
|
193
|
+
cancelFetchAndSaveBrowseResponseWire,
|
|
194
|
+
},
|
|
195
|
+
UserClickedOpenX: {
|
|
196
|
+
clearBrowseQuery,
|
|
197
|
+
resetBrowseStateForReloadWire,
|
|
198
|
+
cancelFetchAndSaveBrowseResponseWire,
|
|
199
|
+
},
|
|
200
|
+
UserClickedOutOfMainModal: {
|
|
201
|
+
clearBrowseQuery,
|
|
202
|
+
},
|
|
203
|
+
UserSelectedAPage: {
|
|
204
|
+
setBrowsePage,
|
|
205
|
+
resetBrowseAppending,
|
|
206
|
+
},
|
|
207
|
+
UserBrowsedToCategory: {
|
|
208
|
+
setBrowseCategory,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
export { browseWiring, cancelFetchAndSaveBrowseResponseWire, clearBrowseQuery, fetchAndSaveBrowseResponseWire, fetchAndSaveBrowseResultsEnrichmentWire, increaseBrowsePageAppendingResultsWire, resetBrowseAppending, resetBrowseRequestOnRefinementWire, resetBrowseStateForReloadWire, resetBrowseStateIfNoRequestWire, resetFromNoBrowseResultsWithFilters, resetIsNoBrowseResults, saveBrowseOriginWire, setBrowseCategory, setBrowseExtraParams, setBrowsePage, setBrowseSelectedFilters, setBrowseSort, setBrowseUrlParamsWire };
|
|
213
|
+
//# sourceMappingURL=wiring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/browse/wiring.ts"],"sourcesContent":["import type { WirePayload } from '../../wiring'\nimport type { InternalBrowseRequest } from './types'\nimport {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring'\n\n/**\n * `browse` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'browse'\n\n/**\n * WireCommit for {@link BrowseXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommit without Payload for {@link BrowseXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link BrowseXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link BrowseXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Cancels the {@link BrowseActions.fetchAndSaveBrowseResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveBrowseResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveBrowseResponse',\n)\n\n/**\n * Sets the browse state `origin`.\n *\n * @public\n */\nexport const saveBrowseOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Requests and stores the browse response.\n *\n * @public\n */\nexport const fetchAndSaveBrowseResponseWire = wireDispatch('fetchAndSaveBrowseResponse')\n\n/**\n * Requests and stores the enrichment results for the results.\n *\n * @public\n */\nexport const fetchAndSaveBrowseResultsEnrichmentWire = wireDispatch('fetchAndSaveResultsEnrichment')\n\n/**\n * Sets the browse state `selectedCategory`.\n *\n * @public\n */\nexport const setBrowseCategory = wireCommit('setSelectedCategory')\n\n/**\n * Clears the browse state `selectedCategory`.\n *\n * @public\n */\nexport const clearBrowseQuery = wireCommit('setSelectedCategory', {\n browseField: '',\n browseValue: '',\n})\n\n/**\n * Sets the browse state `selectedFilters`.\n *\n * @public\n */\nexport const setBrowseSelectedFilters = wireCommit('setSelectedFilters')\n\n/**\n * Sets the browse state `sort`.\n *\n * @public\n */\nexport const setBrowseSort = wireCommit('setSort')\n\n/**\n * Sets the browse state `query`.\n *\n * @public\n */\nexport const setBrowseUrlParamsWire = wireDispatch('setUrlParams')\n\n/**\n * Sets the browse state `page`.\n *\n * @public\n */\nexport const setBrowsePage = wireCommit('setPage')\n\n/**\n * Sets the browse state `params`.\n *\n * @public\n */\nexport const setBrowseExtraParams = wireCommit('setParams')\n\n/**\n * Resets the browse state to reload the current browse.\n *\n * @public\n */\nexport const resetBrowseStateForReloadWire = wireCommitWithoutPayload('resetStateForReload')\n\n/**\n * Resets the browse state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoBrowseResults = wireCommit('setIsNoResults', false)\n\n/**\n * Resets the browse state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoBrowseResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false)\n\n/**\n * Increases the current browse state `page` by one.\n *\n * @public\n */\nexport const increaseBrowsePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults',\n)\n\n/**\n * Resets the browse state `isAppendingResults`.\n *\n * @public\n */\nexport const resetBrowseAppending = wireCommit('setIsAppendResults', false)\n\n/**\n * Resets the {@link BrowseGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetBrowseRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalBrowseRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalBrowseRequest,\n }),\n)\n\n/**\n * Resets the browse state when the request is changed to null. See the\n * {@link BrowseXStoreModule} for details.\n *\n * @public\n */\nexport const resetBrowseStateIfNoRequestWire = filterTruthyPayload<InternalBrowseRequest | null>(\n wireCommitWithoutPayload('resetState'),\n)\n\n/**\n * Browse wiring.\n *\n * @internal\n */\nexport const browseWiring = createWiring({\n ParamsLoadedFromUrl: {\n setBrowseUrlParamsWire,\n saveBrowseOriginWire,\n },\n UserClickedABrowseSort: {\n setBrowseSort,\n },\n UserReachedResultsListEnd: {\n increaseBrowsePageAppendingResultsWire,\n },\n BrowseRequestUpdated: {\n resetBrowseStateIfNoRequestWire,\n fetchAndSaveBrowseResponseWire,\n },\n BrowseRequestChanged: {\n resetBrowseRequestOnRefinementWire,\n },\n SelectedFiltersForRequestChanged: {\n setBrowseSelectedFilters,\n },\n ResultsChanged: {\n resetBrowseAppending,\n fetchAndSaveBrowseResultsEnrichmentWire,\n },\n ReloadBrowseRequested: {\n resetBrowseStateForReloadWire,\n },\n SelectedSortProvided: {\n setBrowseSort,\n },\n ExtraParamsChanged: {\n setBrowseExtraParams,\n },\n UserClickedCloseX: {\n clearBrowseQuery,\n resetBrowseStateForReloadWire,\n cancelFetchAndSaveBrowseResponseWire,\n },\n UserClickedOpenX: {\n clearBrowseQuery,\n resetBrowseStateForReloadWire,\n cancelFetchAndSaveBrowseResponseWire,\n },\n UserClickedOutOfMainModal: {\n clearBrowseQuery,\n },\n UserSelectedAPage: {\n setBrowsePage,\n resetBrowseAppending,\n },\n UserBrowsedToCategory: {\n setBrowseCategory,\n },\n})\n"],"names":[],"mappings":";;;;AAWA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ;AAE3B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC;AAEnD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC;AAE/E;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AAEvD;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;;;;AAIG;MACU,oCAAoC,GAAG,0BAA0B,CAC5E,kCAAkC;AAGpC;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ;AAEzF;;;;AAIG;MACU,8BAA8B,GAAG,YAAY,CAAC,4BAA4B;AAEvF;;;;AAIG;MACU,uCAAuC,GAAG,YAAY,CAAC,+BAA+B;AAEnG;;;;AAIG;MACU,iBAAiB,GAAG,UAAU,CAAC,qBAAqB;AAEjE;;;;AAIG;AACI,MAAM,gBAAgB,GAAG,UAAU,CAAC,qBAAqB,EAAE;AAChE,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,WAAW,EAAE,EAAE;AAChB,CAAA;AAED;;;;AAIG;MACU,wBAAwB,GAAG,UAAU,CAAC,oBAAoB;AAEvE;;;;AAIG;MACU,aAAa,GAAG,UAAU,CAAC,SAAS;AAEjD;;;;AAIG;MACU,sBAAsB,GAAG,YAAY,CAAC,cAAc;AAEjE;;;;AAIG;MACU,aAAa,GAAG,UAAU,CAAC,SAAS;AAEjD;;;;AAIG;MACU,oBAAoB,GAAG,UAAU,CAAC,WAAW;AAE1D;;;;AAIG;MACU,6BAA6B,GAAG,wBAAwB,CAAC,qBAAqB;AAE3F;;;;AAIG;AACI,MAAM,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,EAAE,KAAK;AAExE;;;;AAIG;AACI,MAAM,mCAAmC,GAAG,UAAU,CAAC,6BAA6B,EAAE,KAAK;AAElG;;;;AAIG;MACU,sCAAsC,GAAG,0BAA0B,CAC9E,8BAA8B;AAGhC;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,EAAE,KAAK;AAE1E;;;;;AAKG;MACU,kCAAkC,GAAG,YAAY,CAC5D,0BAA0B,EAC1B,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAsC,MAAM;IAC7F,UAAU;AACV,IAAA,UAAU,EAAE,QAAiC;AAC9C,CAAA,CAAC;AAGJ;;;;;AAKG;AACI,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,wBAAwB,CAAC,YAAY,CAAC;AAGxC;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,mBAAmB,EAAE;QACnB,sBAAsB;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,aAAa;AACd,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,sCAAsC;AACvC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,+BAA+B;QAC/B,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,kCAAkC;AACnC,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,wBAAwB;AACzB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,oBAAoB;QACpB,uCAAuC;AACxC,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,6BAA6B;AAC9B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,aAAa;AACd,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;QAChB,6BAA6B;QAC7B,oCAAoC;AACrC,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,gBAAgB;QAChB,6BAA6B;QAC7B,oCAAoC;AACrC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,oBAAoB;AACrB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,iBAAiB;AAClB,KAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { XPlugin } from '../../plugins/x-plugin.js';
|
|
2
|
+
import { browseEmitters } from './store/emitters.js';
|
|
3
|
+
import { browseXStoreModule } from './store/module.js';
|
|
4
|
+
import { browseWiring } from './wiring.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Search {@link XModule} implementation. This module is auto-registered as soon as you
|
|
8
|
+
* import any component from the `browse` entry point.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
const browseXModule = {
|
|
13
|
+
name: 'browse',
|
|
14
|
+
storeModule: browseXStoreModule,
|
|
15
|
+
storeEmitters: browseEmitters,
|
|
16
|
+
wiring: browseWiring,
|
|
17
|
+
};
|
|
18
|
+
XPlugin.registerXModule(browseXModule);
|
|
19
|
+
|
|
20
|
+
export { browseXModule };
|
|
21
|
+
//# sourceMappingURL=x-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-module.js","sources":["../../../../src/x-modules/browse/x-module.ts"],"sourcesContent":["// XModule\nimport type { XModule } from '../x-modules.types'\nimport type { BrowseXStoreModule } from './store/types'\nimport { XPlugin } from '../../plugins/x-plugin'\nimport { browseEmitters } from './store/emitters'\nimport { browseXStoreModule } from './store/module'\nimport { browseWiring } from './wiring'\n\n/**\n * Search {@link XModule} alias.\n *\n * @public\n */\nexport type BrowseXModule = XModule<BrowseXStoreModule>\n\n/**\n * Search {@link XModule} implementation. This module is auto-registered as soon as you\n * import any component from the `browse` entry point.\n *\n * @public\n */\nexport const browseXModule: BrowseXModule = {\n name: 'browse',\n storeModule: browseXStoreModule,\n storeEmitters: browseEmitters,\n wiring: browseWiring,\n}\n\nXPlugin.registerXModule(browseXModule)\n"],"names":[],"mappings":";;;;;AAeA;;;;;AAKG;AACI,MAAM,aAAa,GAAkB;AAC1C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,WAAW,EAAE,kBAAkB;AAC/B,IAAA,aAAa,EAAE,cAAc;AAC7B,IAAA,MAAM,EAAE,YAAY;;AAGtB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC;;;;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, provide, h } from 'vue';
|
|
2
|
+
import { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
|
|
3
|
+
import ItemsList from '../../../components/items-list.vue.js';
|
|
4
|
+
import { use$x } from '../../../composables/use-_x.js';
|
|
5
|
+
import { useState } from '../../../composables/use-state.js';
|
|
6
|
+
import { AnimationProp } from '../../../types/animation-prop.js';
|
|
7
|
+
import { vendorXModule } from '../x-module.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.
|
|
11
|
+
*
|
|
12
|
+
* The component provides a default slot which wraps the whole component with the `vendorResults`
|
|
13
|
+
* plus the `injectedListItems` which also contains the injected list items from
|
|
14
|
+
* the ancestor.
|
|
15
|
+
*
|
|
16
|
+
* It also provides the parent slots to customize the items.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
var _sfc_main = defineComponent({
|
|
21
|
+
name: 'VendorResultsList',
|
|
22
|
+
xModule: vendorXModule.name,
|
|
23
|
+
props: {
|
|
24
|
+
/** Animation component that will be used to animate the vendor results. */
|
|
25
|
+
animation: {
|
|
26
|
+
type: AnimationProp,
|
|
27
|
+
default: 'ul',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
setup(props, { slots }) {
|
|
31
|
+
const $x = use$x();
|
|
32
|
+
/** The vendor results to render from the state. */
|
|
33
|
+
const stateItems = useState('vendor').results;
|
|
34
|
+
/** It injects {@link ListItem} provided by an ancestor as injectedListItems. */
|
|
35
|
+
const injectedListItems = inject(LIST_ITEMS_KEY);
|
|
36
|
+
/**
|
|
37
|
+
* The `stateItems` concatenated with the `injectedListItems` if there are.
|
|
38
|
+
*
|
|
39
|
+
* @remarks This computed defines the merging strategy of the `stateItems` and the
|
|
40
|
+
* `injectedListItems`.
|
|
41
|
+
*
|
|
42
|
+
* @returns List of {@link ListItem}.
|
|
43
|
+
*/
|
|
44
|
+
const items = computed(() => {
|
|
45
|
+
if (!injectedListItems?.value.length) {
|
|
46
|
+
return stateItems.value;
|
|
47
|
+
}
|
|
48
|
+
const items = [...injectedListItems.value];
|
|
49
|
+
for (const item of stateItems.value) {
|
|
50
|
+
const position = item.position ?? 1;
|
|
51
|
+
let index = position - 1;
|
|
52
|
+
while (items.at(index)?.modelName === 'VendorResult') {
|
|
53
|
+
index++;
|
|
54
|
+
}
|
|
55
|
+
const isIndexInLoadedPages = index <= items.length;
|
|
56
|
+
const areAllPagesLoaded = $x.results.length === $x.totalResults;
|
|
57
|
+
if (!isIndexInLoadedPages && !areAllPagesLoaded) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
items.splice(index, 0, item);
|
|
61
|
+
}
|
|
62
|
+
return items;
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* The computed list items of the entity that uses the mixin.
|
|
66
|
+
*
|
|
67
|
+
* @remarks It should be overridden in the component that uses the mixin and it's intended to be
|
|
68
|
+
* filled with items from the state. Vue doesn't allow mixins as abstract classes.
|
|
69
|
+
* @returns An empty array as fallback in case it is not overridden.
|
|
70
|
+
*/
|
|
71
|
+
provide(LIST_ITEMS_KEY, items);
|
|
72
|
+
return () => {
|
|
73
|
+
const innerProps = { items: items.value, animation: props.animation };
|
|
74
|
+
// https://vue-land.github.io/faq/forwarding-slots#passing-all-slots
|
|
75
|
+
return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export { _sfc_main as default };
|
|
81
|
+
//# sourceMappingURL=vendor-results-list.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor-results-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-results-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorResults`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorResultsList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor results. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor results to render from the state. */\n const stateItems = useState('vendor').results\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedListItems?.value!.length) {\n return stateItems.value\n }\n const items = [...injectedListItems.value]\n for (const item of stateItems.value) {\n const position = item.position ?? 1\n let index = position - 1\n while (items.at(index)?.modelName === 'VendorResult') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n const areAllPagesLoaded = $x.results.length === $x.totalResults\n if (!isIndexInLoadedPages && !areAllPagesLoaded) {\n break\n }\n items.splice(index, 0, item)\n }\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;;QAGjB,MAAM,aAAa,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAM;;AAG5C,QAAA,MAAM,iBAAgB,GAAI,MAAM,CAAkB,cAAwB,CAAA;AAE1E;;;;;;;AAOE;AACF,QAAA,MAAM,KAAI,GAAI,QAAQ,CAAC,MAAI;AACzB,YAAA,IAAI,CAAC,iBAAiB,EAAE,KAAM,CAAC,MAAM,EAAE;gBACrC,OAAO,UAAU,CAAC,KAAI;YACxB;YACA,MAAM,KAAI,GAAI,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAA;AACzC,YAAA,KAAK,MAAM,IAAG,IAAK,UAAU,CAAC,KAAK,EAAE;AACnC,gBAAA,MAAM,QAAO,GAAI,IAAI,CAAC,QAAO,IAAK,CAAA;AAClC,gBAAA,IAAI,KAAI,GAAI,WAAW,CAAA;gBACvB,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,cAAc,cAAc,EAAE;AACpD,oBAAA,KAAK,EAAC;gBACR;AACA,gBAAA,MAAM,uBAAuB,SAAS,KAAK,CAAC,MAAK;gBACjD,MAAM,iBAAgB,GAAI,EAAE,CAAC,OAAO,CAAC,MAAK,KAAM,EAAE,CAAC,YAAW;AAC9D,gBAAA,IAAI,CAAC,oBAAmB,IAAK,CAAC,iBAAiB,EAAE;oBAC/C;gBACF;gBACA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAA;YAC7B;AACA,YAAA,OAAO,KAAI;AACb,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,OAAO,CAAC,cAAwB,EAAE,KAAK,CAAA;AAEvC,QAAA,OAAO,MAAI;AACT,YAAA,MAAM,UAAS,GAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor-results-list.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@empathyco/x-utils';
|
|
2
|
+
import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
|
|
3
|
+
import { vendorXStoreModule } from './module.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* {@link StoreEmitters} For the vendor module.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
const vendorEmitters = createStoreEmitters(vendorXStoreModule, {});
|
|
11
|
+
|
|
12
|
+
export { vendorEmitters };
|
|
13
|
+
//# sourceMappingURL=emitters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/vendor/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { vendorXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the vendor module.\n *\n * @internal\n */\nexport const vendorEmitters = createStoreEmitters(vendorXStoreModule, {})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,EAAE;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const vendorXStoreModule = {
|
|
2
|
+
state: () => ({
|
|
3
|
+
results: [],
|
|
4
|
+
}),
|
|
5
|
+
getters: {},
|
|
6
|
+
mutations: {
|
|
7
|
+
setResults(state, results) {
|
|
8
|
+
state.results = results;
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
actions: {},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { vendorXStoreModule };
|
|
15
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n results: [],\n }),\n getters: {},\n mutations: {\n setResults(state, results) {\n state.results = results\n },\n },\n actions: {},\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,OAAO,EAAE,EAAE;KACZ,CAAC;AACF,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE;QACT,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { namespacedWireCommit } from '../../wiring/namespaced-wires.factory.js';
|
|
2
|
+
import 'rxjs/operators';
|
|
3
|
+
import 'rxjs';
|
|
4
|
+
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WireCommit for {@link VendorXModule}.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
const wireCommit = namespacedWireCommit('vendor');
|
|
12
|
+
/**
|
|
13
|
+
* Sets the vendor results of the {@link VendorXModule}.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
const setResults = wireCommit('setResults', ({ eventPayload }) => eventPayload.map(vendorResult => ({
|
|
18
|
+
...vendorResult,
|
|
19
|
+
modelName: 'VendorResult',
|
|
20
|
+
})));
|
|
21
|
+
/**
|
|
22
|
+
* Resets the vendor results of the {@link VendorXModule}.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
const resetResults = wireCommit('setResults', []);
|
|
27
|
+
/**
|
|
28
|
+
* Wiring configuration for the {@link VendorXModule | vendor module}.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
const vendorWiring = createWiring({
|
|
33
|
+
VendorResultsChanged: {
|
|
34
|
+
setResults,
|
|
35
|
+
},
|
|
36
|
+
SearchRequestChanged: {
|
|
37
|
+
resetResults,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { setResults, vendorWiring };
|
|
42
|
+
//# sourceMappingURL=wiring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport { createWiring, namespacedWireCommit } from '../../wiring'\n\n/**\n * WireCommit for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('vendor')\n\n/**\n * Sets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setResults = wireCommit(\n 'setResults',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorResultsChanged'>>) =>\n eventPayload.map(vendorResult => ({\n ...vendorResult,\n modelName: 'VendorResult' as const,\n })),\n)\n\n/**\n * Resets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetResults = wireCommit('setResults', [])\n\n/**\n * Wiring configuration for the {@link VendorXModule | vendor module}.\n *\n * @internal\n */\nexport const vendorWiring = createWiring({\n VendorResultsChanged: {\n setResults,\n },\n SearchRequestChanged: {\n resetResults,\n },\n})\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,QAAQ,CAAC;AAEjD;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAClC,YAAY,EACZ,CAAC,EAAE,YAAY,EAAsD,KACnE,YAAY,CAAC,GAAG,CAAC,YAAY,KAAK;AAChC,IAAA,GAAG,YAAY;AACf,IAAA,SAAS,EAAE,cAAuB;CACnC,CAAC,CAAC;AAGP;;;;AAIG;AACH,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;AAEjD;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,oBAAoB,EAAE;QACpB,UAAU;AACX,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,YAAY;AACb,KAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { XPlugin } from '../../plugins/x-plugin.js';
|
|
2
|
+
import { vendorEmitters } from './store/emitters.js';
|
|
3
|
+
import { vendorXStoreModule } from './store/module.js';
|
|
4
|
+
import { vendorWiring } from './wiring.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vendor {@link XModule} implementation. This module is auto-registered as soon as you
|
|
8
|
+
* import any component from the `vendor` entry point.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
const vendorXModule = {
|
|
13
|
+
name: 'vendor',
|
|
14
|
+
storeModule: vendorXStoreModule,
|
|
15
|
+
storeEmitters: vendorEmitters,
|
|
16
|
+
wiring: vendorWiring,
|
|
17
|
+
};
|
|
18
|
+
XPlugin.registerXModule(vendorXModule);
|
|
19
|
+
|
|
20
|
+
export { vendorXModule };
|
|
21
|
+
//# sourceMappingURL=x-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-module.js","sources":["../../../../src/x-modules/vendor/x-module.ts"],"sourcesContent":["import type { XModule } from '../x-modules.types'\nimport type { VendorXStoreModule } from './store/types'\nimport { XPlugin } from '../../plugins/x-plugin'\nimport { vendorEmitters } from './store/emitters'\nimport { vendorXStoreModule } from './store/module'\nimport { vendorWiring } from './wiring'\n\n/**\n * Vendor {@link XModule} alias.\n *\n * @public\n */\nexport type VendorXModule = XModule<VendorXStoreModule>\n\n/**\n * Vendor {@link XModule} implementation. This module is auto-registered as soon as you\n * import any component from the `vendor` entry point.\n *\n * @public\n */\nexport const vendorXModule: VendorXModule = {\n name: 'vendor',\n storeModule: vendorXStoreModule,\n storeEmitters: vendorEmitters,\n wiring: vendorWiring,\n}\n\nXPlugin.registerXModule(vendorXModule)\n"],"names":[],"mappings":";;;;;AAcA;;;;;AAKG;AACI,MAAM,aAAa,GAAkB;AAC1C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,WAAW,EAAE,kBAAkB;AAC/B,IAAA,aAAa,EAAE,cAAc;AAC7B,IAAA,MAAM,EAAE,YAAY;;AAGtB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@empathyco/x-adapter": "8.1.8",
|
|
71
|
-
"@empathyco/x-adapter-platform": "1.7.
|
|
72
|
-
"@empathyco/x-types": "10.
|
|
71
|
+
"@empathyco/x-adapter-platform": "1.7.1",
|
|
72
|
+
"@empathyco/x-types": "10.6.0",
|
|
73
73
|
"@empathyco/x-utils": "1.0.9",
|
|
74
74
|
"@vue/devtools-api": "~6.6.4",
|
|
75
75
|
"@vueuse/core": "~12.8.2",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"access": "public",
|
|
118
118
|
"directory": "dist"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "60f292946050b2be4384d28ce746481e55ebbeec"
|
|
121
121
|
}
|