import * as ko from "knockout" ; import "./modal.scss" ; import { SurveyPropertyModalEditor } from "../propertyEditors/propertyModalEditor" ; const templateHtml = require ( "./modal.html" ) ; export class PropertyEditorModalViewModel { constructor ( public isEditable , public onShowModal , public modalNameTarget , public koText , public getLocString , public koValue , public readOnly , public modalName , public koIsShowingModal , public onResetClick , public koTitleCaption , public koShowApplyButton , public onApplyClick , public onOkClick , public model , public afterRender ) { afterRender ( ) ; } } ko . components . register ( "svd-property-editor-modal" , { viewModel : { createViewModel : ( params , componentInfo ) => { const model = params . model ; return new PropertyEditorModalViewModel ( model . isEditable , model . onShowModal , model . modalNameTarget , model . koText , model . getLocString , model . koValue , model . readOnly , model . modalName , model . koIsShowingModal , model . onResetClick , model . koTitleCaption , model . koShowApplyButton , model . onApplyClick , model . onOkClick , model , ( ) => { typeof params . afterRender === "function" && params . afterRender . call ( model , componentInfo ) ; typeof model . koAfterRender === "function" && model . koAfterRender . call ( model , componentInfo ) ; } ) ; } , } , template : templateHtml , } ) ;