File tree 2 files changed +25
-7
lines changed
2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -30,4 +30,11 @@ const Contains = (value, items) => {
30
30
} ) ;
31
31
} ;
32
32
33
- export { StartsWithPerTerm , StartsWith , Contains } ;
33
+ const None = ( _ , items ) => items ;
34
+
35
+ export {
36
+ StartsWithPerTerm ,
37
+ StartsWith ,
38
+ Contains ,
39
+ None ,
40
+ } ;
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ import ResponsivePopover from "./ResponsivePopover.js";
24
24
import List from "./List.js" ;
25
25
import StandardListItem from "./StandardListItem.js" ;
26
26
import ToggleButton from "./ToggleButton.js" ;
27
+ import * as Filters from "./ComboBoxFilters.js" ;
27
28
import Button from "./Button.js" ;
29
+
28
30
import {
29
31
VALUE_STATE_SUCCESS ,
30
32
VALUE_STATE_ERROR ,
@@ -201,6 +203,19 @@ const metadata = {
201
203
type : Boolean ,
202
204
} ,
203
205
206
+ /**
207
+ * Defines the filter type of the <code>ui5-multi-combobox</code>.
208
+ * Available options are: <code>StartsWithPerTerm</code>, <code>None</code>.
209
+ *
210
+ * @type {string }
211
+ * @defaultvalue "StartsWithPerTerm"
212
+ * @public
213
+ */
214
+ filter : {
215
+ type : String ,
216
+ defaultValue : "StartsWithPerTerm" ,
217
+ } ,
218
+
204
219
/**
205
220
* Indicates whether the dropdown is open. True if the dropdown is open, false otherwise.
206
221
*
@@ -586,12 +601,8 @@ class MultiComboBox extends UI5Element {
586
601
}
587
602
}
588
603
589
- _filterItems ( value ) {
590
- return this . items . filter ( item => {
591
- return item . text
592
- && item . text . toLowerCase ( ) . startsWith ( value . toLowerCase ( ) )
593
- && ( this . filterSelected ? item . selected : true ) ;
594
- } ) ;
604
+ _filterItems ( str ) {
605
+ return ( Filters [ this . filter ] || Filters . StartsWithPerTerm ) ( str , this . items ) ;
595
606
}
596
607
597
608
_toggle ( ) {
You can’t perform that action at this time.
0 commit comments