import * as ko from "knockout" ; import { ItemValue , QuestionSelectBase , SurveyTemplateRendererViewModel , SurveyModel } from "survey-core" ; import { CreatorBase , ItemValueWrapperViewModel } from "@survey/creator" ; import { ImplementorBase } from "survey-knockout-ui" ; import { KnockoutDragEvent } from "../events" ; const template = require ( "./item-value.html" ) ; class KnockoutItemValueWrapperViewModel extends ItemValueWrapperViewModel { constructor ( creator , public question , public item , public templateData ) { super ( creator , question , item ) ; } get attributes ( ) { return this . isDraggable ? { "data-sv-drop-target-item-value" : this . item . value } : null ; } } ko . components . register ( "svc-item-value" , { viewModel : { createViewModel : ( params , componentInfo ) => { const creator = params . componentData . creator ; const question = params . componentData . question ; const item = params . templateData . data ; const model = new KnockoutItemValueWrapperViewModel ( creator , question , item , params . templateData ) ; new ImplementorBase ( model ) ; return model ; } } , template : template } ) ;