-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PresentationInstanceFilterDialog
: Make API more convienent (#438)
* Filtering dialog associate descriptor with keys * changeset * Rename
- Loading branch information
1 parent
8791d60
commit 115d815
Showing
7 changed files
with
234 additions
and
86 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,34 @@ | ||
--- | ||
"@itwin/presentation-components": major | ||
--- | ||
|
||
Merged `PresentationInstanceFilterDialogProps.descriptor` and `PresentationInstanceFilterDialogProps.descriptorInputKeys` into single property `PresentationInstanceFilterDialogProps.propertiesSource`. This explicitly associates `Descriptor` with input keys. It provides more convenient API in case `Descriptor` is lazy loaded and input keys are known only after loading. | ||
|
||
Before: | ||
|
||
```tsx | ||
const [inputKey, setInputKeys] = useState([]); | ||
|
||
<PresentationInstanceFilterDialog | ||
descriptor={async () => { | ||
const { descriptor, keys } = loadDescriptorAndKeys(); | ||
setInputKeys(keys); | ||
return descriptor; | ||
}} | ||
descriptorInputKeys={inputKeys} | ||
/> | ||
``` | ||
|
||
After: | ||
|
||
```tsx | ||
<PresentationInstanceFilterDialog | ||
propertiesSource={async () => { | ||
const { descriptor, keys } = loadDescriptorAndKeys(); | ||
return { | ||
descriptor, | ||
inputKeys: keys, | ||
}; | ||
}} | ||
/> | ||
``` |
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
Oops, something went wrong.