@coveo/atomic 3.61.5 → 3.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +58 -10
- package/dist/cjs/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.cjs +19 -7
- package/dist/cjs/components/common/facets/category-facet/active-value.cjs +69 -0
- package/dist/cjs/components/common/facets/category-facet/selected-value.cjs +78 -0
- package/dist/cjs/components/common/facets/category-facet/value-link.cjs +5 -6
- package/dist/cjs/components/search/atomic-category-facet/atomic-category-facet.cjs +19 -8
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +19 -7
- package/dist/esm/components/common/facets/category-facet/active-value.js +31 -0
- package/dist/esm/components/common/facets/category-facet/selected-value.js +30 -0
- package/dist/esm/components/common/facets/category-facet/value-link.js +5 -6
- package/dist/esm/components/search/atomic-category-facet/atomic-category-facet.js +19 -8
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/versions.js +1 -1
- package/dist/types/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.d.ts +7 -1
- package/dist/types/components/common/facets/category-facet/active-value.d.ts +19 -0
- package/dist/types/components/common/facets/category-facet/selected-value.d.ts +22 -0
- package/dist/types/components/common/facets/category-facet/value-link.d.ts +0 -1
- package/dist/types/components/search/atomic-category-facet/atomic-category-facet.d.ts +8 -2
- package/package.json +4 -4
- package/dist/cjs/components/common/facets/category-facet/parent-value-link.cjs +0 -47
- package/dist/esm/components/common/facets/category-facet/parent-value-link.js +0 -9
- package/dist/types/components/common/facets/category-facet/parent-value-link.d.ts +0 -6
package/custom-elements.json
CHANGED
|
@@ -500,25 +500,25 @@
|
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
"kind": "javascript-module",
|
|
503
|
-
"path": "src/
|
|
503
|
+
"path": "src/directives/hierarchical-path.ts",
|
|
504
504
|
"declarations": [],
|
|
505
505
|
"exports": []
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
"kind": "javascript-module",
|
|
509
|
-
"path": "src/directives/
|
|
509
|
+
"path": "src/directives/localized-string.ts",
|
|
510
510
|
"declarations": [],
|
|
511
511
|
"exports": []
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"kind": "javascript-module",
|
|
515
|
-
"path": "src/directives/
|
|
515
|
+
"path": "src/directives/multi-class-map.ts",
|
|
516
516
|
"declarations": [],
|
|
517
517
|
"exports": []
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
520
|
"kind": "javascript-module",
|
|
521
|
-
"path": "src/
|
|
521
|
+
"path": "src/generated/dayjs-locales-data.ts",
|
|
522
522
|
"declarations": [],
|
|
523
523
|
"exports": []
|
|
524
524
|
},
|
|
@@ -1712,6 +1712,22 @@
|
|
|
1712
1712
|
"description": "The highlighted query inside the facet values.",
|
|
1713
1713
|
"name": "search-highlight"
|
|
1714
1714
|
},
|
|
1715
|
+
{
|
|
1716
|
+
"description": "The row displaying the currently selected value and the button that clears the facet.",
|
|
1717
|
+
"name": "selected-value"
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
"description": "The pill displaying the currently selected value.",
|
|
1721
|
+
"name": "selected-value-pill"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
"description": "The button that clears the facet, displayed next to the selected value.",
|
|
1725
|
+
"name": "selected-value-clear-button"
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
"description": "The icon of the button that clears the facet.",
|
|
1729
|
+
"name": "selected-value-clear-button-icon"
|
|
1730
|
+
},
|
|
1715
1731
|
{
|
|
1716
1732
|
"description": "The container surrounding the whole hierarchy of values.",
|
|
1717
1733
|
"name": "parents"
|
|
@@ -1733,7 +1749,7 @@
|
|
|
1733
1749
|
"name": "parent-button"
|
|
1734
1750
|
},
|
|
1735
1751
|
{
|
|
1736
|
-
"description": "The
|
|
1752
|
+
"description": "The currently selected value, displayed last within the parents. Not interactive.",
|
|
1737
1753
|
"name": "active-parent"
|
|
1738
1754
|
},
|
|
1739
1755
|
{
|
|
@@ -1923,6 +1939,11 @@
|
|
|
1923
1939
|
"name": "renderHeader",
|
|
1924
1940
|
"privacy": "private"
|
|
1925
1941
|
},
|
|
1942
|
+
{
|
|
1943
|
+
"kind": "method",
|
|
1944
|
+
"name": "renderSelectedValue",
|
|
1945
|
+
"privacy": "private"
|
|
1946
|
+
},
|
|
1926
1947
|
{
|
|
1927
1948
|
"kind": "method",
|
|
1928
1949
|
"name": "renderValuesTree",
|
|
@@ -28106,6 +28127,22 @@
|
|
|
28106
28127
|
"description": "The highlighted query inside the facet values.",
|
|
28107
28128
|
"name": "search-highlight"
|
|
28108
28129
|
},
|
|
28130
|
+
{
|
|
28131
|
+
"description": "The row displaying the currently selected value and the button that clears the facet.",
|
|
28132
|
+
"name": "selected-value"
|
|
28133
|
+
},
|
|
28134
|
+
{
|
|
28135
|
+
"description": "The pill displaying the currently selected value.",
|
|
28136
|
+
"name": "selected-value-pill"
|
|
28137
|
+
},
|
|
28138
|
+
{
|
|
28139
|
+
"description": "The button that clears the facet, displayed next to the selected value.",
|
|
28140
|
+
"name": "selected-value-clear-button"
|
|
28141
|
+
},
|
|
28142
|
+
{
|
|
28143
|
+
"description": "The icon of the button that clears the facet.",
|
|
28144
|
+
"name": "selected-value-clear-button-icon"
|
|
28145
|
+
},
|
|
28109
28146
|
{
|
|
28110
28147
|
"description": "The container surrounding the whole hierarchy of values.",
|
|
28111
28148
|
"name": "parents"
|
|
@@ -28119,7 +28156,7 @@
|
|
|
28119
28156
|
"name": "values"
|
|
28120
28157
|
},
|
|
28121
28158
|
{
|
|
28122
|
-
"description": "The \"
|
|
28159
|
+
"description": "The \"All Categories\" button displayed first within the parents.",
|
|
28123
28160
|
"name": "all-categories-button"
|
|
28124
28161
|
},
|
|
28125
28162
|
{
|
|
@@ -28127,7 +28164,7 @@
|
|
|
28127
28164
|
"name": "parent-button"
|
|
28128
28165
|
},
|
|
28129
28166
|
{
|
|
28130
|
-
"description": "The
|
|
28167
|
+
"description": "The currently selected value, displayed last within the parents. Not interactive.",
|
|
28131
28168
|
"name": "active-parent"
|
|
28132
28169
|
},
|
|
28133
28170
|
{
|
|
@@ -28529,6 +28566,11 @@
|
|
|
28529
28566
|
"name": "renderSearchInput",
|
|
28530
28567
|
"privacy": "private"
|
|
28531
28568
|
},
|
|
28569
|
+
{
|
|
28570
|
+
"kind": "method",
|
|
28571
|
+
"name": "renderSelectedValue",
|
|
28572
|
+
"privacy": "private"
|
|
28573
|
+
},
|
|
28532
28574
|
{
|
|
28533
28575
|
"kind": "method",
|
|
28534
28576
|
"name": "renderValuesTree",
|
|
@@ -48874,6 +48916,12 @@
|
|
|
48874
48916
|
"declarations": [],
|
|
48875
48917
|
"exports": []
|
|
48876
48918
|
},
|
|
48919
|
+
{
|
|
48920
|
+
"kind": "javascript-module",
|
|
48921
|
+
"path": "src/components/common/facets/category-facet/active-value.ts",
|
|
48922
|
+
"declarations": [],
|
|
48923
|
+
"exports": []
|
|
48924
|
+
},
|
|
48877
48925
|
{
|
|
48878
48926
|
"kind": "javascript-module",
|
|
48879
48927
|
"path": "src/components/common/facets/category-facet/all-categories-button.ts",
|
|
@@ -48906,19 +48954,19 @@
|
|
|
48906
48954
|
},
|
|
48907
48955
|
{
|
|
48908
48956
|
"kind": "javascript-module",
|
|
48909
|
-
"path": "src/components/common/facets/category-facet/
|
|
48957
|
+
"path": "src/components/common/facets/category-facet/search-results-container.ts",
|
|
48910
48958
|
"declarations": [],
|
|
48911
48959
|
"exports": []
|
|
48912
48960
|
},
|
|
48913
48961
|
{
|
|
48914
48962
|
"kind": "javascript-module",
|
|
48915
|
-
"path": "src/components/common/facets/category-facet/search-
|
|
48963
|
+
"path": "src/components/common/facets/category-facet/search-value.ts",
|
|
48916
48964
|
"declarations": [],
|
|
48917
48965
|
"exports": []
|
|
48918
48966
|
},
|
|
48919
48967
|
{
|
|
48920
48968
|
"kind": "javascript-module",
|
|
48921
|
-
"path": "src/components/common/facets/category-facet/
|
|
48969
|
+
"path": "src/components/common/facets/category-facet/selected-value.ts",
|
|
48922
48970
|
"declarations": [],
|
|
48923
48971
|
"exports": []
|
|
48924
48972
|
},
|
|
@@ -59,13 +59,14 @@ const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard
|
|
|
59
59
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
60
60
|
const accessibility_utils_cjs_namespaceObject = require("../../../utils/accessibility-utils.cjs");
|
|
61
61
|
const field_utils_cjs_namespaceObject = require("../../../utils/field-utils.cjs");
|
|
62
|
+
const active_value_cjs_namespaceObject = require("../../common/facets/category-facet/active-value.cjs");
|
|
62
63
|
const all_categories_button_cjs_namespaceObject = require("../../common/facets/category-facet/all-categories-button.cjs");
|
|
63
64
|
const children_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/children-as-tree-container.cjs");
|
|
64
65
|
const parent_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/parent-as-tree-container.cjs");
|
|
65
66
|
const parent_button_cjs_namespaceObject = require("../../common/facets/category-facet/parent-button.cjs");
|
|
66
|
-
const parent_value_link_cjs_namespaceObject = require("../../common/facets/category-facet/parent-value-link.cjs");
|
|
67
67
|
const search_results_container_cjs_namespaceObject = require("../../common/facets/category-facet/search-results-container.cjs");
|
|
68
68
|
const search_value_cjs_namespaceObject = require("../../common/facets/category-facet/search-value.cjs");
|
|
69
|
+
const selected_value_cjs_namespaceObject = require("../../common/facets/category-facet/selected-value.cjs");
|
|
69
70
|
const value_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/value-as-tree-container.cjs");
|
|
70
71
|
const value_link_cjs_namespaceObject = require("../../common/facets/category-facet/value-link.cjs");
|
|
71
72
|
const facet_common_tw_css_cjs_namespaceObject = require("../../common/facets/facet-common.tw.css.cjs");
|
|
@@ -136,6 +137,21 @@ class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElemen
|
|
|
136
137
|
}
|
|
137
138
|
});
|
|
138
139
|
}
|
|
140
|
+
renderSelectedValue() {
|
|
141
|
+
const activeValue = this.facetState.selectedValueAncestry?.at(-1);
|
|
142
|
+
if (!activeValue) return external_lit_namespaceObject.nothing;
|
|
143
|
+
return (0, selected_value_cjs_namespaceObject.renderCategoryFacetSelectedValue)({
|
|
144
|
+
props: {
|
|
145
|
+
displayValue: (0, field_utils_cjs_namespaceObject.getFieldValueCaption)(this.facetState.field, activeValue.value, this.bindings.i18n),
|
|
146
|
+
label: this.displayName,
|
|
147
|
+
i18n: this.bindings.i18n,
|
|
148
|
+
onClearFilters: ()=>{
|
|
149
|
+
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
150
|
+
this.facet.deselectAll();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
139
155
|
renderValuesTree(parents, isRoot) {
|
|
140
156
|
if (!this.hasParents) return this.renderChildren();
|
|
141
157
|
if (isRoot) return (0, value_as_tree_container_cjs_namespaceObject.renderCategoryFacetTreeValueContainer)()((0, external_lit_namespaceObject.html)`
|
|
@@ -180,16 +196,12 @@ class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElemen
|
|
|
180
196
|
const activeParent = parents[0];
|
|
181
197
|
const activeParentDisplayValue = (0, field_utils_cjs_namespaceObject.getFieldValueCaption)(this.facetState?.field, activeParent.value, this.bindings.i18n);
|
|
182
198
|
return (0, external_lit_namespaceObject.html)`
|
|
183
|
-
${(0,
|
|
199
|
+
${(0, active_value_cjs_namespaceObject.renderCategoryFacetActiveValue)({
|
|
184
200
|
props: {
|
|
185
201
|
displayValue: activeParentDisplayValue,
|
|
186
202
|
numberOfResults: activeParent.numberOfResults,
|
|
187
203
|
i18n: this.bindings.i18n,
|
|
188
204
|
isLeafValue: activeParent.isLeafValue,
|
|
189
|
-
onClick: ()=>{
|
|
190
|
-
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
191
|
-
this.facet.deselectAll();
|
|
192
|
-
},
|
|
193
205
|
searchQuery: this.facetState.facetSearch.query,
|
|
194
206
|
setRef: (el)=>{
|
|
195
207
|
this.focusTargets.activeValueFocus.setTarget(el);
|
|
@@ -214,7 +226,6 @@ class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElemen
|
|
|
214
226
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
215
227
|
this.facet.toggleSelect(facetValue);
|
|
216
228
|
},
|
|
217
|
-
isParent: false,
|
|
218
229
|
isSelected,
|
|
219
230
|
searchQuery: this.facetState.facetSearch.query,
|
|
220
231
|
isLeafValue: facetValue.isLeafValue,
|
|
@@ -289,6 +300,7 @@ class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElemen
|
|
|
289
300
|
onClear: ()=>this.facet.facetSearch.clear()
|
|
290
301
|
}
|
|
291
302
|
})}
|
|
303
|
+
${this.renderSelectedValue()}
|
|
292
304
|
${(0, when_js_namespaceObject.when)((0, facet_search_utils_cjs_namespaceObject.shouldDisplaySearchResults)(facetSearch), ()=>(0, external_lit_namespaceObject.html)`
|
|
293
305
|
${(0, when_js_namespaceObject.when)(facetSearch.values.length > 0, ()=>(0, facet_values_group_cjs_namespaceObject.renderFacetValuesGroup)({
|
|
294
306
|
props: {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
renderCategoryFacetActiveValue: ()=>renderCategoryFacetActiveValue
|
|
32
|
+
});
|
|
33
|
+
const external_lit_namespaceObject = require("lit");
|
|
34
|
+
const keyed_js_namespaceObject = require("lit/directives/keyed.js");
|
|
35
|
+
const ref_js_namespaceObject = require("lit/directives/ref.js");
|
|
36
|
+
const facet_value_label_highlight_cjs_namespaceObject = require("../facet-value-label-highlight/facet-value-label-highlight.cjs");
|
|
37
|
+
const renderCategoryFacetActiveValue = ({ props: { displayValue, numberOfResults, i18n, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
38
|
+
const count = numberOfResults.toLocaleString(i18n.language);
|
|
39
|
+
return (0, external_lit_namespaceObject.html)`${(0, keyed_js_namespaceObject.keyed)(displayValue, (0, external_lit_namespaceObject.html)`<li class="contents">
|
|
40
|
+
<span
|
|
41
|
+
part="active-parent ${isLeafValue ? 'leaf-value' : 'node-value'}"
|
|
42
|
+
class="text-primary flex w-full items-center truncate px-2 py-2.5 text-left"
|
|
43
|
+
aria-current="true"
|
|
44
|
+
tabindex="-1"
|
|
45
|
+
${(0, ref_js_namespaceObject.ref)(setRef)}
|
|
46
|
+
>
|
|
47
|
+
${(0, facet_value_label_highlight_cjs_namespaceObject.renderFacetValueLabelHighlight)({
|
|
48
|
+
props: {
|
|
49
|
+
displayValue,
|
|
50
|
+
searchQuery,
|
|
51
|
+
isSelected: true
|
|
52
|
+
}
|
|
53
|
+
})}
|
|
54
|
+
<span part="value-count" class="value-count">
|
|
55
|
+
${i18n.t('between-parentheses', {
|
|
56
|
+
text: count
|
|
57
|
+
})}
|
|
58
|
+
</span>
|
|
59
|
+
</span>
|
|
60
|
+
${children}
|
|
61
|
+
</li>`)}`;
|
|
62
|
+
};
|
|
63
|
+
exports.renderCategoryFacetActiveValue = __webpack_exports__.renderCategoryFacetActiveValue;
|
|
64
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
65
|
+
"renderCategoryFacetActiveValue"
|
|
66
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
67
|
+
Object.defineProperty(exports, '__esModule', {
|
|
68
|
+
value: true
|
|
69
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
renderCategoryFacetSelectedValue: ()=>renderCategoryFacetSelectedValue
|
|
41
|
+
});
|
|
42
|
+
const external_lit_namespaceObject = require("lit");
|
|
43
|
+
const close_cjs_namespaceObject = require("../../../../images/close.cjs");
|
|
44
|
+
var close_cjs_default = /*#__PURE__*/ __webpack_require__.n(close_cjs_namespaceObject);
|
|
45
|
+
require("../../atomic-icon/atomic-icon.cjs");
|
|
46
|
+
const external_button_cjs_namespaceObject = require("../../button.cjs");
|
|
47
|
+
const renderCategoryFacetSelectedValue = ({ props: { displayValue, label, i18n, onClearFilters } })=>(0, external_lit_namespaceObject.html)`<div part="selected-value" class="mt-3 flex items-center justify-between gap-2">
|
|
48
|
+
<span
|
|
49
|
+
part="selected-value-pill"
|
|
50
|
+
title=${displayValue}
|
|
51
|
+
class="bg-neutral-light truncate rounded-md px-2 py-1 text-sm"
|
|
52
|
+
>${displayValue}</span
|
|
53
|
+
>
|
|
54
|
+
${(0, external_button_cjs_namespaceObject.renderButton)({
|
|
55
|
+
props: {
|
|
56
|
+
part: 'selected-value-clear-button',
|
|
57
|
+
style: 'text-primary',
|
|
58
|
+
class: 'flex shrink-0 items-center p-1 text-sm',
|
|
59
|
+
ariaLabel: i18n.t('clear-filters-for-facet', {
|
|
60
|
+
count: 1,
|
|
61
|
+
label: i18n.t(label)
|
|
62
|
+
}),
|
|
63
|
+
onClick: onClearFilters
|
|
64
|
+
}
|
|
65
|
+
})((0, external_lit_namespaceObject.html)`<atomic-icon
|
|
66
|
+
part="selected-value-clear-button-icon"
|
|
67
|
+
class="mr-1 h-2 w-2"
|
|
68
|
+
.icon=${close_cjs_default()}
|
|
69
|
+
></atomic-icon>
|
|
70
|
+
<span>${i18n.t('clear')}</span>`)}
|
|
71
|
+
</div>`;
|
|
72
|
+
exports.renderCategoryFacetSelectedValue = __webpack_exports__.renderCategoryFacetSelectedValue;
|
|
73
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
74
|
+
"renderCategoryFacetSelectedValue"
|
|
75
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
76
|
+
Object.defineProperty(exports, '__esModule', {
|
|
77
|
+
value: true
|
|
78
|
+
});
|
|
@@ -33,12 +33,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
const external_lit_namespaceObject = require("lit");
|
|
34
34
|
const facet_value_label_highlight_cjs_namespaceObject = require("../facet-value-label-highlight/facet-value-label-highlight.cjs");
|
|
35
35
|
const facet_value_link_cjs_namespaceObject = require("../facet-value-link/facet-value-link.cjs");
|
|
36
|
-
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick,
|
|
37
|
-
const partNames = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
else partNames.push('node-value');
|
|
36
|
+
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick, isSelected, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
37
|
+
const partNames = [
|
|
38
|
+
`value-link${isSelected ? ' value-link-selected' : ''}`,
|
|
39
|
+
isLeafValue ? 'leaf-value' : 'node-value'
|
|
40
|
+
];
|
|
42
41
|
return (0, external_lit_namespaceObject.html)`${(0, facet_value_link_cjs_namespaceObject.renderFacetValueLink)({
|
|
43
42
|
props: {
|
|
44
43
|
displayValue,
|
|
@@ -45,13 +45,14 @@ const external_lit_namespaceObject = require("lit");
|
|
|
45
45
|
const decorators_js_namespaceObject = require("lit/decorators.js");
|
|
46
46
|
const map_js_namespaceObject = require("lit/directives/map.js");
|
|
47
47
|
const when_js_namespaceObject = require("lit/directives/when.js");
|
|
48
|
+
const active_value_cjs_namespaceObject = require("../../common/facets/category-facet/active-value.cjs");
|
|
48
49
|
const all_categories_button_cjs_namespaceObject = require("../../common/facets/category-facet/all-categories-button.cjs");
|
|
49
50
|
const children_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/children-as-tree-container.cjs");
|
|
50
51
|
const parent_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/parent-as-tree-container.cjs");
|
|
51
52
|
const parent_button_cjs_namespaceObject = require("../../common/facets/category-facet/parent-button.cjs");
|
|
52
|
-
const parent_value_link_cjs_namespaceObject = require("../../common/facets/category-facet/parent-value-link.cjs");
|
|
53
53
|
const search_results_container_cjs_namespaceObject = require("../../common/facets/category-facet/search-results-container.cjs");
|
|
54
54
|
const search_value_cjs_namespaceObject = require("../../common/facets/category-facet/search-value.cjs");
|
|
55
|
+
const selected_value_cjs_namespaceObject = require("../../common/facets/category-facet/selected-value.cjs");
|
|
55
56
|
const value_as_tree_container_cjs_namespaceObject = require("../../common/facets/category-facet/value-as-tree-container.cjs");
|
|
56
57
|
const value_link_cjs_namespaceObject = require("../../common/facets/category-facet/value-link.cjs");
|
|
57
58
|
const depends_on_cjs_namespaceObject = require("../../common/facets/depends-on.cjs");
|
|
@@ -211,6 +212,21 @@ class AtomicCategoryFacet extends external_lit_namespaceObject.LitElement {
|
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
}
|
|
215
|
+
renderSelectedValue() {
|
|
216
|
+
const activeValue = this.facetState.selectedValueAncestry.at(-1);
|
|
217
|
+
if (!activeValue) return external_lit_namespaceObject.nothing;
|
|
218
|
+
return (0, selected_value_cjs_namespaceObject.renderCategoryFacetSelectedValue)({
|
|
219
|
+
props: {
|
|
220
|
+
displayValue: (0, field_utils_cjs_namespaceObject.getFieldValueCaption)(this.field, activeValue.value, this.bindings.i18n),
|
|
221
|
+
label: this.label,
|
|
222
|
+
i18n: this.bindings.i18n,
|
|
223
|
+
onClearFilters: ()=>{
|
|
224
|
+
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
225
|
+
this.facet.deselectAll();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
214
230
|
renderValuesTree(valuesAsTrees, isRoot) {
|
|
215
231
|
if (!this.hasParents) return this.renderChildren();
|
|
216
232
|
if (isRoot) return (0, value_as_tree_container_cjs_namespaceObject.renderCategoryFacetTreeValueContainer)()((0, external_lit_namespaceObject.html)`
|
|
@@ -255,16 +271,12 @@ class AtomicCategoryFacet extends external_lit_namespaceObject.LitElement {
|
|
|
255
271
|
const activeParent = valuesAsTrees[0];
|
|
256
272
|
const activeParentDisplayValue = (0, field_utils_cjs_namespaceObject.getFieldValueCaption)(this.field, activeParent.value, this.bindings.i18n);
|
|
257
273
|
return (0, external_lit_namespaceObject.html)`
|
|
258
|
-
${(0,
|
|
274
|
+
${(0, active_value_cjs_namespaceObject.renderCategoryFacetActiveValue)({
|
|
259
275
|
props: {
|
|
260
276
|
displayValue: activeParentDisplayValue,
|
|
261
277
|
numberOfResults: activeParent.numberOfResults,
|
|
262
278
|
i18n: this.bindings.i18n,
|
|
263
279
|
isLeafValue: activeParent.isLeafValue,
|
|
264
|
-
onClick: ()=>{
|
|
265
|
-
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
266
|
-
this.facet.deselectAll();
|
|
267
|
-
},
|
|
268
280
|
searchQuery: this.facetState.facetSearch.query,
|
|
269
281
|
setRef: (el)=>{
|
|
270
282
|
this.focusTargets.activeValueFocus.setTarget(el);
|
|
@@ -287,7 +299,6 @@ class AtomicCategoryFacet extends external_lit_namespaceObject.LitElement {
|
|
|
287
299
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
288
300
|
this.facet.toggleSelect(facetValue);
|
|
289
301
|
},
|
|
290
|
-
isParent: false,
|
|
291
302
|
isSelected,
|
|
292
303
|
searchQuery: this.facetState.facetSearch.query,
|
|
293
304
|
isLeafValue: facetValue.isLeafValue,
|
|
@@ -369,7 +380,7 @@ class AtomicCategoryFacet extends external_lit_namespaceObject.LitElement {
|
|
|
369
380
|
return (0, facet_container_cjs_namespaceObject.renderFacetContainer)()((0, external_lit_namespaceObject.html)`
|
|
370
381
|
${this.renderHeader()}
|
|
371
382
|
${(0, when_js_namespaceObject.when)(!this.isCollapsed, ()=>(0, external_lit_namespaceObject.html)`
|
|
372
|
-
${this.renderSearchInput()}
|
|
383
|
+
${this.renderSearchInput()} ${this.renderSelectedValue()}
|
|
373
384
|
${(0, when_js_namespaceObject.when)((0, facet_search_utils_cjs_namespaceObject.shouldDisplaySearchResults)(facetSearch), ()=>(0, external_lit_namespaceObject.html)`
|
|
374
385
|
${(0, when_js_namespaceObject.when)(facetSearch.values.length > 0, ()=>(0, facet_values_group_cjs_namespaceObject.renderFacetValuesGroup)({
|
|
375
386
|
props: {
|
package/dist/cjs/versions.cjs
CHANGED
|
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
headlessVersion: ()=>package_json_namespaceObject.version
|
|
33
33
|
});
|
|
34
34
|
const package_json_namespaceObject = require("@coveo/headless/package.json");
|
|
35
|
-
const atomicVersion = "3.
|
|
35
|
+
const atomicVersion = "3.62.0";
|
|
36
36
|
exports.atomicVersion = __webpack_exports__.atomicVersion;
|
|
37
37
|
exports.headlessVersion = __webpack_exports__.headlessVersion;
|
|
38
38
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -18,13 +18,14 @@ import { errorGuard } from "../../../decorators/error-guard.js";
|
|
|
18
18
|
import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
|
|
19
19
|
import { AriaLiveRegionController, FocusTargetController } from "../../../utils/accessibility-utils.js";
|
|
20
20
|
import { getFieldValueCaption } from "../../../utils/field-utils.js";
|
|
21
|
+
import { renderCategoryFacetActiveValue } from "../../common/facets/category-facet/active-value.js";
|
|
21
22
|
import { renderCategoryFacetAllCategoryButton } from "../../common/facets/category-facet/all-categories-button.js";
|
|
22
23
|
import { renderCategoryFacetChildrenAsTreeContainer } from "../../common/facets/category-facet/children-as-tree-container.js";
|
|
23
24
|
import { renderCategoryFacetParentAsTreeContainer } from "../../common/facets/category-facet/parent-as-tree-container.js";
|
|
24
25
|
import { renderCategoryFacetParentButton } from "../../common/facets/category-facet/parent-button.js";
|
|
25
|
-
import { renderCategoryFacetParentValueLink } from "../../common/facets/category-facet/parent-value-link.js";
|
|
26
26
|
import { renderCategoryFacetSearchResultsContainer } from "../../common/facets/category-facet/search-results-container.js";
|
|
27
27
|
import { renderCategoryFacetSearchValue } from "../../common/facets/category-facet/search-value.js";
|
|
28
|
+
import { renderCategoryFacetSelectedValue } from "../../common/facets/category-facet/selected-value.js";
|
|
28
29
|
import { renderCategoryFacetTreeValueContainer } from "../../common/facets/category-facet/value-as-tree-container.js";
|
|
29
30
|
import { renderCategoryFacetValueLink } from "../../common/facets/category-facet/value-link.js";
|
|
30
31
|
import facet_common_tw_css from "../../common/facets/facet-common.tw.css.js";
|
|
@@ -93,6 +94,21 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
}
|
|
97
|
+
renderSelectedValue() {
|
|
98
|
+
const activeValue = this.facetState.selectedValueAncestry?.at(-1);
|
|
99
|
+
if (!activeValue) return nothing;
|
|
100
|
+
return renderCategoryFacetSelectedValue({
|
|
101
|
+
props: {
|
|
102
|
+
displayValue: getFieldValueCaption(this.facetState.field, activeValue.value, this.bindings.i18n),
|
|
103
|
+
label: this.displayName,
|
|
104
|
+
i18n: this.bindings.i18n,
|
|
105
|
+
onClearFilters: ()=>{
|
|
106
|
+
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
107
|
+
this.facet.deselectAll();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
96
112
|
renderValuesTree(parents, isRoot) {
|
|
97
113
|
if (!this.hasParents) return this.renderChildren();
|
|
98
114
|
if (isRoot) return renderCategoryFacetTreeValueContainer()(html`
|
|
@@ -137,16 +153,12 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
137
153
|
const activeParent = parents[0];
|
|
138
154
|
const activeParentDisplayValue = getFieldValueCaption(this.facetState?.field, activeParent.value, this.bindings.i18n);
|
|
139
155
|
return html`
|
|
140
|
-
${
|
|
156
|
+
${renderCategoryFacetActiveValue({
|
|
141
157
|
props: {
|
|
142
158
|
displayValue: activeParentDisplayValue,
|
|
143
159
|
numberOfResults: activeParent.numberOfResults,
|
|
144
160
|
i18n: this.bindings.i18n,
|
|
145
161
|
isLeafValue: activeParent.isLeafValue,
|
|
146
|
-
onClick: ()=>{
|
|
147
|
-
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
148
|
-
this.facet.deselectAll();
|
|
149
|
-
},
|
|
150
162
|
searchQuery: this.facetState.facetSearch.query,
|
|
151
163
|
setRef: (el)=>{
|
|
152
164
|
this.focusTargets.activeValueFocus.setTarget(el);
|
|
@@ -171,7 +183,6 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
171
183
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
172
184
|
this.facet.toggleSelect(facetValue);
|
|
173
185
|
},
|
|
174
|
-
isParent: false,
|
|
175
186
|
isSelected,
|
|
176
187
|
searchQuery: this.facetState.facetSearch.query,
|
|
177
188
|
isLeafValue: facetValue.isLeafValue,
|
|
@@ -246,6 +257,7 @@ class AtomicCommerceCategoryFacet extends LitElement {
|
|
|
246
257
|
onClear: ()=>this.facet.facetSearch.clear()
|
|
247
258
|
}
|
|
248
259
|
})}
|
|
260
|
+
${this.renderSelectedValue()}
|
|
249
261
|
${when(shouldDisplaySearchResults(facetSearch), ()=>html`
|
|
250
262
|
${when(facetSearch.values.length > 0, ()=>renderFacetValuesGroup({
|
|
251
263
|
props: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { keyed } from "lit/directives/keyed.js";
|
|
3
|
+
import { ref } from "lit/directives/ref.js";
|
|
4
|
+
import { renderFacetValueLabelHighlight } from "../facet-value-label-highlight/facet-value-label-highlight.js";
|
|
5
|
+
const renderCategoryFacetActiveValue = ({ props: { displayValue, numberOfResults, i18n, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
6
|
+
const count = numberOfResults.toLocaleString(i18n.language);
|
|
7
|
+
return html`${keyed(displayValue, html`<li class="contents">
|
|
8
|
+
<span
|
|
9
|
+
part="active-parent ${isLeafValue ? 'leaf-value' : 'node-value'}"
|
|
10
|
+
class="text-primary flex w-full items-center truncate px-2 py-2.5 text-left"
|
|
11
|
+
aria-current="true"
|
|
12
|
+
tabindex="-1"
|
|
13
|
+
${ref(setRef)}
|
|
14
|
+
>
|
|
15
|
+
${renderFacetValueLabelHighlight({
|
|
16
|
+
props: {
|
|
17
|
+
displayValue,
|
|
18
|
+
searchQuery,
|
|
19
|
+
isSelected: true
|
|
20
|
+
}
|
|
21
|
+
})}
|
|
22
|
+
<span part="value-count" class="value-count">
|
|
23
|
+
${i18n.t('between-parentheses', {
|
|
24
|
+
text: count
|
|
25
|
+
})}
|
|
26
|
+
</span>
|
|
27
|
+
</span>
|
|
28
|
+
${children}
|
|
29
|
+
</li>`)}`;
|
|
30
|
+
};
|
|
31
|
+
export { renderCategoryFacetActiveValue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import images_close from "../../../../images/close.js";
|
|
3
|
+
import "../../atomic-icon/atomic-icon.js";
|
|
4
|
+
import { renderButton } from "../../button.js";
|
|
5
|
+
const renderCategoryFacetSelectedValue = ({ props: { displayValue, label, i18n, onClearFilters } })=>html`<div part="selected-value" class="mt-3 flex items-center justify-between gap-2">
|
|
6
|
+
<span
|
|
7
|
+
part="selected-value-pill"
|
|
8
|
+
title=${displayValue}
|
|
9
|
+
class="bg-neutral-light truncate rounded-md px-2 py-1 text-sm"
|
|
10
|
+
>${displayValue}</span
|
|
11
|
+
>
|
|
12
|
+
${renderButton({
|
|
13
|
+
props: {
|
|
14
|
+
part: 'selected-value-clear-button',
|
|
15
|
+
style: 'text-primary',
|
|
16
|
+
class: 'flex shrink-0 items-center p-1 text-sm',
|
|
17
|
+
ariaLabel: i18n.t('clear-filters-for-facet', {
|
|
18
|
+
count: 1,
|
|
19
|
+
label: i18n.t(label)
|
|
20
|
+
}),
|
|
21
|
+
onClick: onClearFilters
|
|
22
|
+
}
|
|
23
|
+
})(html`<atomic-icon
|
|
24
|
+
part="selected-value-clear-button-icon"
|
|
25
|
+
class="mr-1 h-2 w-2"
|
|
26
|
+
.icon=${images_close}
|
|
27
|
+
></atomic-icon>
|
|
28
|
+
<span>${i18n.t('clear')}</span>`)}
|
|
29
|
+
</div>`;
|
|
30
|
+
export { renderCategoryFacetSelectedValue };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { renderFacetValueLabelHighlight } from "../facet-value-label-highlight/facet-value-label-highlight.js";
|
|
3
3
|
import { renderFacetValueLink } from "../facet-value-link/facet-value-link.js";
|
|
4
|
-
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick,
|
|
5
|
-
const partNames = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
else partNames.push('node-value');
|
|
4
|
+
const renderCategoryFacetValueLink = ({ props: { displayValue, numberOfResults, i18n, onClick, isSelected, searchQuery, isLeafValue, setRef } })=>(children)=>{
|
|
5
|
+
const partNames = [
|
|
6
|
+
`value-link${isSelected ? ' value-link-selected' : ''}`,
|
|
7
|
+
isLeafValue ? 'leaf-value' : 'node-value'
|
|
8
|
+
];
|
|
10
9
|
return html`${renderFacetValueLink({
|
|
11
10
|
props: {
|
|
12
11
|
displayValue,
|
|
@@ -4,13 +4,14 @@ import { LitElement, css, html, nothing } from "lit";
|
|
|
4
4
|
import { customElement, property, state } from "lit/decorators.js";
|
|
5
5
|
import { map } from "lit/directives/map.js";
|
|
6
6
|
import { when } from "lit/directives/when.js";
|
|
7
|
+
import { renderCategoryFacetActiveValue } from "../../common/facets/category-facet/active-value.js";
|
|
7
8
|
import { renderCategoryFacetAllCategoryButton } from "../../common/facets/category-facet/all-categories-button.js";
|
|
8
9
|
import { renderCategoryFacetChildrenAsTreeContainer } from "../../common/facets/category-facet/children-as-tree-container.js";
|
|
9
10
|
import { renderCategoryFacetParentAsTreeContainer } from "../../common/facets/category-facet/parent-as-tree-container.js";
|
|
10
11
|
import { renderCategoryFacetParentButton } from "../../common/facets/category-facet/parent-button.js";
|
|
11
|
-
import { renderCategoryFacetParentValueLink } from "../../common/facets/category-facet/parent-value-link.js";
|
|
12
12
|
import { renderCategoryFacetSearchResultsContainer } from "../../common/facets/category-facet/search-results-container.js";
|
|
13
13
|
import { renderCategoryFacetSearchValue } from "../../common/facets/category-facet/search-value.js";
|
|
14
|
+
import { renderCategoryFacetSelectedValue } from "../../common/facets/category-facet/selected-value.js";
|
|
14
15
|
import { renderCategoryFacetTreeValueContainer } from "../../common/facets/category-facet/value-as-tree-container.js";
|
|
15
16
|
import { renderCategoryFacetValueLink } from "../../common/facets/category-facet/value-link.js";
|
|
16
17
|
import { parseDependsOn } from "../../common/facets/depends-on.js";
|
|
@@ -168,6 +169,21 @@ class AtomicCategoryFacet extends LitElement {
|
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
}
|
|
172
|
+
renderSelectedValue() {
|
|
173
|
+
const activeValue = this.facetState.selectedValueAncestry.at(-1);
|
|
174
|
+
if (!activeValue) return nothing;
|
|
175
|
+
return renderCategoryFacetSelectedValue({
|
|
176
|
+
props: {
|
|
177
|
+
displayValue: getFieldValueCaption(this.field, activeValue.value, this.bindings.i18n),
|
|
178
|
+
label: this.label,
|
|
179
|
+
i18n: this.bindings.i18n,
|
|
180
|
+
onClearFilters: ()=>{
|
|
181
|
+
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
182
|
+
this.facet.deselectAll();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
171
187
|
renderValuesTree(valuesAsTrees, isRoot) {
|
|
172
188
|
if (!this.hasParents) return this.renderChildren();
|
|
173
189
|
if (isRoot) return renderCategoryFacetTreeValueContainer()(html`
|
|
@@ -212,16 +228,12 @@ class AtomicCategoryFacet extends LitElement {
|
|
|
212
228
|
const activeParent = valuesAsTrees[0];
|
|
213
229
|
const activeParentDisplayValue = getFieldValueCaption(this.field, activeParent.value, this.bindings.i18n);
|
|
214
230
|
return html`
|
|
215
|
-
${
|
|
231
|
+
${renderCategoryFacetActiveValue({
|
|
216
232
|
props: {
|
|
217
233
|
displayValue: activeParentDisplayValue,
|
|
218
234
|
numberOfResults: activeParent.numberOfResults,
|
|
219
235
|
i18n: this.bindings.i18n,
|
|
220
236
|
isLeafValue: activeParent.isLeafValue,
|
|
221
|
-
onClick: ()=>{
|
|
222
|
-
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
223
|
-
this.facet.deselectAll();
|
|
224
|
-
},
|
|
225
237
|
searchQuery: this.facetState.facetSearch.query,
|
|
226
238
|
setRef: (el)=>{
|
|
227
239
|
this.focusTargets.activeValueFocus.setTarget(el);
|
|
@@ -244,7 +256,6 @@ class AtomicCategoryFacet extends LitElement {
|
|
|
244
256
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
|
245
257
|
this.facet.toggleSelect(facetValue);
|
|
246
258
|
},
|
|
247
|
-
isParent: false,
|
|
248
259
|
isSelected,
|
|
249
260
|
searchQuery: this.facetState.facetSearch.query,
|
|
250
261
|
isLeafValue: facetValue.isLeafValue,
|
|
@@ -326,7 +337,7 @@ class AtomicCategoryFacet extends LitElement {
|
|
|
326
337
|
return renderFacetContainer()(html`
|
|
327
338
|
${this.renderHeader()}
|
|
328
339
|
${when(!this.isCollapsed, ()=>html`
|
|
329
|
-
${this.renderSearchInput()}
|
|
340
|
+
${this.renderSearchInput()} ${this.renderSelectedValue()}
|
|
330
341
|
${when(shouldDisplaySearchResults(facetSearch), ()=>html`
|
|
331
342
|
${when(facetSearch.values.length > 0, ()=>renderFacetValuesGroup({
|
|
332
343
|
props: {
|
package/dist/esm/versions.js
CHANGED
|
@@ -25,12 +25,17 @@ import type { InitializableComponent } from '../../../decorators/types';
|
|
|
25
25
|
* @part search-result-path - The facet search result path.
|
|
26
26
|
* @part search-highlight - The highlighted query inside the facet values.
|
|
27
27
|
*
|
|
28
|
+
* @part selected-value - The row displaying the currently selected value and the button that clears the facet.
|
|
29
|
+
* @part selected-value-pill - The pill displaying the currently selected value.
|
|
30
|
+
* @part selected-value-clear-button - The button that clears the facet, displayed next to the selected value.
|
|
31
|
+
* @part selected-value-clear-button-icon - The icon of the button that clears the facet.
|
|
32
|
+
*
|
|
28
33
|
* @part parents - The container surrounding the whole hierarchy of values.
|
|
29
34
|
* @part sub-parents - The container surrounding a sub-hierarchy of values.
|
|
30
35
|
* @part values - The container surrounding either the children of the active value or the values at the base.
|
|
31
36
|
* @part all-categories-button - The "All categories" button displayed first within the parents.
|
|
32
37
|
* @part parent-button - The clickable parent button displayed first within sub-parents.
|
|
33
|
-
* @part active-parent - The
|
|
38
|
+
* @part active-parent - The currently selected value, displayed last within the parents. Not interactive.
|
|
34
39
|
* @part value-link - The clickable value displayed first within values.
|
|
35
40
|
* @part back-arrow - The back arrow displayed before the clickable parents.
|
|
36
41
|
* @part value-label - The facet value label within a value button.
|
|
@@ -77,6 +82,7 @@ export declare class AtomicCommerceCategoryFacet extends LitElement implements I
|
|
|
77
82
|
shouldUpdate(changedProperties: Map<string | number | symbol, unknown>): boolean;
|
|
78
83
|
private get hasParents();
|
|
79
84
|
private renderHeader;
|
|
85
|
+
private renderSelectedValue;
|
|
80
86
|
private renderValuesTree;
|
|
81
87
|
private renderChild;
|
|
82
88
|
private renderChildren;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { i18n } from 'i18next';
|
|
2
|
+
import type { FunctionalComponentWithChildren } from '../../../../utils/functional-component-utils';
|
|
3
|
+
interface CategoryFacetActiveValueProps {
|
|
4
|
+
displayValue: string;
|
|
5
|
+
numberOfResults: number;
|
|
6
|
+
i18n: i18n;
|
|
7
|
+
searchQuery: string;
|
|
8
|
+
isLeafValue: boolean;
|
|
9
|
+
setRef: (el?: Element) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the deepest selected value of a category facet.
|
|
13
|
+
*
|
|
14
|
+
* The value is not interactive: it represents the filter that is already applied, and it is
|
|
15
|
+
* removed from the facet's clear button rather than by clicking it again. `tabindex="-1"`
|
|
16
|
+
* keeps it a valid target for the focus moved here once the query resolves.
|
|
17
|
+
*/
|
|
18
|
+
export declare const renderCategoryFacetActiveValue: FunctionalComponentWithChildren<CategoryFacetActiveValueProps>;
|
|
19
|
+
export type { CategoryFacetActiveValueProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { i18n } from 'i18next';
|
|
2
|
+
import type { FunctionalComponent } from '../../../../utils/functional-component-utils';
|
|
3
|
+
import '../../atomic-icon/atomic-icon';
|
|
4
|
+
interface CategoryFacetSelectedValueProps {
|
|
5
|
+
/**
|
|
6
|
+
* The localized label of the deepest selected value.
|
|
7
|
+
*/
|
|
8
|
+
displayValue: string;
|
|
9
|
+
/**
|
|
10
|
+
* The label of the facet, used to describe the clear button. It is localized by the component.
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
i18n: i18n;
|
|
14
|
+
onClearFilters(): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders the deepest selected value of a category facet as a pill, next to a button that
|
|
18
|
+
* clears the facet. This is what removes the filter, since the selected value itself is not
|
|
19
|
+
* interactive once applied.
|
|
20
|
+
*/
|
|
21
|
+
export declare const renderCategoryFacetSelectedValue: FunctionalComponent<CategoryFacetSelectedValueProps>;
|
|
22
|
+
export type { CategoryFacetSelectedValueProps };
|
|
@@ -25,12 +25,17 @@ import type { InitializableComponent } from '../../../decorators/types';
|
|
|
25
25
|
* @part search-result-path - The search result path.
|
|
26
26
|
* @part search-highlight - The highlighted query inside the facet values.
|
|
27
27
|
*
|
|
28
|
+
* @part selected-value - The row displaying the currently selected value and the button that clears the facet.
|
|
29
|
+
* @part selected-value-pill - The pill displaying the currently selected value.
|
|
30
|
+
* @part selected-value-clear-button - The button that clears the facet, displayed next to the selected value.
|
|
31
|
+
* @part selected-value-clear-button-icon - The icon of the button that clears the facet.
|
|
32
|
+
*
|
|
28
33
|
* @part parents - The container surrounding the whole hierarchy of values.
|
|
29
34
|
* @part sub-parents - The container surrounding a sub-hierarchy of values.
|
|
30
35
|
* @part values - The container surrounding either the children of the active value or the values at the base.
|
|
31
|
-
* @part all-categories-button - The "
|
|
36
|
+
* @part all-categories-button - The "All Categories" button displayed first within the parents.
|
|
32
37
|
* @part parent-button - The clickable parent button displayed first within sub-parents.
|
|
33
|
-
* @part active-parent - The
|
|
38
|
+
* @part active-parent - The currently selected value, displayed last within the parents. Not interactive.
|
|
34
39
|
* @part value-link - The clickable value displayed first within values.
|
|
35
40
|
* @part back-arrow - The back arrow displayed before the clickable parents.
|
|
36
41
|
* @part value-label - The facet value label within a value button.
|
|
@@ -176,6 +181,7 @@ export declare class AtomicCategoryFacet extends LitElement implements Initializ
|
|
|
176
181
|
private initializeDependenciesManager;
|
|
177
182
|
private renderHeader;
|
|
178
183
|
private renderSearchInput;
|
|
184
|
+
private renderSelectedValue;
|
|
179
185
|
private renderValuesTree;
|
|
180
186
|
private renderChild;
|
|
181
187
|
private renderChildren;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/atomic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.62.0",
|
|
4
4
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
|
5
5
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"./custom-elements-manifest": "./custom-elements.json"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@coveo/atomic-legacy": "0.1.
|
|
58
|
+
"@coveo/atomic-legacy": "0.1.7",
|
|
59
59
|
"@coveo/bueno": "1.1.9",
|
|
60
|
-
"@coveo/headless": "3.57.
|
|
60
|
+
"@coveo/headless": "3.57.2",
|
|
61
61
|
"@coveo/relay-event-types": "20.7.1",
|
|
62
62
|
"@lit/context": "1.1.6",
|
|
63
63
|
"@open-wc/lit-helpers": "0.7.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"@coveo/bueno": "^1.1.9",
|
|
122
|
-
"@coveo/headless": "^3.57.
|
|
122
|
+
"@coveo/headless": "^3.57.2",
|
|
123
123
|
"typescript": ">=5.0.0"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
-
var define = (defs, kind)=>{
|
|
6
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
[kind]: defs[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
define(getters, "get");
|
|
12
|
-
define(values, "value");
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.r = (exports1)=>{
|
|
20
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
-
value: 'Module'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
var __webpack_exports__ = {};
|
|
29
|
-
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
renderCategoryFacetParentValueLink: ()=>renderCategoryFacetParentValueLink
|
|
32
|
-
});
|
|
33
|
-
const external_value_link_cjs_namespaceObject = require("./value-link.cjs");
|
|
34
|
-
const renderCategoryFacetParentValueLink = ({ props })=>(0, external_value_link_cjs_namespaceObject.renderCategoryFacetValueLink)({
|
|
35
|
-
props: {
|
|
36
|
-
...props,
|
|
37
|
-
isParent: true,
|
|
38
|
-
isSelected: true
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
exports.renderCategoryFacetParentValueLink = __webpack_exports__.renderCategoryFacetParentValueLink;
|
|
42
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
|
-
"renderCategoryFacetParentValueLink"
|
|
44
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
|
-
Object.defineProperty(exports, '__esModule', {
|
|
46
|
-
value: true
|
|
47
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { renderCategoryFacetValueLink } from "./value-link.js";
|
|
2
|
-
const renderCategoryFacetParentValueLink = ({ props })=>renderCategoryFacetValueLink({
|
|
3
|
-
props: {
|
|
4
|
-
...props,
|
|
5
|
-
isParent: true,
|
|
6
|
-
isSelected: true
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
export { renderCategoryFacetParentValueLink };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { FunctionalComponentWithChildren } from '../../../../utils/functional-component-utils';
|
|
2
|
-
import { type CategoryFacetValueLinkProps } from './value-link';
|
|
3
|
-
interface CategoryFacetParentValueLinkProps extends Omit<CategoryFacetValueLinkProps, 'isParent' | 'isSelected'> {
|
|
4
|
-
}
|
|
5
|
-
export declare const renderCategoryFacetParentValueLink: FunctionalComponentWithChildren<CategoryFacetParentValueLinkProps>;
|
|
6
|
-
export type { CategoryFacetParentValueLinkProps };
|