@empathyco/x-components 3.0.0-alpha.39 → 3.0.0-alpha.43
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 +79 -0
- package/core/index.js +6 -2
- package/core/index.js.map +1 -1
- package/design-system/base.css +2 -1
- package/design-system/default-theme.css +98 -35
- package/design-system/full-theme.css +324 -45
- package/design-system/grid-default.css +6 -0
- package/design-system/input-group-default.css +16 -7
- package/design-system/list-default.css +0 -5
- package/design-system/option-list-bottom.css +76 -10
- package/design-system/option-list-default.css +39 -2
- package/design-system/result-default.css +1 -1
- package/design-system/sliding-panel-default.css +15 -17
- package/design-system/sliding-panel-default.token.css +0 -2
- package/design-system/typography-default.css +1 -0
- package/design-system/utilities-background-color.css +3 -0
- package/design-system/utilities-border-color.css +3 -0
- package/design-system/utilities-flex.css +32 -0
- package/design-system/utilities-font-color.css +3 -0
- package/design-system/utilities-font-size.css +79 -0
- package/design-system/utilities-line-height.css +17 -0
- package/design-system/utilities-text-decoration.css +15 -0
- package/design-system/utilities-text-transform.css +11 -0
- package/docs/API-reference/api/x-adapter.empathynextquery.md +1 -0
- package/docs/API-reference/api/x-adapter.empathynextquery.source.md +11 -0
- package/docs/API-reference/api/{x-components.resetpage.md → x-components.arrowdownicon.md} +3 -5
- package/docs/API-reference/api/{x-components.resetsort.md → x-components.arrowlefticon.md} +3 -5
- package/docs/API-reference/api/{x-components.resetfacets.md → x-components.arrowrighticon.md} +3 -5
- package/docs/API-reference/api/{x-components.arrowicon.md → x-components.arrowupicon.md} +2 -2
- package/docs/API-reference/api/x-components.cancelfetchandsavesearchresponsewire.md +1 -1
- package/docs/API-reference/api/x-components.fetchandsavesearchresponsewire.md +1 -1
- package/docs/API-reference/api/x-components.getnewandupdatedkeys.md +27 -0
- package/docs/API-reference/api/x-components.grid2rowsicon.md +11 -0
- package/docs/API-reference/api/x-components.increasepageappendingresults.md +1 -1
- package/docs/API-reference/api/x-components.md +12 -7
- package/docs/API-reference/api/x-components.nextqueries.highlightcurated.md +13 -0
- package/docs/API-reference/api/x-components.nextquery.highlightcurated.md +13 -0
- package/docs/API-reference/api/x-components.nextquery.md +1 -0
- package/docs/API-reference/api/x-components.resetappending.md +1 -1
- package/docs/API-reference/api/x-components.resetspellcheckquery.md +1 -1
- package/docs/API-reference/api/x-components.resetstatewire.md +13 -0
- package/docs/API-reference/api/x-components.saveoriginwire.md +1 -1
- package/docs/API-reference/api/x-components.scroll.md +1 -3
- package/docs/API-reference/api/x-components.scrollmixin.md +1 -0
- package/docs/API-reference/api/x-components.scrollmixin.reseton.md +13 -0
- package/docs/API-reference/api/x-components.searchactions.md +1 -0
- package/docs/API-reference/api/x-components.searchactions.resetstate.md +24 -0
- package/docs/API-reference/api/x-components.searchxevents.md +1 -0
- package/docs/API-reference/api/x-components.searchxevents.searchrequestupdated.md +13 -0
- package/docs/API-reference/api/x-components.setpagesize.md +1 -1
- package/docs/API-reference/api/x-components.setquerytagginginfo.md +13 -0
- package/docs/API-reference/api/x-components.setrelatedtags.md +1 -1
- package/docs/API-reference/api/x-components.setsearchextraparams.md +1 -1
- package/docs/API-reference/api/x-components.setsearchpage.md +1 -1
- package/docs/API-reference/api/x-components.setsearchquery.md +1 -1
- package/docs/API-reference/api/x-components.setselectedfilters.md +1 -1
- package/docs/API-reference/api/x-components.setsort.md +1 -1
- package/docs/API-reference/api/x-components.seturlparams.md +1 -1
- package/docs/API-reference/api/x-components.slidingpanel.md +2 -12
- package/docs/API-reference/api/x-components.slidingpanel.resetoncontentchange.md +13 -0
- package/docs/API-reference/api/x-components.slidingpanel.scrollfactor.md +1 -1
- package/docs/API-reference/api/x-components.slidingpanel.showbuttons.md +1 -1
- package/docs/API-reference/api/x-components.taggingmutations.md +1 -0
- package/docs/API-reference/api/x-components.taggingmutations.setquerytagginginfo.md +24 -0
- package/docs/API-reference/api/x-components.taggingstate.md +1 -0
- package/docs/API-reference/api/x-components.taggingstate.querytagginginfo.md +13 -0
- package/docs/API-reference/api/x-components.taggingxevents.md +1 -0
- package/docs/API-reference/api/x-components.taggingxevents.searchtaggingreceived.md +13 -0
- package/docs/API-reference/api/x-components.trackquerywire.md +1 -1
- package/docs/API-reference/api/x-components.watchedinternalsearchrequest.md +21 -0
- package/docs/API-reference/api/x-components.watchedinternalsearchrequest.newrequest.md +11 -0
- package/docs/API-reference/api/x-components.watchedinternalsearchrequest.oldrequest.md +11 -0
- package/docs/API-reference/api/x-components.wiremetadata.md +1 -0
- package/docs/API-reference/api/x-components.wiremetadata.oldvalue.md +13 -0
- package/docs/API-reference/api/x-types.nextquery.iscurated.md +13 -0
- package/docs/API-reference/api/x-types.nextquery.md +6 -0
- package/docs/API-reference/components/common/icons/x-components.arrow-down.md +7 -0
- package/docs/API-reference/components/common/icons/x-components.arrow-left.md +7 -0
- package/docs/API-reference/components/common/icons/x-components.arrow-right.md +7 -0
- package/docs/API-reference/components/common/icons/x-components.arrow-up.md +7 -0
- package/docs/API-reference/components/common/icons/x-components.grid-2-rows.md +7 -0
- package/docs/API-reference/components/common/scroll/x-components.base-scroll.md +52 -33
- package/docs/API-reference/components/common/x-components.sliding-panel.md +192 -33
- package/docs/API-reference/components/next-queries/x-components.next-queries.md +17 -11
- package/docs/API-reference/components/next-queries/x-components.next-query.md +16 -7
- package/docs/API-reference/components/scroll/x-components.scroll.md +5 -8
- package/js/components/icons/arrow-down.vue.js +61 -0
- package/js/components/icons/arrow-down.vue.js.map +1 -0
- package/js/components/icons/arrow-down.vue_rollup-plugin-vue=script.js +4 -0
- package/js/components/icons/arrow-down.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/icons/{arrow.vue.js → arrow-left.vue.js} +2 -2
- package/js/components/icons/arrow-left.vue.js.map +1 -0
- package/js/components/icons/arrow-left.vue_rollup-plugin-vue=script.js +4 -0
- package/js/components/icons/arrow-left.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/icons/arrow-right.vue.js +61 -0
- package/js/components/icons/arrow-right.vue.js.map +1 -0
- package/js/components/icons/arrow-right.vue_rollup-plugin-vue=script.js +4 -0
- package/js/components/icons/arrow-right.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/icons/arrow-up.vue.js +61 -0
- package/js/components/icons/arrow-up.vue.js.map +1 -0
- package/js/components/icons/arrow-up.vue_rollup-plugin-vue=script.js +4 -0
- package/js/components/icons/arrow-up.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/icons/grid-2-rows.vue.js +65 -0
- package/js/components/icons/grid-2-rows.vue.js.map +1 -0
- package/js/components/icons/grid-2-rows.vue_rollup-plugin-vue=script.js +4 -0
- package/js/components/icons/grid-2-rows.vue_rollup-plugin-vue=script.js.map +1 -0
- package/js/components/icons/tag.vue.js +1 -1
- package/js/components/icons/tag.vue.js.map +1 -1
- package/js/components/scroll/base-scroll.vue.js +2 -2
- package/js/components/scroll/base-scroll.vue.js.map +1 -1
- package/js/components/scroll/scroll.mixin.js +12 -6
- package/js/components/scroll/scroll.mixin.js.map +1 -1
- package/js/components/sliding-panel.vue.js +2 -2
- package/js/components/sliding-panel.vue.js.map +1 -1
- package/js/components/sliding-panel.vue_rollup-plugin-vue=script.js +56 -40
- package/js/components/sliding-panel.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/index.js +8 -4
- package/js/index.js.map +1 -1
- package/js/plugins/x-emitters.js +3 -3
- package/js/plugins/x-emitters.js.map +1 -1
- package/js/utils/object.js +17 -1
- package/js/utils/object.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/facets/wiring.js +3 -0
- package/js/x-modules/facets/wiring.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue.js +15 -4
- package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue=script.js +3 -0
- package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query.vue.js +6 -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 +18 -0
- package/js/x-modules/next-queries/components/next-query.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/related-tags/wiring.js +3 -0
- package/js/x-modules/related-tags/wiring.js.map +1 -1
- package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/scroll/components/scroll.vue.js +14 -13
- package/js/x-modules/scroll/components/scroll.vue.js.map +1 -1
- package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js +2 -9
- package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/components/sort.mixin.js +5 -1
- package/js/x-modules/search/components/sort.mixin.js.map +1 -1
- package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js +5 -1
- package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js.map +1 -1
- package/js/x-modules/search/store/actions/increase-page-apending-results.action.js +1 -1
- package/js/x-modules/search/store/actions/increase-page-apending-results.action.js.map +1 -1
- package/js/x-modules/search/store/actions/reset-state.action.js +32 -0
- package/js/x-modules/search/store/actions/reset-state.action.js.map +1 -0
- package/js/x-modules/search/store/emitters.js +6 -0
- package/js/x-modules/search/store/emitters.js.map +1 -1
- package/js/x-modules/search/store/module.js +2 -0
- package/js/x-modules/search/store/module.js.map +1 -1
- package/js/x-modules/search/wiring.js +15 -32
- package/js/x-modules/search/wiring.js.map +1 -1
- package/js/x-modules/tagging/store/emitters.js +2 -4
- package/js/x-modules/tagging/store/emitters.js.map +1 -1
- package/js/x-modules/tagging/store/module.js +5 -1
- package/js/x-modules/tagging/store/module.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +15 -6
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/package.json +4 -4
- package/report/x-adapter.api.json +26 -0
- package/report/x-components.api.json +589 -292
- package/report/x-components.api.md +68 -35
- package/report/x-types.api.json +28 -1
- package/search/index.js +1 -1
- package/tagging/index.js +1 -1
- package/types/components/icons/arrow-down.vue.d.ts +3 -0
- package/types/components/icons/arrow-down.vue.d.ts.map +1 -0
- package/types/components/icons/arrow-left.vue.d.ts +3 -0
- package/types/components/icons/arrow-left.vue.d.ts.map +1 -0
- package/types/components/icons/arrow-right.vue.d.ts +3 -0
- package/types/components/icons/arrow-right.vue.d.ts.map +1 -0
- package/types/components/icons/arrow-up.vue.d.ts +3 -0
- package/types/components/icons/arrow-up.vue.d.ts.map +1 -0
- package/types/components/icons/grid-2-rows.vue.d.ts +3 -0
- package/types/components/icons/grid-2-rows.vue.d.ts.map +1 -0
- package/types/components/icons/index.d.ts +5 -1
- package/types/components/icons/index.d.ts.map +1 -1
- package/types/components/scroll/scroll.mixin.d.ts +7 -0
- package/types/components/scroll/scroll.mixin.d.ts.map +1 -1
- package/types/components/sliding-panel.vue.d.ts +35 -18
- package/types/components/sliding-panel.vue.d.ts.map +1 -1
- package/types/utils/object.d.ts +11 -0
- package/types/utils/object.d.ts.map +1 -1
- package/types/wiring/wiring.types.d.ts +2 -0
- package/types/wiring/wiring.types.d.ts.map +1 -1
- package/types/x-modules/facets/wiring.d.ts +3 -0
- package/types/x-modules/facets/wiring.d.ts.map +1 -1
- package/types/x-modules/next-queries/components/next-queries.vue.d.ts +6 -0
- package/types/x-modules/next-queries/components/next-queries.vue.d.ts.map +1 -1
- package/types/x-modules/next-queries/components/next-query.vue.d.ts +14 -0
- package/types/x-modules/next-queries/components/next-query.vue.d.ts.map +1 -1
- package/types/x-modules/related-tags/wiring.d.ts +3 -0
- package/types/x-modules/related-tags/wiring.d.ts.map +1 -1
- package/types/x-modules/scroll/components/scroll.vue.d.ts +2 -17
- package/types/x-modules/scroll/components/scroll.vue.d.ts.map +1 -1
- package/types/x-modules/search/events.types.d.ts +5 -0
- package/types/x-modules/search/events.types.d.ts.map +1 -1
- package/types/x-modules/search/store/actions/reset-state.action.d.ts +11 -0
- package/types/x-modules/search/store/actions/reset-state.action.d.ts.map +1 -0
- package/types/x-modules/search/store/emitters.d.ts +4 -0
- package/types/x-modules/search/store/emitters.d.ts.map +1 -1
- package/types/x-modules/search/store/module.d.ts.map +1 -1
- package/types/x-modules/search/store/types.d.ts +7 -1
- package/types/x-modules/search/store/types.d.ts.map +1 -1
- package/types/x-modules/search/types.d.ts +10 -0
- package/types/x-modules/search/types.d.ts.map +1 -1
- package/types/x-modules/search/wiring.d.ts +37 -59
- package/types/x-modules/search/wiring.d.ts.map +1 -1
- package/types/x-modules/tagging/events.types.d.ts +6 -0
- package/types/x-modules/tagging/events.types.d.ts.map +1 -1
- package/types/x-modules/tagging/store/emitters.d.ts +1 -0
- package/types/x-modules/tagging/store/emitters.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 +10 -0
- package/types/x-modules/tagging/store/types.d.ts.map +1 -1
- package/types/x-modules/tagging/wiring.d.ts +14 -5
- package/types/x-modules/tagging/wiring.d.ts.map +1 -1
- package/docs/API-reference/api/x-components.scroll.distancetobottom.md +0 -13
- package/docs/API-reference/api/x-components.scroll.throttlems.md +0 -13
- package/docs/API-reference/api/x-components.slidingpanel._refs.md +0 -15
- package/docs/API-reference/api/x-components.slidingpanel.beforedestroy.md +0 -15
- package/docs/API-reference/api/x-components.slidingpanel.isscrollatend.md +0 -13
- package/docs/API-reference/api/x-components.slidingpanel.isscrollatstart.md +0 -13
- package/docs/API-reference/api/x-components.slidingpanel.mounted.md +0 -15
- package/docs/API-reference/api/x-components.slidingpanel.scrollobserver.md +0 -13
- package/docs/API-reference/components/common/icons/x-components.arrow.md +0 -7
- package/js/components/icons/arrow.vue.js.map +0 -1
- package/js/components/icons/arrow.vue_rollup-plugin-vue=script.js +0 -4
- package/js/components/icons/arrow.vue_rollup-plugin-vue=script.js.map +0 -1
- package/types/components/icons/arrow.vue.d.ts +0 -3
- package/types/components/icons/arrow.vue.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliding-panel.vue_rollup-plugin-vue=script.js","sources":["../../../src/components/sliding-panel.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\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { VueCSSClasses } from '../utils/types';\nimport { Debounce } from './decorators/debounce.decorators';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"sliding-panel.vue_rollup-plugin-vue=script.js","sources":["../../../src/components/sliding-panel.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\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { VueCSSClasses } from '../utils/types';\nimport { Debounce } from './decorators/debounce.decorators';\n\n/**\n * This component allows for any other component or element inside it to be horizontally\n * navigable. It also implements customizable buttons as well as other minor customizations to its\n * general behavior.\n *\n * @public\n */\n@Component\nexport default class SlidingPanel extends Vue {\n /**\n * Scroll factor that will dictate how much the scroll moves when pressing a navigation button.\n *\n * @public\n */\n @Prop({ default: 0.7 })\n public scrollFactor!: number;\n\n /**\n * Would make the navigation buttons visible when they're needed or always hide them.\n *\n * @public\n */\n @Prop({ default: true })\n public showButtons!: boolean;\n\n /**\n * When true, whenever the DOM content in the sliding panel slot changes, it will reset\n * the scroll position to 0.\n *\n * @public\n */\n @Prop({ default: true })\n public resetOnContentChange!: boolean;\n\n /**\n * Indicates if the scroll is at the start of the sliding panel.\n *\n * @internal\n */\n protected isScrollAtStart = true;\n\n /**\n * Indicates if the scroll is at the end of the sliding panel.\n *\n * @internal\n */\n protected isScrollAtEnd = true;\n\n /**\n * HTMLElement referencing the scroll of the component.\n *\n * @internal\n */\n public $refs!: {\n scrollContainer: HTMLElement;\n };\n\n /**\n * CSS classes to apply based on the scroll position.\n *\n * @returns The CSS classes to apply.\n *\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-sliding-panel--at-start': this.isScrollAtStart,\n 'x-sliding-panel--at-end': this.isScrollAtEnd\n };\n }\n\n /**\n * Initialises browser platform code:\n * - Creates a mutation observer to detect content changes and reset scroll position.\n * - Stores initial size and scroll position values.\n *\n * @internal\n */\n mounted(): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const resizeObserver = new ResizeObserver(this.debouncedUpdateScrollPosition);\n resizeObserver.observe(this.$el);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const contentChangedObserver = new MutationObserver(this.restoreAndUpdateScroll);\n this.$watch(\n () => this.resetOnContentChange,\n shouldReset => {\n if (shouldReset) {\n contentChangedObserver.observe(this.$refs.scrollContainer, {\n attributes: false,\n childList: true,\n subtree: true,\n characterData: false\n });\n } else {\n contentChangedObserver.disconnect();\n }\n },\n { immediate: true }\n );\n this.$on('hook:beforeDestroy', () => {\n contentChangedObserver.disconnect();\n resizeObserver.disconnect();\n });\n\n this.updateScrollPosition();\n }\n\n /**\n * Resets the scroll and updates the values of the scroll for the buttons to react.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n restoreAndUpdateScroll(): void {\n this.$refs.scrollContainer.scroll({ left: 0, behavior: 'smooth' });\n this.updateScrollPosition();\n }\n\n /**\n * Updates the values of the scroll positions to show or hide the buttons depending on it.\n *\n * @internal\n */\n protected updateScrollPosition(): void {\n const { scrollLeft, clientWidth, scrollWidth } = this.$refs.scrollContainer;\n this.isScrollAtStart = !scrollLeft;\n /* The 2 px extra is to fix some cases in some resolutions where the scroll + client size is\n * less than the scroll width even when the scroll is at the end */\n this.isScrollAtEnd = scrollLeft + clientWidth + 2 >= scrollWidth;\n }\n\n /**\n * Debounced version of the {@link SlidingPanel.updateScrollPosition | updateScrollPosition}\n * method.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n debouncedUpdateScrollPosition(): void {\n this.updateScrollPosition();\n }\n\n /**\n * Scrolls the wrapper element to the left.\n *\n * @internal\n */\n protected scrollLeft(): void {\n this.scrollTo(-this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element to the right.\n *\n * @internal\n */\n protected scrollRight(): void {\n this.scrollTo(this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element towards the provided scroll value.\n *\n * @param scrollValue - The value the scroll will go towards.\n *\n * @internal\n */\n protected scrollTo(scrollValue: number): void {\n this.$refs.scrollContainer.scrollBy({\n left: scrollValue * this.scrollFactor,\n behavior: 'smooth'\n });\n }\n}\n"],"names":[],"mappings":";;;;;AAwCA;;;;;;;AAQA;IAA0C,gCAAG;IAA7C;QAAA,qEAsKC;;;;;;QAvIW,qBAAe,GAAG,IAAI,CAAC;;;;;;QAOvB,mBAAa,GAAG,IAAI,CAAC;;KAgIhC;IA9GC,sBAAc,oCAAU;;;;;;;;aAAxB;YACE,OAAO;gBACL,2BAA2B,EAAE,IAAI,CAAC,eAAe;gBACjD,yBAAyB,EAAE,IAAI,CAAC,aAAa;aAC9C,CAAC;SACH;;;OAAA;;;;;;;;IASD,8BAAO,GAAP;QAAA,iBA4BC;;QA1BC,IAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QAC9E,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;QAEjC,IAAM,sBAAsB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACjF,IAAI,CAAC,MAAM,CACT,cAAM,OAAA,KAAI,CAAC,oBAAoB,GAAA,EAC/B,UAAA,WAAW;YACT,IAAI,WAAW,EAAE;gBACf,sBAAsB,CAAC,OAAO,CAAC,KAAI,CAAC,KAAK,CAAC,eAAe,EAAE;oBACzD,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,IAAI;oBACb,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC;aACJ;iBAAM;gBACL,sBAAsB,CAAC,UAAU,EAAE,CAAC;a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C,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;sDACM;IAQ7B;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDACK;IAS7B;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8DACc;IAkFtC;QADC,QAAQ,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8DAIhC;IAsBD;QADC,QAAQ,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qEAGhC;IArIkB,YAAY;QADhC,SAAS;OACW,YAAY,CAsKhC;IAAD,mBAAC;CAAA,CAtKyC,GAAG;;;;"}
|
package/js/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export { getURLParameter } from './utils/get-url-parameters.js';
|
|
|
16
16
|
export { isElementEqualOrContained } from './utils/html.js';
|
|
17
17
|
export { normalizeString } from './utils/normalize.js';
|
|
18
18
|
export { isInRange } from './utils/number.js';
|
|
19
|
-
export { cleanUndefined, forEach, map, objectFilter, reduce } from './utils/object.js';
|
|
19
|
+
export { cleanUndefined, forEach, getNewAndUpdatedKeys, map, objectFilter, reduce } from './utils/object.js';
|
|
20
20
|
export { createOrigin } from './utils/origin.js';
|
|
21
21
|
export { sanitize } from './utils/sanitize.js';
|
|
22
22
|
export { localStorageService } from './utils/storage.js';
|
|
@@ -39,7 +39,10 @@ export { default as BasePriceFilterLabel } from './components/filters/labels/bas
|
|
|
39
39
|
export { default as StarIcon } from './components/icons/star.vue.js';
|
|
40
40
|
export { default as BaseRating } from './components/base-rating.vue.js';
|
|
41
41
|
export { default as BaseRatingFilterLabel } from './components/filters/labels/base-rating-filter-label.vue.js';
|
|
42
|
-
export { default as
|
|
42
|
+
export { default as ArrowDownIcon } from './components/icons/arrow-down.vue.js';
|
|
43
|
+
export { default as ArrowLeftIcon } from './components/icons/arrow-left.vue.js';
|
|
44
|
+
export { default as ArrowRightIcon } from './components/icons/arrow-right.vue.js';
|
|
45
|
+
export { default as ArrowUpIcon } from './components/icons/arrow-up.vue.js';
|
|
43
46
|
export { default as BagIcon } from './components/icons/bag.vue.js';
|
|
44
47
|
export { default as BarCodeIcon } from './components/icons/bar-code.vue.js';
|
|
45
48
|
export { default as BarcodeTinyIcon } from './components/icons/barcode-tiny.vue.js';
|
|
@@ -63,6 +66,7 @@ export { default as CrossIcon } from './components/icons/cross.vue.js';
|
|
|
63
66
|
export { default as FiltersIcon } from './components/icons/filters.vue.js';
|
|
64
67
|
export { default as Grid1ColIcon } from './components/icons/grid-1-col.vue.js';
|
|
65
68
|
export { default as Grid2ColIcon } from './components/icons/grid-2-col.vue.js';
|
|
69
|
+
export { default as Grid2RowsIcon } from './components/icons/grid-2-rows.vue.js';
|
|
66
70
|
export { default as HideIcon } from './components/icons/hide.vue.js';
|
|
67
71
|
export { default as HistoryTinyIcon } from './components/icons/history-tiny.vue.js';
|
|
68
72
|
export { default as HistoryIcon } from './components/icons/history.vue.js';
|
|
@@ -244,7 +248,7 @@ export { fetchSearchResponse } from './x-modules/search/store/actions/fetch-sear
|
|
|
244
248
|
export { request as searchRequest } from './x-modules/search/store/getters/request.getter.js';
|
|
245
249
|
export { searchXStoreModule } from './x-modules/search/store/module.js';
|
|
246
250
|
export { searchEmitters } from './x-modules/search/store/emitters.js';
|
|
247
|
-
export { cancelFetchAndSaveSearchResponseWire, fetchAndSaveSearchResponseWire, increasePageAppendingResults, resetAppending,
|
|
251
|
+
export { cancelFetchAndSaveSearchResponseWire, fetchAndSaveSearchResponseWire, increasePageAppendingResults, resetAppending, resetSpellcheckQuery, resetStateWire, saveOriginWire, searchWiring, setPageSize, setRelatedTags, setSearchExtraParams, setSearchPage, setSearchQuery, setSelectedFilters, setSort, setUrlParams } from './x-modules/search/wiring.js';
|
|
248
252
|
export { searchXModule } from './x-modules/search/x-module.js';
|
|
249
253
|
export { default as ResultsList } from './x-modules/search/components/results-list.vue.js';
|
|
250
254
|
export { default as NextQueriesList } from './x-modules/next-queries/components/next-queries-list.vue.js';
|
|
@@ -315,7 +319,7 @@ export { DefaultSessionService } from './x-modules/tagging/service/session.servi
|
|
|
315
319
|
export { track } from './x-modules/tagging/store/actions/track.action.js';
|
|
316
320
|
export { taggingXStoreModule } from './x-modules/tagging/store/module.js';
|
|
317
321
|
export { taggingEmitters } from './x-modules/tagging/store/emitters.js';
|
|
318
|
-
export { setConsent, setQueryTaggingDebounce, setSessionDuration, taggingWiring, trackAddToCartWire, trackQueryWire, trackResultClickedWire } from './x-modules/tagging/wiring.js';
|
|
322
|
+
export { setConsent, setQueryTaggingDebounce, setQueryTaggingInfo, setSessionDuration, taggingWiring, trackAddToCartWire, trackQueryWire, trackResultClickedWire } from './x-modules/tagging/wiring.js';
|
|
319
323
|
export { taggingXModule } from './x-modules/tagging/x-module.js';
|
|
320
324
|
export { default as Tagging } from './x-modules/tagging/components/tagging.vue.js';
|
|
321
325
|
export { urlXStoreModule } from './x-modules/url/store/module.js';
|
package/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/plugins/x-emitters.js
CHANGED
|
@@ -18,13 +18,13 @@ function registerStoreEmitters(_a, bus, store) {
|
|
|
18
18
|
var safeGettersProxy = getGettersProxyFromModule(store.getters, name, storeModule);
|
|
19
19
|
forEach(storeEmitters, function (event, stateSelector) {
|
|
20
20
|
var _a = normalizeStateSelector(stateSelector, event), selector = _a.selector, immediate = _a.immediate, filter = _a.filter, options = __rest(_a, ["selector", "immediate", "filter"]);
|
|
21
|
-
var emit = function (value) {
|
|
22
|
-
bus.emit(event, value, { moduleName: name });
|
|
21
|
+
var emit = function (value, oldValue) {
|
|
22
|
+
bus.emit(event, value, { moduleName: name, oldValue: oldValue });
|
|
23
23
|
};
|
|
24
24
|
var watcherSelector = function () { return selector(store.state.x[name], safeGettersProxy); };
|
|
25
25
|
var debouncedEffect = debounceWatcherEffect(event, function (newValue, oldValue) {
|
|
26
26
|
if (filter(newValue, oldValue)) {
|
|
27
|
-
emit(newValue);
|
|
27
|
+
emit(newValue, oldValue);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
store.watch(watcherSelector, debouncedEffect, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-emitters.js","sources":["../../../src/plugins/x-emitters.ts"],"sourcesContent":["import { Store } from 'vuex';\nimport { getGettersProxyFromModule } from '../store/utils/getters-proxy.utils';\nimport { AnySimpleStateSelector, AnyStateSelector } from '../store/utils/store-emitters.utils';\nimport { debounce } from '../utils/debounce';\nimport { forEach } from '../utils/object';\nimport { DebouncedFunction, Dictionary } from '../utils/types';\nimport { XEvent } from '../wiring/events.types';\nimport { AnyXModule } from '../x-modules/x-modules.types';\nimport { XBus } from './x-bus.types';\n\n/**\n * Registers the store emitters, making them emit the event when the part of the state selected\n * changes.\n *\n * @param xModule - The {@link XModule} to register its Store Emitters.\n * @param bus - The {@Link XBus} to emit the events by the Emitters.\n * @param store - The Vuex store to access to state and getters to watch them.\n *\n * @internal\n */\nexport function registerStoreEmitters(\n { name, storeEmitters, storeModule }: AnyXModule,\n bus: XBus,\n store: Store<any>\n): void {\n const safeGettersProxy = getGettersProxyFromModule(store.getters, name, storeModule);\n forEach(storeEmitters, (event, stateSelector: AnySimpleStateSelector | AnyStateSelector) => {\n const { selector, immediate, filter, ...options } = normalizeStateSelector(\n stateSelector,\n event\n );\n\n const emit = (value: unknown): void => {\n bus.emit(event, value, { moduleName: name });\n };\n const watcherSelector = (): unknown => selector(store.state.x[name], safeGettersProxy);\n const debouncedEffect = debounceWatcherEffect(event, (newValue, oldValue) => {\n if (filter(newValue, oldValue)) {\n emit(newValue);\n }\n });\n\n store.watch(watcherSelector, debouncedEffect, options);\n\n if (immediate) {\n Promise.resolve().then(() => {\n emit(watcherSelector());\n });\n }\n });\n}\n\n/**\n * This function \"wraps\" the watcher effect (the callback of the watcher) with debounce to avoid\n * repeating events and request. Right now this function wraps every effect in a debounce and adds\n * an extra debounce to the \"SecondLevelEvent\" events, to try to delay this events after the state\n * change events.\n *\n * @param event - The {@link XEvent} to emit.\n * @param watcherEffect - The callback to execute.\n * @returns A new function with the `watcherEffect` callback wrapped in debounce.\n */\nfunction debounceWatcherEffect(\n event: XEvent,\n watcherEffect: (newValue: unknown, oldValue: unknown) => void\n): (newValue: unknown, oldValue: unknown) => void {\n /*\n * Due the debounce added to the watch callback, the `oldValue` would be the one from the last\n * watcher execution instead of the last callback execution. This would cause problems receiving\n * unstable oldValues, used in the Emitter filter.\n * To solve this, we store the `oldValue` of the watcher in the `previousValue` variable, and we\n * keep there until the watcher callback is finally executed (after the debounce). Then this\n * `previousValue` is cleared to store the next `oldValue`.\n */\n let previousValue: unknown = undefined;\n\n let watcherCallback = debounce((newValue: unknown, oldValue: unknown): void => {\n watcherEffect(newValue, oldValue);\n previousValue = undefined;\n }, 0);\n /* Only applying the extra debounce to the \"SecondLevelEvent\" events to avoid repeating outer\n * effects (requests, URL changes). If we only apply the debounce to all the events we still have\n * the problem of outer effects. */\n if (isSecondLevelEventEmitter(event)) {\n const previousCallback = watcherCallback;\n const debouncedPreviousCallback = debounce(previousCallback, 0);\n watcherCallback = ((n, o) => {\n previousCallback.cancel();\n debouncedPreviousCallback(n, o);\n }) as DebouncedFunction<any>;\n }\n\n return (newValue, oldValue) => {\n previousValue = previousValue !== undefined ? previousValue : oldValue;\n watcherCallback(newValue, previousValue);\n };\n}\n\n/**\n * Transforms a {@link AnySimpleStateSelector} into a {@link AnyStateSelector}, and sets\n * default values for its properties.\n *\n * @param stateSelector - The state selector to normalize.\n * @param event - The event name of the emitter.\n * @returns A {@link AnyStateSelector} with all the properties set.\n *\n * @internal\n */\nfunction normalizeStateSelector(\n stateSelector: AnySimpleStateSelector | AnyStateSelector,\n event: XEvent\n): Required<AnyStateSelector> {\n const normalizedSelector = isSimpleSelector(stateSelector)\n ? { selector: stateSelector }\n : stateSelector;\n return {\n deep: false,\n immediate: false,\n filter: isSecondLevelEventEmitter(event)\n ? (newValue, oldValue) => !hasPayloadChanged(newValue, oldValue)\n : () => true,\n ...normalizedSelector\n };\n}\n\n/**\n * Checks if a the type of the store emitter selector is simple or complex. This selector can be\n * a function if it is simple or an object with the selector and other options if it is complex.\n *\n * @param stateSelector - The store emitter selector.\n * @returns A boolean which flags if the stateSelector is simple (function) or complex (object).\n *\n * @internal\n */\nexport function isSimpleSelector(\n stateSelector: AnySimpleStateSelector | AnyStateSelector\n): stateSelector is AnySimpleStateSelector {\n return typeof stateSelector === 'function';\n}\n\n// TODO: Generalize the Naming of the Events to take this into account\nconst secondLevelEvents: RegExp[] = [/RequestChanged$/, /UrlStateChanged$/];\n\n/**\n * Function to detect if an {@link XEvent} is a \"SecondLevelEvent\", to treat it differently.\n *\n * @param event - The name of the {@link XEvent} to check.\n * @returns True if is an `SecondLevelEvent`, False otherwise.\n *\n * @internal\n */\nfunction isSecondLevelEventEmitter(event: XEvent): boolean {\n return secondLevelEvents.some(regex => regex.test(event));\n}\n/**\n * Function to filter if a payload of an {@link XEvent} has really changed or not. It only\n * compares the first level of fields and not deeply, to avoid CPU consuming task here.\n *\n * @param request1 - First request to compare.\n * @param request2 - Second request to compare.\n * @returns True if the two objects are different, false otherwise.\n *\n * @internal\n */\nfunction hasPayloadChanged<T extends Dictionary>(request1?: T, request2?: T): boolean {\n if (request1 === request2) {\n return true;\n }\n if (!request1 || !request2) {\n return false;\n }\n const keys1 = Object.keys(request1);\n const keys2 = Object.keys(request2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return !keys1.some(key => request1[key] !== request2[key]);\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;SAUgB,qBAAqB,CACnC,EAAgD,EAChD,GAAS,EACT,KAAiB;QAFf,IAAI,UAAA,EAAE,aAAa,mBAAA,EAAE,WAAW,iBAAA;IAIlC,IAAM,gBAAgB,GAAG,yBAAyB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACrF,OAAO,CAAC,aAAa,EAAE,UAAC,KAAK,EAAE,aAAwD;QACrF,IAAM,KAA8C,sBAAsB,CACxE,aAAa,EACb,KAAK,CACN,EAHO,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAK,OAAO,cAAzC,mCAA2C,CAGhD,CAAC;QAEF,IAAM,IAAI,GAAG,UAAC,KAAc;
|
|
1
|
+
{"version":3,"file":"x-emitters.js","sources":["../../../src/plugins/x-emitters.ts"],"sourcesContent":["import { Store } from 'vuex';\nimport { getGettersProxyFromModule } from '../store/utils/getters-proxy.utils';\nimport { AnySimpleStateSelector, AnyStateSelector } from '../store/utils/store-emitters.utils';\nimport { debounce } from '../utils/debounce';\nimport { forEach } from '../utils/object';\nimport { DebouncedFunction, Dictionary } from '../utils/types';\nimport { XEvent } from '../wiring/events.types';\nimport { AnyXModule } from '../x-modules/x-modules.types';\nimport { XBus } from './x-bus.types';\n\n/**\n * Registers the store emitters, making them emit the event when the part of the state selected\n * changes.\n *\n * @param xModule - The {@link XModule} to register its Store Emitters.\n * @param bus - The {@Link XBus} to emit the events by the Emitters.\n * @param store - The Vuex store to access to state and getters to watch them.\n *\n * @internal\n */\nexport function registerStoreEmitters(\n { name, storeEmitters, storeModule }: AnyXModule,\n bus: XBus,\n store: Store<any>\n): void {\n const safeGettersProxy = getGettersProxyFromModule(store.getters, name, storeModule);\n forEach(storeEmitters, (event, stateSelector: AnySimpleStateSelector | AnyStateSelector) => {\n const { selector, immediate, filter, ...options } = normalizeStateSelector(\n stateSelector,\n event\n );\n\n const emit = (value: unknown, oldValue?: unknown): void => {\n bus.emit(event, value, { moduleName: name, oldValue });\n };\n const watcherSelector = (): unknown => selector(store.state.x[name], safeGettersProxy);\n const debouncedEffect = debounceWatcherEffect(event, (newValue, oldValue) => {\n if (filter(newValue, oldValue)) {\n emit(newValue, oldValue);\n }\n });\n\n store.watch(watcherSelector, debouncedEffect, options);\n\n if (immediate) {\n Promise.resolve().then(() => {\n emit(watcherSelector());\n });\n }\n });\n}\n\n/**\n * This function \"wraps\" the watcher effect (the callback of the watcher) with debounce to avoid\n * repeating events and request. Right now this function wraps every effect in a debounce and adds\n * an extra debounce to the \"SecondLevelEvent\" events, to try to delay this events after the state\n * change events.\n *\n * @param event - The {@link XEvent} to emit.\n * @param watcherEffect - The callback to execute.\n * @returns A new function with the `watcherEffect` callback wrapped in debounce.\n */\nfunction debounceWatcherEffect(\n event: XEvent,\n watcherEffect: (newValue: unknown, oldValue: unknown) => void\n): (newValue: unknown, oldValue: unknown) => void {\n /*\n * Due the debounce added to the watch callback, the `oldValue` would be the one from the last\n * watcher execution instead of the last callback execution. This would cause problems receiving\n * unstable oldValues, used in the Emitter filter.\n * To solve this, we store the `oldValue` of the watcher in the `previousValue` variable, and we\n * keep there until the watcher callback is finally executed (after the debounce). Then this\n * `previousValue` is cleared to store the next `oldValue`.\n */\n let previousValue: unknown = undefined;\n\n let watcherCallback = debounce((newValue: unknown, oldValue: unknown): void => {\n watcherEffect(newValue, oldValue);\n previousValue = undefined;\n }, 0);\n /* Only applying the extra debounce to the \"SecondLevelEvent\" events to avoid repeating outer\n * effects (requests, URL changes). If we only apply the debounce to all the events we still have\n * the problem of outer effects. */\n if (isSecondLevelEventEmitter(event)) {\n const previousCallback = watcherCallback;\n const debouncedPreviousCallback = debounce(previousCallback, 0);\n watcherCallback = ((n, o) => {\n previousCallback.cancel();\n debouncedPreviousCallback(n, o);\n }) as DebouncedFunction<any>;\n }\n\n return (newValue, oldValue) => {\n previousValue = previousValue !== undefined ? previousValue : oldValue;\n watcherCallback(newValue, previousValue);\n };\n}\n\n/**\n * Transforms a {@link AnySimpleStateSelector} into a {@link AnyStateSelector}, and sets\n * default values for its properties.\n *\n * @param stateSelector - The state selector to normalize.\n * @param event - The event name of the emitter.\n * @returns A {@link AnyStateSelector} with all the properties set.\n *\n * @internal\n */\nfunction normalizeStateSelector(\n stateSelector: AnySimpleStateSelector | AnyStateSelector,\n event: XEvent\n): Required<AnyStateSelector> {\n const normalizedSelector = isSimpleSelector(stateSelector)\n ? { selector: stateSelector }\n : stateSelector;\n return {\n deep: false,\n immediate: false,\n filter: isSecondLevelEventEmitter(event)\n ? (newValue, oldValue) => !hasPayloadChanged(newValue, oldValue)\n : () => true,\n ...normalizedSelector\n };\n}\n\n/**\n * Checks if a the type of the store emitter selector is simple or complex. This selector can be\n * a function if it is simple or an object with the selector and other options if it is complex.\n *\n * @param stateSelector - The store emitter selector.\n * @returns A boolean which flags if the stateSelector is simple (function) or complex (object).\n *\n * @internal\n */\nexport function isSimpleSelector(\n stateSelector: AnySimpleStateSelector | AnyStateSelector\n): stateSelector is AnySimpleStateSelector {\n return typeof stateSelector === 'function';\n}\n\n// TODO: Generalize the Naming of the Events to take this into account\nconst secondLevelEvents: RegExp[] = [/RequestChanged$/, /UrlStateChanged$/];\n\n/**\n * Function to detect if an {@link XEvent} is a \"SecondLevelEvent\", to treat it differently.\n *\n * @param event - The name of the {@link XEvent} to check.\n * @returns True if is an `SecondLevelEvent`, False otherwise.\n *\n * @internal\n */\nfunction isSecondLevelEventEmitter(event: XEvent): boolean {\n return secondLevelEvents.some(regex => regex.test(event));\n}\n/**\n * Function to filter if a payload of an {@link XEvent} has really changed or not. It only\n * compares the first level of fields and not deeply, to avoid CPU consuming task here.\n *\n * @param request1 - First request to compare.\n * @param request2 - Second request to compare.\n * @returns True if the two objects are different, false otherwise.\n *\n * @internal\n */\nfunction hasPayloadChanged<T extends Dictionary>(request1?: T, request2?: T): boolean {\n if (request1 === request2) {\n return true;\n }\n if (!request1 || !request2) {\n return false;\n }\n const keys1 = Object.keys(request1);\n const keys2 = Object.keys(request2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return !keys1.some(key => request1[key] !== request2[key]);\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;SAUgB,qBAAqB,CACnC,EAAgD,EAChD,GAAS,EACT,KAAiB;QAFf,IAAI,UAAA,EAAE,aAAa,mBAAA,EAAE,WAAW,iBAAA;IAIlC,IAAM,gBAAgB,GAAG,yBAAyB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACrF,OAAO,CAAC,aAAa,EAAE,UAAC,KAAK,EAAE,aAAwD;QACrF,IAAM,KAA8C,sBAAsB,CACxE,aAAa,EACb,KAAK,CACN,EAHO,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAK,OAAO,cAAzC,mCAA2C,CAGhD,CAAC;QAEF,IAAM,IAAI,GAAG,UAAC,KAAc,EAAE,QAAkB;YAC9C,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC;SACxD,CAAC;QACF,IAAM,eAAe,GAAG,cAAe,OAAA,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,GAAA,CAAC;QACvF,IAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,EAAE,UAAC,QAAQ,EAAE,QAAQ;YACtE,IAAI,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;gB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js/utils/object.js
CHANGED
|
@@ -79,7 +79,23 @@ function objectFilter(obj, isIncluded) {
|
|
|
79
79
|
}
|
|
80
80
|
return accumulator;
|
|
81
81
|
}, {});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Compares two objects of the same type, checking the values of their keys and retrieving
|
|
85
|
+
* those that were not present in the old value and/or those whose value has changed.
|
|
86
|
+
*
|
|
87
|
+
* @param newValue - The new object value.
|
|
88
|
+
* @param oldValue - The old object value.
|
|
89
|
+
*
|
|
90
|
+
* @returns An array of keys.
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
function getNewAndUpdatedKeys(newValue, oldValue) {
|
|
94
|
+
if (newValue === oldValue || !newValue || !oldValue) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
return Object.keys(newValue).filter(function (key) { return !(key in oldValue) || newValue[key] !== oldValue[key]; });
|
|
82
98
|
}
|
|
83
99
|
|
|
84
|
-
export { cleanUndefined, forEach, map, objectFilter, reduce };
|
|
100
|
+
export { cleanUndefined, forEach, getNewAndUpdatedKeys, map, objectFilter, reduce };
|
|
85
101
|
//# sourceMappingURL=object.js.map
|
package/js/utils/object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sources":["../../../src/utils/object.ts"],"sourcesContent":["import { Dictionary } from './types';\n\n/**\n * Iterates over every non-undefined property of the object calling the callback passed as\n * parameter.\n *\n * @param obj - The object to iterate through each property.\n * @param callbackFn - The callback function to call for each property.\n * @public\n */\nexport function forEach<T extends Dictionary>(\n obj: T | undefined | null,\n callbackFn: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => void\n): void {\n if (obj == null) {\n return;\n }\n\n let index = 0;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== undefined) {\n callbackFn(key, obj[key], index++);\n }\n }\n}\n\n/**\n * Iterates through the obj properties calling the reducer function.\n *\n * @param obj - The object to iterate through each property.\n * @param reducer - A function that will be called for each property, modifying the initialValue\n * object.\n * @param initialValue - The initial value of the accumulator property of the reducer function.\n * @returns Result of the reducer function.\n * @public\n */\nexport function reduce<T extends Dictionary, V>(\n obj: T | undefined | null,\n reducer: (\n accumulator: V,\n key: keyof T,\n value: Exclude<T[keyof T], undefined>,\n index: number\n ) => V,\n initialValue: V\n): V {\n let accumulator = initialValue;\n forEach(obj, (key, value, index) => {\n accumulator = reducer(accumulator, key, value, index);\n });\n return accumulator;\n}\n\n/**\n * Creates an object from another object transforming each property value.\n *\n * @param obj - The object to transform each property value.\n * @param mapper - The mapper function which will transform each value.\n * @returns A record with the result of the mapper.\n * @public\n */\nexport function map<T extends Dictionary, W>(\n obj: T | undefined | null,\n mapper: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => W\n): Record<keyof T, W> {\n return reduce(\n obj,\n (accumulator, key, value, index) => {\n accumulator[key] = mapper(key, value, index);\n return accumulator;\n },\n {} as Record<keyof T, W>\n );\n}\n\n/**\n * Creates an object picking only the not undefined properties.\n *\n * @param obj - The object from whom pick the values.\n * @returns A new object with the not undefined properties of the source object.\n * @public\n */\nexport function cleanUndefined<T>(obj: T): T {\n return typeof obj !== 'object' || obj === null || Array.isArray(obj)\n ? obj\n : reduce(\n obj,\n (pickedObject, key, value) => {\n pickedObject[key] = cleanUndefined(value);\n return pickedObject;\n },\n {} as T\n );\n}\n\n/**\n * Creates an object picking only the ones that pass the test implemented by the\n * provided function isIncluded.\n *\n * @param obj - T object to be filtered.\n * @param isIncluded - Test function that every obj item must pass.\n * @returns A filtered object.\n * @public\n */\nexport function objectFilter<T extends Dictionary>(\n obj: T | undefined | null,\n isIncluded: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => boolean\n): T {\n return reduce(\n obj,\n (accumulator, key, value, index) => {\n if (isIncluded(key, value, index)) {\n accumulator[key] = value;\n }\n return accumulator;\n },\n {} as T\n );\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;SAQgB,OAAO,CACr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CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAC1C,OAAO,YAAY,CAAC;SACrB,EACD,EAAO,CACR,CAAC;AACR,CAAC;AAED;;;;;;;;;SASgB,YAAY,CAC1B,GAAyB,EACzB,UAA2F;IAE3F,OAAO,MAAM,CACX,GAAG,EACH,UAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK;QAC7B,IAAI,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;YACjC,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC1B;QACD,OAAO,WAAW,CAAC;KACpB,EACD,EAAO,CACR,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"object.js","sources":["../../../src/utils/object.ts"],"sourcesContent":["import { Dictionary } from './types';\n\n/**\n * Iterates over every non-undefined property of the object calling the callback passed as\n * parameter.\n *\n * @param obj - The object to iterate through each property.\n * @param callbackFn - The callback function to call for each property.\n * @public\n */\nexport function forEach<T extends Dictionary>(\n obj: T | undefined | null,\n callbackFn: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => void\n): void {\n if (obj == null) {\n return;\n }\n\n let index = 0;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== undefined) {\n callbackFn(key, obj[key], index++);\n }\n }\n}\n\n/**\n * Iterates through the obj properties calling the reducer function.\n *\n * @param obj - The object to iterate through each property.\n * @param reducer - A function that will be called for each property, modifying the initialValue\n * object.\n * @param initialValue - The initial value of the accumulator property of the reducer function.\n * @returns Result of the reducer function.\n * @public\n */\nexport function reduce<T extends Dictionary, V>(\n obj: T | undefined | null,\n reducer: (\n accumulator: V,\n key: keyof T,\n value: Exclude<T[keyof T], undefined>,\n index: number\n ) => V,\n initialValue: V\n): V {\n let accumulator = initialValue;\n forEach(obj, (key, value, index) => {\n accumulator = reducer(accumulator, key, value, index);\n });\n return accumulator;\n}\n\n/**\n * Creates an object from another object transforming each property value.\n *\n * @param obj - The object to transform each property value.\n * @param mapper - The mapper function which will transform each value.\n * @returns A record with the result of the mapper.\n * @public\n */\nexport function map<T extends Dictionary, W>(\n obj: T | undefined | null,\n mapper: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => W\n): Record<keyof T, W> {\n return reduce(\n obj,\n (accumulator, key, value, index) => {\n accumulator[key] = mapper(key, value, index);\n return accumulator;\n },\n {} as Record<keyof T, W>\n );\n}\n\n/**\n * Creates an object picking only the not undefined properties.\n *\n * @param obj - The object from whom pick the values.\n * @returns A new object with the not undefined properties of the source object.\n * @public\n */\nexport function cleanUndefined<T>(obj: T): T {\n return typeof obj !== 'object' || obj === null || Array.isArray(obj)\n ? obj\n : reduce(\n obj,\n (pickedObject, key, value) => {\n pickedObject[key] = cleanUndefined(value);\n return pickedObject;\n },\n {} as T\n );\n}\n\n/**\n * Creates an object picking only the ones that pass the test implemented by the\n * provided function isIncluded.\n *\n * @param obj - T object to be filtered.\n * @param isIncluded - Test function that every obj item must pass.\n * @returns A filtered object.\n * @public\n */\nexport function objectFilter<T extends Dictionary>(\n obj: T | undefined | null,\n isIncluded: (key: keyof T, value: Exclude<T[keyof T], undefined>, index: number) => boolean\n): T {\n return reduce(\n obj,\n (accumulator, key, value, index) => {\n if (isIncluded(key, value, index)) {\n accumulator[key] = value;\n }\n return accumulator;\n },\n {} as T\n );\n}\n\n/**\n * Compares two objects of the same type, checking the values of their keys and retrieving\n * those that were not present in the old value and/or those whose value has changed.\n *\n * @param newValue - The new object value.\n * @param oldValue - The old object value.\n *\n * @returns An array of keys.\n * @public\n */\nexport function getNewAndUpdatedKeys<ObjectType extends Dictionary>(\n newValue: ObjectType | undefined,\n oldValue: ObjectType | undefined\n): (keyof ObjectType)[] {\n if (newValue === oldValue || !newValue || !oldValue) {\n return [];\n }\n\n return Object.keys(newValue).filter(key => !(key in oldValue) || newValue[key] !== oldValue[key]);\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;SAQgB,OAAO,CACrB,GAAy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AAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAC1C,OAAO,YAAY,CAAC;SACrB,EACD,EAAO,CACR,CAAC;AACR,CAAC;AAED;;;;;;;;;SASgB,YAAY,CAC1B,GAAyB,EACzB,UAA2F;IAE3F,OAAO,MAAM,CACX,GAAG,EACH,UAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK;QAC7B,IAAI,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;YACjC,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC1B;QACD,OAAO,WAAW,CAAC;KACpB,EACD,EAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;SAUgB,oBAAoB,CAClC,QAAgC,EAChC,QAAgC;IAEhC,IAAI,QAAQ,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE;QACnD,OAAO,EAAE,CAAC;KACX;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,GAAA,CAAC,CAAC;AACpG;;;;"}
|
|
@@ -25,7 +25,10 @@ import '../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
25
25
|
import '../../../components/icons/star.vue.js';
|
|
26
26
|
import '../../../components/base-rating.vue.js';
|
|
27
27
|
import '../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
28
|
-
import '../../../components/icons/arrow.vue.js';
|
|
28
|
+
import '../../../components/icons/arrow-down.vue.js';
|
|
29
|
+
import '../../../components/icons/arrow-left.vue.js';
|
|
30
|
+
import '../../../components/icons/arrow-right.vue.js';
|
|
31
|
+
import '../../../components/icons/arrow-up.vue.js';
|
|
29
32
|
import '../../../components/icons/bag.vue.js';
|
|
30
33
|
import '../../../components/icons/bar-code.vue.js';
|
|
31
34
|
import '../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -49,6 +52,7 @@ import '../../../components/icons/cross.vue.js';
|
|
|
49
52
|
import '../../../components/icons/filters.vue.js';
|
|
50
53
|
import '../../../components/icons/grid-1-col.vue.js';
|
|
51
54
|
import '../../../components/icons/grid-2-col.vue.js';
|
|
55
|
+
import '../../../components/icons/grid-2-rows.vue.js';
|
|
52
56
|
import '../../../components/icons/hide.vue.js';
|
|
53
57
|
import '../../../components/icons/history-tiny.vue.js';
|
|
54
58
|
import '../../../components/icons/history.vue.js';
|
package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;AASA;IAAyC,+BAAG;IAA5C;;KA8BC;;;;;IAzBC,6BAAO,GAAP;QACE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,wBAAO,IAAI,CAAC,MAAM,GAAK,IAAI,CAAC,gBAAgB,EAAG,CAAC;KACnF;;IAqBD,4BAAM,GAAN,eAAiB;IATjB;QAFC,KAAK,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;+CACW;IAMpC;QADC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;yDACe;IA1B3B,WAAW;QAH/B,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SAC9C,CAAC;OACmB,WAAW,CA8B/B;IAAD,kBAAC;CAAA,CA9BwC,GAAG;;;;"}
|
package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js
CHANGED
|
@@ -25,7 +25,10 @@ import '../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
25
25
|
import '../../../components/icons/star.vue.js';
|
|
26
26
|
import '../../../components/base-rating.vue.js';
|
|
27
27
|
import '../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
28
|
-
import '../../../components/icons/arrow.vue.js';
|
|
28
|
+
import '../../../components/icons/arrow-down.vue.js';
|
|
29
|
+
import '../../../components/icons/arrow-left.vue.js';
|
|
30
|
+
import '../../../components/icons/arrow-right.vue.js';
|
|
31
|
+
import '../../../components/icons/arrow-up.vue.js';
|
|
29
32
|
import '../../../components/icons/bag.vue.js';
|
|
30
33
|
import '../../../components/icons/bar-code.vue.js';
|
|
31
34
|
import '../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -49,6 +52,7 @@ import '../../../components/icons/cross.vue.js';
|
|
|
49
52
|
import '../../../components/icons/filters.vue.js';
|
|
50
53
|
import '../../../components/icons/grid-1-col.vue.js';
|
|
51
54
|
import '../../../components/icons/grid-2-col.vue.js';
|
|
55
|
+
import '../../../components/icons/grid-2-rows.vue.js';
|
|
52
56
|
import '../../../components/icons/hide.vue.js';
|
|
53
57
|
import '../../../components/icons/history-tiny.vue.js';
|
|
54
58
|
import '../../../components/icons/history.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderless-extra-param.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NoElement, State, xComponentMixin } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.UserChangedExtraParams} when the `updateValue`\n * is called.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)],\n components: {\n NoElement\n }\n})\nexport default class RenderlessExtraParam extends Vue {\n /**\n * The extra param's name.\n *\n * @public\n */\n @Prop({ required: true })\n public name!: string;\n\n /**\n * A dictionary with the extra params in the store state.\n *\n * @public\n */\n @State('extraParams', 'params')\n public stateParams!: Dictionary<unknown>;\n\n /**\n * It returns the value of the extra param from the store.\n *\n * @returns - The value from the store.\n *\n * @internal\n */\n protected get value(): unknown {\n return this.stateParams[this.name];\n }\n\n /**\n * It sets the new value to the store.\n *\n * @param newValue - The new value of the extra param.\n *\n * @internal\n */\n protected updateValue(newValue: unknown): void {\n this.$x.emit('UserChangedExtraParams', { [this.name]: newValue });\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderless-extra-param.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/renderless-extra-param.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { NoElement, State, xComponentMixin } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.UserChangedExtraParams} when the `updateValue`\n * is called.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)],\n components: {\n NoElement\n }\n})\nexport default class RenderlessExtraParam extends Vue {\n /**\n * The extra param's name.\n *\n * @public\n */\n @Prop({ required: true })\n public name!: string;\n\n /**\n * A dictionary with the extra params in the store state.\n *\n * @public\n */\n @State('extraParams', 'params')\n public stateParams!: Dictionary<unknown>;\n\n /**\n * It returns the value of the extra param from the store.\n *\n * @returns - The value from the store.\n *\n * @internal\n */\n protected get value(): unknown {\n return this.stateParams[this.name];\n }\n\n /**\n * It sets the new value to the store.\n *\n * @param newValue - The new value of the extra param.\n *\n * @internal\n */\n protected updateValue(newValue: unknown): void {\n this.$x.emit('UserChangedExtraParams', { [this.name]: newValue });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;AAYA;IAAkD,wCAAG;IAArD;;KAsCC;IAdC,sBAAc,uCAAK;;;;;;;;aAAnB;YACE,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACpC;;;OAAA;;;;;;;;IASS,0CAAW,GAArB,UAAsB,QAAiB;;QACrC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,YAAI,GAAC,IAAI,CAAC,IAAI,IAAG,QAAQ,MAAG,CAAC;KACnE;IA9BD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sDACJ;IAQrB;QADC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;6DACU;IAftB,oBAAoB;QANxC,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC7C,UAAU,EAAE;gBACV,SAAS,WAAA;aACV;SACF,CAAC;OACmB,oBAAoB,CAsCxC;IAAD,2BAAC;CAAA,CAtCiD,GAAG;;;;"}
|
|
@@ -42,7 +42,10 @@ import '../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
42
42
|
import '../../../components/icons/star.vue.js';
|
|
43
43
|
import '../../../components/base-rating.vue.js';
|
|
44
44
|
import '../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
45
|
-
import '../../../components/icons/arrow.vue.js';
|
|
45
|
+
import '../../../components/icons/arrow-down.vue.js';
|
|
46
|
+
import '../../../components/icons/arrow-left.vue.js';
|
|
47
|
+
import '../../../components/icons/arrow-right.vue.js';
|
|
48
|
+
import '../../../components/icons/arrow-up.vue.js';
|
|
46
49
|
import '../../../components/icons/bag.vue.js';
|
|
47
50
|
import '../../../components/icons/bar-code.vue.js';
|
|
48
51
|
import '../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -66,6 +69,7 @@ import '../../../components/icons/cross.vue.js';
|
|
|
66
69
|
import '../../../components/icons/filters.vue.js';
|
|
67
70
|
import '../../../components/icons/grid-1-col.vue.js';
|
|
68
71
|
import '../../../components/icons/grid-2-col.vue.js';
|
|
72
|
+
import '../../../components/icons/grid-2-rows.vue.js';
|
|
69
73
|
import '../../../components/icons/hide.vue.js';
|
|
70
74
|
import '../../../components/icons/history-tiny.vue.js';
|
|
71
75
|
import '../../../components/icons/history.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Watch, Inject } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components';\nimport { Dictionary, forEach } from '../../../utils';\nimport { SnippetConfig } from '../../../x-installer';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = ['callbacks'];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams({\n instance,\n scope,\n lang,\n searchLang,\n consent,\n documentDirection,\n currency,\n ...snippetExtraParams\n }: SnippetConfig): void {\n forEach(snippetExtraParams, (name, value) => {\n if (this.notAllowedExtraParams.includes(name)) {\n return;\n }\n this.$set(this.extraParams, name, value);\n });\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Watch, Inject } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components';\nimport { Dictionary, forEach } from '../../../utils';\nimport { SnippetConfig } from '../../../x-installer';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = ['callbacks'];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams({\n instance,\n scope,\n lang,\n searchLang,\n consent,\n documentDirection,\n currency,\n ...snippetExtraParams\n }: SnippetConfig): void {\n forEach(snippetExtraParams, (name, value) => {\n if (this.notAllowedExtraParams.includes(name)) {\n return;\n }\n this.$set(this.extraParams, name, value);\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;AAUA;IAAsD,4CAAG;IAAzD;QAAA,qEAmDC;;;;;;;;;QAlCW,iBAAW,GAAwB,EAAE,CAAC;;;;;;QAOtC,2BAAqB,GAA+B,CAAC,WAAW,CAAC,CAAC;;KA2B7E;;;;;;;;IAjBC,kDAAe,GAAf,UAAgB,EASA;QAVhB,iBAiBC;QAfC,IAAA,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,OAAO,aAAA,EACP,iBAAiB,uBAAA,EACjB,QAAQ,cAAA,EACL,kBAAkB,cARP,uFASf,CADsB;QAErB,OAAO,CAAC,kBAAkB,EAAE,UAAC,IAAI,EAAE,KAAK;YACtC,IAAI,KAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAC7C,OAAO;aACR;YACD,KAAI,CAAC,IAAI,CAAC,KAAI,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;SAC1C,CAAC,CAAC;KACJ;IA3CD;QADC,MAAM,CAAC,eAAe,CAAC;mEACa;IA2BrC;QADC,KAAK,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;mEAiBvD;IAlDkB,wBAAwB;QAJ5C,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,WAAW,aAAA,EAAE;YAC3B,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;SAC9C,CAAC;OACmB,wBAAwB,CAmD5C;IAAD,+BAAC;CAAA,CAnDqD,GAAG;;;;"}
|
|
@@ -25,7 +25,10 @@ import '../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
25
25
|
import '../../../components/icons/star.vue.js';
|
|
26
26
|
import '../../../components/base-rating.vue.js';
|
|
27
27
|
import '../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
28
|
-
import '../../../components/icons/arrow.vue.js';
|
|
28
|
+
import '../../../components/icons/arrow-down.vue.js';
|
|
29
|
+
import '../../../components/icons/arrow-left.vue.js';
|
|
30
|
+
import '../../../components/icons/arrow-right.vue.js';
|
|
31
|
+
import '../../../components/icons/arrow-up.vue.js';
|
|
29
32
|
import '../../../components/icons/bag.vue.js';
|
|
30
33
|
import '../../../components/icons/bar-code.vue.js';
|
|
31
34
|
import '../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -49,6 +52,7 @@ import '../../../components/icons/cross.vue.js';
|
|
|
49
52
|
import '../../../components/icons/filters.vue.js';
|
|
50
53
|
import '../../../components/icons/grid-1-col.vue.js';
|
|
51
54
|
import '../../../components/icons/grid-2-col.vue.js';
|
|
55
|
+
import '../../../components/icons/grid-2-rows.vue.js';
|
|
52
56
|
import '../../../components/icons/hide.vue.js';
|
|
53
57
|
import '../../../components/icons/history-tiny.vue.js';
|
|
54
58
|
import '../../../components/icons/history.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-filters.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/facets/components/clear-filters.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Facet, Filter, isFacetFilter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter, xComponentMixin } from '../../../components';\nimport BaseEventButton from '../../../components/base-event-button.vue';\nimport { VueCSSClasses } from '../../../utils';\nimport { XEventsTypes } from '../../../wiring';\nimport { facetsXModule } from '../x-module';\n\n/**\n * Renders a simple button, emitting the needed events when clicked.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class ClearFilters extends Vue {\n /**\n * It handles if the ClearFilters button is always visible no matter if there are not\n * filters selected. If false, the ClearFilters button is not visible whether\n * there are no filters selected.\n *\n * @public\n */\n @Prop({ default: false })\n public alwaysVisible!: boolean;\n\n /**\n * Array of facets ids that will be passed to event like payload.\n *\n * @public\n */\n @Prop()\n public facetsIds?: Array<Facet['id']>;\n\n /**\n * Get the selected filters from store.\n *\n * @internal\n */\n @Getter('facets', 'selectedFilters')\n public allSelectedFilters!: Filter[];\n\n /**\n * If alwaysVisible prop is true, ClearAllFilters button is always shown, but disabled\n * if there are no filters selected.\n * If alwaysVisible prop is false, ClearAllFilters button is shown whether there\n * are some filter selected.\n *\n * @returns True if alwaysVisible is true or in the opposite case true or false depends\n * on if there are selected filters or not.\n *\n * @internal\n */\n protected get show(): boolean {\n return this.alwaysVisible || this.areThereSelectedFilters;\n }\n\n /**\n * Get selected filters.\n * If there are facets ids, get selected filters whose facet id match with some of facets ids.\n * If there aren't facets ids, get selected filters.\n *\n * @returns Array of selected filters depends on there are facets ids or not.\n * @internal\n */\n protected get facetsSelectedFilters(): Filter[] {\n if (this.facetsIds) {\n return this.allSelectedFilters.filter(\n filter => isFacetFilter(filter) && this.facetsIds!.includes(filter.facetId)\n );\n } else {\n return this.allSelectedFilters;\n }\n }\n\n /**\n * Check if there are selected filters.\n *\n * @returns True or false depends on if there are facets ids and if there are selected filters.\n * @internal\n */\n protected get areThereSelectedFilters(): boolean {\n return !!this.facetsSelectedFilters.length;\n }\n\n /**\n * The events that will be emitted when the button clear filters is clicked.\n *\n * @returns The events to be emitted when the button clear filters is clicked.\n * @internal\n */\n protected get events(): Partial<XEventsTypes> {\n return this.facetsIds\n ? {\n UserClickedClearAllFilters: this.facetsIds\n }\n : {\n UserClickedClearAllFilters: undefined\n };\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-clear-filters--has-not-selected-filters': !this.areThereSelectedFilters,\n 'x-clear-filters--has-selected-filters': this.areThereSelectedFilters\n };\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clear-filters.vue_rollup-plugin-vue=script.js","sources":["../../../../../src/x-modules/facets/components/clear-filters.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Facet, Filter, isFacetFilter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Getter, xComponentMixin } from '../../../components';\nimport BaseEventButton from '../../../components/base-event-button.vue';\nimport { VueCSSClasses } from '../../../utils';\nimport { XEventsTypes } from '../../../wiring';\nimport { facetsXModule } from '../x-module';\n\n/**\n * Renders a simple button, emitting the needed events when clicked.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class ClearFilters extends Vue {\n /**\n * It handles if the ClearFilters button is always visible no matter if there are not\n * filters selected. If false, the ClearFilters button is not visible whether\n * there are no filters selected.\n *\n * @public\n */\n @Prop({ default: false })\n public alwaysVisible!: boolean;\n\n /**\n * Array of facets ids that will be passed to event like payload.\n *\n * @public\n */\n @Prop()\n public facetsIds?: Array<Facet['id']>;\n\n /**\n * Get the selected filters from store.\n *\n * @internal\n */\n @Getter('facets', 'selectedFilters')\n public allSelectedFilters!: Filter[];\n\n /**\n * If alwaysVisible prop is true, ClearAllFilters button is always shown, but disabled\n * if there are no filters selected.\n * If alwaysVisible prop is false, ClearAllFilters button is shown whether there\n * are some filter selected.\n *\n * @returns True if alwaysVisible is true or in the opposite case true or false depends\n * on if there are selected filters or not.\n *\n * @internal\n */\n protected get show(): boolean {\n return this.alwaysVisible || this.areThereSelectedFilters;\n }\n\n /**\n * Get selected filters.\n * If there are facets ids, get selected filters whose facet id match with some of facets ids.\n * If there aren't facets ids, get selected filters.\n *\n * @returns Array of selected filters depends on there are facets ids or not.\n * @internal\n */\n protected get facetsSelectedFilters(): Filter[] {\n if (this.facetsIds) {\n return this.allSelectedFilters.filter(\n filter => isFacetFilter(filter) && this.facetsIds!.includes(filter.facetId)\n );\n } else {\n return this.allSelectedFilters;\n }\n }\n\n /**\n * Check if there are selected filters.\n *\n * @returns True or false depends on if there are facets ids and if there are selected filters.\n * @internal\n */\n protected get areThereSelectedFilters(): boolean {\n return !!this.facetsSelectedFilters.length;\n }\n\n /**\n * The events that will be emitted when the button clear filters is clicked.\n *\n * @returns The events to be emitted when the button clear filters is clicked.\n * @internal\n */\n protected get events(): Partial<XEventsTypes> {\n return this.facetsIds\n ? {\n UserClickedClearAllFilters: this.facetsIds\n }\n : {\n UserClickedClearAllFilters: undefined\n };\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-clear-filters--has-not-selected-filters': !this.areThereSelectedFilters,\n 'x-clear-filters--has-selected-filters': this.areThereSelectedFilters\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;AASA;IAA0C,gCAAG;IAA7C;;KAkGC;IA5DC,sBAAc,8BAAI;;;;;;;;;;;;aAAlB;YACE,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,uBAAuB,CAAC;SAC3D;;;OAAA;IAUD,sBAAc,+CAAqB;;;;;;;;;aAAnC;YAAA,iBAQC;YAPC,IAAI,IAAI,CAAC,SAAS,EAAE;gBAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CACnC,UAAA,MAAM,IAAI,OAAA,aAAa,CAAC,MAAM,CAAC,IAAI,KAAI,CAAC,SAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAA,CAC5E,CAAC;aACH;iBAAM;gBACL,OAAO,IAAI,CAAC,kBAAkB,CAAC;aAChC;SACF;;;OAAA;IAQD,sBAAc,iDAAuB;;;;;;;aAArC;YACE,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC;SAC5C;;;OAAA;IAQD,sBAAc,gCAAM;;;;;;;aAApB;YACE,OAAO,IAAI,CAAC,SAAS;kBACjB;oBACE,0BAA0B,EAAE,IAAI,CAAC,SAAS;iBAC3C;kBACD;oBACE,0BAA0B,EAAE,SAAS;iBACtC,CAAC;SACP;;;OAAA;IAQD,sBAAc,oCAAU;;;;;;;aAAxB;YACE,OAAO;gBACL,2CAA2C,EAAE,CAAC,IAAI,CAAC,uBAAuB;gBAC1E,uCAAuC,EAAE,IAAI,CAAC,uBAAuB;aACtE,CAAC;SACH;;;OAAA;IAxFD;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;uDACM;IAQ/B;QADC,IAAI,EAAE;mDAC+B;IAQtC;QADC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;4DACC;IAzBlB,YAAY;QAJhC,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,eAAe,iBAAA,EAAE;YAC/B,MAAM,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACzC,CAAC;OACmB,YAAY,CAkGhC;IAAD,mBAAC;CAAA,CAlGyC,GAAG;;;;"}
|
package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js
CHANGED
|
@@ -26,7 +26,10 @@ import '../../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
26
26
|
import '../../../../components/icons/star.vue.js';
|
|
27
27
|
import '../../../../components/base-rating.vue.js';
|
|
28
28
|
import '../../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
29
|
-
import '../../../../components/icons/arrow.vue.js';
|
|
29
|
+
import '../../../../components/icons/arrow-down.vue.js';
|
|
30
|
+
import '../../../../components/icons/arrow-left.vue.js';
|
|
31
|
+
import '../../../../components/icons/arrow-right.vue.js';
|
|
32
|
+
import '../../../../components/icons/arrow-up.vue.js';
|
|
30
33
|
import '../../../../components/icons/bag.vue.js';
|
|
31
34
|
import '../../../../components/icons/bar-code.vue.js';
|
|
32
35
|
import '../../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -50,6 +53,7 @@ import '../../../../components/icons/cross.vue.js';
|
|
|
50
53
|
import '../../../../components/icons/filters.vue.js';
|
|
51
54
|
import '../../../../components/icons/grid-1-col.vue.js';
|
|
52
55
|
import '../../../../components/icons/grid-2-col.vue.js';
|
|
56
|
+
import '../../../../components/icons/grid-2-rows.vue.js';
|
|
53
57
|
import '../../../../components/icons/hide.vue.js';
|
|
54
58
|
import '../../../../components/icons/history-tiny.vue.js';
|
|
55
59
|
import '../../../../components/icons/history.vue.js';
|
package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets-provider.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets-provider.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport { Facet, Filter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop, Watch } from 'vue-property-decorator';\nimport { XOn } from '../../../../components';\nimport { xComponentMixin } from '../../../../components/x-component.mixin';\nimport { areFiltersDifferent } from '../../../../utils/filters';\nimport { FacetsGroup } from '../../service/types';\nimport { GroupId } from '../../store/types';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * This component allows to provide facets by prop, to add them to the state of the\n * `Facets X-Module`. These facets will be added to the `Facets X-Module` state together with\n * the facets emitted by the `Search X-Module` through the {@link SearchXEvents.FacetsChanged}\n * event.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class FacetsProvider extends Vue {\n /**\n * An facet group identifier to distinguish the provided facets from other facets like the\n * `Search X-Module` facets.\n *\n * @public\n */\n @Prop({ default: 'provided-facets' })\n public groupId!: GroupId;\n\n /**\n * The facets to provide to the `Facets X-Module` state. They have to include the\n * {@link @empathyco/x-types#Filter | filters}.\n *\n * @internal\n */\n @Prop({ required: true })\n public facets!: Facet[];\n\n /**\n * Temporarily stores the selected filters from the {@link FacetsProvider.facets} prop.\n * This is necessary to handle the {@link FacetsXEvents.UserChangedSelectedFilters} event.\n *\n * @internal\n */\n protected selectedFilters: Filter[] | null = null;\n\n /**\n * A computed property to group the facets and the groupId. This is used by the watcher.\n *\n * @returns The FacetGroup with the facets and the group id.\n *\n * @internal\n */\n protected get facetsGroup(): FacetsGroup {\n return { id: this.groupId, facets: this.facets };\n }\n\n /**\n * Emits the {@link FacetsXEvents.UserChangedSelectedFilters} event when the user changes\n * the selected filters.\n *\n * @param selectedFilters - The new list of selected filters.\n * @internal\n */\n @XOn('SelectedFiltersChanged')\n emitSelectedFiltersChanged(selectedFilters: Filter[]): void {\n if (\n this.selectedFilters === null ||\n areFiltersDifferent(this.selectedFilters, selectedFilters)\n ) {\n this.$x.emit('UserChangedSelectedFilters', selectedFilters);\n }\n this.selectedFilters = null;\n }\n\n /**\n * Emits the {@link FacetsXEvents.FacetsGroupProvided} event with the\n * {@link FacetsProvider.facetsGroup} as payload. It also extracts and saves the selected\n * filters.\n */\n @Watch('facetsGroup', { immediate: true })\n provideFacets(): void {\n if (this.facetsGroup.facets) {\n this.$x.emit('FacetsGroupProvided', this.facetsGroup);\n this.extractSelectedFilters(this.facets);\n }\n }\n\n /**\n * Extracts the selected filters from the facets and stores them in the\n * {@link FacetsProvider.selectedFilters} property.\n *\n * @param facets - The facets from whom extract the selected filters.\n * @internal\n */\n protected extractSelectedFilters(facets: Facet[]): void {\n this.selectedFilters = facets\n .flatMap(facet => facet.filters)\n .filter(filter => filter.selected);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"facets-provider.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets-provider.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport { Facet, Filter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop, Watch } from 'vue-property-decorator';\nimport { XOn } from '../../../../components';\nimport { xComponentMixin } from '../../../../components/x-component.mixin';\nimport { areFiltersDifferent } from '../../../../utils/filters';\nimport { FacetsGroup } from '../../service/types';\nimport { GroupId } from '../../store/types';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * This component allows to provide facets by prop, to add them to the state of the\n * `Facets X-Module`. These facets will be added to the `Facets X-Module` state together with\n * the facets emitted by the `Search X-Module` through the {@link SearchXEvents.FacetsChanged}\n * event.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class FacetsProvider extends Vue {\n /**\n * An facet group identifier to distinguish the provided facets from other facets like the\n * `Search X-Module` facets.\n *\n * @public\n */\n @Prop({ default: 'provided-facets' })\n public groupId!: GroupId;\n\n /**\n * The facets to provide to the `Facets X-Module` state. They have to include the\n * {@link @empathyco/x-types#Filter | filters}.\n *\n * @internal\n */\n @Prop({ required: true })\n public facets!: Facet[];\n\n /**\n * Temporarily stores the selected filters from the {@link FacetsProvider.facets} prop.\n * This is necessary to handle the {@link FacetsXEvents.UserChangedSelectedFilters} event.\n *\n * @internal\n */\n protected selectedFilters: Filter[] | null = null;\n\n /**\n * A computed property to group the facets and the groupId. This is used by the watcher.\n *\n * @returns The FacetGroup with the facets and the group id.\n *\n * @internal\n */\n protected get facetsGroup(): FacetsGroup {\n return { id: this.groupId, facets: this.facets };\n }\n\n /**\n * Emits the {@link FacetsXEvents.UserChangedSelectedFilters} event when the user changes\n * the selected filters.\n *\n * @param selectedFilters - The new list of selected filters.\n * @internal\n */\n @XOn('SelectedFiltersChanged')\n emitSelectedFiltersChanged(selectedFilters: Filter[]): void {\n if (\n this.selectedFilters === null ||\n areFiltersDifferent(this.selectedFilters, selectedFilters)\n ) {\n this.$x.emit('UserChangedSelectedFilters', selectedFilters);\n }\n this.selectedFilters = null;\n }\n\n /**\n * Emits the {@link FacetsXEvents.FacetsGroupProvided} event with the\n * {@link FacetsProvider.facetsGroup} as payload. It also extracts and saves the selected\n * filters.\n */\n @Watch('facetsGroup', { immediate: true })\n provideFacets(): void {\n if (this.facetsGroup.facets) {\n this.$x.emit('FacetsGroupProvided', this.facetsGroup);\n this.extractSelectedFilters(this.facets);\n }\n }\n\n /**\n * Extracts the selected filters from the facets and stores them in the\n * {@link FacetsProvider.selectedFilters} property.\n *\n * @param facets - The facets from whom extract the selected filters.\n * @internal\n */\n protected extractSelectedFilters(facets: Facet[]): void {\n this.selectedFilters = facets\n .flatMap(facet => facet.filters)\n .filter(filter => filter.selected);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty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C,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;mDACZ;IASzB;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACD;IA6BxB;QADC,GAAG,CAAC,wBAAwB,CAAC;oEAS7B;IAQD;QADC,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;uDAMzC;IAnEkB,cAAc;QAHlC,SAAS,CAAC;YACT,MAAM,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACzC,CAAC;OACmB,cAAc,CAoFlC;IAAD,qBAAC;CAAA,CApF2C,GAAG;;;;"}
|
|
@@ -26,7 +26,10 @@ import '../../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
26
26
|
import '../../../../components/icons/star.vue.js';
|
|
27
27
|
import '../../../../components/base-rating.vue.js';
|
|
28
28
|
import '../../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
29
|
-
import '../../../../components/icons/arrow.vue.js';
|
|
29
|
+
import '../../../../components/icons/arrow-down.vue.js';
|
|
30
|
+
import '../../../../components/icons/arrow-left.vue.js';
|
|
31
|
+
import '../../../../components/icons/arrow-right.vue.js';
|
|
32
|
+
import '../../../../components/icons/arrow-up.vue.js';
|
|
30
33
|
import '../../../../components/icons/bag.vue.js';
|
|
31
34
|
import '../../../../components/icons/bar-code.vue.js';
|
|
32
35
|
import '../../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -50,6 +53,7 @@ import '../../../../components/icons/cross.vue.js';
|
|
|
50
53
|
import '../../../../components/icons/filters.vue.js';
|
|
51
54
|
import '../../../../components/icons/grid-1-col.vue.js';
|
|
52
55
|
import '../../../../components/icons/grid-2-col.vue.js';
|
|
56
|
+
import '../../../../components/icons/grid-2-rows.vue.js';
|
|
53
57
|
import '../../../../components/icons/hide.vue.js';
|
|
54
58
|
import '../../../../components/icons/history-tiny.vue.js';
|
|
55
59
|
import '../../../../components/icons/history.vue.js';
|
package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/all-filter.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 Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Facet } from '@empathyco/x-types';\nimport { Getter, xComponentMixin } from '../../../../components';\nimport BaseEventButton from '../../../../components/base-event-button.vue';\nimport { isArrayEmpty } from '../../../../utils/array';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { FiltersByFacet } from '../../store';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * This component receives a required `facet` with\n * {@link @empathyco/x-types#BooleanFilter | BooleanFilter} as prop and renders a button, which\n * on clicked emits the {@link FacetsXEvents.UserClickedAllFilter} event. By default\n * the rendered button displays a message with the facet label but this content is customizable\n * through the default slot.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class AllFilter extends Vue {\n /** The facet data. */\n @Prop({ required: true })\n public facet!: Facet;\n\n /** The getter of the selectedFiltersByFacet. */\n @Getter('facets', 'selectedFiltersByFacet')\n public selectedFiltersByFacet!: FiltersByFacet;\n\n /**\n * The event that will be emitted when the all filter button is clicked.\n *\n * @returns The event to emit on click.\n * @internal\n */\n protected get clickEvent(): Partial<XEventsTypes> {\n return {\n UserClickedAllFilter: [this.facet.id]\n };\n }\n\n /**\n * Computed to retrieve the selected state of this component.\n *\n * @returns True if is selected false otherwise.\n */\n protected get isSelected(): boolean {\n return isArrayEmpty(this.selectedFiltersByFacet?.[this.facet.id]);\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @remarks This is only valid considering that in the case of HierarchicalFilters, ancestors\n * of nested selected filters are also selected.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-filter--is-selected': this.isSelected,\n 'x-all-filter--is-selected': this.isSelected\n };\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"all-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/all-filter.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 Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { Facet } from '@empathyco/x-types';\nimport { Getter, xComponentMixin } from '../../../../components';\nimport BaseEventButton from '../../../../components/base-event-button.vue';\nimport { isArrayEmpty } from '../../../../utils/array';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { FiltersByFacet } from '../../store';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * This component receives a required `facet` with\n * {@link @empathyco/x-types#BooleanFilter | BooleanFilter} as prop and renders a button, which\n * on clicked emits the {@link FacetsXEvents.UserClickedAllFilter} event. By default\n * the rendered button displays a message with the facet label but this content is customizable\n * through the default slot.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class AllFilter extends Vue {\n /** The facet data. */\n @Prop({ required: true })\n public facet!: Facet;\n\n /** The getter of the selectedFiltersByFacet. */\n @Getter('facets', 'selectedFiltersByFacet')\n public selectedFiltersByFacet!: FiltersByFacet;\n\n /**\n * The event that will be emitted when the all filter button is clicked.\n *\n * @returns The event to emit on click.\n * @internal\n */\n protected get clickEvent(): Partial<XEventsTypes> {\n return {\n UserClickedAllFilter: [this.facet.id]\n };\n }\n\n /**\n * Computed to retrieve the selected state of this component.\n *\n * @returns True if is selected false otherwise.\n */\n protected get isSelected(): boolean {\n return isArrayEmpty(this.selectedFiltersByFacet?.[this.facet.id]);\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @remarks This is only valid considering that in the case of HierarchicalFilters, ancestors\n * of nested selected filters are also selected.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-filter--is-selected': this.isSelected,\n 'x-all-filter--is-selected': this.isSelected\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA;;;;;;;;;AAaA;IAAuC,6BAAG;IAA1C;;KA6CC;IA9BC,sBAAc,iCAAU;;;;;;;aAAxB;YACE,OAAO;gBACL,oBAAoB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;aACtC,CAAC;SACH;;;OAAA;IAOD,sBAAc,iCAAU;;;;;;aAAxB;;YACE,OAAO,YAAY,CAAC,MAAA,IAAI,CAAC,sBAAsB,0CAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SACnE;;;OAAA;IAWD,sBAAc,iCAAU;;;;;;;;;;aAAxB;YACE,OAAO;gBACL,uBAAuB,EAAE,IAAI,CAAC,UAAU;gBACxC,2BAA2B,EAAE,IAAI,CAAC,UAAU;aAC7C,CAAC;SACH;;;OAAA;IAzCD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;4CACJ;IAIrB;QADC,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC;6DACI;IAP5B,SAAS;QAJ7B,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,eAAe,iBAAA,EAAE;YAC/B,MAAM,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACzC,CAAC;OACmB,SAAS,CA6C7B;IAAD,gBAAC;CAAA,CA7CsC,GAAG;;;;"}
|
|
@@ -25,7 +25,10 @@ import '../../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
25
25
|
import '../../../../components/icons/star.vue.js';
|
|
26
26
|
import '../../../../components/base-rating.vue.js';
|
|
27
27
|
import '../../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
28
|
-
import '../../../../components/icons/arrow.vue.js';
|
|
28
|
+
import '../../../../components/icons/arrow-down.vue.js';
|
|
29
|
+
import '../../../../components/icons/arrow-left.vue.js';
|
|
30
|
+
import '../../../../components/icons/arrow-right.vue.js';
|
|
31
|
+
import '../../../../components/icons/arrow-up.vue.js';
|
|
29
32
|
import '../../../../components/icons/bag.vue.js';
|
|
30
33
|
import '../../../../components/icons/bar-code.vue.js';
|
|
31
34
|
import '../../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -49,6 +52,7 @@ import '../../../../components/icons/cross.vue.js';
|
|
|
49
52
|
import '../../../../components/icons/filters.vue.js';
|
|
50
53
|
import '../../../../components/icons/grid-1-col.vue.js';
|
|
51
54
|
import '../../../../components/icons/grid-2-col.vue.js';
|
|
55
|
+
import '../../../../components/icons/grid-2-rows.vue.js';
|
|
52
56
|
import '../../../../components/icons/hide.vue.js';
|
|
53
57
|
import '../../../../components/icons/history-tiny.vue.js';
|
|
54
58
|
import '../../../../components/icons/history.vue.js';
|
package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/base-filter.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 { BooleanFilter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../../components';\nimport BaseEventButton from '../../../../components/base-event-button.vue';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * Renders a button with a default slot. It receives a\n * {@link @empathyco/x-types#BooleanFilter | BooleanFilter} that will be used in the\n * default slot and the {@link XEvent | XEvents} that will be emitted when clicking the button.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class BaseFilter extends Vue {\n /** The filter data to render. */\n @Prop({ required: true })\n public filter!: BooleanFilter;\n\n /** Additional events with its payload to emit when the filter is clicked. */\n @Prop()\n public clickEvents?: Partial<XEventsTypes>;\n\n /**\n * The events that will be emitted when the filter is clicked.\n *\n * @returns The events to be emitted when the filter is clicked.\n * @internal\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserClickedAFilter: this.filter,\n ...this.clickEvents\n };\n }\n\n /**\n * Returns `true` when the filter should be disabled.\n *\n * @returns `true` if the filter should be disabled.\n * @internal\n */\n protected get isDisabled(): boolean {\n return this.filter.totalResults === 0;\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-filter--is-selected': this.filter.selected,\n 'x-filter--is-disabled': this.isDisabled\n };\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/base-filter.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 { BooleanFilter } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../../components';\nimport BaseEventButton from '../../../../components/base-event-button.vue';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { facetsXModule } from '../../x-module';\n\n/**\n * Renders a button with a default slot. It receives a\n * {@link @empathyco/x-types#BooleanFilter | BooleanFilter} that will be used in the\n * default slot and the {@link XEvent | XEvents} that will be emitted when clicking the button.\n *\n * @public\n */\n@Component({\n components: { BaseEventButton },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class BaseFilter extends Vue {\n /** The filter data to render. */\n @Prop({ required: true })\n public filter!: BooleanFilter;\n\n /** Additional events with its payload to emit when the filter is clicked. */\n @Prop()\n public clickEvents?: Partial<XEventsTypes>;\n\n /**\n * The events that will be emitted when the filter is clicked.\n *\n * @returns The events to be emitted when the filter is clicked.\n * @internal\n */\n protected get events(): Partial<XEventsTypes> {\n return {\n UserClickedAFilter: this.filter,\n ...this.clickEvents\n };\n }\n\n /**\n * Returns `true` when the filter should be disabled.\n *\n * @returns `true` if the filter should be disabled.\n * @internal\n */\n protected get isDisabled(): boolean {\n return this.filter.totalResults === 0;\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-filter--is-selected': this.filter.selected,\n 'x-filter--is-disabled': this.isDisabled\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;;;;;;;AAWA;IAAwC,8BAAG;IAA3C;;KA4CC;IA7BC,sBAAc,8BAAM;;;;;;;aAApB;YACE,kBACE,kBAAkB,EAAE,IAAI,CAAC,MAAM,IAC5B,IAAI,CAAC,WAAW,EACnB;SACH;;;OAAA;IAQD,sBAAc,kCAAU;;;;;;;aAAxB;YACE,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC;SACvC;;;OAAA;IAQD,sBAAc,kCAAU;;;;;;;aAAxB;YACE,OAAO;gBACL,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;gBAC7C,uBAAuB,EAAE,IAAI,CAAC,UAAU;aACzC,CAAC;SACH;;;OAAA;IAxCD;QADC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8CACK;IAI9B;QADC,IAAI,EAAE;mDACoC;IAPxB,UAAU;QAJ9B,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,eAAe,iBAAA,EAAE;YAC/B,MAAM,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACzC,CAAC;OACmB,UAAU,CA4C9B;IAAD,iBAAC;CAAA,CA5CuC,GAAG;;;;"}
|
package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js
CHANGED
|
@@ -25,7 +25,10 @@ import '../../../../components/filters/labels/base-price-filter-label.vue.js';
|
|
|
25
25
|
import '../../../../components/icons/star.vue.js';
|
|
26
26
|
import '../../../../components/base-rating.vue.js';
|
|
27
27
|
import '../../../../components/filters/labels/base-rating-filter-label.vue.js';
|
|
28
|
-
import '../../../../components/icons/arrow.vue.js';
|
|
28
|
+
import '../../../../components/icons/arrow-down.vue.js';
|
|
29
|
+
import '../../../../components/icons/arrow-left.vue.js';
|
|
30
|
+
import '../../../../components/icons/arrow-right.vue.js';
|
|
31
|
+
import '../../../../components/icons/arrow-up.vue.js';
|
|
29
32
|
import '../../../../components/icons/bag.vue.js';
|
|
30
33
|
import '../../../../components/icons/bar-code.vue.js';
|
|
31
34
|
import '../../../../components/icons/barcode-tiny.vue.js';
|
|
@@ -49,6 +52,7 @@ import '../../../../components/icons/cross.vue.js';
|
|
|
49
52
|
import '../../../../components/icons/filters.vue.js';
|
|
50
53
|
import '../../../../components/icons/grid-1-col.vue.js';
|
|
51
54
|
import '../../../../components/icons/grid-2-col.vue.js';
|
|
55
|
+
import '../../../../components/icons/grid-2-rows.vue.js';
|
|
52
56
|
import '../../../../components/icons/hide.vue.js';
|
|
53
57
|
import '../../../../components/icons/history-tiny.vue.js';
|
|
54
58
|
import '../../../../components/icons/history.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchical-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Filter, HierarchicalFilter as HierarchicalFilterModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin } from '../../../../components';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { facetsXModule } from '../../x-module';\nimport FiltersList from '../lists/filters-list.vue';\nimport RenderlessFilter from './renderless-filter.vue';\n\n/**\n * Renders a hierarchical filter recursively, emitting the needed events when clicked.\n *\n * @public\n */\n@Component({\n name: 'HierarchicalFilter',\n components: { FiltersList, RenderlessFilter },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class HierarchicalFilter extends Vue {\n /** The filter data to render. */\n @Prop({ required: true })\n public filter!: HierarchicalFilterModel;\n\n /** The animation component to use for the children filters. */\n @Prop()\n public childrenAnimation?: Vue | string;\n /**\n * The state filters.\n *\n * @internal\n */\n @State('facets', 'filters')\n public filters!: Record<Filter['id'], Filter>;\n\n /**\n * Additional events to emit when the filter is clicked.\n *\n * @returns A dictionary with the events to be emitted when the filter is clicked, and its\n * payload.\n * @internal\n */\n protected get clickEvents(): Partial<XEventsTypes> {\n return {\n UserClickedAHierarchicalFilter: this.filter\n };\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-hierarchical-filter--is-partially-selected': this.isPartiallySelected,\n 'x-hierarchical-filter--is-selected': this.filter.selected,\n 'x-filter--is-partially-selected': this.isPartiallySelected\n };\n }\n\n /**\n * Returns if the filter is partially selected, which means having more than one child filter\n * selected, but not every of them, or having at least one child filter partially selected.\n *\n * @returns True if the filter is partially selected. False otherwise.\n * @internal\n */\n protected get isPartiallySelected(): boolean {\n return this.isFilterPartiallySelected(this.filter);\n }\n\n /**\n * List of filters to render, in case that the children's array\n * is empty it will return an empty array instead of inject the ones from the parent.\n *\n * @returns A list of filters.\n *\n * @internal\n */\n protected get renderedChildrenFilters(): Filter[] {\n return this.filter.children?.map(filterId => this.filters[filterId]) ?? [];\n }\n\n protected isFilterPartiallySelected(filter: HierarchicalFilterModel): boolean {\n const selectedChildren = filter.children\n ?.map(filterId => this.filters[filterId])\n ?.filter(filter => filter?.selected) as HierarchicalFilterModel[] | undefined;\n const filterChildrenLength = filter.children?.length ?? 0;\n return (\n !!selectedChildren &&\n ((selectedChildren.length > 0 && selectedChildren.length < filterChildrenLength) ||\n // eslint-disable-next-line @typescript-eslint/unbound-method\n selectedChildren.some(this.isFilterPartiallySelected))\n );\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hierarchical-filter.vue_rollup-plugin-vue=script.js","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Filter, HierarchicalFilter as HierarchicalFilterModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin } from '../../../../components';\nimport { VueCSSClasses } from '../../../../utils/types';\nimport { XEventsTypes } from '../../../../wiring/events.types';\nimport { facetsXModule } from '../../x-module';\nimport FiltersList from '../lists/filters-list.vue';\nimport RenderlessFilter from './renderless-filter.vue';\n\n/**\n * Renders a hierarchical filter recursively, emitting the needed events when clicked.\n *\n * @public\n */\n@Component({\n name: 'HierarchicalFilter',\n components: { FiltersList, RenderlessFilter },\n mixins: [xComponentMixin(facetsXModule)]\n})\nexport default class HierarchicalFilter extends Vue {\n /** The filter data to render. */\n @Prop({ required: true })\n public filter!: HierarchicalFilterModel;\n\n /** The animation component to use for the children filters. */\n @Prop()\n public childrenAnimation?: Vue | string;\n /**\n * The state filters.\n *\n * @internal\n */\n @State('facets', 'filters')\n public filters!: Record<Filter['id'], Filter>;\n\n /**\n * Additional events to emit when the filter is clicked.\n *\n * @returns A dictionary with the events to be emitted when the filter is clicked, and its\n * payload.\n * @internal\n */\n protected get clickEvents(): Partial<XEventsTypes> {\n return {\n UserClickedAHierarchicalFilter: this.filter\n };\n }\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-hierarchical-filter--is-partially-selected': this.isPartiallySelected,\n 'x-hierarchical-filter--is-selected': this.filter.selected,\n 'x-filter--is-partially-selected': this.isPartiallySelected\n };\n }\n\n /**\n * Returns if the filter is partially selected, which means having more than one child filter\n * selected, but not every of them, or having at least one child filter partially selected.\n *\n * @returns True if the filter is partially selected. False otherwise.\n * @internal\n */\n protected get isPartiallySelected(): boolean {\n return this.isFilterPartiallySelected(this.filter);\n }\n\n /**\n * List of filters to render, in case that the children's array\n * is empty it will return an empty array instead of inject the ones from the parent.\n *\n * @returns A list of filters.\n *\n * @internal\n */\n protected get renderedChildrenFilters(): Filter[] {\n return this.filter.children?.map(filterId => this.filters[filterId]) ?? [];\n }\n\n protected isFilterPartiallySelected(filter: HierarchicalFilterModel): boolean {\n const selectedChildren = filter.children\n ?.map(filterId => this.filters[filterId])\n ?.filter(filter => filter?.selected) as HierarchicalFilterModel[] | undefined;\n const filterChildrenLength = filter.children?.length ?? 0;\n return (\n !!selectedChildren &&\n ((selectedChildren.length > 0 && selectedChildren.length < filterChildrenLength) ||\n // eslint-disable-next-line @typescript-eslint/unbound-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