@coveo/atomic 3.35.0-pre.67ccca567a → 3.35.0-pre.b985e047c6
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/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/atomic-category-facet.js +7 -17
- package/dist/atomic/components/atomic-category-facet.js.map +1 -1
- package/dist/atomic/components/atomic-recs-interface.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +0 -3
- package/dist/atomic/components/components/common/facets/category-facet/all-categories-button.js +2 -3
- package/dist/atomic/components/components/common/facets/category-facet/search-value.js +1 -6
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/{p-7d212157.entry.js → p-81bdbd07.entry.js} +2 -2
- package/dist/atomic/p-81bdbd07.entry.js.map +1 -0
- package/dist/atomic/{p-c8e27f4e.entry.js → p-82df2024.entry.js} +2 -2
- package/dist/cjs/atomic-category-facet.cjs.entry.js +7 -17
- package/dist/cjs/atomic-category-facet.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/atomic-category-facet.entry.js +7 -17
- package/dist/esm/atomic-category-facet.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/components/common/facets/category-facet/all-categories-button.d.ts +0 -2
- package/dist/types/components/common/facets/category-facet/search-value.d.ts +0 -1
- package/dist/types/components/common/facets/category-facet/stencil-all-categories-button.d.ts +0 -2
- package/dist/types/components/common/facets/category-facet/stencil-search-value.d.ts +0 -1
- package/dist/types/types/open-api.d.ts +3 -0
- package/docs/atomic-docs.json +1 -1
- package/package.json +10 -1
- package/dist/atomic/components/components/common/facets/category-facet/all-categories-localized-label.js +0 -9
- package/dist/atomic/p-7d212157.entry.js.map +0 -1
- package/dist/types/components/common/facets/category-facet/all-categories-localized-label.d.ts +0 -6
- /package/dist/atomic/{p-c8e27f4e.entry.js.map → p-82df2024.entry.js.map} +0 -0
@@ -36,21 +36,11 @@ require('./stencil-heading-2faee1f7.js');
|
|
36
36
|
require('./search-a4774f02.js');
|
37
37
|
require('./stencil-fieldset-group-3b25c138.js');
|
38
38
|
|
39
|
-
const getAllCategoriesLocalizedLabel = ({ facetId, field, i18n, }) => {
|
40
|
-
if (facetId && i18n.exists(`all-categories-${facetId}`)) {
|
41
|
-
return i18n.t(`all-categories-${facetId}`);
|
42
|
-
}
|
43
|
-
if (i18n.exists(`all-categories-${field}`)) {
|
44
|
-
return i18n.t(`all-categories-${field}`);
|
45
|
-
}
|
46
|
-
return i18n.t('all-categories');
|
47
|
-
};
|
48
|
-
|
49
39
|
/**
|
50
40
|
* @deprecated should only be used for Stencil components.
|
51
41
|
*/
|
52
|
-
const CategoryFacetAllCategoryButton = ({ i18n, onClick
|
53
|
-
const allCategories =
|
42
|
+
const CategoryFacetAllCategoryButton = ({ i18n, onClick }) => {
|
43
|
+
const allCategories = i18n.t('all-categories');
|
54
44
|
return (index.h(stencilButton.Button, { style: "text-neutral", part: "all-categories-button", onClick: () => {
|
55
45
|
onClick();
|
56
46
|
} },
|
@@ -115,10 +105,10 @@ const CategoryFacetSearchResultsContainer = (_, children) => {
|
|
115
105
|
const SEPARATOR = '/';
|
116
106
|
const ELLIPSIS = '...';
|
117
107
|
const PATH_MAX_LENGTH = 3;
|
118
|
-
const CategoryFacetSearchValue = ({ value,
|
108
|
+
const CategoryFacetSearchValue = ({ value, field, i18n, onClick, searchQuery }) => {
|
119
109
|
const count = value.count.toLocaleString(i18n.language);
|
120
110
|
const inLabel = i18n.t('in');
|
121
|
-
const allCategories =
|
111
|
+
const allCategories = i18n.t('all-categories');
|
122
112
|
const localizedPath = value.path.length
|
123
113
|
? value.path.map((value) => fieldUtils.getFieldValueCaption(field, value, i18n))
|
124
114
|
: [allCategories];
|
@@ -426,7 +416,7 @@ const AtomicCategoryFacet = class {
|
|
426
416
|
return this.renderChildren();
|
427
417
|
}
|
428
418
|
if (isRoot) {
|
429
|
-
return (index.h(CategoryFacetTreeValueContainer, null, index.h(CategoryFacetAllCategoryButton, { i18n: this.bindings.i18n,
|
419
|
+
return (index.h(CategoryFacetTreeValueContainer, null, index.h(CategoryFacetAllCategoryButton, { i18n: this.bindings.i18n, onClick: () => {
|
430
420
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
431
421
|
this.facet.deselectAll();
|
432
422
|
} }), index.h(CategoryFacetParentAsTreeContainer, { isTopLevel: false }, this.renderValuesTree(valuesAsTrees, false))));
|
@@ -470,7 +460,7 @@ const AtomicCategoryFacet = class {
|
|
470
460
|
return this.facetState.valuesAsTrees.map((value, i) => this.renderChild(value, i === 0, i === this.resultIndexToFocusOnShowMore));
|
471
461
|
}
|
472
462
|
renderSearchResults() {
|
473
|
-
return (index.h(CategoryFacetSearchResultsContainer, null, this.facetState.facetSearch.values.map((value) => (index.h(CategoryFacetSearchValue, { value: value, field: this.field,
|
463
|
+
return (index.h(CategoryFacetSearchResultsContainer, null, this.facetState.facetSearch.values.map((value) => (index.h(CategoryFacetSearchValue, { value: value, field: this.field, i18n: this.bindings.i18n, searchQuery: this.facetState.facetSearch.query, onClick: () => {
|
474
464
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
475
465
|
this.facet.facetSearch.select(value);
|
476
466
|
} })))));
|
@@ -495,7 +485,7 @@ const AtomicCategoryFacet = class {
|
|
495
485
|
}
|
496
486
|
render() {
|
497
487
|
const { bindings: { i18n }, label, facetState: { facetSearch, enabled, valuesAsTrees, selectedValueAncestry }, searchStatusState: { hasError, firstSearchExecuted }, } = this;
|
498
|
-
return (index.h(facetGuard.FacetGuard, { key: '
|
488
|
+
return (index.h(facetGuard.FacetGuard, { key: 'c03f14b0c8885a312289aa35f6efc258b67cdede', enabled: enabled, firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: valuesAsTrees.length > 0 }, firstSearchExecuted ? (index.h(facetPlaceholder.FacetContainer, null, this.renderHeader(), !this.isCollapsed && [
|
499
489
|
this.renderSearchInput(),
|
500
490
|
stencilFacetValueLabelHighlight.shouldDisplaySearchResults(facetSearch) ? (index.h(index.Fragment, null, facetSearch.values.length ? (index.h(stencilFacetValuesGroup.FacetValuesGroup, { i18n: i18n, label: label, query: facetSearch.query }, this.renderSearchResults())) : (index.h("div", { class: "mt-3" })), this.renderMatches())) : (index.h(index.Fragment, null, index.h(stencilFacetValuesGroup.FacetValuesGroup, { i18n: i18n, label: label }, this.hasParents ? (index.h(CategoryFacetParentAsTreeContainer, { isTopLevel: true, className: "mt-3" }, this.renderValuesTree(selectedValueAncestry, true))) : (index.h(CategoryFacetChildrenAsTreeContainer, { className: "mt-3" }, this.renderChildren()))), this.renderShowMoreLess())),
|
501
491
|
])) : (index.h(facetPlaceholder.FacetPlaceholder, { isCollapsed: this.isCollapsed, numberOfValues: this.numberOfValues }))));
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"atomic-category-facet.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,8BAA8B,GAAG,CAAC,EAC7C,OAAO,EACP,KAAK,EACL,IAAI,GAKL;IACC,IAAI,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,OAAO,EAAE,CAAC,EAAE;QACvD,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;KAC5C;IACD,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,KAAK,EAAE,CAAC,EAAE;QAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC;KAC1C;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAClC,CAAC;;ACLD;;;AAGO,MAAM,8BAA8B,GAEvC,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC;IAClC,M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O,EAAE;sDAAuD;AAWvD;IADTC,wCAAc,CAAC,cAAc,CAAC;mEACW;;;;;","names":["h","Button","LeftArrow","FacetValueLink","FacetValueLabelHighlight","getFieldValueCaption","index","buildSearchStatus","buildTabManager","buildCategoryFacet","announceFacetSearchResultsWithAriaLive","initializePopover","FocusTargetController","shouldUpdateFacetSearchComponent","buildFacetConditionsManager","parseDependsOn","FacetHeader","FacetSearchInput","getFieldCaptions","FacetSearchMatches","FacetShowMoreLess","FacetGuard","FacetContainer","shouldDisplaySearchResults","Fragment","FacetValuesGroup","FacetPlaceholder","InitializeBindings","BindStateToController","ArrayProp","MapProp","AriaLiveRegion"],"sources":["src/components/common/facets/category-facet/all-categories-localized-label.ts","src/components/common/facets/category-facet/stencil-all-categories-button.tsx","src/components/common/facets/category-facet/stencil-value-link.tsx","src/components/common/facets/category-facet/stencil-child-value-link.tsx","src/components/common/facets/category-facet/stencil-children-as-tree-container.tsx","src/components/common/facets/category-facet/stencil-parent-as-tree-container.tsx","src/components/common/facets/category-facet/stencil-parent-button.tsx","src/components/common/facets/category-facet/stencil-parent-value-link.tsx","src/components/common/facets/category-facet/stencil-search-results-container.tsx","src/components/common/facets/category-facet/stencil-search-value.tsx","src/components/common/facets/category-facet/stencil-value-as-tree-container.tsx","src/components/search/facets/atomic-category-facet/atomic-category-facet.pcss?tag=atomic-category-facet&encapsulation=shadow","src/components/search/facets/atomic-category-facet/atomic-category-facet.tsx"],"sourcesContent":["import type {i18n} from 'i18next';\n\nexport const getAllCategoriesLocalizedLabel = ({\n facetId,\n field,\n i18n,\n}: {\n facetId?: string;\n field: string;\n i18n: i18n;\n}) => {\n if (facetId && i18n.exists(`all-categories-${facetId}`)) {\n return i18n.t(`all-categories-${facetId}`);\n }\n if (i18n.exists(`all-categories-${field}`)) {\n return i18n.t(`all-categories-${field}`);\n }\n return i18n.t('all-categories');\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport LeftArrow from '../../../../images/arrow-left-rounded.svg';\nimport {Button} from '../../stencil-button';\nimport { getAllCategoriesLocalizedLabel } from './all-categories-localized-label';\n\ninterface CategoryFacetAllCategoryButtonProps {\n i18n: i18n;\n onClick(): void;\n facetId?: string;\n field: string;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const CategoryFacetAllCategoryButton: FunctionalComponent<\n CategoryFacetAllCategoryButtonProps\n> = ({i18n, onClick, facetId, field}) => {\n const allCategories = getAllCategoriesLocalizedLabel({facetId, field, i18n});\n return (\n <Button\n style=\"text-neutral\"\n part=\"all-categories-button\"\n onClick={() => {\n onClick();\n }}\n >\n <atomic-icon\n aria-hidden=\"true\"\n icon={LeftArrow}\n part=\"back-arrow\"\n ></atomic-icon>\n <span class=\"truncate\">{allCategories}</span>\n </Button>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {FacetValueLabelHighlight} from '../facet-value-label-highlight/stencil-facet-value-label-highlight';\nimport {FacetValueLink} from '../facet-value-link/stencil-facet-value-link';\n\nexport interface CategoryFacetValueLinkProps {\n displayValue: string;\n numberOfResults: number;\n i18n: i18n;\n onClick: () => void;\n isParent: boolean;\n isSelected: boolean;\n searchQuery: string;\n isLeafValue: boolean;\n setRef: (el?: HTMLButtonElement) => void;\n}\n\nexport const CategoryFacetValueLink: FunctionalComponent<\n CategoryFacetValueLinkProps\n> = (\n {\n displayValue,\n numberOfResults,\n i18n,\n onClick,\n isParent,\n isSelected,\n searchQuery,\n isLeafValue,\n setRef,\n },\n children\n) => {\n const partNames = [];\n if (isParent) {\n partNames.push('active-parent');\n } else {\n partNames.push(`value-link${isSelected ? ' value-link-selected' : ''}`);\n }\n\n if (isLeafValue) {\n partNames.push('leaf-value');\n } else {\n partNames.push('node-value');\n }\n\n return (\n <FacetValueLink\n displayValue={displayValue}\n numberOfResults={numberOfResults}\n isSelected={isSelected}\n i18n={i18n}\n onClick={() => {\n onClick();\n }}\n searchQuery={searchQuery}\n part={partNames.join(' ')}\n class=\"contents\"\n buttonRef={(btn) => setRef(btn)}\n subList={children}\n >\n <FacetValueLabelHighlight\n displayValue={displayValue}\n isSelected={isSelected}\n ></FacetValueLabelHighlight>\n </FacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {\n CategoryFacetValueLink,\n CategoryFacetValueLinkProps,\n} from './stencil-value-link';\n\ninterface CategoryFacetChildValueLinkProps\n extends Omit<CategoryFacetValueLinkProps, 'isParent'> {}\n\nexport const CategoryFacetChildValueLink: FunctionalComponent<\n CategoryFacetChildValueLinkProps\n> = (props, children) => {\n return (\n <CategoryFacetValueLink {...props} isParent={false}>\n {children}\n </CategoryFacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\ninterface CategoryFacetChildrenAsTreeContainerProps {\n className?: string;\n}\nexport const CategoryFacetChildrenAsTreeContainer: FunctionalComponent<\n CategoryFacetChildrenAsTreeContainerProps\n> = ({className}, children) => {\n return (\n <ul part=\"values\" class={className ?? ''}>\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport interface CategoryFacetParentAsTreeContainerProps {\n isTopLevel: boolean;\n className?: string;\n}\nexport const CategoryFacetParentAsTreeContainer: FunctionalComponent<\n CategoryFacetParentAsTreeContainerProps\n> = ({isTopLevel, className}, children) => {\n return (\n <ul class={className ?? ''} part={`${isTopLevel ? '' : 'sub-'}parents`}>\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport LeftArrow from '../../../../images/arrow-left-rounded.svg';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {Button} from '../../stencil-button';\n\ninterface CategoryFacetParentButtonProps {\n i18n: i18n;\n field: string;\n facetValue: {value: string; numberOfResults: number};\n onClick: () => void;\n}\nexport const CategoryFacetParentButton: FunctionalComponent<\n CategoryFacetParentButtonProps\n> = ({field, facetValue, i18n, onClick}) => {\n const displayValue = getFieldValueCaption(field, facetValue.value, i18n);\n const ariaLabel = i18n.t('facet-value', {\n value: displayValue,\n count: facetValue.numberOfResults,\n formattedCount: facetValue.numberOfResults.toLocaleString(i18n.language),\n });\n\n return (\n <Button\n style=\"text-neutral\"\n part=\"parent-button\"\n ariaPressed=\"false\"\n onClick={() => {\n onClick();\n }}\n ariaLabel={ariaLabel}\n >\n <atomic-icon\n icon={LeftArrow}\n part=\"back-arrow\"\n class=\"back-arrow\"\n ></atomic-icon>\n <span class=\"truncate\">{displayValue}</span>\n </Button>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {\n CategoryFacetValueLink,\n CategoryFacetValueLinkProps,\n} from './stencil-value-link';\n\ninterface CategoryFacetParentValueLinkProps\n extends Omit<CategoryFacetValueLinkProps, 'isParent' | 'isSelected'> {}\n\nexport const CategoryFacetParentValueLink: FunctionalComponent<\n CategoryFacetParentValueLinkProps\n> = (props, children) => {\n return (\n <CategoryFacetValueLink {...props} isParent isSelected>\n {children}\n </CategoryFacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport const CategoryFacetSearchResultsContainer: FunctionalComponent = (\n _,\n children\n) => {\n return (\n <ul part=\"search-results\" class=\"mt-3\">\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {Button} from '../../stencil-button';\nimport {FacetValueLabelHighlight} from '../facet-value-label-highlight/stencil-facet-value-label-highlight';\nimport { getAllCategoriesLocalizedLabel } from './all-categories-localized-label';\ninterface CategoryFacetSearchValueProps {\n value: {count: number; path: string[]; displayValue: string};\n i18n: i18n;\n field: string;\n facetId?: string;\n onClick(): void;\n searchQuery: string;\n}\n\nconst SEPARATOR = '/';\nconst ELLIPSIS = '...';\nconst PATH_MAX_LENGTH = 3;\n\nexport const CategoryFacetSearchValue: FunctionalComponent<\n CategoryFacetSearchValueProps\n> = ({value, facetId, field, i18n, onClick, searchQuery}) => {\n const count = value.count.toLocaleString(i18n.language);\n const inLabel = i18n.t('in');\n const allCategories = getAllCategoriesLocalizedLabel({facetId, field, i18n});\n const localizedPath = value.path.length\n ? value.path.map((value) => getFieldValueCaption(field, value, i18n))\n : [allCategories];\n const ariaLabel = i18n.t('under', {\n child: i18n.t('facet-value', {\n count: value.count,\n formattedCount: count,\n value: value.displayValue,\n }),\n parent: localizedPath.join(', '),\n });\n\n function ellipsedPath(path: string[]) {\n if (path.length <= PATH_MAX_LENGTH) {\n return path;\n }\n const firstPart = path.slice(0, 1);\n const lastParts = path.slice(-PATH_MAX_LENGTH + 1);\n return firstPart.concat(ELLIPSIS, ...lastParts);\n }\n\n function renderPath(path: string[]) {\n if (!path.length) {\n return <span class=\"truncate\">{`${inLabel} ${allCategories}`}</span>;\n }\n\n return [\n <span class=\"mr-0.5\">{inLabel}</span>,\n ellipsedPath(path).map((value, index) => [\n index > 0 && <span class=\"mx-0.5\">{SEPARATOR}</span>,\n <span class={value === ELLIPSIS ? '' : 'max-w-max flex-1 truncate'}>\n {value}\n </span>,\n ]),\n ];\n }\n\n return (\n <li key={value.displayValue}>\n <Button\n style=\"text-neutral\"\n part=\"search-result\"\n onClick={() => onClick()}\n class=\"group flex w-full flex-col truncate px-2 py-2.5 focus-visible:outline-none\"\n aria-label={ariaLabel}\n >\n <div class=\"flex w-full\">\n <FacetValueLabelHighlight\n displayValue={value.displayValue}\n isSelected={false}\n searchQuery={searchQuery}\n ></FacetValueLabelHighlight>\n <span part=\"value-count\" class=\"value-count\">\n {i18n.t('between-parentheses', {\n text: count,\n })}\n </span>\n </div>\n <div\n part=\"search-result-path\"\n class=\"text-neutral-dark group-focus:text-primary group-hover:text-primary mt-1 flex w-full\"\n >\n {renderPath(localizedPath)}\n </div>\n </Button>\n </li>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport const CategoryFacetTreeValueContainer: FunctionalComponent = (\n _,\n children\n) => {\n return <li class=\"contents\">{children}</li>;\n};\n","@import '../../../common/facets/facet-common.pcss';\n@import '../../../common/facets/facet-search/facet-search.pcss';\n\n[part~='active-parent'] {\n @apply pl-9;\n}\n\n[part~='parents'] [part~='values'] {\n @apply pl-9;\n}\n\n[part~='all-categories-button'],\n[part~='parent-button'] {\n @apply relative flex w-full items-center py-2.5 pr-2 pl-7 text-left;\n}\n\n[part~='back-arrow'] {\n @apply absolute left-1 h-5 w-5;\n}\n","import {\n CategoryFacet,\n buildCategoryFacet,\n CategoryFacetState,\n CategoryFacetOptions,\n CategoryFacetSortCriterion,\n SearchStatus,\n SearchStatusState,\n buildSearchStatus,\n CategoryFacetValue,\n buildFacetConditionsManager,\n FacetConditionsManager,\n FacetValueRequest,\n CategoryFacetValueRequest,\n TabManagerState,\n TabManager,\n buildTabManager,\n} from '@coveo/headless';\nimport {Component, h, State, Prop, Element, Fragment} from '@stencil/core';\nimport {\n getFieldCaptions,\n getFieldValueCaption,\n} from '../../../../utils/field-utils';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp, MapProp} from '../../../../utils/props-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {CategoryFacetAllCategoryButton} from '../../../common/facets/category-facet/stencil-all-categories-button';\nimport {CategoryFacetChildValueLink} from '../../../common/facets/category-facet/stencil-child-value-link';\nimport {CategoryFacetChildrenAsTreeContainer} from '../../../common/facets/category-facet/stencil-children-as-tree-container';\nimport {CategoryFacetParentAsTreeContainer} from '../../../common/facets/category-facet/stencil-parent-as-tree-container';\nimport {CategoryFacetParentButton} from '../../../common/facets/category-facet/stencil-parent-button';\nimport {CategoryFacetParentValueLink} from '../../../common/facets/category-facet/stencil-parent-value-link';\nimport {CategoryFacetSearchResultsContainer} from '../../../common/facets/category-facet/stencil-search-results-container';\nimport {CategoryFacetSearchValue} from '../../../common/facets/category-facet/stencil-search-value';\nimport {CategoryFacetTreeValueContainer} from '../../../common/facets/category-facet/stencil-value-as-tree-container';\nimport {parseDependsOn} from '../../../common/facets/depends-on';\nimport {FacetInfo} from '../../../common/facets/facet-common-store';\nimport {FacetContainer} from '../../../common/facets/facet-container/stencil-facet-container';\nimport {FacetGuard} from '../../../common/facets/facet-guard';\nimport {FacetHeader} from '../../../common/facets/facet-header/stencil-facet-header';\nimport {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';\nimport {announceFacetSearchResultsWithAriaLive} from '../../../common/facets/facet-search/facet-search-aria-live';\nimport {\n shouldUpdateFacetSearchComponent,\n shouldDisplaySearchResults,\n} from '../../../common/facets/facet-search/facet-search-utils';\nimport {FacetSearchInput} from '../../../common/facets/facet-search/stencil-facet-search-input';\nimport {FacetSearchMatches} from '../../../common/facets/facet-search/stencil-facet-search-matches';\nimport {FacetShowMoreLess} from '../../../common/facets/facet-show-more-less/stencil-facet-show-more-less';\nimport {FacetValuesGroup} from '../../../common/facets/facet-values-group/stencil-facet-values-group';\nimport {initializePopover} from '../../../common/facets/popover/popover-type';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * A facet is a list of values for a certain field occurring in the results, ordered using a configurable criteria (e.g., number of occurrences).\n * An `atomic-category-facet` displays a facet of values in a browsable, hierarchical fashion.\n *\n * @part facet - The wrapper for the entire facet.\n * @part placeholder - The placeholder shown before the first search is executed.\n *\n * @part label-button - The button that displays the label and allows to expand/collapse the facet.\n * @part label-button-icon - The label button icon.\n *\n * @part search-wrapper - The search box wrapper.\n * @part search-input - The search box input.\n * @part search-icon - The search box submit button.\n * @part search-clear-button - The button to clear the search box of input.\n * @part more-matches - The label indicating there are more matches for the current facet search query.\n * @part no-matches - The label indicating there are no matches for the current facet search query.\n * @part matches-query - The highlighted query inside the matches labels.\n * @part search-results - The search results container.\n * @part search-result - The search result value.\n * @part search-result-path - The search result path.\n * @part search-highlight - The highlighted query inside the facet values.\n *\n * @part parents - The container surrounding the whole hierarchy of values.\n * @part sub-parents - The container surrounding a sub-hierarchy of values.\n * @part values - The container surrounding either the children of the active value or the values at the base.\n * @part all-categories-button - The \"View all\" button displayed first within the parents.\n * @part parent-button - The clickable parent button displayed first within sub-parents.\n * @part active-parent - The clickable active parent displayed first within the last sub-parents.\n * @part value-link - The clickable value displayed first within values.\n * @part back-arrow - The back arrow displayed before the clickable parents.\n * @part value-label - The facet value label within a value button.\n * @part value-count - The facet value count within a value button.\n * @part leaf-value - A facet value with no child value.\n * @part node-value - A facet value with child values.\n *\n * @part show-more - The show more results button.\n * @part show-less - The show less results button.\n * @part show-more-less-icon - The icons of the show more & show less buttons.\n */\n@Component({\n tag: 'atomic-category-facet',\n styleUrl: 'atomic-category-facet.pcss',\n shadow: true,\n})\nexport class AtomicCategoryFacet implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public facet!: CategoryFacet;\n private dependenciesManager?: FacetConditionsManager;\n private resultIndexToFocusOnShowMore = 0;\n public searchStatus!: SearchStatus;\n public tabManager!: TabManager;\n @Element() private host!: HTMLElement;\n\n @BindStateToController('facet')\n @State()\n public facetState!: CategoryFacetState;\n @BindStateToController('searchStatus')\n @State()\n public searchStatusState!: SearchStatusState;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() public error!: Error;\n\n /**\n * Specifies a unique identifier for the facet.\n */\n @Prop({mutable: true, reflect: true}) public facetId?: string;\n /**\n * The non-localized label for the facet.\n * Used in the `atomic-breadbox` component through the bindings store.\n */\n @Prop({reflect: true}) public label = 'no-label';\n /**\n * The field whose values you want to display in the facet.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * The tabs on which the facet can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-timeframe-facet tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-timeframe-facet>\n * ```\n * If you don't set this property, the facet can be displayed on any tab. Otherwise, the facet can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this facet must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-timeframe-facet tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-timeframe-facet>\n * ```\n * If you don't set this property, the facet can be displayed on any tab. Otherwise, the facet won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n\n /**\n * The number of values to request for this facet.\n * Also determines the number of additional values to request each time more values are shown.\n */\n @Prop({reflect: true}) public numberOfValues = 8;\n /**\n * Whether this facet should contain a search box.\n *\n */\n @Prop({reflect: true}) public withSearch = false;\n /**\n * The sort criterion to apply to the returned facet values.\n * Possible values are 'alphanumeric' and 'occurrences'.\n * For this criterion to apply to the top-layer facet values, disable\n * [facet value ordering](https://docs.coveo.com/en/l1qf4156/#facet-value-ordering)\n * in your Dynamic Navigation Experience configuration.\n */\n // TODO: add automatic (occurrences when not expanded, alphanumeric when expanded)\n @Prop({reflect: true}) public sortCriteria: CategoryFacetSortCriterion =\n 'occurrences';\n /**\n * The character that separates values of a multi-value field.\n *\n * *Note:* If you use the [example formatting](https://docs.coveo.com/en/atomic/latest/reference/components/atomic-category-facet/#usage-notes) for the associated multi-value field, you must set this value to `|` or the facet won't display properly.\n */\n @Prop({reflect: true}) public delimitingCharacter = ';';\n /**\n * The base path shared by all values for the facet.\n *\n * Specify the property as an array using a JSON string representation:\n * ```html\n * <atomic-category-facet base-path='[\"first value\", \"second value\"]' ></atomic-category-facet>\n * ```\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public basePath: string[] | string = '[]';\n\n /**\n * Whether to use basePath as a filter for the results.\n */\n @Prop({reflect: true}) public filterByBasePath = true;\n /**\n * Specifies whether the facet is collapsed. When the facet is the child of an `atomic-facet-manager` component, the facet manager controls this property.\n */\n @Prop({reflect: true, mutable: true}) public isCollapsed = false;\n /**\n * The [heading level](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) to use for the heading over the facet, from 1 to 6.\n */\n @Prop({reflect: true}) public headingLevel = 0;\n /**\n * Whether to exclude the parents of folded results when estimating the result count for each facet value.\n *\n *\n * Note: Resulting count is only an estimation, in some cases this value could be incorrect.\n */\n @Prop({reflect: true}) public filterFacetCount = true;\n /**\n * The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.\n * Note: A high injectionDepth may negatively impact the facet request performance.\n * Minimum: `0`\n * Default: `1000`\n */\n @Prop({reflect: true}) public injectionDepth = 1000;\n // @Prop() public customSort?: string; TODO: KIT-753 Add customSort option for facet\n\n /**\n * The required facets and values for this facet to be displayed.\n * Examples:\n * ```html\n * <atomic-facet facet-id=\"abc\" field=\"objecttype\" ...></atomic-facet>\n *\n * <!-- To show the facet when any value is selected in the facet with id \"abc\": -->\n * <atomic-category-facet\n * depends-on-abc\n * ...\n * ></atomic-category-facet>\n *\n * <!-- To show the facet when value \"doc\" is selected in the facet with id \"abc\": -->\n * <atomic-category-facet\n * depends-on-abc=\"doc\"\n * ...\n * ></atomic-category-facet>\n * ```\n */\n @MapProp() @Prop() public dependsOn: Record<string, string> = {};\n\n private showLessFocus?: FocusTargetController;\n\n private showMoreFocus?: FocusTargetController;\n\n private headerFocus?: FocusTargetController;\n\n private activeValueFocus?: FocusTargetController;\n\n @AriaLiveRegion('facet-search')\n protected facetSearchAriaMessage!: string;\n\n public initialize() {\n if (\n [...this.tabsIncluded].length > 0 &&\n [...this.tabsExcluded].length > 0\n ) {\n console.warn(\n 'Values for both \"tabs-included\" and \"tabs-excluded\" have been provided. This is could lead to unexpected behaviors.'\n );\n }\n this.searchStatus = buildSearchStatus(this.bindings.engine);\n this.tabManager = buildTabManager(this.bindings.engine);\n const options: CategoryFacetOptions = {\n facetId: this.facetId,\n field: this.field,\n numberOfValues: this.numberOfValues,\n sortCriteria: this.sortCriteria,\n facetSearch: {numberOfValues: this.numberOfValues},\n basePath: [...this.basePath],\n delimitingCharacter: this.delimitingCharacter,\n filterByBasePath: this.filterByBasePath,\n injectionDepth: this.injectionDepth,\n filterFacetCount: this.filterFacetCount,\n tabs: {\n included: [...this.tabsIncluded],\n excluded: [...this.tabsExcluded],\n },\n };\n this.facet = buildCategoryFacet(this.bindings.engine, {options});\n announceFacetSearchResultsWithAriaLive(\n this.facet,\n this.label,\n (msg) => (this.facetSearchAriaMessage = msg),\n this.bindings.i18n\n );\n this.facetId = this.facet.state.facetId;\n const facetInfo: FacetInfo = {\n label: () => this.bindings.i18n.t(this.label),\n facetId: this.facetId!,\n element: this.host,\n isHidden: () => this.isHidden,\n };\n this.bindings.store.registerFacet('categoryFacets', facetInfo);\n initializePopover(this.host, {\n ...facetInfo,\n hasValues: () => !!this.facet.state.valuesAsTrees.length,\n numberOfActiveValues: () => (this.facetState.hasActiveValues ? 1 : 0),\n });\n this.initializeDependenciesManager();\n }\n\n private get focusTargets() {\n if (!this.showLessFocus) {\n this.showLessFocus = new FocusTargetController(this);\n }\n if (!this.showMoreFocus) {\n this.showMoreFocus = new FocusTargetController(this);\n }\n if (!this.headerFocus) {\n this.headerFocus = new FocusTargetController(this);\n }\n if (!this.activeValueFocus) {\n this.activeValueFocus = new FocusTargetController(this);\n }\n\n return {\n showLessFocus: this.showLessFocus,\n showMoreFocus: this.showMoreFocus,\n headerFocus: this.headerFocus,\n activeValueFocus: this.activeValueFocus,\n };\n }\n\n public disconnectedCallback() {\n if (this.host.isConnected) {\n return;\n }\n this.dependenciesManager?.stopWatching();\n }\n\n private get isHidden() {\n return (\n this.searchStatusState.hasError ||\n !this.facet.state.enabled ||\n (!this.facet.state.selectedValueAncestry.length &&\n !this.facet.state.valuesAsTrees.length)\n );\n }\n\n public componentShouldUpdate(\n next: unknown,\n prev: unknown,\n propName: keyof AtomicCategoryFacet\n ) {\n if (\n this.isCategoryFacetState(prev, propName) &&\n this.isCategoryFacetState(next, propName)\n ) {\n return shouldUpdateFacetSearchComponent(\n next.facetSearch,\n prev.facetSearch\n );\n }\n return true;\n }\n\n private get hasParents() {\n return !!this.facetState.selectedValueAncestry.length;\n }\n\n private initializeDependenciesManager() {\n this.dependenciesManager = buildFacetConditionsManager(\n this.bindings.engine,\n {\n facetId: this.facetId!,\n conditions: parseDependsOn<\n FacetValueRequest | CategoryFacetValueRequest\n >(this.dependsOn),\n }\n );\n }\n\n private renderHeader() {\n return (\n <FacetHeader\n i18n={this.bindings.i18n}\n label={this.label}\n numberOfActiveValues={\n this.facetState.hasActiveValues && this.isCollapsed ? 1 : 0\n }\n isCollapsed={this.isCollapsed}\n headingLevel={this.headingLevel}\n onToggleCollapse={() => (this.isCollapsed = !this.isCollapsed)}\n onClearFilters={() => {\n this.focusTargets.headerFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n headerRef={(header) => {\n this.focusTargets.headerFocus.setTarget(header);\n if (!this.hasParents) {\n this.focusTargets.activeValueFocus.setTarget(header);\n }\n }}\n ></FacetHeader>\n );\n }\n\n private renderSearchInput() {\n if (!this.withSearch) {\n return;\n }\n\n return (\n <FacetSearchInput\n i18n={this.bindings.i18n}\n label={this.label}\n query={this.facetState.facetSearch.query}\n onChange={(value) => {\n if (value === '') {\n this.facet.facetSearch.clear();\n return;\n }\n this.facet.facetSearch.updateCaptions(\n getFieldCaptions(this.field, this.bindings.i18n)\n );\n this.facet.facetSearch.updateText(value);\n this.facet.facetSearch.search();\n }}\n onClear={() => this.facet.facetSearch.clear()}\n ></FacetSearchInput>\n );\n }\n\n private renderValuesTree(\n valuesAsTrees: CategoryFacetValue[],\n isRoot: boolean\n ) {\n if (!this.hasParents) {\n return this.renderChildren();\n }\n\n if (isRoot) {\n return (\n <CategoryFacetTreeValueContainer>\n <CategoryFacetAllCategoryButton\n i18n={this.bindings.i18n}\n facetId={this.facet.state.facetId}\n field={this.field}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n />\n <CategoryFacetParentAsTreeContainer isTopLevel={false}>\n {this.renderValuesTree(valuesAsTrees, false)}\n </CategoryFacetParentAsTreeContainer>\n </CategoryFacetTreeValueContainer>\n );\n }\n\n if (valuesAsTrees.length > 1) {\n const parentValue = valuesAsTrees[0];\n\n return (\n <CategoryFacetTreeValueContainer>\n <CategoryFacetParentButton\n facetValue={parentValue}\n field={this.field}\n i18n={this.bindings.i18n}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.toggleSelect(parentValue);\n }}\n />\n <CategoryFacetParentAsTreeContainer isTopLevel={false}>\n {this.renderValuesTree(valuesAsTrees.slice(1), false)}\n </CategoryFacetParentAsTreeContainer>\n </CategoryFacetTreeValueContainer>\n );\n }\n\n const activeParent = valuesAsTrees[0];\n const activeParentDisplayValue = getFieldValueCaption(\n this.field,\n activeParent.value,\n this.bindings.i18n\n );\n\n return (\n <CategoryFacetParentValueLink\n displayValue={activeParentDisplayValue}\n numberOfResults={activeParent.numberOfResults}\n i18n={this.bindings.i18n}\n isLeafValue={activeParent.isLeafValue}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n searchQuery={this.facetState.facetSearch.query}\n setRef={(el) => this.focusTargets.activeValueFocus.setTarget(el)}\n >\n <CategoryFacetChildrenAsTreeContainer>\n {this.renderChildren()}\n </CategoryFacetChildrenAsTreeContainer>\n </CategoryFacetParentValueLink>\n );\n }\n\n private renderChild(\n facetValue: CategoryFacetValue,\n isShowLessFocusTarget: boolean,\n isShowMoreFocusTarget: boolean\n ) {\n const displayValue = getFieldValueCaption(\n this.field,\n facetValue.value,\n this.bindings.i18n\n );\n const isSelected = facetValue.state === 'selected';\n return (\n <CategoryFacetChildValueLink\n displayValue={displayValue}\n i18n={this.bindings.i18n}\n isLeafValue={facetValue.isLeafValue}\n isSelected={isSelected}\n numberOfResults={facetValue.numberOfResults}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.toggleSelect(facetValue);\n }}\n searchQuery={this.facetState.facetSearch.query}\n setRef={(element) => {\n isShowLessFocusTarget &&\n this.focusTargets.showLessFocus.setTarget(element);\n isShowMoreFocusTarget &&\n this.focusTargets.showMoreFocus.setTarget(element);\n }}\n ></CategoryFacetChildValueLink>\n );\n }\n\n private renderChildren() {\n if (!this.facetState.valuesAsTrees.length) {\n return;\n }\n if (this.facetState.selectedValueAncestry.length > 0) {\n return this.facetState.selectedValueAncestry\n .find((value) => value.state === 'selected')\n ?.children.map((value, i) =>\n this.renderChild(\n value,\n i === 0,\n i === this.resultIndexToFocusOnShowMore\n )\n );\n }\n\n return this.facetState.valuesAsTrees.map((value, i) =>\n this.renderChild(value, i === 0, i === this.resultIndexToFocusOnShowMore)\n );\n }\n\n private renderSearchResults() {\n return (\n <CategoryFacetSearchResultsContainer>\n {this.facetState.facetSearch.values.map((value) => (\n <CategoryFacetSearchValue\n value={value}\n field={this.field}\n facetId={this.facetId}\n i18n={this.bindings.i18n}\n searchQuery={this.facetState.facetSearch.query}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.facetSearch.select(value);\n }}\n ></CategoryFacetSearchValue>\n ))}\n </CategoryFacetSearchResultsContainer>\n );\n }\n\n private renderMatches() {\n return (\n <FacetSearchMatches\n i18n={this.bindings.i18n}\n query={this.facetState.facetSearch.query}\n numberOfMatches={this.facetState.facetSearch.values.length}\n hasMoreMatches={this.facetState.facetSearch.moreValuesAvailable}\n showMoreMatches={() => this.facet.facetSearch.showMoreResults()}\n ></FacetSearchMatches>\n );\n }\n\n private renderShowMoreLess() {\n return (\n <div class={this.hasParents ? 'pl-9' : ''}>\n <FacetShowMoreLess\n label={this.label}\n i18n={this.bindings.i18n}\n onShowMore={() => {\n this.resultIndexToFocusOnShowMore =\n this.facetState.valuesAsTrees[0].children.length;\n this.focusTargets.showMoreFocus.focusAfterSearch();\n this.facet.showMoreValues();\n }}\n onShowLess={() => {\n this.focusTargets.showLessFocus.focusAfterSearch();\n this.facet.showLessValues();\n }}\n canShowLessValues={this.facetState.canShowLessValues}\n canShowMoreValues={this.facetState.canShowMoreValues}\n ></FacetShowMoreLess>\n </div>\n );\n }\n\n private isCategoryFacetState(\n state: unknown,\n propName: string\n ): state is CategoryFacetState {\n return (\n propName === 'facetState' &&\n typeof (state as CategoryFacetState)?.facetId === 'string'\n );\n }\n\n public render() {\n const {\n bindings: {i18n},\n label,\n facetState: {facetSearch, enabled, valuesAsTrees, selectedValueAncestry},\n searchStatusState: {hasError, firstSearchExecuted},\n } = this;\n\n return (\n <FacetGuard\n enabled={enabled}\n firstSearchExecuted={firstSearchExecuted}\n hasError={hasError}\n hasResults={valuesAsTrees.length > 0}\n >\n {firstSearchExecuted ? (\n <FacetContainer>\n {this.renderHeader()}\n {!this.isCollapsed && [\n this.renderSearchInput(),\n shouldDisplaySearchResults(facetSearch) ? (\n <Fragment>\n {facetSearch.values.length ? (\n <FacetValuesGroup\n i18n={i18n}\n label={label}\n query={facetSearch.query}\n >\n {this.renderSearchResults()}\n </FacetValuesGroup>\n ) : (\n <div class=\"mt-3\"></div>\n )}\n {this.renderMatches()}\n </Fragment>\n ) : (\n <Fragment>\n <FacetValuesGroup i18n={i18n} label={label}>\n {this.hasParents ? (\n <CategoryFacetParentAsTreeContainer\n isTopLevel={true}\n className=\"mt-3\"\n >\n {this.renderValuesTree(selectedValueAncestry, true)}\n </CategoryFacetParentAsTreeContainer>\n ) : (\n <CategoryFacetChildrenAsTreeContainer className=\"mt-3\">\n {this.renderChildren()}\n </CategoryFacetChildrenAsTreeContainer>\n )}\n </FacetValuesGroup>\n {this.renderShowMoreLess()}\n </Fragment>\n ),\n ]}\n </FacetContainer>\n ) : (\n <FacetPlaceholder\n isCollapsed={this.isCollapsed}\n numberOfValues={this.numberOfValues}\n />\n )}\n </FacetGuard>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"atomic-category-facet.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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FieldValueCaption","index","buildSearchStatus","buildTabManager","buildCategoryFacet","announceFacetSearchResultsWithAriaLive","initializePopover","FocusTargetController","shouldUpdateFacetSearchComponent","buildFacetConditionsManager","parseDependsOn","FacetHeader","FacetSearchInput","getFieldCaptions","FacetSearchMatches","FacetShowMoreLess","FacetGuard","FacetContainer","shouldDisplaySearchResults","Fragment","FacetValuesGroup","FacetPlaceholder","InitializeBindings","BindStateToController","ArrayProp","MapProp","AriaLiveRegion"],"sources":["src/components/common/facets/category-facet/stencil-all-categories-button.tsx","src/components/common/facets/category-facet/stencil-value-link.tsx","src/components/common/facets/category-facet/stencil-child-value-link.tsx","src/components/common/facets/category-facet/stencil-children-as-tree-container.tsx","src/components/common/facets/category-facet/stencil-parent-as-tree-container.tsx","src/components/common/facets/category-facet/stencil-parent-button.tsx","src/components/common/facets/category-facet/stencil-parent-value-link.tsx","src/components/common/facets/category-facet/stencil-search-results-container.tsx","src/components/common/facets/category-facet/stencil-search-value.tsx","src/components/common/facets/category-facet/stencil-value-as-tree-container.tsx","src/components/search/facets/atomic-category-facet/atomic-category-facet.pcss?tag=atomic-category-facet&encapsulation=shadow","src/components/search/facets/atomic-category-facet/atomic-category-facet.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport LeftArrow from '../../../../images/arrow-left-rounded.svg';\nimport {Button} from '../../stencil-button';\n\ninterface CategoryFacetAllCategoryButtonProps {\n i18n: i18n;\n onClick(): void;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const CategoryFacetAllCategoryButton: FunctionalComponent<\n CategoryFacetAllCategoryButtonProps\n> = ({i18n, onClick}) => {\n const allCategories = i18n.t('all-categories');\n return (\n <Button\n style=\"text-neutral\"\n part=\"all-categories-button\"\n onClick={() => {\n onClick();\n }}\n >\n <atomic-icon\n aria-hidden=\"true\"\n icon={LeftArrow}\n part=\"back-arrow\"\n ></atomic-icon>\n <span class=\"truncate\">{allCategories}</span>\n </Button>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {FacetValueLabelHighlight} from '../facet-value-label-highlight/stencil-facet-value-label-highlight';\nimport {FacetValueLink} from '../facet-value-link/stencil-facet-value-link';\n\nexport interface CategoryFacetValueLinkProps {\n displayValue: string;\n numberOfResults: number;\n i18n: i18n;\n onClick: () => void;\n isParent: boolean;\n isSelected: boolean;\n searchQuery: string;\n isLeafValue: boolean;\n setRef: (el?: HTMLButtonElement) => void;\n}\n\nexport const CategoryFacetValueLink: FunctionalComponent<\n CategoryFacetValueLinkProps\n> = (\n {\n displayValue,\n numberOfResults,\n i18n,\n onClick,\n isParent,\n isSelected,\n searchQuery,\n isLeafValue,\n setRef,\n },\n children\n) => {\n const partNames = [];\n if (isParent) {\n partNames.push('active-parent');\n } else {\n partNames.push(`value-link${isSelected ? ' value-link-selected' : ''}`);\n }\n\n if (isLeafValue) {\n partNames.push('leaf-value');\n } else {\n partNames.push('node-value');\n }\n\n return (\n <FacetValueLink\n displayValue={displayValue}\n numberOfResults={numberOfResults}\n isSelected={isSelected}\n i18n={i18n}\n onClick={() => {\n onClick();\n }}\n searchQuery={searchQuery}\n part={partNames.join(' ')}\n class=\"contents\"\n buttonRef={(btn) => setRef(btn)}\n subList={children}\n >\n <FacetValueLabelHighlight\n displayValue={displayValue}\n isSelected={isSelected}\n ></FacetValueLabelHighlight>\n </FacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {\n CategoryFacetValueLink,\n CategoryFacetValueLinkProps,\n} from './stencil-value-link';\n\ninterface CategoryFacetChildValueLinkProps\n extends Omit<CategoryFacetValueLinkProps, 'isParent'> {}\n\nexport const CategoryFacetChildValueLink: FunctionalComponent<\n CategoryFacetChildValueLinkProps\n> = (props, children) => {\n return (\n <CategoryFacetValueLink {...props} isParent={false}>\n {children}\n </CategoryFacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\ninterface CategoryFacetChildrenAsTreeContainerProps {\n className?: string;\n}\nexport const CategoryFacetChildrenAsTreeContainer: FunctionalComponent<\n CategoryFacetChildrenAsTreeContainerProps\n> = ({className}, children) => {\n return (\n <ul part=\"values\" class={className ?? ''}>\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport interface CategoryFacetParentAsTreeContainerProps {\n isTopLevel: boolean;\n className?: string;\n}\nexport const CategoryFacetParentAsTreeContainer: FunctionalComponent<\n CategoryFacetParentAsTreeContainerProps\n> = ({isTopLevel, className}, children) => {\n return (\n <ul class={className ?? ''} part={`${isTopLevel ? '' : 'sub-'}parents`}>\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport LeftArrow from '../../../../images/arrow-left-rounded.svg';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {Button} from '../../stencil-button';\n\ninterface CategoryFacetParentButtonProps {\n i18n: i18n;\n field: string;\n facetValue: {value: string; numberOfResults: number};\n onClick: () => void;\n}\nexport const CategoryFacetParentButton: FunctionalComponent<\n CategoryFacetParentButtonProps\n> = ({field, facetValue, i18n, onClick}) => {\n const displayValue = getFieldValueCaption(field, facetValue.value, i18n);\n const ariaLabel = i18n.t('facet-value', {\n value: displayValue,\n count: facetValue.numberOfResults,\n formattedCount: facetValue.numberOfResults.toLocaleString(i18n.language),\n });\n\n return (\n <Button\n style=\"text-neutral\"\n part=\"parent-button\"\n ariaPressed=\"false\"\n onClick={() => {\n onClick();\n }}\n ariaLabel={ariaLabel}\n >\n <atomic-icon\n icon={LeftArrow}\n part=\"back-arrow\"\n class=\"back-arrow\"\n ></atomic-icon>\n <span class=\"truncate\">{displayValue}</span>\n </Button>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {\n CategoryFacetValueLink,\n CategoryFacetValueLinkProps,\n} from './stencil-value-link';\n\ninterface CategoryFacetParentValueLinkProps\n extends Omit<CategoryFacetValueLinkProps, 'isParent' | 'isSelected'> {}\n\nexport const CategoryFacetParentValueLink: FunctionalComponent<\n CategoryFacetParentValueLinkProps\n> = (props, children) => {\n return (\n <CategoryFacetValueLink {...props} isParent isSelected>\n {children}\n </CategoryFacetValueLink>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport const CategoryFacetSearchResultsContainer: FunctionalComponent = (\n _,\n children\n) => {\n return (\n <ul part=\"search-results\" class=\"mt-3\">\n {children}\n </ul>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {Button} from '../../stencil-button';\nimport {FacetValueLabelHighlight} from '../facet-value-label-highlight/stencil-facet-value-label-highlight';\n\ninterface CategoryFacetSearchValueProps {\n value: {count: number; path: string[]; displayValue: string};\n i18n: i18n;\n field: string;\n onClick(): void;\n searchQuery: string;\n}\n\nconst SEPARATOR = '/';\nconst ELLIPSIS = '...';\nconst PATH_MAX_LENGTH = 3;\n\nexport const CategoryFacetSearchValue: FunctionalComponent<\n CategoryFacetSearchValueProps\n> = ({value, field, i18n, onClick, searchQuery}) => {\n const count = value.count.toLocaleString(i18n.language);\n const inLabel = i18n.t('in');\n const allCategories = i18n.t('all-categories');\n const localizedPath = value.path.length\n ? value.path.map((value) => getFieldValueCaption(field, value, i18n))\n : [allCategories];\n const ariaLabel = i18n.t('under', {\n child: i18n.t('facet-value', {\n count: value.count,\n formattedCount: count,\n value: value.displayValue,\n }),\n parent: localizedPath.join(', '),\n });\n\n function ellipsedPath(path: string[]) {\n if (path.length <= PATH_MAX_LENGTH) {\n return path;\n }\n const firstPart = path.slice(0, 1);\n const lastParts = path.slice(-PATH_MAX_LENGTH + 1);\n return firstPart.concat(ELLIPSIS, ...lastParts);\n }\n\n function renderPath(path: string[]) {\n if (!path.length) {\n return <span class=\"truncate\">{`${inLabel} ${allCategories}`}</span>;\n }\n\n return [\n <span class=\"mr-0.5\">{inLabel}</span>,\n ellipsedPath(path).map((value, index) => [\n index > 0 && <span class=\"mx-0.5\">{SEPARATOR}</span>,\n <span class={value === ELLIPSIS ? '' : 'max-w-max flex-1 truncate'}>\n {value}\n </span>,\n ]),\n ];\n }\n\n return (\n <li key={value.displayValue}>\n <Button\n style=\"text-neutral\"\n part=\"search-result\"\n onClick={() => onClick()}\n class=\"group flex w-full flex-col truncate px-2 py-2.5 focus-visible:outline-none\"\n aria-label={ariaLabel}\n >\n <div class=\"flex w-full\">\n <FacetValueLabelHighlight\n displayValue={value.displayValue}\n isSelected={false}\n searchQuery={searchQuery}\n ></FacetValueLabelHighlight>\n <span part=\"value-count\" class=\"value-count\">\n {i18n.t('between-parentheses', {\n text: count,\n })}\n </span>\n </div>\n <div\n part=\"search-result-path\"\n class=\"text-neutral-dark group-focus:text-primary group-hover:text-primary mt-1 flex w-full\"\n >\n {renderPath(localizedPath)}\n </div>\n </Button>\n </li>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\n\nexport const CategoryFacetTreeValueContainer: FunctionalComponent = (\n _,\n children\n) => {\n return <li class=\"contents\">{children}</li>;\n};\n","@import '../../../common/facets/facet-common.pcss';\n@import '../../../common/facets/facet-search/facet-search.pcss';\n\n[part~='active-parent'] {\n @apply pl-9;\n}\n\n[part~='parents'] [part~='values'] {\n @apply pl-9;\n}\n\n[part~='all-categories-button'],\n[part~='parent-button'] {\n @apply relative flex w-full items-center py-2.5 pr-2 pl-7 text-left;\n}\n\n[part~='back-arrow'] {\n @apply absolute left-1 h-5 w-5;\n}\n","import {\n CategoryFacet,\n buildCategoryFacet,\n CategoryFacetState,\n CategoryFacetOptions,\n CategoryFacetSortCriterion,\n SearchStatus,\n SearchStatusState,\n buildSearchStatus,\n CategoryFacetValue,\n buildFacetConditionsManager,\n FacetConditionsManager,\n FacetValueRequest,\n CategoryFacetValueRequest,\n TabManagerState,\n TabManager,\n buildTabManager,\n} from '@coveo/headless';\nimport {Component, h, State, Prop, Element, Fragment} from '@stencil/core';\nimport {\n getFieldCaptions,\n getFieldValueCaption,\n} from '../../../../utils/field-utils';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp, MapProp} from '../../../../utils/props-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {CategoryFacetAllCategoryButton} from '../../../common/facets/category-facet/stencil-all-categories-button';\nimport {CategoryFacetChildValueLink} from '../../../common/facets/category-facet/stencil-child-value-link';\nimport {CategoryFacetChildrenAsTreeContainer} from '../../../common/facets/category-facet/stencil-children-as-tree-container';\nimport {CategoryFacetParentAsTreeContainer} from '../../../common/facets/category-facet/stencil-parent-as-tree-container';\nimport {CategoryFacetParentButton} from '../../../common/facets/category-facet/stencil-parent-button';\nimport {CategoryFacetParentValueLink} from '../../../common/facets/category-facet/stencil-parent-value-link';\nimport {CategoryFacetSearchResultsContainer} from '../../../common/facets/category-facet/stencil-search-results-container';\nimport {CategoryFacetSearchValue} from '../../../common/facets/category-facet/stencil-search-value';\nimport {CategoryFacetTreeValueContainer} from '../../../common/facets/category-facet/stencil-value-as-tree-container';\nimport {parseDependsOn} from '../../../common/facets/depends-on';\nimport {FacetInfo} from '../../../common/facets/facet-common-store';\nimport {FacetContainer} from '../../../common/facets/facet-container/stencil-facet-container';\nimport {FacetGuard} from '../../../common/facets/facet-guard';\nimport {FacetHeader} from '../../../common/facets/facet-header/stencil-facet-header';\nimport {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';\nimport {announceFacetSearchResultsWithAriaLive} from '../../../common/facets/facet-search/facet-search-aria-live';\nimport {\n shouldUpdateFacetSearchComponent,\n shouldDisplaySearchResults,\n} from '../../../common/facets/facet-search/facet-search-utils';\nimport {FacetSearchInput} from '../../../common/facets/facet-search/stencil-facet-search-input';\nimport {FacetSearchMatches} from '../../../common/facets/facet-search/stencil-facet-search-matches';\nimport {FacetShowMoreLess} from '../../../common/facets/facet-show-more-less/stencil-facet-show-more-less';\nimport {FacetValuesGroup} from '../../../common/facets/facet-values-group/stencil-facet-values-group';\nimport {initializePopover} from '../../../common/facets/popover/popover-type';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * A facet is a list of values for a certain field occurring in the results, ordered using a configurable criteria (e.g., number of occurrences).\n * An `atomic-category-facet` displays a facet of values in a browsable, hierarchical fashion.\n *\n * @part facet - The wrapper for the entire facet.\n * @part placeholder - The placeholder shown before the first search is executed.\n *\n * @part label-button - The button that displays the label and allows to expand/collapse the facet.\n * @part label-button-icon - The label button icon.\n *\n * @part search-wrapper - The search box wrapper.\n * @part search-input - The search box input.\n * @part search-icon - The search box submit button.\n * @part search-clear-button - The button to clear the search box of input.\n * @part more-matches - The label indicating there are more matches for the current facet search query.\n * @part no-matches - The label indicating there are no matches for the current facet search query.\n * @part matches-query - The highlighted query inside the matches labels.\n * @part search-results - The search results container.\n * @part search-result - The search result value.\n * @part search-result-path - The search result path.\n * @part search-highlight - The highlighted query inside the facet values.\n *\n * @part parents - The container surrounding the whole hierarchy of values.\n * @part sub-parents - The container surrounding a sub-hierarchy of values.\n * @part values - The container surrounding either the children of the active value or the values at the base.\n * @part all-categories-button - The \"View all\" button displayed first within the parents.\n * @part parent-button - The clickable parent button displayed first within sub-parents.\n * @part active-parent - The clickable active parent displayed first within the last sub-parents.\n * @part value-link - The clickable value displayed first within values.\n * @part back-arrow - The back arrow displayed before the clickable parents.\n * @part value-label - The facet value label within a value button.\n * @part value-count - The facet value count within a value button.\n * @part leaf-value - A facet value with no child value.\n * @part node-value - A facet value with child values.\n *\n * @part show-more - The show more results button.\n * @part show-less - The show less results button.\n * @part show-more-less-icon - The icons of the show more & show less buttons.\n */\n@Component({\n tag: 'atomic-category-facet',\n styleUrl: 'atomic-category-facet.pcss',\n shadow: true,\n})\nexport class AtomicCategoryFacet implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public facet!: CategoryFacet;\n private dependenciesManager?: FacetConditionsManager;\n private resultIndexToFocusOnShowMore = 0;\n public searchStatus!: SearchStatus;\n public tabManager!: TabManager;\n @Element() private host!: HTMLElement;\n\n @BindStateToController('facet')\n @State()\n public facetState!: CategoryFacetState;\n @BindStateToController('searchStatus')\n @State()\n public searchStatusState!: SearchStatusState;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() public error!: Error;\n\n /**\n * Specifies a unique identifier for the facet.\n */\n @Prop({mutable: true, reflect: true}) public facetId?: string;\n /**\n * The non-localized label for the facet.\n * Used in the `atomic-breadbox` component through the bindings store.\n */\n @Prop({reflect: true}) public label = 'no-label';\n /**\n * The field whose values you want to display in the facet.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * The tabs on which the facet can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-timeframe-facet tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-timeframe-facet>\n * ```\n * If you don't set this property, the facet can be displayed on any tab. Otherwise, the facet can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this facet must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-timeframe-facet tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-timeframe-facet>\n * ```\n * If you don't set this property, the facet can be displayed on any tab. Otherwise, the facet won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n\n /**\n * The number of values to request for this facet.\n * Also determines the number of additional values to request each time more values are shown.\n */\n @Prop({reflect: true}) public numberOfValues = 8;\n /**\n * Whether this facet should contain a search box.\n *\n */\n @Prop({reflect: true}) public withSearch = false;\n /**\n * The sort criterion to apply to the returned facet values.\n * Possible values are 'alphanumeric' and 'occurrences'.\n * For this criterion to apply to the top-layer facet values, disable\n * [facet value ordering](https://docs.coveo.com/en/l1qf4156/#facet-value-ordering)\n * in your Dynamic Navigation Experience configuration.\n */\n // TODO: add automatic (occurrences when not expanded, alphanumeric when expanded)\n @Prop({reflect: true}) public sortCriteria: CategoryFacetSortCriterion =\n 'occurrences';\n /**\n * The character that separates values of a multi-value field.\n *\n * *Note:* If you use the [example formatting](https://docs.coveo.com/en/atomic/latest/reference/components/atomic-category-facet/#usage-notes) for the associated multi-value field, you must set this value to `|` or the facet won't display properly.\n */\n @Prop({reflect: true}) public delimitingCharacter = ';';\n /**\n * The base path shared by all values for the facet.\n *\n * Specify the property as an array using a JSON string representation:\n * ```html\n * <atomic-category-facet base-path='[\"first value\", \"second value\"]' ></atomic-category-facet>\n * ```\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public basePath: string[] | string = '[]';\n\n /**\n * Whether to use basePath as a filter for the results.\n */\n @Prop({reflect: true}) public filterByBasePath = true;\n /**\n * Specifies whether the facet is collapsed. When the facet is the child of an `atomic-facet-manager` component, the facet manager controls this property.\n */\n @Prop({reflect: true, mutable: true}) public isCollapsed = false;\n /**\n * The [heading level](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) to use for the heading over the facet, from 1 to 6.\n */\n @Prop({reflect: true}) public headingLevel = 0;\n /**\n * Whether to exclude the parents of folded results when estimating the result count for each facet value.\n *\n *\n * Note: Resulting count is only an estimation, in some cases this value could be incorrect.\n */\n @Prop({reflect: true}) public filterFacetCount = true;\n /**\n * The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.\n * Note: A high injectionDepth may negatively impact the facet request performance.\n * Minimum: `0`\n * Default: `1000`\n */\n @Prop({reflect: true}) public injectionDepth = 1000;\n // @Prop() public customSort?: string; TODO: KIT-753 Add customSort option for facet\n\n /**\n * The required facets and values for this facet to be displayed.\n * Examples:\n * ```html\n * <atomic-facet facet-id=\"abc\" field=\"objecttype\" ...></atomic-facet>\n *\n * <!-- To show the facet when any value is selected in the facet with id \"abc\": -->\n * <atomic-category-facet\n * depends-on-abc\n * ...\n * ></atomic-category-facet>\n *\n * <!-- To show the facet when value \"doc\" is selected in the facet with id \"abc\": -->\n * <atomic-category-facet\n * depends-on-abc=\"doc\"\n * ...\n * ></atomic-category-facet>\n * ```\n */\n @MapProp() @Prop() public dependsOn: Record<string, string> = {};\n\n private showLessFocus?: FocusTargetController;\n\n private showMoreFocus?: FocusTargetController;\n\n private headerFocus?: FocusTargetController;\n\n private activeValueFocus?: FocusTargetController;\n\n @AriaLiveRegion('facet-search')\n protected facetSearchAriaMessage!: string;\n\n public initialize() {\n if (\n [...this.tabsIncluded].length > 0 &&\n [...this.tabsExcluded].length > 0\n ) {\n console.warn(\n 'Values for both \"tabs-included\" and \"tabs-excluded\" have been provided. This is could lead to unexpected behaviors.'\n );\n }\n this.searchStatus = buildSearchStatus(this.bindings.engine);\n this.tabManager = buildTabManager(this.bindings.engine);\n const options: CategoryFacetOptions = {\n facetId: this.facetId,\n field: this.field,\n numberOfValues: this.numberOfValues,\n sortCriteria: this.sortCriteria,\n facetSearch: {numberOfValues: this.numberOfValues},\n basePath: [...this.basePath],\n delimitingCharacter: this.delimitingCharacter,\n filterByBasePath: this.filterByBasePath,\n injectionDepth: this.injectionDepth,\n filterFacetCount: this.filterFacetCount,\n tabs: {\n included: [...this.tabsIncluded],\n excluded: [...this.tabsExcluded],\n },\n };\n this.facet = buildCategoryFacet(this.bindings.engine, {options});\n announceFacetSearchResultsWithAriaLive(\n this.facet,\n this.label,\n (msg) => (this.facetSearchAriaMessage = msg),\n this.bindings.i18n\n );\n this.facetId = this.facet.state.facetId;\n const facetInfo: FacetInfo = {\n label: () => this.bindings.i18n.t(this.label),\n facetId: this.facetId!,\n element: this.host,\n isHidden: () => this.isHidden,\n };\n this.bindings.store.registerFacet('categoryFacets', facetInfo);\n initializePopover(this.host, {\n ...facetInfo,\n hasValues: () => !!this.facet.state.valuesAsTrees.length,\n numberOfActiveValues: () => (this.facetState.hasActiveValues ? 1 : 0),\n });\n this.initializeDependenciesManager();\n }\n\n private get focusTargets() {\n if (!this.showLessFocus) {\n this.showLessFocus = new FocusTargetController(this);\n }\n if (!this.showMoreFocus) {\n this.showMoreFocus = new FocusTargetController(this);\n }\n if (!this.headerFocus) {\n this.headerFocus = new FocusTargetController(this);\n }\n if (!this.activeValueFocus) {\n this.activeValueFocus = new FocusTargetController(this);\n }\n\n return {\n showLessFocus: this.showLessFocus,\n showMoreFocus: this.showMoreFocus,\n headerFocus: this.headerFocus,\n activeValueFocus: this.activeValueFocus,\n };\n }\n\n public disconnectedCallback() {\n if (this.host.isConnected) {\n return;\n }\n this.dependenciesManager?.stopWatching();\n }\n\n private get isHidden() {\n return (\n this.searchStatusState.hasError ||\n !this.facet.state.enabled ||\n (!this.facet.state.selectedValueAncestry.length &&\n !this.facet.state.valuesAsTrees.length)\n );\n }\n\n public componentShouldUpdate(\n next: unknown,\n prev: unknown,\n propName: keyof AtomicCategoryFacet\n ) {\n if (\n this.isCategoryFacetState(prev, propName) &&\n this.isCategoryFacetState(next, propName)\n ) {\n return shouldUpdateFacetSearchComponent(\n next.facetSearch,\n prev.facetSearch\n );\n }\n return true;\n }\n\n private get hasParents() {\n return !!this.facetState.selectedValueAncestry.length;\n }\n\n private initializeDependenciesManager() {\n this.dependenciesManager = buildFacetConditionsManager(\n this.bindings.engine,\n {\n facetId: this.facetId!,\n conditions: parseDependsOn<\n FacetValueRequest | CategoryFacetValueRequest\n >(this.dependsOn),\n }\n );\n }\n\n private renderHeader() {\n return (\n <FacetHeader\n i18n={this.bindings.i18n}\n label={this.label}\n numberOfActiveValues={\n this.facetState.hasActiveValues && this.isCollapsed ? 1 : 0\n }\n isCollapsed={this.isCollapsed}\n headingLevel={this.headingLevel}\n onToggleCollapse={() => (this.isCollapsed = !this.isCollapsed)}\n onClearFilters={() => {\n this.focusTargets.headerFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n headerRef={(header) => {\n this.focusTargets.headerFocus.setTarget(header);\n if (!this.hasParents) {\n this.focusTargets.activeValueFocus.setTarget(header);\n }\n }}\n ></FacetHeader>\n );\n }\n\n private renderSearchInput() {\n if (!this.withSearch) {\n return;\n }\n\n return (\n <FacetSearchInput\n i18n={this.bindings.i18n}\n label={this.label}\n query={this.facetState.facetSearch.query}\n onChange={(value) => {\n if (value === '') {\n this.facet.facetSearch.clear();\n return;\n }\n this.facet.facetSearch.updateCaptions(\n getFieldCaptions(this.field, this.bindings.i18n)\n );\n this.facet.facetSearch.updateText(value);\n this.facet.facetSearch.search();\n }}\n onClear={() => this.facet.facetSearch.clear()}\n ></FacetSearchInput>\n );\n }\n\n private renderValuesTree(\n valuesAsTrees: CategoryFacetValue[],\n isRoot: boolean\n ) {\n if (!this.hasParents) {\n return this.renderChildren();\n }\n\n if (isRoot) {\n return (\n <CategoryFacetTreeValueContainer>\n <CategoryFacetAllCategoryButton\n i18n={this.bindings.i18n}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n />\n <CategoryFacetParentAsTreeContainer isTopLevel={false}>\n {this.renderValuesTree(valuesAsTrees, false)}\n </CategoryFacetParentAsTreeContainer>\n </CategoryFacetTreeValueContainer>\n );\n }\n\n if (valuesAsTrees.length > 1) {\n const parentValue = valuesAsTrees[0];\n\n return (\n <CategoryFacetTreeValueContainer>\n <CategoryFacetParentButton\n facetValue={parentValue}\n field={this.field}\n i18n={this.bindings.i18n}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.toggleSelect(parentValue);\n }}\n />\n <CategoryFacetParentAsTreeContainer isTopLevel={false}>\n {this.renderValuesTree(valuesAsTrees.slice(1), false)}\n </CategoryFacetParentAsTreeContainer>\n </CategoryFacetTreeValueContainer>\n );\n }\n\n const activeParent = valuesAsTrees[0];\n const activeParentDisplayValue = getFieldValueCaption(\n this.field,\n activeParent.value,\n this.bindings.i18n\n );\n\n return (\n <CategoryFacetParentValueLink\n displayValue={activeParentDisplayValue}\n numberOfResults={activeParent.numberOfResults}\n i18n={this.bindings.i18n}\n isLeafValue={activeParent.isLeafValue}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.deselectAll();\n }}\n searchQuery={this.facetState.facetSearch.query}\n setRef={(el) => this.focusTargets.activeValueFocus.setTarget(el)}\n >\n <CategoryFacetChildrenAsTreeContainer>\n {this.renderChildren()}\n </CategoryFacetChildrenAsTreeContainer>\n </CategoryFacetParentValueLink>\n );\n }\n\n private renderChild(\n facetValue: CategoryFacetValue,\n isShowLessFocusTarget: boolean,\n isShowMoreFocusTarget: boolean\n ) {\n const displayValue = getFieldValueCaption(\n this.field,\n facetValue.value,\n this.bindings.i18n\n );\n const isSelected = facetValue.state === 'selected';\n return (\n <CategoryFacetChildValueLink\n displayValue={displayValue}\n i18n={this.bindings.i18n}\n isLeafValue={facetValue.isLeafValue}\n isSelected={isSelected}\n numberOfResults={facetValue.numberOfResults}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.toggleSelect(facetValue);\n }}\n searchQuery={this.facetState.facetSearch.query}\n setRef={(element) => {\n isShowLessFocusTarget &&\n this.focusTargets.showLessFocus.setTarget(element);\n isShowMoreFocusTarget &&\n this.focusTargets.showMoreFocus.setTarget(element);\n }}\n ></CategoryFacetChildValueLink>\n );\n }\n\n private renderChildren() {\n if (!this.facetState.valuesAsTrees.length) {\n return;\n }\n if (this.facetState.selectedValueAncestry.length > 0) {\n return this.facetState.selectedValueAncestry\n .find((value) => value.state === 'selected')\n ?.children.map((value, i) =>\n this.renderChild(\n value,\n i === 0,\n i === this.resultIndexToFocusOnShowMore\n )\n );\n }\n\n return this.facetState.valuesAsTrees.map((value, i) =>\n this.renderChild(value, i === 0, i === this.resultIndexToFocusOnShowMore)\n );\n }\n\n private renderSearchResults() {\n return (\n <CategoryFacetSearchResultsContainer>\n {this.facetState.facetSearch.values.map((value) => (\n <CategoryFacetSearchValue\n value={value}\n field={this.field}\n i18n={this.bindings.i18n}\n searchQuery={this.facetState.facetSearch.query}\n onClick={() => {\n this.focusTargets.activeValueFocus.focusAfterSearch();\n this.facet.facetSearch.select(value);\n }}\n ></CategoryFacetSearchValue>\n ))}\n </CategoryFacetSearchResultsContainer>\n );\n }\n\n private renderMatches() {\n return (\n <FacetSearchMatches\n i18n={this.bindings.i18n}\n query={this.facetState.facetSearch.query}\n numberOfMatches={this.facetState.facetSearch.values.length}\n hasMoreMatches={this.facetState.facetSearch.moreValuesAvailable}\n showMoreMatches={() => this.facet.facetSearch.showMoreResults()}\n ></FacetSearchMatches>\n );\n }\n\n private renderShowMoreLess() {\n return (\n <div class={this.hasParents ? 'pl-9' : ''}>\n <FacetShowMoreLess\n label={this.label}\n i18n={this.bindings.i18n}\n onShowMore={() => {\n this.resultIndexToFocusOnShowMore =\n this.facetState.valuesAsTrees[0].children.length;\n this.focusTargets.showMoreFocus.focusAfterSearch();\n this.facet.showMoreValues();\n }}\n onShowLess={() => {\n this.focusTargets.showLessFocus.focusAfterSearch();\n this.facet.showLessValues();\n }}\n canShowLessValues={this.facetState.canShowLessValues}\n canShowMoreValues={this.facetState.canShowMoreValues}\n ></FacetShowMoreLess>\n </div>\n );\n }\n\n private isCategoryFacetState(\n state: unknown,\n propName: string\n ): state is CategoryFacetState {\n return (\n propName === 'facetState' &&\n typeof (state as CategoryFacetState)?.facetId === 'string'\n );\n }\n\n public render() {\n const {\n bindings: {i18n},\n label,\n facetState: {facetSearch, enabled, valuesAsTrees, selectedValueAncestry},\n searchStatusState: {hasError, firstSearchExecuted},\n } = this;\n\n return (\n <FacetGuard\n enabled={enabled}\n firstSearchExecuted={firstSearchExecuted}\n hasError={hasError}\n hasResults={valuesAsTrees.length > 0}\n >\n {firstSearchExecuted ? (\n <FacetContainer>\n {this.renderHeader()}\n {!this.isCollapsed && [\n this.renderSearchInput(),\n shouldDisplaySearchResults(facetSearch) ? (\n <Fragment>\n {facetSearch.values.length ? (\n <FacetValuesGroup\n i18n={i18n}\n label={label}\n query={facetSearch.query}\n >\n {this.renderSearchResults()}\n </FacetValuesGroup>\n ) : (\n <div class=\"mt-3\"></div>\n )}\n {this.renderMatches()}\n </Fragment>\n ) : (\n <Fragment>\n <FacetValuesGroup i18n={i18n} label={label}>\n {this.hasParents ? (\n <CategoryFacetParentAsTreeContainer\n isTopLevel={true}\n className=\"mt-3\"\n >\n {this.renderValuesTree(selectedValueAncestry, true)}\n </CategoryFacetParentAsTreeContainer>\n ) : (\n <CategoryFacetChildrenAsTreeContainer className=\"mt-3\">\n {this.renderChildren()}\n </CategoryFacetChildrenAsTreeContainer>\n )}\n </FacetValuesGroup>\n {this.renderShowMoreLess()}\n </Fragment>\n ),\n ]}\n </FacetContainer>\n ) : (\n <FacetPlaceholder\n isCollapsed={this.isCollapsed}\n numberOfValues={this.numberOfValues}\n />\n )}\n </FacetGuard>\n );\n }\n}\n"],"version":3}
|
package/dist/cjs/version.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
module.exports.headlessVersion = '3.31.2';
|
2
|
-
module.exports.atomicVersion = '3.35.0-pre.
|
2
|
+
module.exports.atomicVersion = '3.35.0-pre.b985e047c6';
|
@@ -32,21 +32,11 @@ import './stencil-heading-2b28a9b9.js';
|
|
32
32
|
import './search-64cc84a9.js';
|
33
33
|
import './stencil-fieldset-group-5fa357cd.js';
|
34
34
|
|
35
|
-
const getAllCategoriesLocalizedLabel = ({ facetId, field, i18n, }) => {
|
36
|
-
if (facetId && i18n.exists(`all-categories-${facetId}`)) {
|
37
|
-
return i18n.t(`all-categories-${facetId}`);
|
38
|
-
}
|
39
|
-
if (i18n.exists(`all-categories-${field}`)) {
|
40
|
-
return i18n.t(`all-categories-${field}`);
|
41
|
-
}
|
42
|
-
return i18n.t('all-categories');
|
43
|
-
};
|
44
|
-
|
45
35
|
/**
|
46
36
|
* @deprecated should only be used for Stencil components.
|
47
37
|
*/
|
48
|
-
const CategoryFacetAllCategoryButton = ({ i18n, onClick
|
49
|
-
const allCategories =
|
38
|
+
const CategoryFacetAllCategoryButton = ({ i18n, onClick }) => {
|
39
|
+
const allCategories = i18n.t('all-categories');
|
50
40
|
return (h(Button, { style: "text-neutral", part: "all-categories-button", onClick: () => {
|
51
41
|
onClick();
|
52
42
|
} },
|
@@ -111,10 +101,10 @@ const CategoryFacetSearchResultsContainer = (_, children) => {
|
|
111
101
|
const SEPARATOR = '/';
|
112
102
|
const ELLIPSIS = '...';
|
113
103
|
const PATH_MAX_LENGTH = 3;
|
114
|
-
const CategoryFacetSearchValue = ({ value,
|
104
|
+
const CategoryFacetSearchValue = ({ value, field, i18n, onClick, searchQuery }) => {
|
115
105
|
const count = value.count.toLocaleString(i18n.language);
|
116
106
|
const inLabel = i18n.t('in');
|
117
|
-
const allCategories =
|
107
|
+
const allCategories = i18n.t('all-categories');
|
118
108
|
const localizedPath = value.path.length
|
119
109
|
? value.path.map((value) => getFieldValueCaption(field, value, i18n))
|
120
110
|
: [allCategories];
|
@@ -422,7 +412,7 @@ const AtomicCategoryFacet = class {
|
|
422
412
|
return this.renderChildren();
|
423
413
|
}
|
424
414
|
if (isRoot) {
|
425
|
-
return (h(CategoryFacetTreeValueContainer, null, h(CategoryFacetAllCategoryButton, { i18n: this.bindings.i18n,
|
415
|
+
return (h(CategoryFacetTreeValueContainer, null, h(CategoryFacetAllCategoryButton, { i18n: this.bindings.i18n, onClick: () => {
|
426
416
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
427
417
|
this.facet.deselectAll();
|
428
418
|
} }), h(CategoryFacetParentAsTreeContainer, { isTopLevel: false }, this.renderValuesTree(valuesAsTrees, false))));
|
@@ -466,7 +456,7 @@ const AtomicCategoryFacet = class {
|
|
466
456
|
return this.facetState.valuesAsTrees.map((value, i) => this.renderChild(value, i === 0, i === this.resultIndexToFocusOnShowMore));
|
467
457
|
}
|
468
458
|
renderSearchResults() {
|
469
|
-
return (h(CategoryFacetSearchResultsContainer, null, this.facetState.facetSearch.values.map((value) => (h(CategoryFacetSearchValue, { value: value, field: this.field,
|
459
|
+
return (h(CategoryFacetSearchResultsContainer, null, this.facetState.facetSearch.values.map((value) => (h(CategoryFacetSearchValue, { value: value, field: this.field, i18n: this.bindings.i18n, searchQuery: this.facetState.facetSearch.query, onClick: () => {
|
470
460
|
this.focusTargets.activeValueFocus.focusAfterSearch();
|
471
461
|
this.facet.facetSearch.select(value);
|
472
462
|
} })))));
|
@@ -491,7 +481,7 @@ const AtomicCategoryFacet = class {
|
|
491
481
|
}
|
492
482
|
render() {
|
493
483
|
const { bindings: { i18n }, label, facetState: { facetSearch, enabled, valuesAsTrees, selectedValueAncestry }, searchStatusState: { hasError, firstSearchExecuted }, } = this;
|
494
|
-
return (h(FacetGuard, { key: '
|
484
|
+
return (h(FacetGuard, { key: 'c03f14b0c8885a312289aa35f6efc258b67cdede', enabled: enabled, firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: valuesAsTrees.length > 0 }, firstSearchExecuted ? (h(FacetContainer, null, this.renderHeader(), !this.isCollapsed && [
|
495
485
|
this.renderSearchInput(),
|
496
486
|
shouldDisplaySearchResults(facetSearch) ? (h(Fragment, null, facetSearch.values.length ? (h(FacetValuesGroup, { i18n: i18n, label: label, query: facetSearch.query }, this.renderSearchResults())) : (h("div", { class: "mt-3" })), this.renderMatches())) : (h(Fragment, null, h(FacetValuesGroup, { i18n: i18n, label: label }, this.hasParents ? (h(CategoryFacetParentAsTreeContainer, { isTopLevel: true, className: "mt-3" }, this.renderValuesTree(selectedValueAncestry, true))) : (h(CategoryFacetChildrenAsTreeContainer, { className: "mt-3" }, this.renderChildren()))), this.renderShowMoreLess())),
|
497
487
|
])) : (h(FacetPlaceholder, { isCollapsed: this.isCollapsed, numberOfValues: this.numberOfValues }))));
|