@@ -6,6 +6,7 @@ import type SearchField from "./SearchField.js";
66import decline from "@ui5/webcomponents-icons/dist/decline.js" ;
77import search from "@ui5/webcomponents-icons/dist/search.js" ;
88import ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js" ;
9+ import BusyIndicator from "@ui5/webcomponents/dist/BusyIndicator.js" ;
910
1011export type SearchFieldTemplateOptions = {
1112 /**
@@ -22,81 +23,84 @@ export default function SearchFieldTemplate(this: SearchField, options?: SearchF
2223 icon = { search }
2324 design = { ButtonDesign . Transparent }
2425 data-sap-focus-ref
26+ loading = { this . fieldLoading }
2527 onClick = { this . _handleSearchIconPress }
2628 tooltip = { this . _effectiveIconTooltip }
2729 accessibleName = { this . _effectiveIconTooltip }
2830 accessibilityAttributes = { this . _searchButtonAccessibilityAttributes }
2931 > </ Button >
3032 ) : (
31- < div class = "ui5-search-field-root" role = "search" onFocusOut = { this . _onFocusOutSearch } >
32- < div class = "ui5-search-field-content" >
33- { this . scopes ?. length ? (
34- < >
35- < Select
36- onChange = { this . _handleScopeChange }
37- class = "sapUiSizeCompact ui5-search-field-select"
38- accessibleName = { this . _translations . scope }
39- tooltip = { this . _translations . scope }
40- value = { this . scopeValue }
41- >
42- { this . scopes . map ( scopeOption => (
43- < Option
44- value = { scopeOption . value }
45- data-ui5-stable = { scopeOption . stableDomRef }
46- ref = { this . captureRef . bind ( scopeOption ) }
47- > { scopeOption . text }
48- </ Option >
49- ) ) }
50- </ Select >
51- < div class = "ui5-search-field-separator" > </ div >
52- </ >
53- ) : this . filterButton ?. length ? (
54- < >
55- < div class = "ui5-filter-wrapper" style = "display: contents" >
56- < slot name = "filterButton" > </ slot >
57- </ div >
58- < div class = "ui5-search-field-separator" > </ div >
59- </ >
60- ) : null }
33+ < BusyIndicator class = "ui5-search-field-busy-indicator" active = { this . fieldLoading } >
34+ < div class = "ui5-search-field-root" role = "search" onFocusOut = { this . _onFocusOutSearch } >
35+ < div class = "ui5-search-field-content" >
36+ { this . scopes ?. length ? (
37+ < >
38+ < Select
39+ onChange = { this . _handleScopeChange }
40+ class = "sapUiSizeCompact ui5-search-field-select"
41+ accessibleName = { this . _translations . scope }
42+ tooltip = { this . _translations . scope }
43+ value = { this . scopeValue }
44+ >
45+ { this . scopes . map ( scopeOption => (
46+ < Option
47+ value = { scopeOption . value }
48+ data-ui5-stable = { scopeOption . stableDomRef }
49+ ref = { this . captureRef . bind ( scopeOption ) }
50+ > { scopeOption . text }
51+ </ Option >
52+ ) ) }
53+ </ Select >
54+ < div class = "ui5-search-field-separator" > </ div >
55+ </ >
56+ ) : this . filterButton ?. length ? (
57+ < >
58+ < div class = "ui5-filter-wrapper" style = "display: contents" >
59+ < slot name = "filterButton" > </ slot >
60+ </ div >
61+ < div class = "ui5-search-field-separator" > </ div >
62+ </ >
63+ ) : null }
6164
62- < input
63- class = "ui5-search-field-inner-input"
64- role = "searchbox"
65- aria-description = { this . accessibleDescription }
66- aria-label = { this . accessibleName || this . _translations . searchFieldAriaLabel }
67- aria-autocomplete = "both"
68- aria-controls = "ui5-search-list"
69- value = { this . value }
70- placeholder = { this . placeholder }
71- data-sap-focus-ref
72- onInput = { this . _handleInput }
73- onFocusIn = { this . _onfocusin }
74- onFocusOut = { this . _onfocusout }
75- onKeyDown = { this . _onkeydown }
76- onClick = { this . _handleInnerClick } />
65+ < input
66+ class = "ui5-search-field-inner-input"
67+ role = "searchbox"
68+ aria-description = { this . accessibleDescription }
69+ aria-label = { this . accessibleName || this . _translations . searchFieldAriaLabel }
70+ aria-autocomplete = "both"
71+ aria-controls = "ui5-search-list"
72+ value = { this . value }
73+ placeholder = { this . placeholder }
74+ data-sap-focus-ref
75+ onInput = { this . _handleInput }
76+ onFocusIn = { this . _onfocusin }
77+ onFocusOut = { this . _onfocusout }
78+ onKeyDown = { this . _onkeydown }
79+ onClick = { this . _handleInnerClick } />
80+
81+ { this . _effectiveShowClearIcon &&
82+ < Icon
83+ class = "ui5-shell-search-field-icon"
84+ name = { decline }
85+ showTooltip = { true }
86+ accessibleName = { this . _translations . clearIcon }
87+ onClick = { this . _handleClear }
88+ > </ Icon >
89+ }
7790
78- { this . _effectiveShowClearIcon &&
7991 < Icon
80- class = "ui5-shell-search-field-icon"
81- name = { decline }
92+ class = { {
93+ "ui5-shell-search-field-icon" : true ,
94+ "ui5-shell-search-field-search-icon" : this . _isSearchIcon ,
95+ } }
96+ name = { search }
8297 showTooltip = { true }
83- accessibleName = { this . _translations . clearIcon }
84- onClick = { this . _handleClear }
98+ accessibleName = { this . _effectiveIconTooltip }
99+ onClick = { this . _handleSearchIconPress }
85100 > </ Icon >
86- }
87-
88- < Icon
89- class = { {
90- "ui5-shell-search-field-icon" : true ,
91- "ui5-shell-search-field-search-icon" : this . _isSearchIcon ,
92- } }
93- name = { search }
94- showTooltip = { true }
95- accessibleName = { this . _effectiveIconTooltip }
96- onClick = { this . _handleSearchIconPress }
97- > </ Icon >
101+ </ div >
98102 </ div >
99- </ div >
103+ </ BusyIndicator >
100104 )
101105 ) ;
102106}
0 commit comments