Add search modal ()

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-10 17:22:53 +05:30
parent 20443f8a4d
commit c9ec161ccc
10 changed files with 348 additions and 7 deletions

View file

@ -56,7 +56,7 @@ class AsyncSearch extends EventEmitter {
this._softReset();
this.term = (this.isCaseSensitive) ? term : term.toLocaleLowerCase();
if (this.ignoreWhitespace) this.term = this.term.replace(' ', '');
if (this.ignoreWhitespace) this.term = this.term.replaceAll(' ', '');
if (this.term === '') {
this._sendFindings();
return;
@ -114,7 +114,7 @@ class AsyncSearch extends EventEmitter {
_compare(item) {
if (typeof item !== 'string') return false;
let myItem = (this.isCaseSensitive) ? item : item.toLocaleLowerCase();
if (this.ignoreWhitespace) myItem = myItem.replace(' ', '');
if (this.ignoreWhitespace) myItem = myItem.replaceAll(' ', '');
if (this.isContain) return myItem.indexOf(this.term) !== -1;
return myItem.startsWith(this.term);