diff --git a/app/components/InputStyler/InputStyler.tsx b/app/components/InputStyler/InputStyler.tsx index bc4d626..4c2b374 100644 --- a/app/components/InputStyler/InputStyler.tsx +++ b/app/components/InputStyler/InputStyler.tsx @@ -80,7 +80,6 @@ export default function InputStyler( ruleProperties: any ) { const updateFieldValue = (field: string, value: any) => { - console.log(field, value, "this is input change"); const updatedData = { ...rawData, [field]: value }; if (typeof setRawData === "function") { setRawData(updatedData); @@ -161,6 +160,17 @@ export default function InputStyler( handleInputChange={handleInputChange} /> ); + case "multiselect": + return ( + + ); case "text": return ( typeof item === "object" && item !== null); + if (Array.isArray(value) && !allObjects) { + const stringValue = value.filter((item) => typeof item !== "object" || item === null).join(", "); + return ; + } + return ( <> ( -
+
{each.label} {InputStyler( - item[each.name], - `${field}[${index}].${each.name}`, + item[each.field], + `${field}[${index}].${each.field}`, true, scenarios, rawData, @@ -51,7 +51,7 @@ export const ChildFieldInput = ({ const updatedArray = [...value]; updatedArray[index] = { ...updatedArray[index], - [each.name]: newData[`${field}[${index}].${each.name}`], + [each.field]: newData[`${field}[${index}].${each.field}`], }; handleInputChange?.(updatedArray, field); }, @@ -76,8 +76,8 @@ export const ObjectArrayInput = ({ const customName = parsedPropertyName.charAt(0).toUpperCase() + parsedPropertyName.slice(1); const childFields = ruleProperties?.childFields || []; - const childFieldMap = childFields.reduce((acc: { [x: string]: null }, field: { name: string | number }) => { - acc[field.name] = null; + const childFieldMap = childFields.reduce((acc: { [x: string]: null }, field: { field: string | number }) => { + acc[field.field] = null; return acc; }, {}); @@ -95,9 +95,9 @@ export const ObjectArrayInput = ({ {customName} {index + 1}