@empathyco/x-components 6.0.0-alpha.219 → 6.0.0-alpha.220
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 +8 -0
- package/docs/API-reference/components/ai/x-components.ai-overview.md +4 -4
- package/docs/API-reference/components/common/animations/x-components.animate-width.md +4 -4
- package/docs/API-reference/components/common/animations/x-components.change-height.md +10 -6
- package/docs/API-reference/components/common/animations/x-components.collapse-height.md +15 -11
- package/docs/API-reference/components/common/animations/x-components.collapse-width.md +12 -10
- package/docs/API-reference/components/common/animations/x-components.cross-fade.md +9 -9
- package/docs/API-reference/components/common/animations/x-components.fade-and-slide.md +6 -6
- package/docs/API-reference/components/common/animations/x-components.fade.md +9 -9
- package/docs/API-reference/components/common/animations/x-components.no-animation.md +2 -2
- package/docs/API-reference/components/common/animations/x-components.staggered-fade-and-slide.md +5 -5
- package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-dropdown.md +13 -9
- package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-list.md +18 -18
- package/docs/API-reference/components/common/currency/x-components.base-currency.md +15 -15
- package/docs/API-reference/components/common/filters/labels/x-components.base-price-filter-label.md +6 -2
- package/docs/API-reference/components/common/filters/labels/x-components.base-rating-filter-label.md +26 -26
- package/docs/API-reference/components/common/layouts/x-components.fixed-header-and-asides-layout.md +1 -1
- package/docs/API-reference/components/common/layouts/x-components.multi-column-max-width-layout.md +1 -1
- package/docs/API-reference/components/common/layouts/x-components.single-column-layout.md +1 -1
- package/docs/API-reference/components/common/modals/x-components.base-events-modal-close.md +5 -3
- package/docs/API-reference/components/common/modals/x-components.base-events-modal-open.md +2 -2
- package/docs/API-reference/components/common/modals/x-components.base-events-modal.md +28 -10
- package/docs/API-reference/components/common/modals/x-components.base-id-modal-close.md +2 -2
- package/docs/API-reference/components/common/modals/x-components.base-id-modal-open.md +2 -2
- package/docs/API-reference/components/common/modals/x-components.base-id-modal.md +10 -2
- package/docs/API-reference/components/common/modals/x-components.base-modal.md +12 -12
- package/docs/API-reference/components/common/modals/x-components.close-main-modal.md +5 -1
- package/docs/API-reference/components/common/modals/x-components.main-modal.md +20 -4
- package/docs/API-reference/components/common/modals/x-components.open-main-modal.md +5 -1
- package/docs/API-reference/components/common/panels/x-components.base-header-toggle-panel.md +17 -13
- package/docs/API-reference/components/common/panels/x-components.base-id-toggle-panel-button.md +11 -4
- package/docs/API-reference/components/common/panels/x-components.base-id-toggle-panel.md +20 -13
- package/docs/API-reference/components/common/panels/x-components.base-tabs-panel.md +13 -10
- package/docs/API-reference/components/common/panels/x-components.base-toggle-panel.md +4 -4
- package/docs/API-reference/components/common/result/x-components.base-result-add-to-cart.md +4 -4
- package/docs/API-reference/components/common/result/x-components.base-result-current-price.md +7 -5
- package/docs/API-reference/components/common/result/x-components.base-result-image.md +25 -19
- package/docs/API-reference/components/common/result/x-components.base-result-link.md +5 -5
- package/docs/API-reference/components/common/result/x-components.base-result-previous-price.md +7 -5
- package/docs/API-reference/components/common/result/x-components.base-result-rating.md +26 -23
- package/docs/API-reference/components/common/result/x-components.result-variant-selector.md +62 -42
- package/docs/API-reference/components/common/result/x-components.result-variants-provider.md +35 -25
- package/docs/API-reference/components/common/scroll/x-components.base-scroll.md +11 -11
- package/docs/API-reference/components/common/suggestions/x-components.base-suggestion.md +24 -24
- package/docs/API-reference/components/common/suggestions/x-components.base-suggestions.md +47 -44
- package/docs/API-reference/components/common/x-components.auto-progress-bar.md +8 -5
- package/docs/API-reference/components/common/x-components.base-dropdown.md +7 -5
- package/docs/API-reference/components/common/x-components.base-event-button.md +9 -7
- package/docs/API-reference/components/common/x-components.base-grid.md +23 -23
- package/docs/API-reference/components/common/x-components.base-keyboard-navigation.md +6 -6
- package/docs/API-reference/components/common/x-components.base-rating.md +3 -3
- package/docs/API-reference/components/common/x-components.base-slider.md +20 -16
- package/docs/API-reference/components/common/x-components.base-switch.md +6 -6
- package/docs/API-reference/components/common/x-components.base-variable-column-grid.md +37 -28
- package/docs/API-reference/components/common/x-components.display-click-provider.md +9 -9
- package/docs/API-reference/components/common/x-components.display-emitter.md +1 -1
- package/docs/API-reference/components/common/x-components.global-x-bus.md +3 -3
- package/docs/API-reference/components/common/x-components.highlight.md +6 -6
- package/docs/API-reference/components/common/x-components.location-provider.md +4 -4
- package/docs/API-reference/components/common/x-components.page-loader-button.md +14 -14
- package/docs/API-reference/components/common/x-components.page-selector.md +12 -12
- package/docs/API-reference/components/common/x-components.sliding-panel.md +23 -20
- package/docs/API-reference/components/common/x-components.snippet-callbacks.md +3 -3
- package/docs/API-reference/components/device/x-components.device-detector.md +15 -15
- package/docs/API-reference/components/empathize/x-components.empathize.md +20 -20
- package/docs/API-reference/components/experience-controls/x-components.experience-controls.md +1 -1
- package/docs/API-reference/components/extra-params/x-components.extra-params.md +3 -3
- package/docs/API-reference/components/extra-params/x-components.renderless-extra-param.md +9 -5
- package/docs/API-reference/components/extra-params/x-components.snippet-config-extra-params.md +8 -8
- package/docs/API-reference/components/facets/x-components.clear-filters.md +10 -6
- package/docs/API-reference/components/facets/x-components.facets/facets-provider.md +16 -16
- package/docs/API-reference/components/facets/x-components.facets/facets.md +15 -9
- package/docs/API-reference/components/facets/x-components.filters/all-filter.md +20 -6
- package/docs/API-reference/components/facets/x-components.filters/editable-number-range-filter.md +37 -30
- package/docs/API-reference/components/facets/x-components.filters/hierarchical-filter.md +33 -27
- package/docs/API-reference/components/facets/x-components.filters/number-range-filter.md +19 -16
- package/docs/API-reference/components/facets/x-components.filters/renderless-filter.md +17 -15
- package/docs/API-reference/components/facets/x-components.filters/simple-filter.md +38 -32
- package/docs/API-reference/components/facets/x-components.lists/exclude-filters-with-no-results.md +30 -30
- package/docs/API-reference/components/facets/x-components.lists/filters-list.md +15 -15
- package/docs/API-reference/components/facets/x-components.lists/filters-search.md +31 -22
- package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +8 -6
- package/docs/API-reference/components/facets/x-components.lists/selected-filters.md +5 -5
- package/docs/API-reference/components/facets/x-components.lists/sliced-filters.md +35 -8
- package/docs/API-reference/components/facets/x-components.lists/sorted-filters.md +7 -2
- package/docs/API-reference/components/facets/x-components.preselected-filters.md +15 -9
- package/docs/API-reference/components/history-queries/x-components.clear-history-queries.md +8 -5
- package/docs/API-reference/components/history-queries/x-components.history-queries-switch.md +12 -9
- package/docs/API-reference/components/history-queries/x-components.history-queries.md +18 -15
- package/docs/API-reference/components/history-queries/x-components.history-query.md +21 -21
- package/docs/API-reference/components/history-queries/x-components.my-history.md +14 -11
- package/docs/API-reference/components/history-queries/x-components.remove-history-query.md +5 -5
- package/docs/API-reference/components/identifier-results/x-components.identifier-result.md +3 -3
- package/docs/API-reference/components/identifier-results/x-components.identifier-results.md +7 -7
- package/docs/API-reference/components/next-queries/x-components.next-queries-list.md +20 -15
- package/docs/API-reference/components/next-queries/x-components.next-queries.md +17 -13
- package/docs/API-reference/components/next-queries/x-components.next-query-preview.md +36 -25
- package/docs/API-reference/components/next-queries/x-components.next-query.md +14 -12
- package/docs/API-reference/components/popular-searches/x-components.popular-search.md +11 -11
- package/docs/API-reference/components/popular-searches/x-components.popular-searches.md +10 -7
- package/docs/API-reference/components/queries-preview/x-components.query-preview-button.md +6 -6
- package/docs/API-reference/components/queries-preview/x-components.query-preview-list.md +23 -21
- package/docs/API-reference/components/queries-preview/x-components.query-preview.md +27 -16
- package/docs/API-reference/components/query-suggestions/x-components.query-suggestion.md +20 -17
- package/docs/API-reference/components/query-suggestions/x-components.query-suggestions.md +16 -13
- package/docs/API-reference/components/recommendations/x-components.recommendations.md +23 -12
- package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +12 -12
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +13 -13
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +8 -5
- package/docs/API-reference/components/related-tags/x-components.related-tag.md +16 -16
- package/docs/API-reference/components/related-tags/x-components.related-tags.md +19 -16
- package/docs/API-reference/components/scroll/x-components.main-scroll-item.md +9 -5
- package/docs/API-reference/components/scroll/x-components.main-scroll.md +16 -8
- package/docs/API-reference/components/scroll/x-components.scroll-to-top.md +1 -1
- package/docs/API-reference/components/scroll/x-components.scroll.md +27 -27
- package/docs/API-reference/components/search/x-components.banner.md +16 -16
- package/docs/API-reference/components/search/x-components.banners-list.md +13 -13
- package/docs/API-reference/components/search/x-components.fallback-disclaimer.md +4 -4
- package/docs/API-reference/components/search/x-components.partial-query-button.md +6 -6
- package/docs/API-reference/components/search/x-components.partial-results-list.md +11 -7
- package/docs/API-reference/components/search/x-components.promoted.md +16 -16
- package/docs/API-reference/components/search/x-components.promoteds-list.md +13 -13
- package/docs/API-reference/components/search/x-components.redirection.md +2 -2
- package/docs/API-reference/components/search/x-components.results-list.md +17 -13
- package/docs/API-reference/components/search/x-components.sort-dropdown.md +13 -9
- package/docs/API-reference/components/search/x-components.sort-list.md +7 -7
- package/docs/API-reference/components/search/x-components.sort-picker-list.md +10 -10
- package/docs/API-reference/components/search/x-components.spellcheck-button.md +2 -2
- package/docs/API-reference/components/search/x-components.spellcheck.md +5 -3
- package/docs/API-reference/components/search-box/x-components.clear-search-input.md +15 -7
- package/docs/API-reference/components/search-box/x-components.search-button.md +11 -11
- package/docs/API-reference/components/search-box/x-components.search-input-placeholder.md +22 -16
- package/docs/API-reference/components/search-box/x-components.search-input.md +19 -10
- package/docs/API-reference/components/semantic-queries/x-components.semantic-queries.md +17 -11
- package/docs/API-reference/components/semantic-queries/x-components.semantic-query.md +12 -9
- package/docs/API-reference/components/tagging/x-components.tagging.md +8 -4
- package/docs/API-reference/components/url/x-components.url-handler.md +2 -2
- package/js/store/utils/store-emitters.utils.js.map +1 -1
- package/js/x-bus/x-bus.js.map +1 -1
- package/js/x-bus/x-priority-queue/x-priority-queue.js.map +1 -1
- package/js/x-modules/facets/entities/types.js.map +1 -1
- package/package.json +6 -6
- package/types/store/utils/store-emitters.utils.d.ts.map +1 -1
- package/types/wiring/events.types.d.ts.map +1 -1
- package/types/x-bus/x-bus.d.ts.map +1 -1
- package/types/x-bus/x-priority-queue/x-priority-queue.d.ts.map +1 -1
- package/types/x-modules/facets/entities/types.d.ts.map +1 -1
- package/types/x-modules/facets/store/types.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/types.d.ts.map +1 -1
- package/types/x-modules/identifier-results/store/types.d.ts.map +1 -1
- package/types/x-modules/next-queries/store/types.d.ts.map +1 -1
- package/types/x-modules/popular-searches/store/types.d.ts.map +1 -1
- package/types/x-modules/query-suggestions/store/types.d.ts.map +1 -1
- package/types/x-modules/recommendations/store/types.d.ts.map +1 -1
- package/types/x-modules/related-tags/store/types.d.ts.map +1 -1
- package/types/x-modules/search/store/types.d.ts.map +1 -1
- package/types/x-modules/semantic-queries/store/types.d.ts.map +1 -1
|
@@ -40,9 +40,9 @@ Simple panel that receives its open state via prop, which is responsible for ren
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup>
|
|
43
|
-
import { BaseTogglePanel } from
|
|
44
|
-
import { CollapseFromTop } from
|
|
45
|
-
const animation = CollapseFromTop
|
|
46
|
-
const filters = [{ label:
|
|
43
|
+
import { BaseTogglePanel } from "@empathyco/x-components";
|
|
44
|
+
import { CollapseFromTop } from "@empathyco/x-components/animations";
|
|
45
|
+
const animation = CollapseFromTop;
|
|
46
|
+
const filters = [{ label: "Color" }, { label: "Size" }, { label: "Brand" }];
|
|
47
47
|
</script>
|
|
48
48
|
```
|
|
@@ -46,12 +46,12 @@ This component is a button to emit `UserClickedResultAddToCart` when clicked by
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script setup>
|
|
49
|
-
import { BaseResultAddToCart } from
|
|
49
|
+
import { BaseResultAddToCart } from "@empathyco/x-components";
|
|
50
50
|
const result = {
|
|
51
|
-
id:
|
|
52
|
-
name:
|
|
51
|
+
id: "123",
|
|
52
|
+
name: "Product name",
|
|
53
53
|
price: 19.99,
|
|
54
54
|
// ...other result properties
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
</script>
|
|
57
57
|
```
|
package/docs/API-reference/components/common/result/x-components.base-result-current-price.md
CHANGED
|
@@ -35,11 +35,11 @@ the `BaseCurrency` component use an injected one.
|
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup>
|
|
38
|
-
import { BaseResultCurrentPrice } from
|
|
38
|
+
import { BaseResultCurrentPrice } from "@empathyco/x-components";
|
|
39
39
|
const result = {
|
|
40
40
|
price: { value: 123.45, hasDiscount: false },
|
|
41
41
|
// ...other result properties
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
</script>
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -48,15 +48,17 @@ const result = {
|
|
|
48
48
|
```vue
|
|
49
49
|
<template>
|
|
50
50
|
<BaseResultCurrentPrice :result="result">
|
|
51
|
-
<span class="custom-base-result-current-price">{{
|
|
51
|
+
<span class="custom-base-result-current-price">{{
|
|
52
|
+
result.price.value
|
|
53
|
+
}}</span>
|
|
52
54
|
</BaseResultCurrentPrice>
|
|
53
55
|
</template>
|
|
54
56
|
|
|
55
57
|
<script setup>
|
|
56
|
-
import { BaseResultCurrentPrice } from
|
|
58
|
+
import { BaseResultCurrentPrice } from "@empathyco/x-components";
|
|
57
59
|
const result = {
|
|
58
60
|
price: { value: 123.45, hasDiscount: false },
|
|
59
61
|
// ...other result properties
|
|
60
|
-
}
|
|
62
|
+
};
|
|
61
63
|
</script>
|
|
62
64
|
```
|
|
@@ -39,11 +39,11 @@ The result prop is required. It will render a `<img/>` with the result image:
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import { BaseResultImage } from
|
|
42
|
+
import { BaseResultImage } from "@empathyco/x-components";
|
|
43
43
|
const result = {
|
|
44
|
-
name:
|
|
45
|
-
images: [
|
|
46
|
-
}
|
|
44
|
+
name: "Jacket",
|
|
45
|
+
images: ["https://some-image-url.com/image1.jpg"],
|
|
46
|
+
};
|
|
47
47
|
</script>
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -57,11 +57,14 @@ If a result has multiple images, it can show the next one on hover.
|
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<script setup>
|
|
60
|
-
import { BaseResultImage } from
|
|
60
|
+
import { BaseResultImage } from "@empathyco/x-components";
|
|
61
61
|
const result = {
|
|
62
|
-
name:
|
|
63
|
-
images: [
|
|
64
|
-
|
|
62
|
+
name: "Jacket",
|
|
63
|
+
images: [
|
|
64
|
+
"https://some-image-url.com/image1.jpg",
|
|
65
|
+
"https://some-image-url.com/image2.jpg",
|
|
66
|
+
],
|
|
67
|
+
};
|
|
65
68
|
</script>
|
|
66
69
|
```
|
|
67
70
|
|
|
@@ -87,11 +90,11 @@ displayed while the real one is loaded.
|
|
|
87
90
|
</template>
|
|
88
91
|
|
|
89
92
|
<script setup>
|
|
90
|
-
import { BaseResultImage } from
|
|
93
|
+
import { BaseResultImage } from "@empathyco/x-components";
|
|
91
94
|
const result = {
|
|
92
|
-
name:
|
|
93
|
-
images: [
|
|
94
|
-
}
|
|
95
|
+
name: "Jacket",
|
|
96
|
+
images: ["https://some-image-url.com/image1.jpg"],
|
|
97
|
+
};
|
|
95
98
|
</script>
|
|
96
99
|
```
|
|
97
100
|
|
|
@@ -117,13 +120,16 @@ The `hoverAnimation` is used to transition between the image and the hover image
|
|
|
117
120
|
</template>
|
|
118
121
|
|
|
119
122
|
<script setup>
|
|
120
|
-
import { BaseResultImage } from
|
|
121
|
-
import { CrossFade, CollapseHeight } from
|
|
122
|
-
const loadAnimation = CrossFade
|
|
123
|
-
const hoverAnimation = CollapseHeight
|
|
123
|
+
import { BaseResultImage } from "@empathyco/x-components";
|
|
124
|
+
import { CrossFade, CollapseHeight } from "@empathyco/x-components/animations";
|
|
125
|
+
const loadAnimation = CrossFade;
|
|
126
|
+
const hoverAnimation = CollapseHeight;
|
|
124
127
|
const result = {
|
|
125
|
-
name:
|
|
126
|
-
images: [
|
|
127
|
-
|
|
128
|
+
name: "Jacket",
|
|
129
|
+
images: [
|
|
130
|
+
"https://some-image-url.com/image1.jpg",
|
|
131
|
+
"https://some-image-url.com/image2.jpg",
|
|
132
|
+
],
|
|
133
|
+
};
|
|
128
134
|
</script>
|
|
129
135
|
```
|
|
@@ -49,11 +49,11 @@ The result prop is required. It will render an anchor element with the href to t
|
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
51
|
<script setup>
|
|
52
|
-
import { BaseResultLink } from
|
|
52
|
+
import { BaseResultLink } from "@empathyco/x-components";
|
|
53
53
|
const result = {
|
|
54
|
-
name:
|
|
55
|
-
url:
|
|
56
|
-
images: [
|
|
57
|
-
}
|
|
54
|
+
name: "Jacket",
|
|
55
|
+
url: "https://shop.com/jacket",
|
|
56
|
+
images: ["https://shop.com/jacket.jpg"],
|
|
57
|
+
};
|
|
58
58
|
</script>
|
|
59
59
|
```
|
package/docs/API-reference/components/common/result/x-components.base-result-previous-price.md
CHANGED
|
@@ -34,11 +34,11 @@ This component shows the previous price formatted if it has discount. The compon
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import { BaseResultPreviousPrice } from
|
|
37
|
+
import { BaseResultPreviousPrice } from "@empathyco/x-components";
|
|
38
38
|
const result = {
|
|
39
39
|
price: { originalValue: 199.99, hasDiscount: true },
|
|
40
40
|
// ...other result properties
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
42
|
</script>
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -47,15 +47,17 @@ const result = {
|
|
|
47
47
|
```vue
|
|
48
48
|
<template>
|
|
49
49
|
<BaseResultPreviousPrice :result="result">
|
|
50
|
-
<span class="custom-base-result-previous-price">{{
|
|
50
|
+
<span class="custom-base-result-previous-price">{{
|
|
51
|
+
result.price.originalValue
|
|
52
|
+
}}</span>
|
|
51
53
|
</BaseResultPreviousPrice>
|
|
52
54
|
</template>
|
|
53
55
|
|
|
54
56
|
<script setup>
|
|
55
|
-
import { BaseResultPreviousPrice } from
|
|
57
|
+
import { BaseResultPreviousPrice } from "@empathyco/x-components";
|
|
56
58
|
const result = {
|
|
57
59
|
price: { originalValue: 199.99, hasDiscount: true },
|
|
58
60
|
// ...other result properties
|
|
59
|
-
}
|
|
61
|
+
};
|
|
60
62
|
</script>
|
|
61
63
|
```
|
|
@@ -39,12 +39,12 @@ This component emits the following events:
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import { BaseResultRating } from
|
|
42
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
43
43
|
const result = {
|
|
44
44
|
id: 1,
|
|
45
|
-
name:
|
|
45
|
+
name: "Result with rating",
|
|
46
46
|
rating: { value: 3 },
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
</script>
|
|
49
49
|
```
|
|
50
50
|
|
|
@@ -60,12 +60,12 @@ In this example, the result rating has been configured to 6 as maximum value usi
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script setup>
|
|
63
|
-
import { BaseResultRating } from
|
|
63
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
64
64
|
const result = {
|
|
65
65
|
id: 1,
|
|
66
|
-
name:
|
|
66
|
+
name: "Result with rating",
|
|
67
67
|
rating: { value: 3 },
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
</script>
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -79,12 +79,12 @@ In this example, the result rating has been configured with a link to redirect w
|
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<script setup>
|
|
82
|
-
import { BaseResultRating } from
|
|
82
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
83
83
|
const result = {
|
|
84
84
|
id: 1,
|
|
85
|
-
name:
|
|
85
|
+
name: "Result with rating",
|
|
86
86
|
rating: { value: 3 },
|
|
87
|
-
}
|
|
87
|
+
};
|
|
88
88
|
</script>
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -94,18 +94,21 @@ In this example, a message has been added to be shown when the result rating is
|
|
|
94
94
|
|
|
95
95
|
```vue
|
|
96
96
|
<template>
|
|
97
|
-
<BaseResultRating
|
|
97
|
+
<BaseResultRating
|
|
98
|
+
:result="result"
|
|
99
|
+
@UserClickedAResultRating="logUserClickedRating"
|
|
100
|
+
/>
|
|
98
101
|
</template>
|
|
99
102
|
|
|
100
103
|
<script setup>
|
|
101
|
-
import { BaseResultRating } from
|
|
104
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
102
105
|
const result = {
|
|
103
106
|
id: 1,
|
|
104
|
-
name:
|
|
107
|
+
name: "Result with rating",
|
|
105
108
|
rating: { value: 3 },
|
|
106
|
-
}
|
|
109
|
+
};
|
|
107
110
|
function logUserClickedRating(result) {
|
|
108
|
-
console.log(
|
|
111
|
+
console.log("User clickedRating of this result:", result);
|
|
109
112
|
}
|
|
110
113
|
</script>
|
|
111
114
|
```
|
|
@@ -126,12 +129,12 @@ states (filled and empty), must have the same size make component work properly.
|
|
|
126
129
|
</template>
|
|
127
130
|
|
|
128
131
|
<script setup>
|
|
129
|
-
import { BaseResultRating } from
|
|
132
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
130
133
|
const result = {
|
|
131
134
|
id: 1,
|
|
132
|
-
name:
|
|
135
|
+
name: "Result with rating",
|
|
133
136
|
rating: { value: 3 },
|
|
134
|
-
}
|
|
137
|
+
};
|
|
135
138
|
</script>
|
|
136
139
|
```
|
|
137
140
|
|
|
@@ -149,12 +152,12 @@ link and event behaviour:
|
|
|
149
152
|
</template>
|
|
150
153
|
|
|
151
154
|
<script setup>
|
|
152
|
-
import { BaseResultRating } from
|
|
155
|
+
import { BaseResultRating } from "@empathyco/x-components";
|
|
153
156
|
const result = {
|
|
154
157
|
id: 1,
|
|
155
|
-
name:
|
|
158
|
+
name: "Result with rating",
|
|
156
159
|
rating: { value: 3 },
|
|
157
|
-
}
|
|
160
|
+
};
|
|
158
161
|
</script>
|
|
159
162
|
```
|
|
160
163
|
|
|
@@ -171,11 +174,11 @@ It is also possible to reuse our rating component:
|
|
|
171
174
|
</template>
|
|
172
175
|
|
|
173
176
|
<script setup>
|
|
174
|
-
import { BaseResultRating, BaseRating } from
|
|
177
|
+
import { BaseResultRating, BaseRating } from "@empathyco/x-components";
|
|
175
178
|
const result = {
|
|
176
179
|
id: 1,
|
|
177
|
-
name:
|
|
180
|
+
name: "Result with rating",
|
|
178
181
|
rating: { value: 3 },
|
|
179
|
-
}
|
|
182
|
+
};
|
|
180
183
|
</script>
|
|
181
184
|
```
|
|
@@ -53,28 +53,31 @@ rendered.
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup>
|
|
56
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
ResultVariantsProvider,
|
|
58
|
+
ResultVariantSelector,
|
|
59
|
+
} from "@empathyco/x-components";
|
|
57
60
|
const result = {
|
|
58
|
-
id:
|
|
59
|
-
modelName:
|
|
60
|
-
type:
|
|
61
|
+
id: "jacket",
|
|
62
|
+
modelName: "Result",
|
|
63
|
+
type: "Product",
|
|
61
64
|
isWishlisted: false,
|
|
62
|
-
identifier: { value:
|
|
65
|
+
identifier: { value: "jacket" },
|
|
63
66
|
images: [],
|
|
64
|
-
name:
|
|
67
|
+
name: "jacket",
|
|
65
68
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
66
|
-
url:
|
|
69
|
+
url: "/products/jacket",
|
|
67
70
|
variants: [
|
|
68
71
|
{
|
|
69
|
-
name:
|
|
70
|
-
variants: [{ name:
|
|
72
|
+
name: "red",
|
|
73
|
+
variants: [{ name: "red XL" }, { name: "red L" }],
|
|
71
74
|
},
|
|
72
75
|
{
|
|
73
|
-
name:
|
|
74
|
-
variants: [{ name:
|
|
76
|
+
name: "blue",
|
|
77
|
+
variants: [{ name: "blue S" }, { name: "blue M" }, { name: "blue L" }],
|
|
75
78
|
},
|
|
76
79
|
],
|
|
77
|
-
}
|
|
80
|
+
};
|
|
78
81
|
</script>
|
|
79
82
|
```
|
|
80
83
|
|
|
@@ -85,9 +88,14 @@ You can customize the list using the default slot:
|
|
|
85
88
|
```vue
|
|
86
89
|
<template>
|
|
87
90
|
<ResultVariantsProvider :result="result">
|
|
88
|
-
<ResultVariantSelector
|
|
91
|
+
<ResultVariantSelector
|
|
92
|
+
:level="0"
|
|
93
|
+
#default="{ variants, selectedVariant, selectVariant }"
|
|
94
|
+
>
|
|
89
95
|
<div>
|
|
90
|
-
<p v-if="selectedVariant">
|
|
96
|
+
<p v-if="selectedVariant">
|
|
97
|
+
Selected variant: {{ selectedVariant.name }}
|
|
98
|
+
</p>
|
|
91
99
|
<ul class="x-flex">
|
|
92
100
|
<li v-for="(variant, index) in variants" :key="index">
|
|
93
101
|
<button @click="selectVariant(variant)">{{ variant.name }}</button>
|
|
@@ -99,19 +107,22 @@ You can customize the list using the default slot:
|
|
|
99
107
|
</template>
|
|
100
108
|
|
|
101
109
|
<script setup>
|
|
102
|
-
import {
|
|
110
|
+
import {
|
|
111
|
+
ResultVariantsProvider,
|
|
112
|
+
ResultVariantSelector,
|
|
113
|
+
} from "@empathyco/x-components";
|
|
103
114
|
const result = {
|
|
104
|
-
id:
|
|
105
|
-
modelName:
|
|
106
|
-
type:
|
|
115
|
+
id: "jacket",
|
|
116
|
+
modelName: "Result",
|
|
117
|
+
type: "Product",
|
|
107
118
|
isWishlisted: false,
|
|
108
|
-
identifier: { value:
|
|
119
|
+
identifier: { value: "jacket" },
|
|
109
120
|
images: [],
|
|
110
|
-
name:
|
|
121
|
+
name: "jacket",
|
|
111
122
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
112
|
-
url:
|
|
113
|
-
variants: [{ name:
|
|
114
|
-
}
|
|
123
|
+
url: "/products/jacket",
|
|
124
|
+
variants: [{ name: "red" }, { name: "blue" }],
|
|
125
|
+
};
|
|
115
126
|
</script>
|
|
116
127
|
```
|
|
117
128
|
|
|
@@ -122,7 +133,10 @@ You can customize the variant item using the `variant` slot:
|
|
|
122
133
|
```vue
|
|
123
134
|
<template>
|
|
124
135
|
<ResultVariantsProvider :result="result">
|
|
125
|
-
<ResultVariantSelector
|
|
136
|
+
<ResultVariantSelector
|
|
137
|
+
:level="0"
|
|
138
|
+
#variant="{ variant, isSelected, selectVariant }"
|
|
139
|
+
>
|
|
126
140
|
<div>
|
|
127
141
|
<button @click="selectVariant">
|
|
128
142
|
{{ variant.name }}
|
|
@@ -134,19 +148,22 @@ You can customize the variant item using the `variant` slot:
|
|
|
134
148
|
</template>
|
|
135
149
|
|
|
136
150
|
<script setup>
|
|
137
|
-
import {
|
|
151
|
+
import {
|
|
152
|
+
ResultVariantsProvider,
|
|
153
|
+
ResultVariantSelector,
|
|
154
|
+
} from "@empathyco/x-components";
|
|
138
155
|
const result = {
|
|
139
|
-
id:
|
|
140
|
-
modelName:
|
|
141
|
-
type:
|
|
156
|
+
id: "jacket",
|
|
157
|
+
modelName: "Result",
|
|
158
|
+
type: "Product",
|
|
142
159
|
isWishlisted: false,
|
|
143
|
-
identifier: { value:
|
|
160
|
+
identifier: { value: "jacket" },
|
|
144
161
|
images: [],
|
|
145
|
-
name:
|
|
162
|
+
name: "jacket",
|
|
146
163
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
147
|
-
url:
|
|
148
|
-
variants: [{ name:
|
|
149
|
-
}
|
|
164
|
+
url: "/products/jacket",
|
|
165
|
+
variants: [{ name: "red" }, { name: "blue" }],
|
|
166
|
+
};
|
|
150
167
|
</script>
|
|
151
168
|
```
|
|
152
169
|
|
|
@@ -167,18 +184,21 @@ You can customize the content of the default variant button using the `variant-c
|
|
|
167
184
|
</template>
|
|
168
185
|
|
|
169
186
|
<script setup>
|
|
170
|
-
import {
|
|
187
|
+
import {
|
|
188
|
+
ResultVariantsProvider,
|
|
189
|
+
ResultVariantSelector,
|
|
190
|
+
} from "@empathyco/x-components";
|
|
171
191
|
const result = {
|
|
172
|
-
id:
|
|
173
|
-
modelName:
|
|
174
|
-
type:
|
|
192
|
+
id: "jacket",
|
|
193
|
+
modelName: "Result",
|
|
194
|
+
type: "Product",
|
|
175
195
|
isWishlisted: false,
|
|
176
|
-
identifier: { value:
|
|
196
|
+
identifier: { value: "jacket" },
|
|
177
197
|
images: [],
|
|
178
|
-
name:
|
|
198
|
+
name: "jacket",
|
|
179
199
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
180
|
-
url:
|
|
181
|
-
variants: [{ name:
|
|
182
|
-
}
|
|
200
|
+
url: "/products/jacket",
|
|
201
|
+
variants: [{ name: "red" }, { name: "blue" }],
|
|
202
|
+
};
|
|
183
203
|
</script>
|
|
184
204
|
```
|
package/docs/API-reference/components/common/result/x-components.result-variants-provider.md
CHANGED
|
@@ -52,28 +52,31 @@ By default, the first variants of all the levels will be selected when the compo
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
ResultVariantsProvider,
|
|
57
|
+
ResultVariantSelector,
|
|
58
|
+
} from "@empathyco/x-components";
|
|
56
59
|
const result = {
|
|
57
|
-
id:
|
|
58
|
-
modelName:
|
|
59
|
-
type:
|
|
60
|
+
id: "jacket",
|
|
61
|
+
modelName: "Result",
|
|
62
|
+
type: "Product",
|
|
60
63
|
isWishlisted: false,
|
|
61
|
-
identifier: { value:
|
|
64
|
+
identifier: { value: "jacket" },
|
|
62
65
|
images: [],
|
|
63
|
-
name:
|
|
66
|
+
name: "jacket",
|
|
64
67
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
65
|
-
url:
|
|
68
|
+
url: "/products/jacket",
|
|
66
69
|
variants: [
|
|
67
70
|
{
|
|
68
|
-
name:
|
|
69
|
-
variants: [{ name:
|
|
71
|
+
name: "red",
|
|
72
|
+
variants: [{ name: "red XL" }, { name: "red L" }],
|
|
70
73
|
},
|
|
71
74
|
{
|
|
72
|
-
name:
|
|
73
|
-
variants: [{ name:
|
|
75
|
+
name: "blue",
|
|
76
|
+
variants: [{ name: "blue S" }, { name: "blue M" }, { name: "blue L" }],
|
|
74
77
|
},
|
|
75
78
|
],
|
|
76
|
-
}
|
|
79
|
+
};
|
|
77
80
|
</script>
|
|
78
81
|
```
|
|
79
82
|
|
|
@@ -85,7 +88,11 @@ first variant of the first level, and so on.
|
|
|
85
88
|
|
|
86
89
|
```vue
|
|
87
90
|
<template>
|
|
88
|
-
<ResultVariantsProvider
|
|
91
|
+
<ResultVariantsProvider
|
|
92
|
+
:result="result"
|
|
93
|
+
:autoSelectDepth="0"
|
|
94
|
+
#default="{ result }"
|
|
95
|
+
>
|
|
89
96
|
<p>Result name: {{ result.name }}</p>
|
|
90
97
|
|
|
91
98
|
<h1>Select color</h1>
|
|
@@ -101,27 +108,30 @@ first variant of the first level, and so on.
|
|
|
101
108
|
</template>
|
|
102
109
|
|
|
103
110
|
<script setup>
|
|
104
|
-
import {
|
|
111
|
+
import {
|
|
112
|
+
ResultVariantsProvider,
|
|
113
|
+
ResultVariantSelector,
|
|
114
|
+
} from "@empathyco/x-components";
|
|
105
115
|
const result = {
|
|
106
|
-
id:
|
|
107
|
-
modelName:
|
|
108
|
-
type:
|
|
116
|
+
id: "jacket",
|
|
117
|
+
modelName: "Result",
|
|
118
|
+
type: "Product",
|
|
109
119
|
isWishlisted: false,
|
|
110
|
-
identifier: { value:
|
|
120
|
+
identifier: { value: "jacket" },
|
|
111
121
|
images: [],
|
|
112
|
-
name:
|
|
122
|
+
name: "jacket",
|
|
113
123
|
price: { hasDiscount: false, originalValue: 10, value: 10 },
|
|
114
|
-
url:
|
|
124
|
+
url: "/products/jacket",
|
|
115
125
|
variants: [
|
|
116
126
|
{
|
|
117
|
-
name:
|
|
118
|
-
variants: [{ name:
|
|
127
|
+
name: "red",
|
|
128
|
+
variants: [{ name: "red XL" }, { name: "red L" }],
|
|
119
129
|
},
|
|
120
130
|
{
|
|
121
|
-
name:
|
|
122
|
-
variants: [{ name:
|
|
131
|
+
name: "blue",
|
|
132
|
+
variants: [{ name: "blue S" }, { name: "blue M" }, { name: "blue L" }],
|
|
123
133
|
},
|
|
124
134
|
],
|
|
125
|
-
}
|
|
135
|
+
};
|
|
126
136
|
</script>
|
|
127
137
|
```
|
|
@@ -61,21 +61,21 @@ for scroll position, direction, when reaching the start or end, and when about r
|
|
|
61
61
|
</template>
|
|
62
62
|
|
|
63
63
|
<script setup>
|
|
64
|
-
import { BaseScroll } from
|
|
64
|
+
import { BaseScroll } from "@empathyco/x-components";
|
|
65
65
|
function onScroll(position) {
|
|
66
|
-
console.log(
|
|
66
|
+
console.log("scroll", position);
|
|
67
67
|
}
|
|
68
68
|
function onDirectionChange(direction) {
|
|
69
|
-
console.log(
|
|
69
|
+
console.log("scroll:direction-change", direction);
|
|
70
70
|
}
|
|
71
71
|
function onAtStart() {
|
|
72
|
-
console.log(
|
|
72
|
+
console.log("scroll:at-start");
|
|
73
73
|
}
|
|
74
74
|
function onAlmostAtEnd(distance) {
|
|
75
|
-
console.log(
|
|
75
|
+
console.log("scroll:almost-at-end", distance);
|
|
76
76
|
}
|
|
77
77
|
function onAtEnd() {
|
|
78
|
-
console.log(
|
|
78
|
+
console.log("scroll:at-end");
|
|
79
79
|
}
|
|
80
80
|
</script>
|
|
81
81
|
```
|
|
@@ -95,9 +95,9 @@ Set `resetOnChange` to `false` to prevent scroll reset on query change (default
|
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
97
|
<script setup>
|
|
98
|
-
import { BaseScroll } from
|
|
98
|
+
import { BaseScroll } from "@empathyco/x-components";
|
|
99
99
|
function onScroll(position) {
|
|
100
|
-
console.log(
|
|
100
|
+
console.log("scroll", position);
|
|
101
101
|
}
|
|
102
102
|
</script>
|
|
103
103
|
```
|
|
@@ -117,10 +117,10 @@ Configure which events reset the scroll position using the `resetOn` prop.
|
|
|
117
117
|
</template>
|
|
118
118
|
|
|
119
119
|
<script setup>
|
|
120
|
-
import { BaseScroll } from
|
|
121
|
-
const resetScrollEvents = [
|
|
120
|
+
import { BaseScroll } from "@empathyco/x-components";
|
|
121
|
+
const resetScrollEvents = ["UserAcceptedAQuery"];
|
|
122
122
|
function onScroll(position) {
|
|
123
|
-
console.log(
|
|
123
|
+
console.log("scroll", position);
|
|
124
124
|
}
|
|
125
125
|
</script>
|
|
126
126
|
```
|