import * as ko from "knockout" ; import "./string.scss" ; import { SurveyStringPropertyEditor } from "../propertyEditors/propertyEditorFactory" ; const templateHtml = require ( "./string.html" ) ; export class PropertyEditorStringViewModel { constructor ( public koValue , public readOnly , public koInputType , public defaultValue , public koMaxLength , public displayName , public listName , public dataList , public koDisplayError , public getLocString , public koErrorText , public onKeydown , public afterRender ) { afterRender ( ) ; } } ko . components . register ( "svd-property-editor-string" , { viewModel : { createViewModel : ( params , componentInfo ) => { const model = params . model ; return new PropertyEditorStringViewModel ( model . koValue , model . readOnly , model . koInputType , model . defaultValue , model . koMaxLength , model . displayName , model . listName , model . property . dataList , model . koDisplayError , model . getLocString , model . koErrorText , model . onInputKeydown , ( ) => { typeof params . afterRender === "function" && params . afterRender . call ( model , componentInfo ) ; typeof model . koAfterRender === "function" && model . koAfterRender . call ( model , componentInfo ) ; } ) ; } , } , template : templateHtml , } ) ;