define(["require", "exports", "../../common/base/constant", "../../common/base/pivot-common", "@syncfusion/ej2-base"], function (require, exports, events, pivot_common_1, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Common = (function () {
function Common(parent) {
this.parent = parent;
this.parent.commonModule = this;
this.addEventListener();
}
Common.prototype.getModuleName = function () {
return 'common';
};
Common.prototype.initiateCommonModule = function () {
if (!this.parent.pivotCommon) {
var args = {
pivotEngine: this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule,
dataSourceSettings: this.parent.dataSourceSettings.properties ?
this.parent.dataSourceSettings.properties : this.parent.dataSourceSettings,
id: this.parent.element.id,
element: this.parent.element,
moduleName: this.parent.getModuleName(),
enableRtl: this.parent.enableRtl,
enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
isAdaptive: ej2_base_1.Browser.isDevice,
renderMode: 'Popup',
localeObj: this.parent.localeObj,
dataType: this.parent.dataType,
cssClass: this.parent.cssClass
};
this.parent.pivotCommon = new pivot_common_1.PivotCommon(args);
}
else {
this.parent.pivotCommon.element = this.parent.element;
this.parent.pivotCommon.engineModule = this.parent.dataType === 'olap' ?
this.parent.olapEngineModule : this.parent.engineModule;
this.parent.pivotCommon.parentID = this.parent.element.id;
this.parent.pivotCommon.dataSourceSettings = this.parent.dataSourceSettings.properties ?
this.parent.dataSourceSettings.properties : this.parent.dataSourceSettings;
this.parent.pivotCommon.moduleName = this.parent.getModuleName();
this.parent.pivotCommon.enableRtl = this.parent.enableRtl;
this.parent.pivotCommon.isAdaptive = ej2_base_1.Browser.isDevice;
this.parent.pivotCommon.renderMode = 'Popup';
this.parent.pivotCommon.localeObj = this.parent.localeObj;
this.parent.pivotCommon.dataType = this.parent.dataType;
this.parent.pivotCommon.cssClass = this.parent.cssClass;
}
this.parent.pivotCommon.control = this.parent;
};
Common.prototype.addEventListener = function () {
Iif (this.parent.isDestroyed) {
return;
}
this.parent.on(events.initialLoad, this.initiateCommonModule, this);
this.parent.on(events.uiUpdate, this.initiateCommonModule, this);
};
Common.prototype.removeEventListener = function () {
Iif (this.parent.isDestroyed) {
return;
}
this.parent.off(events.initialLoad, this.initiateCommonModule);
this.parent.off(events.uiUpdate, this.initiateCommonModule);
};
Common.prototype.destroy = function () {
this.removeEventListener();
if (this.parent.pivotCommon) {
this.parent.pivotCommon.destroy();
this.parent.pivotCommon = null;
}
};
return Common;
}());
exports.Common = Common;
});
|