-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
17 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
designer/client/src/components/sidePanels/SearchLabeledAutocomplete.tsx
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,22 @@ | ||
import { Autocomplete, FormControl } from "@mui/material"; | ||
import { nodeInput } from "../graph/node-modal/NodeDetailsContent/NodeTableStyled"; | ||
import React from "react"; | ||
|
||
export const SearchLabeledAutocomplete = ({ children, name, values }) => { | ||
return ( | ||
<FormControl sx={{ display: "flex", flexDirection: "column", m: 0, gap: 1, width: "100%" }}> | ||
{children} | ||
<Autocomplete | ||
options={values} | ||
className={nodeInput} | ||
renderInput={(params) => ( | ||
<div ref={params.InputProps.ref}> | ||
<input name={name} {...params.inputProps} placeholder="Type to search..." className={nodeInput} /> | ||
</div> | ||
)} | ||
/> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
SearchLabeledAutocomplete.displayName = "SearchLabeledAutocomplete"; |
13 changes: 4 additions & 9 deletions
13
designer/client/src/components/sidePanels/SearchLabeledInput.tsx
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,19 +1,14 @@ | ||
import { forwardRef, PropsWithChildren } from "react"; | ||
import React, { PropsWithChildren } from "react"; | ||
import { FormControl } from "@mui/material"; | ||
import { nodeInput } from "../graph/node-modal/NodeDetailsContent/NodeTableStyled"; | ||
import React from "react"; | ||
|
||
export type SearchLabeledInputProps = PropsWithChildren<{ | ||
name: string; | ||
}>; | ||
|
||
export const SearchLabeledInput = forwardRef<HTMLInputElement, SearchLabeledInputProps>(({ children, ...props }, ref) => { | ||
export const SearchLabeledInput = ({ children, ...props }) => { | ||
return ( | ||
<FormControl sx={{ display: "flex", flexDirection: "column", m: 0, gap: 1, width: "100%" }}> | ||
{children} | ||
<input ref={ref} {...props} className={nodeInput} /> | ||
<input {...props} className={nodeInput} /> | ||
</FormControl> | ||
); | ||
}); | ||
}; | ||
|
||
SearchLabeledInput.displayName = "SearchLabeledInput"; |
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