import { Options } from 'vue-class-component' ; import { isUndefined } from '@syncfusion/ej2-base' ; import { ComponentBase , EJComponentDecorator , getProps , allVue , gh } from '@syncfusion/ej2-vue-base' ; import { isNullOrUndefined , getValue } from '@syncfusion/ej2-base' ; import { AccumulationChart } from '@syncfusion/ej2-charts' ; import { AccumulationSeriesCollectionDirective , AccumulationSeriesDirective , AccumulationSeriesCollectionPlugin , AccumulationSeriesPlugin } from './series.directive' ; import { AccumulationAnnotationsDirective , AccumulationAnnotationDirective , AccumulationAnnotationsPlugin , AccumulationAnnotationPlugin } from './annotations.directive' ; export const properties = [ 'isLazyUpdate' , 'allowExport' , 'annotations' , 'background' , 'backgroundImage' , 'border' , 'center' , 'currencyCode' , 'dataSource' , 'enableAnimation' , 'enableBorderOnMouseMove' , 'enableExport' , 'enablePersistence' , 'enableRtl' , 'enableSmartLabels' , 'height' , 'highlightMode' , 'highlightPattern' , 'isMultiSelect' , 'legendSettings' , 'locale' , 'margin' , 'selectedDataIndexes' , 'selectionMode' , 'selectionPattern' , 'series' , 'subTitle' , 'subTitleStyle' , 'theme' , 'title' , 'titleStyle' , 'tooltip' , 'useGroupingSeparator' , 'width' , 'afterExport' , 'animationComplete' , 'annotationRender' , 'beforePrint' , 'beforeResize' , 'chartDoubleClick' , 'chartMouseClick' , 'chartMouseDown' , 'chartMouseLeave' , 'chartMouseMove' , 'chartMouseUp' , 'legendRender' , 'load' , 'loaded' , 'pointClick' , 'pointMove' , 'pointRender' , 'resized' , 'selectionComplete' , 'seriesRender' , 'textRender' , 'tooltipRender' ] ; export const modelProps = [ 'dataSource' ] ; export const testProp = getProps ( { props : properties } ) ; export const props = testProp [ 0 ] ; export const watch = testProp [ 1 ] ; export const emitProbs = Object . keys ( watch ) ; emitProbs . push ( 'modelchanged' ) ; for ( let props of modelProps ) { emitProbs . push ( 'update:' + props ) ; } export const isExecute = gh ? false : true ; /**
 * Represents Vuejs AccumulationChart Component
 * ```vue
 * <ejs-accumulationchart></ejs-accumulationchart>
 * ```
 */ @ EJComponentDecorator ( { props : properties , model : { event : 'modelchanged' } } , isExecute ) export class AccumulationChartComponent extends ComponentBase { public ej2Instances : any ; public propKeys : string [ ] = properties ; public models : string [ ] = modelProps ; public hasChildDirective : boolean = true ; protected hasInjectedModules : boolean = true ; public tagMapper : { [ key ] : Object ; } = { "e-accumulation-series-collection" : "e-accumulation-series" , "e-accumulation-annotations" : "e-accumulation-annotation" } ; public tagNameMapper : Object = { "e-accumulation-series-collection" : "e-series" , "e-accumulation-annotations" : "e-annotations" } ; public isVue3 : boolean ; public templateCollection : any ; constructor ( ) { super ( arguments ) ; this . isVue3 = ! isExecute ; this . ej2Instances = new AccumulationChart ( { } ) ; this . ej2Instances . _trigger = this . ej2Instances . trigger ; this . ej2Instances . trigger = this . trigger ; this . bindProperties ( ) ; this . ej2Instances . _setProperties = this . ej2Instances . setProperties ; this . ej2Instances . setProperties = this . setProperties ; this . ej2Instances . clearTemplate = this . clearTemplate ; } public clearTemplate ( templateNames ? ) { if ( ! templateNames ) { templateNames = Object . keys ( this . templateCollection || { } ) ; } if ( templateNames . length && this . templateCollection ) { for ( let tempName of templateNames ) { let elementCollection = this . templateCollection [ tempName ] ; if ( elementCollection && elementCollection . length ) { for ( let ele of elementCollection ) { let destroy = getValue ( '__vue__.$destroy' , ele ) ; if ( destroy ) { ele . __vue__ . $destroy ( ) ; } if ( ele . innerHTML ) { ele . innerHTML = '' ; } } delete this . templateCollection [ tempName ] ; } } } } public setProperties ( prop , muteOnChange ) { if ( this . isVue3 ) { this . models = ! this . models ? this . ej2Instances . referModels : this . models ; } if ( this . ej2Instances && this . ej2Instances . _setProperties ) { this . ej2Instances . _setProperties ( prop , muteOnChange ) ; } if ( prop && this . models && this . models . length ) { Object . keys ( prop ) . map ( ( key ) : void => { this . models . map ( ( model ) : void => { if ( ( key === model ) && ! ( /datasource/i . test ( key ) ) ) { if ( this . isVue3 ) { this . ej2Instances . vueInstance . $emit ( 'update:' + key , prop [ key ] ) ; } else { ( this as any ) . $emit ( 'update:' + key , prop [ key ] ) ; ( this as any ) . $emit ( 'modelchanged' , prop [ key ] ) ; } } } ) ; } ) ; } } public trigger ( eventName , eventProp , successHandler ? ) { if ( ! isExecute ) { this . models = ! this . models ? this . ej2Instances . referModels : this . models ; } if ( ( eventName === 'change' || eventName === 'input' ) && this . models && ( this . models . length !== 0 ) ) { let key = this . models . toString ( ) . match ( /checked|value/ ) || [ ] ; let propKey = key [ 0 ] ; if ( eventProp && key && ! isUndefined ( eventProp [ propKey ] ) ) { if ( ! isExecute ) { this . ej2Instances . vueInstance . $emit ( 'update:' + propKey , eventProp [ propKey ] ) ; this . ej2Instances . vueInstance . $emit ( 'modelchanged' , eventProp [ propKey ] ) ; } else { if ( eventName === 'change' || ( ( this as any ) . $props && ! ( this as any ) . $props . isLazyUpdate ) ) { ( this as any ) . $emit ( 'update:' + propKey , eventProp [ propKey ] ) ; ( this as any ) . $emit ( 'modelchanged' , eventProp [ propKey ] ) ; } } } } else if ( ( eventName === 'actionBegin' && eventProp . requestType === 'dateNavigate' ) && this . models && ( this . models . length !== 0 ) ) { let key = this . models . toString ( ) . match ( /currentView|selectedDate/ ) || [ ] ; let propKey = key [ 0 ] ; if ( eventProp && key && ! isUndefined ( eventProp [ propKey ] ) ) { if ( ! isExecute ) { this . ej2Instances . vueInstance . $emit ( 'update:' + propKey , eventProp [ propKey ] ) ; this . ej2Instances . vueInstance . $emit ( 'modelchanged' , eventProp [ propKey ] ) ; } else { ( this as any ) . $emit ( 'update:' + propKey , eventProp [ propKey ] ) ; ( this as any ) . $emit ( 'modelchanged' , eventProp [ propKey ] ) ; } } } if ( ( this . ej2Instances && this . ej2Instances . _trigger ) ) { this . ej2Instances . _trigger ( eventName , eventProp , successHandler ) ; } } public render ( createElement ) { let h = gh || createElement ; let slots = null ; if ( ! isNullOrUndefined ( ( this as any ) . $slots . default ) ) { slots = gh ? ( this as any ) . $slots . default ( ) : ( this as any ) . $slots . default ; } return h ( 'div' , slots ) ; } public export ( type , fileName ) { return this . ej2Instances . export ( type , fileName ) ; } public print ( id ? ) { return this . ej2Instances . print ( id ) ; } public setAnnotationValue ( annotationIndex , content ) { return this . ej2Instances . setAnnotationValue ( annotationIndex , content ) ; } public titleTooltip ( event , x , y , isTouch ? ) { return this . ej2Instances . titleTooltip ( event , x , y , isTouch ) ; } } export const AccumulationChartPlugin = { name : 'ejs-accumulationchart' , install ( Vue ) { Vue . component ( AccumulationChartPlugin . name , AccumulationChartComponent ) ; Vue . component ( AccumulationSeriesPlugin . name , AccumulationSeriesDirective ) ; Vue . component ( AccumulationSeriesCollectionPlugin . name , AccumulationSeriesCollectionDirective ) ; Vue . component ( AccumulationAnnotationPlugin . name , AccumulationAnnotationDirective ) ; Vue . component ( AccumulationAnnotationsPlugin . name , AccumulationAnnotationsDirective ) ; } } ;