@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
|
@@ -58,29 +58,29 @@ If the suggestion contains a filter, it is displayed next to the suggestion.
|
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
60
|
<script setup>
|
|
61
|
-
import { BaseSuggestion } from
|
|
62
|
-
const query =
|
|
61
|
+
import { BaseSuggestion } from "@empathyco/x-components";
|
|
62
|
+
const query = "st";
|
|
63
63
|
const suggestion = {
|
|
64
|
-
modelName:
|
|
65
|
-
query:
|
|
64
|
+
modelName: "QuerySuggestion",
|
|
65
|
+
query: "steak",
|
|
66
66
|
facets: [
|
|
67
67
|
{
|
|
68
|
-
modelName:
|
|
69
|
-
id:
|
|
70
|
-
label:
|
|
68
|
+
modelName: "SimpleFacet",
|
|
69
|
+
id: "category",
|
|
70
|
+
label: "Category",
|
|
71
71
|
filters: [
|
|
72
72
|
{
|
|
73
|
-
id:
|
|
74
|
-
modelName:
|
|
75
|
-
facetId:
|
|
76
|
-
label:
|
|
73
|
+
id: "category:groceries",
|
|
74
|
+
modelName: "SimpleFilter",
|
|
75
|
+
facetId: "category-facet",
|
|
76
|
+
label: "Groceries",
|
|
77
77
|
selected: false,
|
|
78
78
|
totalResults: 10,
|
|
79
79
|
},
|
|
80
80
|
],
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
|
-
}
|
|
83
|
+
};
|
|
84
84
|
</script>
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -100,12 +100,12 @@ You can make this component render any content you want by using the `default` s
|
|
|
100
100
|
</template>
|
|
101
101
|
|
|
102
102
|
<script setup>
|
|
103
|
-
import { BaseSuggestion } from
|
|
104
|
-
const query =
|
|
103
|
+
import { BaseSuggestion } from "@empathyco/x-components";
|
|
104
|
+
const query = "st";
|
|
105
105
|
const suggestion = {
|
|
106
|
-
modelName:
|
|
107
|
-
query:
|
|
108
|
-
}
|
|
106
|
+
modelName: "QuerySuggestion",
|
|
107
|
+
query: "steak",
|
|
108
|
+
};
|
|
109
109
|
</script>
|
|
110
110
|
```
|
|
111
111
|
|
|
@@ -123,14 +123,14 @@ You can emit additional custom events when a suggestion is selected by passing t
|
|
|
123
123
|
</template>
|
|
124
124
|
|
|
125
125
|
<script setup>
|
|
126
|
-
import { BaseSuggestion } from
|
|
127
|
-
const query =
|
|
126
|
+
import { BaseSuggestion } from "@empathyco/x-components";
|
|
127
|
+
const query = "st";
|
|
128
128
|
const suggestion = {
|
|
129
|
-
modelName:
|
|
130
|
-
query:
|
|
131
|
-
}
|
|
129
|
+
modelName: "QuerySuggestion",
|
|
130
|
+
query: "steak",
|
|
131
|
+
};
|
|
132
132
|
const suggestionSelectedEvents = {
|
|
133
|
-
CustomSuggestionEvent: { custom:
|
|
134
|
-
}
|
|
133
|
+
CustomSuggestionEvent: { custom: "payload" },
|
|
134
|
+
};
|
|
135
135
|
</script>
|
|
136
136
|
```
|
|
@@ -46,32 +46,32 @@ when clicked.
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script setup>
|
|
49
|
-
import { ref } from
|
|
50
|
-
import { BaseSuggestions } from
|
|
51
|
-
import { use$x } from
|
|
49
|
+
import { ref } from "vue";
|
|
50
|
+
import { BaseSuggestions } from "@empathyco/x-components";
|
|
51
|
+
import { use$x } from "../../composables";
|
|
52
52
|
|
|
53
|
-
const x = use$x()
|
|
53
|
+
const x = use$x();
|
|
54
54
|
const suggestions = ref([
|
|
55
55
|
{
|
|
56
|
-
query:
|
|
56
|
+
query: "Chips",
|
|
57
57
|
facets: [],
|
|
58
|
-
key:
|
|
58
|
+
key: "chips",
|
|
59
59
|
totalResults: 10,
|
|
60
60
|
results: [],
|
|
61
|
-
modelName:
|
|
61
|
+
modelName: "PopularSearch",
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
query:
|
|
64
|
+
query: "Puzzle",
|
|
65
65
|
facets: [],
|
|
66
|
-
key:
|
|
66
|
+
key: "puzzle",
|
|
67
67
|
totalResults: 5,
|
|
68
68
|
results: [],
|
|
69
|
-
modelName:
|
|
69
|
+
modelName: "PopularSearch",
|
|
70
70
|
},
|
|
71
|
-
])
|
|
71
|
+
]);
|
|
72
72
|
function emitSuggestionSelected(event, suggestion) {
|
|
73
|
-
x.emit(
|
|
74
|
-
x.emit(
|
|
73
|
+
x.emit("UserAcceptedAQuery", suggestion.query, { target: event.target });
|
|
74
|
+
x.emit("UserSelectedAQuerySuggestion", suggestion, { target: event.target });
|
|
75
75
|
}
|
|
76
76
|
</script>
|
|
77
77
|
```
|
|
@@ -87,41 +87,41 @@ another toy in the input field to try it out!_
|
|
|
87
87
|
</template>
|
|
88
88
|
|
|
89
89
|
<script setup>
|
|
90
|
-
import { BaseSuggestions } from
|
|
90
|
+
import { BaseSuggestions } from "@empathyco/x-components";
|
|
91
91
|
const suggestions = [
|
|
92
92
|
{
|
|
93
93
|
facets: [],
|
|
94
|
-
key:
|
|
95
|
-
query:
|
|
94
|
+
key: "chips",
|
|
95
|
+
query: "Chips",
|
|
96
96
|
totalResults: 10,
|
|
97
97
|
results: [],
|
|
98
|
-
modelName:
|
|
98
|
+
modelName: "PopularSearch",
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
facets: [],
|
|
102
|
-
key:
|
|
103
|
-
query:
|
|
102
|
+
key: "puzzle",
|
|
103
|
+
query: "Puzzle",
|
|
104
104
|
totalResults: 5,
|
|
105
105
|
results: [],
|
|
106
|
-
modelName:
|
|
106
|
+
modelName: "PopularSearch",
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
facets: [],
|
|
110
|
-
key:
|
|
111
|
-
query:
|
|
110
|
+
key: "lego",
|
|
111
|
+
query: "Lego",
|
|
112
112
|
totalResults: 8,
|
|
113
113
|
results: [],
|
|
114
|
-
modelName:
|
|
114
|
+
modelName: "PopularSearch",
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
facets: [],
|
|
118
|
-
key:
|
|
119
|
-
query:
|
|
118
|
+
key: "car",
|
|
119
|
+
query: "Car",
|
|
120
120
|
totalResults: 3,
|
|
121
121
|
results: [],
|
|
122
|
-
modelName:
|
|
122
|
+
modelName: "PopularSearch",
|
|
123
123
|
},
|
|
124
|
-
]
|
|
124
|
+
];
|
|
125
125
|
</script>
|
|
126
126
|
```
|
|
127
127
|
|
|
@@ -141,33 +141,33 @@ This will render:
|
|
|
141
141
|
</template>
|
|
142
142
|
|
|
143
143
|
<script setup>
|
|
144
|
-
import { BaseSuggestions } from
|
|
144
|
+
import { BaseSuggestions } from "@empathyco/x-components";
|
|
145
145
|
const suggestions = [
|
|
146
146
|
{
|
|
147
147
|
facets: [
|
|
148
148
|
{
|
|
149
|
-
id:
|
|
150
|
-
label:
|
|
151
|
-
modelName:
|
|
149
|
+
id: "exampleFacet",
|
|
150
|
+
label: "exampleFacet",
|
|
151
|
+
modelName: "SimpleFacet",
|
|
152
152
|
filters: [
|
|
153
153
|
{
|
|
154
|
-
facetId:
|
|
154
|
+
facetId: "exampleFacet",
|
|
155
155
|
id: '{!tag=exampleFacet}exampleFacet_60361120_64009600:"EXAMPLE"',
|
|
156
|
-
label:
|
|
156
|
+
label: "EXAMPLE",
|
|
157
157
|
selected: false,
|
|
158
158
|
totalResults: 10,
|
|
159
|
-
modelName:
|
|
159
|
+
modelName: "SimpleFilter",
|
|
160
160
|
},
|
|
161
161
|
],
|
|
162
162
|
},
|
|
163
163
|
],
|
|
164
|
-
key:
|
|
165
|
-
query:
|
|
164
|
+
key: "chips",
|
|
165
|
+
query: "Chips",
|
|
166
166
|
totalResults: 10,
|
|
167
167
|
results: [],
|
|
168
|
-
modelName:
|
|
168
|
+
modelName: "PopularSearch",
|
|
169
169
|
},
|
|
170
|
-
]
|
|
170
|
+
];
|
|
171
171
|
</script>
|
|
172
172
|
```
|
|
173
173
|
|
|
@@ -175,20 +175,23 @@ In this example, the `suggestionItemClass` prop can be used to add classes to th
|
|
|
175
175
|
|
|
176
176
|
```vue
|
|
177
177
|
<template>
|
|
178
|
-
<BaseSuggestions
|
|
178
|
+
<BaseSuggestions
|
|
179
|
+
:suggestions="suggestions"
|
|
180
|
+
suggestionItemClass="x-custom-class"
|
|
181
|
+
/>
|
|
179
182
|
</template>
|
|
180
183
|
|
|
181
184
|
<script setup>
|
|
182
|
-
import { BaseSuggestions } from
|
|
185
|
+
import { BaseSuggestions } from "@empathyco/x-components";
|
|
183
186
|
const suggestions = [
|
|
184
187
|
{
|
|
185
188
|
facets: [],
|
|
186
|
-
key:
|
|
187
|
-
query:
|
|
189
|
+
key: "chips",
|
|
190
|
+
query: "Chips",
|
|
188
191
|
totalResults: 10,
|
|
189
192
|
results: [],
|
|
190
|
-
modelName:
|
|
193
|
+
modelName: "PopularSearch",
|
|
191
194
|
},
|
|
192
|
-
]
|
|
195
|
+
];
|
|
193
196
|
</script>
|
|
194
197
|
```
|
|
@@ -31,13 +31,16 @@ Here you have a basic example of how the auto progress bar is rendered.
|
|
|
31
31
|
|
|
32
32
|
```vue live
|
|
33
33
|
<template>
|
|
34
|
-
<AutoProgressBar
|
|
34
|
+
<AutoProgressBar
|
|
35
|
+
:isLoading="isLoading"
|
|
36
|
+
:durationInSeconds="durationInSeconds"
|
|
37
|
+
/>
|
|
35
38
|
</template>
|
|
36
39
|
|
|
37
40
|
<script setup>
|
|
38
|
-
import { AutoProgressBar } from
|
|
39
|
-
const isLoading = true
|
|
40
|
-
const durationInSeconds = 100
|
|
41
|
+
import { AutoProgressBar } from "@empathyco/x-components";
|
|
42
|
+
const isLoading = true;
|
|
43
|
+
const durationInSeconds = 100;
|
|
41
44
|
</script>
|
|
42
45
|
```
|
|
43
46
|
|
|
@@ -52,6 +55,6 @@ to cancel the animation by sending the isLoading prop to false.
|
|
|
52
55
|
</template>
|
|
53
56
|
|
|
54
57
|
<script setup>
|
|
55
|
-
import { AutoProgressBar } from
|
|
58
|
+
import { AutoProgressBar } from "@empathyco/x-components";
|
|
56
59
|
</script>
|
|
57
60
|
```
|
|
@@ -50,7 +50,9 @@ provided, the `item` slot will be used for that.
|
|
|
50
50
|
```vue
|
|
51
51
|
<template>
|
|
52
52
|
<BaseDropdown v-model="value" :items="items">
|
|
53
|
-
<template #toggle="{ item, isOpen }"
|
|
53
|
+
<template #toggle="{ item, isOpen }"
|
|
54
|
+
>{{ item }} {{ isOpen ? "🔼" : "🔽" }}️</template
|
|
55
|
+
>
|
|
54
56
|
<template #item="{ item, isSelected, isHighlighted }">
|
|
55
57
|
<span v-if="isHighlighted">🟢</span>
|
|
56
58
|
<span v-if="isSelected">✅</span>
|
|
@@ -60,9 +62,9 @@ provided, the `item` slot will be used for that.
|
|
|
60
62
|
</template>
|
|
61
63
|
|
|
62
64
|
<script setup>
|
|
63
|
-
import { BaseDropdown } from
|
|
64
|
-
import { ref } from
|
|
65
|
-
const items = [
|
|
66
|
-
const value = ref(
|
|
65
|
+
import { BaseDropdown } from "@empathyco/x-components";
|
|
66
|
+
import { ref } from "vue";
|
|
67
|
+
const items = ["a", 2, { id: "3" }];
|
|
68
|
+
const value = ref("a");
|
|
67
69
|
</script>
|
|
68
70
|
```
|
|
@@ -38,8 +38,8 @@ with the value as payload on click:
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup>
|
|
41
|
-
import { BaseEventButton } from
|
|
42
|
-
const payload = { foo:
|
|
41
|
+
import { BaseEventButton } from "@empathyco/x-components";
|
|
42
|
+
const payload = { foo: "bar" };
|
|
43
43
|
</script>
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ If the event doesn't need payload then `undefined` must be passed:
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script setup>
|
|
54
|
-
import { BaseEventButton } from
|
|
54
|
+
import { BaseEventButton } from "@empathyco/x-components";
|
|
55
55
|
</script>
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -59,12 +59,14 @@ It can emit multiple events at the same time:
|
|
|
59
59
|
|
|
60
60
|
```vue
|
|
61
61
|
<template>
|
|
62
|
-
<BaseEventButton
|
|
62
|
+
<BaseEventButton
|
|
63
|
+
:events="{ myFirstEvent: payload1, mySecondEvent: payload2 }"
|
|
64
|
+
/>
|
|
63
65
|
</template>
|
|
64
66
|
|
|
65
67
|
<script setup>
|
|
66
|
-
import { BaseEventButton } from
|
|
67
|
-
const payload1 = { foo: 1 }
|
|
68
|
-
const payload2 = { bar: 2 }
|
|
68
|
+
import { BaseEventButton } from "@empathyco/x-components";
|
|
69
|
+
const payload1 = { foo: 1 };
|
|
70
|
+
const payload2 = { bar: 2 };
|
|
69
71
|
</script>
|
|
70
72
|
```
|
|
@@ -50,12 +50,12 @@ It renders a list of items using the default slot:
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup>
|
|
53
|
-
import { BaseGrid } from
|
|
53
|
+
import { BaseGrid } from "@empathyco/x-components";
|
|
54
54
|
const items = [
|
|
55
|
-
{ id: 1, name:
|
|
56
|
-
{ id: 2, name:
|
|
57
|
-
{ id: 3, name:
|
|
58
|
-
]
|
|
55
|
+
{ id: 1, name: "Item 1" },
|
|
56
|
+
{ id: 2, name: "Item 2" },
|
|
57
|
+
{ id: 3, name: "Item 3" },
|
|
58
|
+
];
|
|
59
59
|
</script>
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -73,12 +73,12 @@ It renders a grid with 12 columns instead of 6, which is the default value:
|
|
|
73
73
|
</template>
|
|
74
74
|
|
|
75
75
|
<script setup>
|
|
76
|
-
import { BaseGrid } from
|
|
76
|
+
import { BaseGrid } from "@empathyco/x-components";
|
|
77
77
|
const items = [
|
|
78
|
-
{ id: 1, name:
|
|
79
|
-
{ id: 2, name:
|
|
80
|
-
{ id: 3, name:
|
|
81
|
-
]
|
|
78
|
+
{ id: 1, name: "Item 1" },
|
|
79
|
+
{ id: 2, name: "Item 2" },
|
|
80
|
+
{ id: 3, name: "Item 3" },
|
|
81
|
+
];
|
|
82
82
|
</script>
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -118,15 +118,15 @@ and are rendered in different slots.
|
|
|
118
118
|
</template>
|
|
119
119
|
|
|
120
120
|
<script setup>
|
|
121
|
-
import { BaseGrid } from
|
|
122
|
-
import BaseResultLink from
|
|
123
|
-
const animation =
|
|
121
|
+
import { BaseGrid } from "@empathyco/x-components";
|
|
122
|
+
import BaseResultLink from "./BaseResultLink.vue";
|
|
123
|
+
const animation = "ul";
|
|
124
124
|
const items = [
|
|
125
|
-
{ id: 1, modelName:
|
|
126
|
-
{ id: 2, modelName:
|
|
127
|
-
{ id: 3, modelName:
|
|
128
|
-
{ id: 4, modelName:
|
|
129
|
-
]
|
|
125
|
+
{ id: 1, modelName: "banner", title: "Banner 1" },
|
|
126
|
+
{ id: 2, modelName: "next-queries", totalResults: 5 },
|
|
127
|
+
{ id: 3, modelName: "promoted", title: "Promo 1" },
|
|
128
|
+
{ id: 4, modelName: "result", name: "Result 1" },
|
|
129
|
+
];
|
|
130
130
|
</script>
|
|
131
131
|
```
|
|
132
132
|
|
|
@@ -145,11 +145,11 @@ items.
|
|
|
145
145
|
</template>
|
|
146
146
|
|
|
147
147
|
<script setup>
|
|
148
|
-
import { BaseGrid } from
|
|
148
|
+
import { BaseGrid } from "@empathyco/x-components";
|
|
149
149
|
const items = [
|
|
150
|
-
{ id: 1, name:
|
|
151
|
-
{ id: 2, name:
|
|
152
|
-
{ id: 3, name:
|
|
153
|
-
]
|
|
150
|
+
{ id: 1, name: "Item 1" },
|
|
151
|
+
{ id: 2, name: "Item 2" },
|
|
152
|
+
{ id: 3, name: "Item 3" },
|
|
153
|
+
];
|
|
154
154
|
</script>
|
|
155
155
|
```
|
|
@@ -48,8 +48,8 @@ reaching the navigation limit in any direction.
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<script setup>
|
|
51
|
-
import { BaseKeyboardNavigation } from
|
|
52
|
-
import QuerySuggestions from
|
|
51
|
+
import { BaseKeyboardNavigation } from "@empathyco/x-components";
|
|
52
|
+
import QuerySuggestions from "./QuerySuggestions.vue";
|
|
53
53
|
</script>
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -76,8 +76,8 @@ import QuerySuggestions from './QuerySuggestions.vue'
|
|
|
76
76
|
</template>
|
|
77
77
|
|
|
78
78
|
<script setup>
|
|
79
|
-
import { BaseKeyboardNavigation } from
|
|
80
|
-
import QuerySuggestions from
|
|
79
|
+
import { BaseKeyboardNavigation } from "@empathyco/x-components";
|
|
80
|
+
import QuerySuggestions from "./QuerySuggestions.vue";
|
|
81
81
|
</script>
|
|
82
82
|
```
|
|
83
83
|
|
|
@@ -102,7 +102,7 @@ import QuerySuggestions from './QuerySuggestions.vue'
|
|
|
102
102
|
</template>
|
|
103
103
|
|
|
104
104
|
<script setup>
|
|
105
|
-
import { BaseKeyboardNavigation } from
|
|
106
|
-
import QuerySuggestions from
|
|
105
|
+
import { BaseKeyboardNavigation } from "@empathyco/x-components";
|
|
106
|
+
import QuerySuggestions from "./QuerySuggestions.vue";
|
|
107
107
|
</script>
|
|
108
108
|
```
|
|
@@ -36,7 +36,7 @@ on this value.
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script setup>
|
|
39
|
-
import { BaseRating } from
|
|
39
|
+
import { BaseRating } from "@empathyco/x-components";
|
|
40
40
|
</script>
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -55,7 +55,7 @@ import { BaseRating } from '@empathyco/x-components'
|
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script setup>
|
|
58
|
-
import { BaseRating } from
|
|
59
|
-
import TestIcon from
|
|
58
|
+
import { BaseRating } from "@empathyco/x-components";
|
|
59
|
+
import TestIcon from "./TestIcon.vue";
|
|
60
60
|
</script>
|
|
61
61
|
```
|
|
@@ -50,9 +50,9 @@ It is required to send the value prop which holds the selected values.
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup>
|
|
53
|
-
import { BaseSlider } from
|
|
54
|
-
import { ref } from
|
|
55
|
-
const selectedRange = ref({ min: 0, max: 1000 })
|
|
53
|
+
import { BaseSlider } from "@empathyco/x-components";
|
|
54
|
+
import { ref } from "vue";
|
|
55
|
+
const selectedRange = ref({ min: 0, max: 1000 });
|
|
56
56
|
</script>
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -64,10 +64,10 @@ const selectedRange = ref({ min: 0, max: 1000 })
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<script setup>
|
|
67
|
-
import { BaseSlider } from
|
|
68
|
-
import { ref } from
|
|
69
|
-
const threshold = { min: 0, max: 1000 }
|
|
70
|
-
const selectedRange = ref({ ...threshold })
|
|
67
|
+
import { BaseSlider } from "@empathyco/x-components";
|
|
68
|
+
import { ref } from "vue";
|
|
69
|
+
const threshold = { min: 0, max: 1000 };
|
|
70
|
+
const selectedRange = ref({ ...threshold });
|
|
71
71
|
</script>
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -79,7 +79,11 @@ It is possible to override the default slot to customize the layout for the sele
|
|
|
79
79
|
|
|
80
80
|
```vue live
|
|
81
81
|
<template>
|
|
82
|
-
<BaseSlider
|
|
82
|
+
<BaseSlider
|
|
83
|
+
v-model="selectedRange"
|
|
84
|
+
:threshold="threshold"
|
|
85
|
+
v-slot="{ rangeSelected }"
|
|
86
|
+
>
|
|
83
87
|
<p class="x-base-slider__selected-min">
|
|
84
88
|
<span>min value</span>
|
|
85
89
|
<span>
|
|
@@ -96,10 +100,10 @@ It is possible to override the default slot to customize the layout for the sele
|
|
|
96
100
|
</template>
|
|
97
101
|
|
|
98
102
|
<script setup>
|
|
99
|
-
import { BaseSlider } from
|
|
100
|
-
import { ref } from
|
|
101
|
-
const threshold = { min: 0, max: 1000 }
|
|
102
|
-
const selectedRange = ref({ ...threshold })
|
|
103
|
+
import { BaseSlider } from "@empathyco/x-components";
|
|
104
|
+
import { ref } from "vue";
|
|
105
|
+
const threshold = { min: 0, max: 1000 };
|
|
106
|
+
const selectedRange = ref({ ...threshold });
|
|
103
107
|
</script>
|
|
104
108
|
```
|
|
105
109
|
|
|
@@ -131,9 +135,9 @@ manually.
|
|
|
131
135
|
</template>
|
|
132
136
|
|
|
133
137
|
<script setup>
|
|
134
|
-
import { BaseSlider } from
|
|
135
|
-
import { ref } from
|
|
136
|
-
const threshold = { min: 0, max: 1000 }
|
|
137
|
-
const selectedRange = ref({ ...threshold })
|
|
138
|
+
import { BaseSlider } from "@empathyco/x-components";
|
|
139
|
+
import { ref } from "vue";
|
|
140
|
+
const threshold = { min: 0, max: 1000 };
|
|
141
|
+
const selectedRange = ref({ ...threshold });
|
|
138
142
|
</script>
|
|
139
143
|
```
|
|
@@ -38,9 +38,9 @@ _Try clicking it to see how it changes its state_
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup>
|
|
41
|
-
import { BaseSwitch } from
|
|
42
|
-
import { ref } from
|
|
43
|
-
const value = ref(false)
|
|
41
|
+
import { BaseSwitch } from "@empathyco/x-components";
|
|
42
|
+
import { ref } from "vue";
|
|
43
|
+
const value = ref(false);
|
|
44
44
|
</script>
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -53,8 +53,8 @@ change:
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup>
|
|
56
|
-
import { BaseSwitch } from
|
|
57
|
-
import { ref } from
|
|
58
|
-
const value = ref(false)
|
|
56
|
+
import { BaseSwitch } from "@empathyco/x-components";
|
|
57
|
+
import { ref } from "vue";
|
|
58
|
+
const value = ref(false);
|
|
59
59
|
</script>
|
|
60
60
|
```
|