File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,19 +9,20 @@ import {MenuItem, MenuLabel} from "../menu/Menu";
99import { Flex } from "../flex/Flex" ;
1010import { IconArrowDown , IconArrowUp , IconCornerDownLeft } from "@tabler/icons-react" ;
1111import { Spacing } from "../spacing/Spacing" ;
12+ import { DUserView } from "./DUser.view" ;
1213
1314export interface DUserInputProps extends TextInputProps {
14-
15+ filter ?: ( user : DUserView , index : number ) => boolean
1516}
1617
1718export const DUserInput : React . FC < DUserInputProps > = ( props ) => {
1819
19- const { ...rest } = props
20+ const { filter = ( ) => true , ...rest } = props
2021
2122 const userService = useService ( DUserReactiveService )
2223 const userStore = useStore ( DUserReactiveService )
2324 const suggestions : InputSuggestion [ ] = React . useMemo ( ( ) => {
24- return userService . values ( ) . map ( user => ( {
25+ return userService . values ( ) . filter ( filter ) . map ( user => ( {
2526 value : user . username || "" ,
2627 children : < Flex align = { "end" } style = { { gap : "0.35rem" } } >
2728 < Text > { user . username } </ Text >
You can’t perform that action at this time.
0 commit comments