feat: add InputFile customization (#9233)
* ✨ (frontend): introduce CustomInputFileComponent to customize file input component in parameter render component for better flexibility and customization. Remove InputFileComponent from parameter render component and replace it with CustomInputFileComponent.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
575cb7fb17
commit
96b35e0843
2 changed files with 33 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import { useMemo } from "react";
|
|
||||||
import type { handleOnNewValueType } from "@/CustomNodes/hooks/use-handle-new-value";
|
import type { handleOnNewValueType } from "@/CustomNodes/hooks/use-handle-new-value";
|
||||||
import CodeAreaComponent from "@/components/core/parameterRenderComponent/components/codeAreaComponent";
|
import CodeAreaComponent from "@/components/core/parameterRenderComponent/components/codeAreaComponent";
|
||||||
import SliderComponent from "@/components/core/parameterRenderComponent/components/sliderComponent";
|
import SliderComponent from "@/components/core/parameterRenderComponent/components/sliderComponent";
|
||||||
|
|
@ -6,12 +5,12 @@ import TableNodeComponent from "@/components/core/parameterRenderComponent/compo
|
||||||
import TabComponent from "@/components/core/parameterRenderComponent/components/tabComponent";
|
import TabComponent from "@/components/core/parameterRenderComponent/components/tabComponent";
|
||||||
import { TEXT_FIELD_TYPES } from "@/constants/constants";
|
import { TEXT_FIELD_TYPES } from "@/constants/constants";
|
||||||
import CustomConnectionComponent from "@/customization/components/custom-connectionComponent";
|
import CustomConnectionComponent from "@/customization/components/custom-connectionComponent";
|
||||||
|
import CustomInputFileComponent from "@/customization/components/custom-input-file";
|
||||||
import CustomLinkComponent from "@/customization/components/custom-linkComponent";
|
import CustomLinkComponent from "@/customization/components/custom-linkComponent";
|
||||||
import type { APIClassType, InputFieldType } from "@/types/api";
|
import type { APIClassType, InputFieldType } from "@/types/api";
|
||||||
import DictComponent from "./components/dictComponent";
|
import DictComponent from "./components/dictComponent";
|
||||||
import { EmptyParameterComponent } from "./components/emptyParameterComponent";
|
import { EmptyParameterComponent } from "./components/emptyParameterComponent";
|
||||||
import FloatComponent from "./components/floatComponent";
|
import FloatComponent from "./components/floatComponent";
|
||||||
import InputFileComponent from "./components/inputFileComponent";
|
|
||||||
import InputListComponent from "./components/inputListComponent";
|
import InputListComponent from "./components/inputListComponent";
|
||||||
import IntComponent from "./components/intComponent";
|
import IntComponent from "./components/intComponent";
|
||||||
import KeypairListComponent from "./components/keypairListComponent";
|
import KeypairListComponent from "./components/keypairListComponent";
|
||||||
|
|
@ -171,7 +170,7 @@ export function ParameterRenderComponent({
|
||||||
);
|
);
|
||||||
case "file":
|
case "file":
|
||||||
return (
|
return (
|
||||||
<InputFileComponent
|
<CustomInputFileComponent
|
||||||
{...baseInputProps}
|
{...baseInputProps}
|
||||||
fileTypes={templateData.fileTypes}
|
fileTypes={templateData.fileTypes}
|
||||||
file_path={templateData.file_path}
|
file_path={templateData.file_path}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
import InputFileComponent from "@/components/core/parameterRenderComponent/components/inputFileComponent";
|
||||||
|
import type {
|
||||||
|
FileComponentType,
|
||||||
|
InputProps,
|
||||||
|
} from "@/components/core/parameterRenderComponent/types";
|
||||||
|
|
||||||
|
export default function CustomInputFileComponent({
|
||||||
|
value,
|
||||||
|
file_path,
|
||||||
|
handleOnNewValue,
|
||||||
|
disabled,
|
||||||
|
fileTypes,
|
||||||
|
isList,
|
||||||
|
tempFile = true,
|
||||||
|
editNode = false,
|
||||||
|
id,
|
||||||
|
}: InputProps<string, FileComponentType>): JSX.Element {
|
||||||
|
return (
|
||||||
|
<InputFileComponent
|
||||||
|
value={value}
|
||||||
|
file_path={file_path}
|
||||||
|
handleOnNewValue={handleOnNewValue}
|
||||||
|
disabled={disabled}
|
||||||
|
fileTypes={fileTypes}
|
||||||
|
isList={isList}
|
||||||
|
tempFile={tempFile}
|
||||||
|
editNode={editNode}
|
||||||
|
id={`inputfile_${id}`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue