import * as ko from "knockout" ; import "./dropdown.scss" ; import { SurveyDropdownPropertyEditor } from "../propertyEditors/propertyEditorFactory" ; const templateHtml = require ( "./dropdown.html" ) ; export class PropertyEditorDropdownViewModel { constructor ( public koValue , public readOnly , public optionsCaption , public koChoices , public koHasFocus , public displayName , public afterRender ) { afterRender ( ) ; } } ko . components . register ( "svd-property-editor-dropdown" , { viewModel : { createViewModel : ( params , componentInfo ) => { const model = params . model ; return new PropertyEditorDropdownViewModel ( model . koValue , model . readOnly , model . optionsCaption , model . koChoices , model . koHasFocus , model . displayName , ( ) => { typeof params . afterRender === "function" && params . afterRender . call ( model , componentInfo ) ; typeof model . koAfterRender === "function" && model . koAfterRender . call ( model , componentInfo ) ; } ) ; } , } , template : templateHtml , } ) ;