import * as ko from "knockout" ; import "./nested-items.scss" ; import { SurveyNestedPropertyEditor , SurveyNestedPropertyEditorColumn , } from "../propertyEditors/propertyNestedPropertyEditor" ; const templateHtml = require ( "./nested-items.html" ) ; export class PropertyEditorNestedItemsViewModel { constructor ( public koIsList , public getLocString , public koShowHeader , public columns , public sortableOptions , public model , public koAllowAddRemoveItems , public readOnly , public onAddClick , public onClearClick , public koAllowRemoveAllItems , public koCanAddItem , public addItemText , public afterRender ) { afterRender ( ) ; } public get originalValue ( ) { return this . model . originalValue ; } } ko . components . register ( "svd-property-editor-nested-items" , { viewModel : { createViewModel : ( params , componentInfo ) => { const model = params . model ; return new PropertyEditorNestedItemsViewModel ( model . koIsList , model . getLocString , model . koShowHeader , model . columns , model . sortableOptions , model , model . koAllowAddRemoveItems , model . readOnly , model . onAddClick , model . onClearClick , model . koAllowRemoveAllItems , model . koCanAddItem , model . addItemText , ( ) => { typeof params . afterRender === "function" && params . afterRender . call ( model , componentInfo ) ; typeof model . koAfterRender === "function" && model . koAfterRender . call ( model , componentInfo ) ; } ) ; } , } , template : templateHtml , } ) ;