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