0
? this.state.formState[itemInput.name]
: this.state.formState[itemInput.name] &&
this.state.formState[itemInput.name].length === 0
? undefined
: itemInput.defaultData
}
onChange={
typeof this.props.onChange !== "undefined"
? this.handleChangeMultSelect.bind(this, itemInput.name)
: null
}
responsiveHeight={250}
messages={{
searchPlaceholder: "Buscar...",
noItemsMessage: "Sem itens...",
noneSelectedMessage: "Nenhum",
selectedMessage: "selecionados",
selectAllMessage: "Selecionar todos",
clearAllMessage: "Limpar",
disabledItemsTooltip: "Você pode selecionar apenas 1 item",
}}
/>
}
/>
);
}
case "checkbox":
return (
);
break;
case "search":
return (
}
/>
);
break;
case "textArea":
return (
);
break;
case "header":
return (
{itemInput.icon && }
{itemInput.label}
);
break;
case "dropdown":
return (
}
/>
);
case "radio":
return (
{itemInput.data.map((item: any, index: number) =>
itemInput.variation &&
(itemInput.variation === INPUT_VARIATIONS.TOGGLE ||
itemInput.variation === INPUT_VARIATIONS.SLIDER) ? (
) : itemInput.variation &&
itemInput.variation === INPUT_VARIATIONS.CHECKBOX ? (
) : (
)
)}
);
case "multiprogress":
const canRenderMultiProgressBar = this.canRenderMultiProgress(
itemInput.data
);
return (
);
default:
return (
)
}
/>
);
break;
}
}
canRenderMultiProgress = (data: any) =>
data && data.length && data[0].readings && Array.isArray(data[0].readings);
render() {
const {
title,
border,
loading,
refForm,
accordion,
actionRightTop,
} = this.props;
const { formTemplate, activeAccordion } = this.state;
const defineBorder = border
? border === "attached"
? "attached segment"
: "segment"
: null;
return (
{actionRightTop && actionRightTop}
{accordion && (
)}
<>
{accordion && }
{itemRow.row.grouped &&
this.mountActionGroupingRow(itemRow, indexRow)}
{itemRow.row.fields.map(
(itemInput: any, indexField: number) =>
this.mountForm(itemInput, indexRow, indexField, itemRow)
)}
{itemRow.row.removed && (
)}
))}
{this.props.children}
>
);
}
}