Skip to content

Commit 78035f8

Browse files
authored
refactor(ui5-input): Add tempalte hook for the suggestions (#1928)
Add template hook for the suggestions list, so the third party components can entirely replace our list with another and to fully control the appearance of the suggestion items. // CustomInputPopoverTemplate.hbs {{>include "InputPopoverTemplate"}} {{#*inline "suggestionsList"}} <ui5-my-list> </ui5-my-list> {{/inline}}
1 parent 2b76fe7 commit 78035f8

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

packages/main/src/InputPopover.hbs

+23-18
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,8 @@
4949
{{/if}}
5050
{{/unless}}
5151

52-
<ui5-list separators="{{suggestionSeparators}}">
53-
{{#each suggestionsTexts}}
54-
{{#if group}}
55-
<ui5-li-groupheader data-ui5-key="{{key}}">{{ this.text }}</ui5-li-groupheader>
56-
{{else}}
57-
<ui5-li
58-
image="{{this.image}}"
59-
icon="{{this.icon}}"
60-
description="{{this.description}}"
61-
info="{{this.info}}"
62-
type="{{this.type}}"
63-
info-state="{{this.infoState}}"
64-
@ui5-_item-press="{{ fnOnSuggestionItemPress }}"
65-
data-ui5-key="{{key}}"
66-
>{{ this.text }}</ui5-li>
67-
{{/if}}
68-
{{/each}}
69-
</ui5-list>
52+
{{> suggestionsList}}
53+
7054
{{#if _isPhone}}
7155
<div slot="footer" class="ui5-responsive-popover-footer">
7256
<ui5-button
@@ -101,3 +85,24 @@
10185
{{/each}}
10286
{{/if}}
10387
{{/inline}}
88+
89+
{{#*inline "suggestionsList"}}
90+
<ui5-list separators="{{suggestionSeparators}}">
91+
{{#each suggestionsTexts}}
92+
{{#if group}}
93+
<ui5-li-groupheader data-ui5-key="{{key}}">{{ this.text }}</ui5-li-groupheader>
94+
{{else}}
95+
<ui5-li
96+
image="{{this.image}}"
97+
icon="{{this.icon}}"
98+
description="{{this.description}}"
99+
info="{{this.info}}"
100+
type="{{this.type}}"
101+
info-state="{{this.infoState}}"
102+
@ui5-_item-press="{{ fnOnSuggestionItemPress }}"
103+
data-ui5-key="{{key}}"
104+
>{{ this.text }}</ui5-li>
105+
{{/if}}
106+
{{/each}}
107+
</ui5-list>
108+
{{/inline}}

0 commit comments

Comments
 (0)