-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
onStateChange
callback to Command component (#972)
Co-authored-by: Hunter Johnston <[email protected]> Co-authored-by: Hunter Johnston <[email protected]>
- Loading branch information
1 parent
028a078
commit 38d38f4
Showing
7 changed files
with
74 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"bits-ui": patch | ||
--- | ||
|
||
feat: add `onStateChange` callback to `Command` component |
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
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
19 changes: 19 additions & 0 deletions
19
...ib/content/api-reference/extended-types/command/command-on-state-change-prop.md
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,19 @@ | ||
```ts | ||
type CommandState = { | ||
/** The value of the search query */ | ||
search: string; | ||
/** The value of the selected command menu item */ | ||
value: string; | ||
/** The filtered items */ | ||
filtered: { | ||
/** The count of all visible items. */ | ||
count: number; | ||
/** Map from visible item id to its search store. */ | ||
items: Map<string, number>; | ||
/** Set of groups with at least one visible item. */ | ||
groups: Set<string>; | ||
}; | ||
}; | ||
|
||
type onStateChange = (state: Readonly<CommandState>) => void; | ||
``` |
1 change: 1 addition & 0 deletions
1
sites/docs/src/lib/content/api-reference/extended-types/command/index.ts
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as CommandFilterProp } from "./command-filter-prop.md"; | ||
export { default as CommandOnStateChangeProp } from "./command-on-state-change-prop.md"; |