From b159723069aea21470104a26277dc4bb3a4ef869 Mon Sep 17 00:00:00 2001 From: Adham Sabry Date: Sat, 31 May 2025 16:17:00 +1000 Subject: [PATCH] feat: added support for search on keys array and json path #297 --- README.md | 4 +-- projects/demo/src/app/app.component.html | 10 +++--- projects/ngx-select-dropdown/README.md | 4 +-- .../src/lib/pipes/filter-by.pipe.spec.ts | 11 ++++++- .../src/lib/pipes/filter-by.pipe.ts | 31 ++++++++++++++++--- .../lib/types/ngx-select-dropdown.types.ts | 2 +- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d7cc5c3..c7b51fc 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ * search dropdown list * arrows keys support * limit number of items displayed in dropdown -* custom sort +* custom sort * angular forms support * angular v4 and above supported * cross browser support @@ -105,7 +105,7 @@ config = { moreText: 'more' // text to be displayed whenmore than one items are selected like Option 1 + 5 more noResultsFound: 'No results found!' // text to be displayed when no items are found while searching searchPlaceholder:'Search' // label thats displayed in search input, - searchOnKey: 'name' // key on which search should be performed this will be selective search. if undefined this will be extensive search on all keys + searchOnKey: 'name' // key or array of keys on which search should be performed this will be selective search. if undefined this will be extensive search on all keys, you may also provide an object path (array objects are not supported) clearOnSelection: false // clears search criteria when an option is selected if set to true, default is false inputDirection: 'ltr' // the direction of the search input can be rtl or ltr(default) selectAllLabel: 'Select all' // label that is displayed in multiple selection for select all diff --git a/projects/demo/src/app/app.component.html b/projects/demo/src/app/app.component.html index 13e28e4..5c5847c 100644 --- a/projects/demo/src/app/app.component.html +++ b/projects/demo/src/app/app.component.html @@ -119,17 +119,17 @@
Input
moreText: 'more' // text to be displayed whenmore than one items are selected like Option 1 + 5 more noResultsFound: 'No results found!' // text to be displayed when no items are found while searching searchPlaceholder:'Search' // label thats displayed in search input, - searchOnKey: 'name' // key on which search should be performed this will be selective search. if undefined this will be extensive search on all keys + searchOnKey: 'name' // key or array of keys on which search should be performed this will be selective search. if undefined this will be extensive search on all keys, you may also provide an object path (array objects are not supported) {{ '}' }}