import React from "react" ; import { ItemValue , QuestionSelectBase } from "survey-core" ; import { ReactElementFactory } from "survey-react-ui" ; import { QuestionAdornerComponent , QuestionAdornerComponentProps } from "./Question" ; export class QuestionDropdownAdornerComponent extends QuestionAdornerComponent { renderElementPlaceholder ( ) { const question = this . props . question as QuestionSelectBase ; const textStyle = ( this . props . question as any ) . textStyle ; return ( < div className = "svc-question__dropdown-choices" > { ( question . visibleChoices || [ ] ) . map ( ( item , index ) => ( < div className = "svc-question__dropdown-choice" key = { `editable_choice_${ index }` } > { question . survey [ "wrapItemValue" ] ( ReactElementFactory . Instance . createElement ( "survey-radiogroup-item" , { question : question , cssClasses : question . cssClasses , isDisplayMode : true , item : item , textStyle : textStyle , index : index , isChecked : question . value === item . value } ) , question , item ) } < /div>))} < /div>); } } ReactElementFactory . Instance . registerElement ( "svc-dropdown-question" , ( props ) => { return React . createElement ( QuestionDropdownAdornerComponent , props ) ; } ) ;