generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove deprecated usages of app
- Loading branch information
1 parent
2efb3be
commit 343ff57
Showing
8 changed files
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { App } from "obsidian"; | ||
import { TextInputSuggest } from "./suggest"; | ||
|
||
export class ArraySuggest extends TextInputSuggest<string> { | ||
content: Set<string>; | ||
|
||
constructor(app: App, input: HTMLInputElement, content: Set<string>) { | ||
super(app, input); | ||
this.content = content; | ||
} | ||
|
||
getSuggestions(inputStr: string): string[] { | ||
const lowerCaseInputStr = inputStr.toLowerCase(); | ||
return [...this.content].filter((content) => | ||
content.contains(lowerCaseInputStr) | ||
); | ||
} | ||
|
||
renderSuggestion(content: string, el: HTMLElement): void { | ||
el.setText(content); | ||
} | ||
|
||
selectSuggestion(content: string): void { | ||
this.inputEl.value = content; | ||
this.inputEl.trigger("input"); | ||
this.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters