Skip to content

Commit

Permalink
Improve the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bendera committed Sep 12, 2024
1 parent 0d02fda commit 1035b18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/includes/vscode-select/vscode-select-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ export class VscodeSelectBase extends VscElement {
invalid = false;

/**
* Filter method
* Search method in the filtered list within the combobox mode.
*
* @attr [filter=fuzzy]
* @type {"fuzzy"|"contains"|"startsWith"|"startsWithPerTerm"}
* - contains - The list item includes the searched pattern at any position.
* - fuzzy - The list item contains the letters of the search pattern in the same order, but at any position.
* - startsWith - The search pattern matches the beginning of the searched text.
* - startsWithPerTerm - The search pattern matches the beginning of any word in the searched text.
*
* @default 'fuzzy'
*/
@property({type: String})
set filter(val: string) {
@property()
set filter(val: 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm') {
const validValues: SearchMethod[] = [
'contains',
'fuzzy',
Expand All @@ -78,7 +82,7 @@ export class VscodeSelectBase extends VscElement {
);
}
}
get filter(): string {
get filter(): 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm' {
return this._filter;
}

Expand Down
2 changes: 2 additions & 0 deletions src/vscode-multi-select/vscode-multi-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {highlightRanges} from '../includes/vscode-select/helpers.js';
* @cssprop --vscode-list-activeSelectionBackground
* @cssprop --vscode-list-activeSelectionForeground
* @cssprop --vscode-list-focusOutline
* @cssprop --vscode-list-focusHighlightForeground
* @cssprop --vscode-list-highlightForeground
* @cssprop --vscode-list-hoverBackground
* @cssprop --vscode-list-hoverForeground
* @cssprop --vscode-list-hoverBackground
Expand Down
2 changes: 2 additions & 0 deletions src/vscode-single-select/vscode-single-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import {highlightRanges} from '../includes/vscode-select/helpers.js';
* @cssprop --vscode-list-activeSelectionBackground
* @cssprop --vscode-list-activeSelectionForeground
* @cssprop --vscode-list-focusOutline
* @cssprop --vscode-list-highlightForeground
* @cssprop --vscode-list-focusHighlightForeground
* @cssprop --vscode-list-hoverBackground
* @cssprop --vscode-list-hoverForeground
* @cssprop --vscode-list-hoverBackground
Expand Down

0 comments on commit 1035b18

Please sign in to comment.