import { Options } from 'vue-class-component' ; import { ComponentBase , EJComponentDecorator , getProps , allVue , gh } from '@syncfusion/ej2-vue-base' ; import { isNullOrUndefined , getValue } from '@syncfusion/ej2-base' ; import { PivotView } from '@syncfusion/ej2-pivotview' ; export const properties = [ 'isLazyUpdate' , 'aggregateTypes' , 'allowCalculatedField' , 'allowConditionalFormatting' , 'allowDataCompression' , 'allowDeferLayoutUpdate' , 'allowDrillThrough' , 'allowExcelExport' , 'allowGrouping' , 'allowNumberFormatting' , 'allowPdfExport' , 'cellTemplate' , 'chartSettings' , 'chartTypes' , 'currencyCode' , 'dataSourceSettings' , 'displayOption' , 'editSettings' , 'enableHtmlSanitizer' , 'enablePersistence' , 'enableRtl' , 'enableValueSorting' , 'enableVirtualization' , 'exportAllPages' , 'gridSettings' , 'groupingBarSettings' , 'height' , 'hyperlinkSettings' , 'loadOnDemandInMemberEditor' , 'locale' , 'maxNodeLimitInMemberEditor' , 'maxRowsInDrillThrough' , 'pivotValues' , 'showFieldList' , 'showGroupingBar' , 'showToolbar' , 'showTooltip' , 'showValuesButton' , 'spinnerTemplate' , 'toolbar' , 'toolbarTemplate' , 'tooltipTemplate' , 'width' , 'actionBegin' , 'actionComplete' , 'actionFailure' , 'aggregateCellInfo' , 'aggregateMenuOpen' , 'beforeExport' , 'beforeServiceInvoke' , 'beginDrillThrough' , 'calculatedFieldCreate' , 'cellClick' , 'cellSelected' , 'cellSelecting' , 'chartSeriesCreated' , 'conditionalFormatting' , 'created' , 'dataBound' , 'destroyed' , 'drill' , 'drillThrough' , 'editCompleted' , 'enginePopulated' , 'enginePopulating' , 'fetchReport' , 'fieldDragStart' , 'fieldDrop' , 'fieldListRefreshed' , 'fieldRemove' , 'hyperlinkCellClick' , 'load' , 'loadReport' , 'memberEditorOpen' , 'memberFiltering' , 'newReport' , 'numberFormatting' , 'onFieldDropped' , 'onPdfCellRender' , 'removeReport' , 'renameReport' , 'saveReport' , 'toolbarClick' , 'toolbarRender' ] ; export const modelProps = [ ] ; 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 ; /**
 * `ejs-pivotview` represents the VueJS PivotView Component.
 * ```vue
 * <ejs-pivotview></ejs-pivotview>
 * ```
 */ @ EJComponentDecorator ( { props : properties } , isExecute ) export class PivotViewComponent extends ComponentBase { public ej2Instances : any ; public propKeys : string [ ] = properties ; public models : string [ ] = modelProps ; public hasChildDirective : boolean = false ; protected hasInjectedModules : boolean = true ; public tagMapper : { [ key ] : Object ; } = { } ; public tagNameMapper : Object = { } ; public isVue3 : boolean ; public templateCollection : any ; constructor ( ) { super ( arguments ) ; this . isVue3 = ! isExecute ; this . ej2Instances = new PivotView ( { } ) ; 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 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 chartExport ( type , fileName , orientation ? , width ? , height ? ) { return this . ej2Instances . chartExport ( type , fileName , orientation , width , height ) ; } public createCalculatedFieldDialog ( ) { return this . ej2Instances . createCalculatedFieldDialog ( ) ; } public csvExport ( excelExportProperties ? , isMultipleExport ? , workbook ? , isBlob ? ) { return this . ej2Instances . csvExport ( excelExportProperties , isMultipleExport , workbook , isBlob ) ; } public excelExport ( excelExportProperties ? , isMultipleExport ? , workbook ? , isBlob ? ) { return this . ej2Instances . excelExport ( excelExportProperties , isMultipleExport , workbook , isBlob ) ; } public getCellTemplate ( ) { return this . ej2Instances . getCellTemplate ( ) ; } public getRowText ( rowIndex , colIndex ) { return this . ej2Instances . getRowText ( rowIndex , colIndex ) ; } public loadPersistData ( persistData ) { return this . ej2Instances . loadPersistData ( persistData ) ; } public pdfExport ( pdfExportProperties ? , isMultipleExport ? , pdfDoc ? , isBlob ? ) { return this . ej2Instances . pdfExport ( pdfExportProperties , isMultipleExport , pdfDoc , isBlob ) ; } public printChart ( ) { return this . ej2Instances . printChart ( ) ; } public refresh ( ) { return this . ej2Instances . refresh ( ) ; } public showConditionalFormattingDialog ( ) { return this . ej2Instances . showConditionalFormattingDialog ( ) ; } public showNumberFormattingDialog ( ) { return this . ej2Instances . showNumberFormattingDialog ( ) ; } public templateParser ( template ) { return this . ej2Instances . templateParser ( template ) ; } } export const PivotViewPlugin = { name : 'ejs-pivotview' , install ( Vue ) { Vue . component ( PivotViewPlugin . name , PivotViewComponent ) ; } } ;