@coveo/atomic 3.35.0-pre.00c6c9ad52 → 3.35.0-pre.1c25c9644c
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/atomic.esm.js.map +1 -1
- package/dist/atomic/components/_index.d.ts +0 -2
- package/dist/atomic/components/_index.js +1 -3
- package/dist/atomic/components/atomic-insight-search-box.js +29 -2
- package/dist/atomic/components/atomic-insight-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-recs-interface.js +1 -1
- package/dist/atomic/components/atomic-search-box-instant-results.js +37 -2
- package/dist/atomic/components/atomic-search-box-instant-results.js.map +1 -1
- package/dist/atomic/components/atomic-search-box.js +1 -7
- package/dist/atomic/components/atomic-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
- package/dist/atomic/components/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/common/suggestions/query-suggestions.js +11 -16
- package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +107 -0
- package/dist/atomic/components/components/search/index.js +1 -0
- package/dist/atomic/components/components/search/lazy-index.js +1 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/{p-874f0a4c.entry.js → p-060b94d2.entry.js} +2 -2
- package/dist/atomic/{p-17ba2e4f.entry.js → p-21a786e1.entry.js} +2 -2
- package/dist/atomic/{p-ed413091.entry.js → p-8a30d1e9.entry.js} +2 -2
- package/dist/atomic/p-d55668a3.entry.js +2 -0
- package/dist/atomic/p-d55668a3.entry.js.map +1 -0
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js +30 -4
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/index-757bc886.js +0 -4
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/atomic-insight-search-box.entry.js +29 -3
- package/dist/esm/atomic-insight-search-box.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/index-3f35faca.js +0 -4
- package/dist/esm/version.js +1 -1
- package/dist/types/components/search/{search-box-suggestions/atomic-search-box-query-suggestions → atomic-search-box-query-suggestions}/atomic-search-box-query-suggestions.d.ts +16 -7
- package/dist/types/components/search/index.d.ts +1 -0
- package/dist/types/components.d.ts +0 -49
- package/docs/atomic-docs.json +3 -102
- package/package.json +3 -6
- package/dist/atomic/components/atomic-search-box-query-suggestions.d.ts +0 -11
- package/dist/atomic/components/atomic-search-box-query-suggestions.js +0 -8
- package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +0 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +0 -89
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +0 -1
- package/dist/atomic/components/stencil-query-suggestions.js +0 -33
- package/dist/atomic/components/stencil-query-suggestions.js.map +0 -1
- package/dist/atomic/components/suggestions-events.js +0 -40
- package/dist/atomic/components/suggestions-events.js.map +0 -1
- package/dist/atomic/p-af93b44c.js +0 -2
- package/dist/atomic/p-af93b44c.js.map +0 -1
- package/dist/atomic/p-ca1425cc.entry.js +0 -2
- package/dist/atomic/p-ca1425cc.entry.js.map +0 -1
- package/dist/atomic/p-e8176ac8.entry.js +0 -2
- package/dist/atomic/p-e8176ac8.entry.js.map +0 -1
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +0 -76
- package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +0 -1
- package/dist/cjs/stencil-query-suggestions-03268ecc.js +0 -38
- package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +0 -1
- package/dist/esm/atomic-search-box-query-suggestions.entry.js +0 -72
- package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +0 -1
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js +0 -33
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +0 -1
- /package/dist/atomic/{p-874f0a4c.entry.js.map → p-060b94d2.entry.js.map} +0 -0
- /package/dist/atomic/{p-17ba2e4f.entry.js.map → p-21a786e1.entry.js.map} +0 -0
- /package/dist/atomic/{p-ed413091.entry.js.map → p-8a30d1e9.entry.js.map} +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"stencil-query-suggestions-03268ecc.js","mappings":";;;;;MAUa,oCAAoC,GAAG,CAClD,UAAsB,EACtB,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,GAAG,EAAE,MAAMA,iCAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACvD,KAAK,EAAE,UAAU,CAAC,QAAQ;QAC1B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;YAC1C,KAAK,EAAE,UAAU,CAAC,QAAQ;YAC1B,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,EAAE;MAEW,wBAAwB,GAAwB,CAAC,CAAC,EAAE,QAAQ;IACvE,QACEC,iBAAK,IAAI,EAAC,0BAA0B,EAAC,KAAK,EAAC,mBAAmB,IAC3D,QAAQ,CACL,EACN;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC;IACxB,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;KACR;IAED,QACEA,yBACE,IAAI,EAAC,uBAAuB,EAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,uBAAuB,GAChB,EACf;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAC;IACzB,IAAI,QAAQ,EAAE;QACZ,QACEA,kBACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,wBAAwB,EAC9B,SAAS,EAAE,UAAU,CAAC,gBAAgB,GAChC,EACR;KACH;IAED,QACEA,kBAAM,IAAI,EAAC,uBAAuB,EAAC,KAAK,EAAC,wBAAwB,IAC9D,UAAU,CAAC,QAAQ,CACf,EACP;AACJ;;;;;;;","names":["encodeForDomAttribute","h"],"sources":["src/components/common/suggestions/stencil-query-suggestions.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils.js';\nimport {SearchBoxSuggestionElement} from './suggestions-types.js';\n\ninterface Suggestion {\n highlightedValue: string;\n rawValue: string;\n}\n\nexport const getPartialSearchBoxSuggestionElement = (\n suggestion: Suggestion,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'query-suggestion-item',\n key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,\n query: suggestion.rawValue,\n ariaLabel: i18n.t('query-suggestion-label', {\n query: suggestion.rawValue,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const QuerySuggestionContainer: FunctionalComponent = (_, children) => {\n return (\n <div part=\"query-suggestion-content\" class=\"flex items-center\">\n {children}\n </div>\n );\n};\n\ninterface QuerySuggestionIconProps {\n icon: string;\n hasSuggestion: boolean;\n}\n\nexport const QuerySuggestionIcon: FunctionalComponent<\n QuerySuggestionIconProps\n> = ({icon, hasSuggestion}) => {\n if (!hasSuggestion) {\n return;\n }\n\n return (\n <atomic-icon\n part=\"query-suggestion-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface QuerySuggestionTextProps {\n suggestion: Suggestion;\n hasQuery: boolean;\n}\n\nexport const QuerySuggestionText: FunctionalComponent<\n QuerySuggestionTextProps\n> = ({suggestion, hasQuery}) => {\n if (hasQuery) {\n return (\n <span\n part=\"query-suggestion-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={suggestion.highlightedValue}\n ></span>\n );\n }\n\n return (\n <span part=\"query-suggestion-text\" class=\"line-clamp-2 break-all\">\n {suggestion.rawValue}\n </span>\n );\n};\n"],"version":3}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
|
2
|
-
import { loadQuerySuggestActions } from '@coveo/headless';
|
3
|
-
import { S as SearchIcon } from './search-64cc84a9.js';
|
4
|
-
import { g as getPartialSearchBoxSuggestionElement, Q as QuerySuggestionText, a as QuerySuggestionIcon, b as QuerySuggestionContainer } from './stencil-query-suggestions-5d6a46d7.js';
|
5
|
-
import { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events-b7a6f007.js';
|
6
|
-
import './string-utils-5f5a23a8.js';
|
7
|
-
import './dom-utils-f6086cd3.js';
|
8
|
-
import './event-utils-8de63ec3.js';
|
9
|
-
|
10
|
-
const AtomicSearchBoxQuerySuggestions = class {
|
11
|
-
constructor(hostRef) {
|
12
|
-
registerInstance(this, hostRef);
|
13
|
-
this.error = undefined;
|
14
|
-
this.icon = undefined;
|
15
|
-
this.maxWithQuery = undefined;
|
16
|
-
this.maxWithoutQuery = undefined;
|
17
|
-
}
|
18
|
-
componentWillLoad() {
|
19
|
-
try {
|
20
|
-
dispatchSearchBoxSuggestionsEvent((bindings) => {
|
21
|
-
this.bindings = bindings;
|
22
|
-
return this.initialize();
|
23
|
-
}, this.host, ['atomic-search-box']);
|
24
|
-
}
|
25
|
-
catch (error) {
|
26
|
-
this.error = error;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
initialize() {
|
30
|
-
const engine = this.bindings.engine;
|
31
|
-
const { registerQuerySuggest, fetchQuerySuggestions } = loadQuerySuggestActions(engine);
|
32
|
-
engine.dispatch(registerQuerySuggest({
|
33
|
-
id: this.bindings.id,
|
34
|
-
count: this.bindings.numberOfQueries,
|
35
|
-
}));
|
36
|
-
return {
|
37
|
-
position: Array.from(this.host.parentNode.children).indexOf(this.host),
|
38
|
-
onInput: () => engine.dispatch(fetchQuerySuggestions({
|
39
|
-
id: this.bindings.id,
|
40
|
-
})),
|
41
|
-
renderItems: () => this.renderItems(),
|
42
|
-
};
|
43
|
-
}
|
44
|
-
renderItems() {
|
45
|
-
const hasQuery = this.bindings.searchBoxController.state.value !== '';
|
46
|
-
const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
|
47
|
-
return this.bindings.searchBoxController.state.suggestions
|
48
|
-
.slice(0, max)
|
49
|
-
.map((suggestion) => this.renderItem(suggestion));
|
50
|
-
}
|
51
|
-
renderItem(suggestion) {
|
52
|
-
const hasQuery = this.bindings.searchBoxController.state.value !== '';
|
53
|
-
const partialItem = getPartialSearchBoxSuggestionElement(suggestion, this.bindings.i18n);
|
54
|
-
return {
|
55
|
-
...partialItem,
|
56
|
-
content: (h(QuerySuggestionContainer, null, h(QuerySuggestionIcon, { icon: this.icon || SearchIcon, hasSuggestion: this.bindings.getSuggestions().length > 1 }), h(QuerySuggestionText, { suggestion: suggestion, hasQuery: hasQuery }))),
|
57
|
-
onSelect: () => {
|
58
|
-
this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);
|
59
|
-
},
|
60
|
-
};
|
61
|
-
}
|
62
|
-
render() {
|
63
|
-
if (this.error) {
|
64
|
-
return (h("atomic-component-error", { key: '7fdb4afa7291ad70c37a9709fd7108f4fe0fb94d', element: this.host, error: this.error }));
|
65
|
-
}
|
66
|
-
}
|
67
|
-
get host() { return getElement(this); }
|
68
|
-
};
|
69
|
-
|
70
|
-
export { AtomicSearchBoxQuerySuggestions as atomic_search_box_query_suggestions };
|
71
|
-
|
72
|
-
//# sourceMappingURL=atomic-search-box-query-suggestions.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"atomic-search-box-query-suggestions.entry.js","mappings":";;;;;;;;;MA8Ba,+BAA+B;;;;;;;;IAwB1C,iBAAiB;QACf,IAAI;YACF,iCAAiC,CAC/B,CAAC,QAAQ;gBACP,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACzB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;aAC1B,EACD,IAAI,CAAC,IAAI,EACT,CAAC,mBAAmB,CAAC,CACtB,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;SAC7B;KACF;IAEO,UAAU;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAG3B,CAAC;QACH,MAAM,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,GACjD,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAElC,MAAM,CAAC,QAAQ,CACb,oBAAoB,CAAC;YACnB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;YACpB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe;SACrC,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACvE,OAAO,EAAE,MACP,MAAM,CAAC,QAAQ,CACb,qBAAqB,CAAC;gBACpB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;aACrB,CAAC,CACH;YACH,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE;SACtC,CAAC;KACH;IAEO,WAAW;QACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,GAAG,GAAG,QAAQ,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC;QAChE,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,WAAW;aACvD,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;aACb,GAAG,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;KACrD;IAEO,UAAU,CAAC,UAAsB;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,WAAW,GAAG,oCAAoC,CACtD,UAAU,EACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CACnB,CAAC;QAEF,OAAO;YACL,GAAG,WAAW;YACd,OAAO,GACL,EAAC,wBAAwB,QACvB,EAAC,mBAAmB,IAClB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,UAAU,EAC7B,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC,GACxD,EAEF,EAAC,mBAAmB,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC1C,CAC5B;YACD,QAAQ,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACzE;SACF,CAAC;KACH;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;","names":[],"sources":["src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx"],"sourcesContent":["import {\n loadQuerySuggestActions,\n SearchBox,\n SearchEngine,\n Suggestion,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport SearchIcon from '../../../../images/search.svg';\nimport {\n getPartialSearchBoxSuggestionElement,\n QuerySuggestionContainer,\n QuerySuggestionIcon,\n QuerySuggestionText,\n} from '../../../common/suggestions/stencil-query-suggestions';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\n\n/**\n * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.\n */\n@Component({\n tag: 'atomic-search-box-query-suggestions',\n shadow: true,\n})\nexport class AtomicSearchBoxQuerySuggestions {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox>;\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The SVG icon to display.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly.\n */\n @Prop() public icon?: string;\n\n /**\n * The maximum number of suggestions that will be displayed if the user has typed something into the input field.\n */\n @Prop({reflect: true}) public maxWithQuery?: number;\n /**\n * The maximum number of suggestions that will be displayed initially when the input field is empty.\n */\n @Prop({reflect: true}) public maxWithoutQuery?: number;\n\n componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private initialize(): SearchBoxSuggestions {\n const engine = this.bindings.engine as SearchEngine<{\n querySet: string;\n querySuggest: string;\n }>;\n const {registerQuerySuggest, fetchQuerySuggestions} =\n loadQuerySuggestActions(engine);\n\n engine.dispatch(\n registerQuerySuggest({\n id: this.bindings.id,\n count: this.bindings.numberOfQueries,\n })\n );\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n onInput: () =>\n engine.dispatch(\n fetchQuerySuggestions({\n id: this.bindings.id,\n })\n ),\n renderItems: () => this.renderItems(),\n };\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n return this.bindings.searchBoxController.state.suggestions\n .slice(0, max)\n .map((suggestion) => this.renderItem(suggestion));\n }\n\n private renderItem(suggestion: Suggestion) {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const partialItem = getPartialSearchBoxSuggestionElement(\n suggestion,\n this.bindings.i18n\n );\n\n return {\n ...partialItem,\n content: (\n <QuerySuggestionContainer>\n <QuerySuggestionIcon\n icon={this.icon || SearchIcon}\n hasSuggestion={this.bindings.getSuggestions().length > 1}\n />\n\n <QuerySuggestionText suggestion={suggestion} hasQuery={hasQuery} />\n </QuerySuggestionContainer>\n ),\n onSelect: () => {\n this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);\n },\n };\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { h } from './index-3f35faca.js';
|
2
|
-
import { e as encodeForDomAttribute } from './string-utils-5f5a23a8.js';
|
3
|
-
|
4
|
-
const getPartialSearchBoxSuggestionElement = (suggestion, i18n) => {
|
5
|
-
return {
|
6
|
-
part: 'query-suggestion-item',
|
7
|
-
key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,
|
8
|
-
query: suggestion.rawValue,
|
9
|
-
ariaLabel: i18n.t('query-suggestion-label', {
|
10
|
-
query: suggestion.rawValue,
|
11
|
-
interpolation: { escapeValue: false },
|
12
|
-
}),
|
13
|
-
};
|
14
|
-
};
|
15
|
-
const QuerySuggestionContainer = (_, children) => {
|
16
|
-
return (h("div", { part: "query-suggestion-content", class: "flex items-center" }, children));
|
17
|
-
};
|
18
|
-
const QuerySuggestionIcon = ({ icon, hasSuggestion }) => {
|
19
|
-
if (!hasSuggestion) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
return (h("atomic-icon", { part: "query-suggestion-icon", icon: icon, class: "mr-2 h-4 w-4 shrink-0" }));
|
23
|
-
};
|
24
|
-
const QuerySuggestionText = ({ suggestion, hasQuery }) => {
|
25
|
-
if (hasQuery) {
|
26
|
-
return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all", innerHTML: suggestion.highlightedValue }));
|
27
|
-
}
|
28
|
-
return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all" }, suggestion.rawValue));
|
29
|
-
};
|
30
|
-
|
31
|
-
export { QuerySuggestionText as Q, QuerySuggestionIcon as a, QuerySuggestionContainer as b, getPartialSearchBoxSuggestionElement as g };
|
32
|
-
|
33
|
-
//# sourceMappingURL=stencil-query-suggestions-5d6a46d7.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"stencil-query-suggestions-5d6a46d7.js","mappings":";;;MAUa,oCAAoC,GAAG,CAClD,UAAsB,EACtB,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,GAAG,EAAE,MAAM,qBAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACvD,KAAK,EAAE,UAAU,CAAC,QAAQ;QAC1B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;YAC1C,KAAK,EAAE,UAAU,CAAC,QAAQ;YAC1B,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,EAAE;MAEW,wBAAwB,GAAwB,CAAC,CAAC,EAAE,QAAQ;IACvE,QACE,WAAK,IAAI,EAAC,0BAA0B,EAAC,KAAK,EAAC,mBAAmB,IAC3D,QAAQ,CACL,EACN;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC;IACxB,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;KACR;IAED,QACE,mBACE,IAAI,EAAC,uBAAuB,EAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,uBAAuB,GAChB,EACf;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAC;IACzB,IAAI,QAAQ,EAAE;QACZ,QACE,YACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,wBAAwB,EAC9B,SAAS,EAAE,UAAU,CAAC,gBAAgB,GAChC,EACR;KACH;IAED,QACE,YAAM,IAAI,EAAC,uBAAuB,EAAC,KAAK,EAAC,wBAAwB,IAC9D,UAAU,CAAC,QAAQ,CACf,EACP;AACJ;;;;","names":[],"sources":["src/components/common/suggestions/stencil-query-suggestions.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils.js';\nimport {SearchBoxSuggestionElement} from './suggestions-types.js';\n\ninterface Suggestion {\n highlightedValue: string;\n rawValue: string;\n}\n\nexport const getPartialSearchBoxSuggestionElement = (\n suggestion: Suggestion,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'query-suggestion-item',\n key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,\n query: suggestion.rawValue,\n ariaLabel: i18n.t('query-suggestion-label', {\n query: suggestion.rawValue,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const QuerySuggestionContainer: FunctionalComponent = (_, children) => {\n return (\n <div part=\"query-suggestion-content\" class=\"flex items-center\">\n {children}\n </div>\n );\n};\n\ninterface QuerySuggestionIconProps {\n icon: string;\n hasSuggestion: boolean;\n}\n\nexport const QuerySuggestionIcon: FunctionalComponent<\n QuerySuggestionIconProps\n> = ({icon, hasSuggestion}) => {\n if (!hasSuggestion) {\n return;\n }\n\n return (\n <atomic-icon\n part=\"query-suggestion-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface QuerySuggestionTextProps {\n suggestion: Suggestion;\n hasQuery: boolean;\n}\n\nexport const QuerySuggestionText: FunctionalComponent<\n QuerySuggestionTextProps\n> = ({suggestion, hasQuery}) => {\n if (hasQuery) {\n return (\n <span\n part=\"query-suggestion-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={suggestion.highlightedValue}\n ></span>\n );\n }\n\n return (\n <span part=\"query-suggestion-text\" class=\"line-clamp-2 break-all\">\n {suggestion.rawValue}\n </span>\n );\n};\n"],"version":3}
|
File without changes
|
File without changes
|
File without changes
|