added password field
This commit is contained in:
parent
9200d7e12a
commit
1910be7c33
3 changed files with 4 additions and 2 deletions
|
|
@ -101,6 +101,7 @@ export default function ParameterComponent({
|
|||
) : (
|
||||
<InputComponent
|
||||
disabled={disabled}
|
||||
password={data.node.template[name].password ?? true}
|
||||
value={data.node.template[name].value ?? ""}
|
||||
onChange={(t) => {
|
||||
data.node.template[name].value = t;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useState } from "react";
|
||||
import { InputComponentType } from "../../types/components";
|
||||
|
||||
export default function InputComponent({value, onChange, disabled}: InputComponentType){
|
||||
export default function InputComponent({value, onChange, disabled, password}: InputComponentType){
|
||||
const [myValue, setMyValue] = useState(value ?? "");
|
||||
useEffect(()=> {
|
||||
if(disabled){
|
||||
|
|
@ -12,7 +12,7 @@ export default function InputComponent({value, onChange, disabled}: InputCompone
|
|||
return (
|
||||
<div className={disabled ? "pointer-events-none cursor-not-allowed" : ""}>
|
||||
<input
|
||||
type="text"
|
||||
type={password ? "password" : "text"}
|
||||
value={myValue}
|
||||
className={"block w-full form-input dark:bg-gray-900 dark:border-gray-600 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + (disabled ? " bg-gray-200 dark:bg-gray-700" : "")}
|
||||
placeholder="Type a text"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ export type InputComponentType = {
|
|||
value: string;
|
||||
disabled?: boolean;
|
||||
onChange: (value: string) => void;
|
||||
password: boolean;
|
||||
};
|
||||
export type ToggleComponentType = {
|
||||
enabled: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue