UNPKG

igniteui-angular-spreadsheet

Version:

Ignite UI Angular spreadsheet component for displaying and editing Microsoft Excel workbooks for modern web apps.

1,152 lines (1,147 loc) 142 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { EventEmitter, Output, Component, ViewChild, Input, ChangeDetectionStrategy, ViewContainerRef } from '@angular/core'; import { AngularRenderer } from "igniteui-angular-core"; import { toPoint, fromPoint, ensureBool, toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-angular-core"; import { TypeRegistrar } from "igniteui-angular-core"; import { Spreadsheet } from './Spreadsheet'; import { SpreadsheetCss } from './SpreadsheetCss'; import { RendererContainer } from './RendererContainer'; import { IgxComponentRendererContainerComponent } from "igniteui-angular-core"; import { delegateCombine } from "igniteui-angular-core"; import { IgxSpreadsheetActionExecutedEventArgs } from './igx-spreadsheet-action-executed-event-args'; import { IgxSpreadsheetActionExecutingEventArgs } from './igx-spreadsheet-action-executing-event-args'; import { IgxSpreadsheetActiveCellChangedEventArgs } from './igx-spreadsheet-active-cell-changed-event-args'; import { IgxSpreadsheetActivePaneChangedEventArgs } from './igx-spreadsheet-active-pane-changed-event-args'; import { IgxSpreadsheetActiveTableChangedEventArgs } from './igx-spreadsheet-active-table-changed-event-args'; import { IgxSpreadsheetActiveWorksheetChangedEventArgs } from './igx-spreadsheet-active-worksheet-changed-event-args'; import { IgxSpreadsheetContextMenuOpeningEventArgs } from './igx-spreadsheet-context-menu-opening-event-args'; import { IgxSpreadsheetEditModeExitingEventArgs } from './igx-spreadsheet-edit-mode-exiting-event-args'; import { IgxSpreadsheetEditModeExitedEventArgs } from './igx-spreadsheet-edit-mode-exited-event-args'; import { IgxSpreadsheetEditModeEnteringEventArgs } from './igx-spreadsheet-edit-mode-entering-event-args'; import { IgxSpreadsheetEditModeEnteredEventArgs } from './igx-spreadsheet-edit-mode-entered-event-args'; import { IgxSpreadsheetEditModeValidationErrorEventArgs } from './igx-spreadsheet-edit-mode-validation-error-event-args'; import { IgxSpreadsheetEditRangePasswordNeededEventArgs } from './igx-spreadsheet-edit-range-password-needed-event-args'; import { IgxSpreadsheetHyperlinkExecutingEventArgs } from './igx-spreadsheet-hyperlink-executing-event-args'; import { IgxSpreadsheetSelectionChangedEventArgs } from './igx-spreadsheet-selection-changed-event-args'; import { IgxSpreadsheetUserPromptDisplayingEventArgs } from './igx-spreadsheet-user-prompt-displaying-event-args'; import { IgxSpreadsheetWorkbookDirtiedEventArgs } from './igx-spreadsheet-workbook-dirtied-event-args'; import * as i0 from "@angular/core"; /** * Custom control that displays one or more worksheets. */ var IgxSpreadsheetComponent = /** @class */ (function () { // #region Constructor function IgxSpreadsheetComponent(_renderer, _elRef, _ngZone, _componentFactoryResolver, _injector) { //super(); var _this = this; this._renderer = _renderer; this._elRef = _elRef; this._ngZone = _ngZone; this._componentFactoryResolver = _componentFactoryResolver; this._injector = _injector; this._zoneRunner = null; this.__p = null; this._hasUserValues = new Set(); this._stylingContainer = null; this._stylingParent = null; this._inStyling = false; this._contextMenuOpening = null; this._ActionExecuted = null; this._ActionExecuting = null; this._activeCellChanged = null; this._activePaneChanged = null; this._activeTableChanged = null; this._activeWorksheetChanged = null; this._editModeExiting = null; this._editModeExited = null; this._editModeEntering = null; this._editModeEntered = null; this._editModeValidationError = null; this._editRangePasswordNeeded = null; this._hyperlinkExecuting = null; this._selectionChanged = null; this._userPromptDisplaying = null; this._workbookDirtied = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._zoneRunner = function (act) { return _this._ngZone.run(act); }; this._implementation = this.createImplementation(); this._container = _renderer.createElement("div"); _renderer.appendChild(_elRef.element.nativeElement, this._container); _renderer.setStyle(this._container, "display", "block"); _renderer.setStyle(this._container, "width", "100%"); _renderer.setStyle(this._container, "height", "100%"); var root; root = this._container; if (this._container.nativeElement != null) { root = this._container.nativeElement; } var ren = new AngularRenderer(root, this._renderer, window.document, this._ngZone, false, {}); this._wrapper = ren; var spreadsheet = this.i; spreadsheet.css = new SpreadsheetCss(); spreadsheet.createRendererContainer = function () { return _this._createContainer(); }; this._spreadsheet = spreadsheet; spreadsheet.provideContainer(ren); spreadsheet.onInitialized(); ren.addSizeWatcher(function () { _this._spreadsheet.containerResized(); }); } Object.defineProperty(IgxSpreadsheetComponent.prototype, "height", { get: function () { return this._height; }, set: function (value) { this._height = value; this._renderer.setStyle(this._elRef.element.nativeElement, "height", value); this._spreadsheet.containerResized(); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "width", { get: function () { return this._width; }, set: function (value) { this._width = value; this._renderer.setStyle(this._elRef.element.nativeElement, "width", value); this._spreadsheet.containerResized(); }, enumerable: false, configurable: true }); // #endregion Constructor IgxSpreadsheetComponent.prototype.ngOnDestroy = function () { this._spreadsheet.destroy(); this._wrapper.destroy(); }; IgxSpreadsheetComponent.prototype.createImplementation = function () { return new Spreadsheet(); }; IgxSpreadsheetComponent.prototype._createContainer = function () { var factory = this._componentFactoryResolver.resolveComponentFactory(IgxComponentRendererContainerComponent); var componentRef = this._dynamicContent.createComponent(factory); var container = new RendererContainer(function () { return componentRef.destroy(); }); container.initialize(componentRef.instance, componentRef.location.nativeElement); return container; }; IgxSpreadsheetComponent.prototype.ngAfterContentInit = function () { this.i.containerResized(); this.i.styleUpdated(); }; IgxSpreadsheetComponent.prototype._runInZone = function (act) { if (this._zoneRunner != null) { this._zoneRunner(act); } else { act(); } }; Object.defineProperty(IgxSpreadsheetComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgxSpreadsheetComponent._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igx" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; Object.defineProperty(IgxSpreadsheetComponent.prototype, "panes", { /** * Returns an array of the panes for the activeWorksheet. */ get: function () { return this.i._getPanesAsArray(); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isScrollLocked", { /** * Returns or sets a boolean indicating whether the scroll lock key is toggled. * This property is used when certain keys are pressed while the control has focus. For example * if an arrow key is pressed while the scroll lock is enabled the cell area will be scrolled rather than changing * the active cell. * Note: * This property is not maintained/changed by the control. It is just queried when * performing actions that consider whether the scroll lock is enabled. */ get: function () { return this.i.isScrollLocked; }, set: function (v) { this.i.isScrollLocked = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeCell", { /** * Returns or sets the active cell within the selected worksheet. */ get: function () { return this.i.activeCell; }, set: function (v) { this.i.activeCell = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activePane", { /** * Returns an object that represents the pane with the focus. */ get: function () { return this.i.activePane; }, set: function (v) { this.i.activePane = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeSelection", { /** * Returns an object that represents the current selection of the * activePane. */ get: function () { return this.i.activeSelection; }, set: function (v) { this.i.activeSelection = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeSelectionCellRangeFormat", { /** * Returns an object used to get the formatting of the * activeCell and where modifications are applied to the entire * activeSelection. * Any changes made to this object will affect all the objects in the selection. So for example, the * Font.Name may return "Arial" because the active cell has that as its resolved font name even though the other * cells are using a different font but if you set the Font.Name of this object to "Arial" then all the objects * affected by the selection will have their Font.Name updated to that value. */ get: function () { return this.i.activeSelectionCellRangeFormat; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeTable", { /** * Returns the * ig.excel.WorksheetTable associated with the * activeCell of the * activeWorksheet. */ get: function () { return this.i.activeTable; }, set: function (v) { this.i.activeTable = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeWorksheet", { /** * Returns or sets the Worksheet from the * workbook whose content should be displayed within the control. */ get: function () { return this.i.activeWorksheet; }, set: function (v) { this.i.activeWorksheet = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "allowAddWorksheet", { /** * Returns or sets a boolean indicating whether the spreadsheet allows adding worksheets. */ get: function () { return this.i.allowAddWorksheet; }, set: function (v) { this.i.allowAddWorksheet = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "allowAsyncCalculations", { /** * Returns or sets a boolean indicating whether the spreadsheet allows adding worksheets. * Note: * if this property is set to false and the current * workbook is performing async calculations, the spreadsheet will cancel them. */ get: function () { return this.i.allowAsyncCalculations; }, set: function (v) { this.i.allowAsyncCalculations = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "allowDeleteWorksheet", { /** * Returns or sets a boolean indicating whether the spreadsheet allows deleting worksheets. */ get: function () { return this.i.allowDeleteWorksheet; }, set: function (v) { this.i.allowDeleteWorksheet = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "areGridlinesVisible", { /** * Returns or sets a boolean indicating if the grid lines are displayed in the selected worksheets. */ get: function () { return this.i.areGridlinesVisible; }, set: function (v) { this.i.areGridlinesVisible = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "areHeadersVisible", { /** * Returns or sets a boolean indicating if the row and column headers are displayed for the selected worksheets. */ get: function () { return this.i.areHeadersVisible; }, set: function (v) { this.i.areHeadersVisible = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "cellEditMode", { /** * Returns an enumeration used to indicate the current edit mode state. */ get: function () { return this.i.cellEditMode; }, set: function (v) { this.i.cellEditMode = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "chartAdapter", { /** * Returns or sets the object that will provide the chart visualization for display within the * Spreadsheet * By default charts are not displayed within the spreadsheet. To display charts one should set this * property to an instance of a * SpreadsheetChartAdapter * which is in a separate reference since it relies upon * the chart and other data visualization controls. */ get: function () { return this.i.chartAdapter; }, set: function (v) { this.i.chartAdapter = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "enterKeyNavigationDirection", { /** * Returns or sets an enumeration indicating the direction of the cell adjacent to the * activeCell that should be activated when the enter key is pressed. * This property is only used if the * isEnterKeyNavigationEnabled is set to true. Also, the reverse direction is * navigated when Shift + Enter are pressed. */ get: function () { return this.i.enterKeyNavigationDirection; }, set: function (v) { this.i.enterKeyNavigationDirection = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "fixedDecimalPlaceCount", { /** * Returns or sets the number of decimal places by which a whole number typed in during edit mode should be adjusted when * isFixedDecimalEnabled is true */ get: function () { return this.i.fixedDecimalPlaceCount; }, set: function (v) { this.i.fixedDecimalPlaceCount = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isEnterKeyNavigationEnabled", { /** * Returns or sets a boolean indicating whether the adjacent cell indicated by the * enterKeyNavigationDirection should be navigated to when the enter key is pressed. */ get: function () { return this.i.isEnterKeyNavigationEnabled; }, set: function (v) { this.i.isEnterKeyNavigationEnabled = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isFixedDecimalEnabled", { /** * Returns or sets a boolean indicating whether a fixed decimal place is automatically added when a whole number is entered while in edit mode. */ get: function () { return this.i.isFixedDecimalEnabled; }, set: function (v) { this.i.isFixedDecimalEnabled = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isFormulaBarVisible", { /** * Returns or sets a boolean indicating if the formula bar is displayed within the * Spreadsheet. */ get: function () { return this.i.isFormulaBarVisible; }, set: function (v) { this.i.isFormulaBarVisible = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isInEditMode", { /** * Returns a boolean indicating if the control is currently editing the value of the * activeCell */ get: function () { return this.i.isInEditMode; }, set: function (v) { this.i.isInEditMode = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isInEndMode", { /** * Returns or sets a boolean indicating whether the control is in "End mode". * End mode is a mode that affects certain keyboard navigation such as navigating with the arrow keys. For example when in * end mode and one presses the right arrow, the * activeCell will be changed to be the first cell to the right of the current ActiveCell * that has a value (even if the value is ""). If there were no cells to the right with a value then it would activate the right most cell in that row. End * mode will end automatically such as when one presses an arrow key. */ get: function () { return this.i.isInEndMode; }, set: function (v) { this.i.isInEndMode = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isPerformingAsyncCalculations", { /** * Returns a boolean indicating if the current * workbook is performing asynchronous calculations. */ get: function () { return this.i.isPerformingAsyncCalculations; }, set: function (v) { this.i.isPerformingAsyncCalculations = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isRenamingWorksheet", { /** * Returns a boolean indicating if the user is currently editing the name of the active worksheet. */ get: function () { return this.i.isRenamingWorksheet; }, set: function (v) { this.i.isRenamingWorksheet = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "isUndoEnabled", { /** * Returns or sets a boolean indicating whether undo is enabled for the control. */ get: function () { return this.i.isUndoEnabled; }, set: function (v) { this.i.isUndoEnabled = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "nameBoxWidth", { /** * Returns or sets the width of the name box within the formula bar. */ get: function () { return this.i.nameBoxWidth; }, set: function (v) { this.i.nameBoxWidth = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "selectionMode", { /** * Returns or sets a value indicating how the selection is updated when interacting with the cells via the mouse or keyboard. */ get: function () { return this.i.selectionMode; }, set: function (v) { this.i.selectionMode = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "selectedWorksheets", { /** * Returns or sets an array of the Worksheets whose tabs are selected. */ get: function () { return this.i.selectedWorksheets; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.selectedWorksheets = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "undoManager", { /** * Returns or sets the UndoManager. * Note: * this property can not be set to null. */ get: function () { return this.i.undoManager; }, set: function (v) { this.i.undoManager = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "validationInputMessagePosition", { /** * Returns or sets the position of the screen tip used to display the input message for the data validation rule associated with the active cell. */ get: function () { return fromPoint(this.i.validationInputMessagePosition); }, set: function (v) { this.i.validationInputMessagePosition = toPoint(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "workbook", { /** * Returns or sets the * workbook whose information is displayed in the control. */ get: function () { return this.i.workbook; }, set: function (v) { this.i.workbook = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "zoomLevel", { /** * Returns or sets the magnification of the selected worksheets. */ get: function () { return this.i.zoomLevel; }, set: function (v) { this.i.zoomLevel = +v; }, enumerable: false, configurable: true }); IgxSpreadsheetComponent.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; }; Object.defineProperty(IgxSpreadsheetComponent.prototype, "hasUserValues", { get: function () { return this._hasUserValues; }, enumerable: false, configurable: true }); IgxSpreadsheetComponent.prototype.__m = function (propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } }; IgxSpreadsheetComponent.prototype._styling = function (container, component, parent) { if (this._inStyling) { return; } this._inStyling = true; this._stylingContainer = container; this._stylingParent = component; var genericPrefix = ""; var typeName = this.i.$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("SpreadsheetComponent"); var additionalPrefixes = []; var prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); var b = this.i.$type.baseType; while (b && b.name != "Object" && b.name != "Base" && b.name != "Control" && b.Name != "DependencyObject" && b.Name != "FrameworkElement") { typeName = b.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } var basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { var parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } var parentPrefix = toSpinal(parentTypeName); additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-"); additionalPrefixes.push(parentPrefix + "-" + prefix + "-"); } initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes); if (this._otherStyling) { this._otherStyling(container, component, parent); } this._inStyling = false; }; /** * Notifies the spreadsheet that the container object has been resized. */ IgxSpreadsheetComponent.prototype.containerResized = function () { this.i.containerResized(); }; /** * Executes the specified action. * @param action * Identifies the action to be performed. */ IgxSpreadsheetComponent.prototype.executeAction = function (action) { var iv = this.i.executeCommand(action); return (iv); }; /** * Forces the spreadsheet to synchronously perform any deferred work. */ IgxSpreadsheetComponent.prototype.flush = function () { this.i.flush(); }; /** * Notifies the spreadsheet that style information used for rendering may have been updated. */ IgxSpreadsheetComponent.prototype.styleUpdated = function () { this.i.styleUpdated(); }; /** * Returns an object with information about the visual state of the spreadsheet. */ IgxSpreadsheetComponent.prototype.exportVisualData = function () { var iv = this.i.exportVisualData(); return (iv); }; Object.defineProperty(IgxSpreadsheetComponent.prototype, "contextMenuOpening", { /** * Invoked when a contextmenu is being opened for the * Spreadsheet. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.menuArea" argType="string" Get the [area](ig.spreadsheet.SpreadsheetContextMenuArea) for which the menu is being displayed. */ get: function () { var _this = this; if (this._contextMenuOpening == null) { this._contextMenuOpening = new EventEmitter(); this.i.contextMenuOpening = delegateCombine(this.i.contextMenuOpening, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetContextMenuOpeningEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeContextMenuOpening) { _this.beforeContextMenuOpening(_this, outerArgs); } _this._contextMenuOpening.emit({ sender: _this, args: outerArgs }); }); }); } return this._contextMenuOpening; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "ActionExecuted", { /** * Invoked when an action is executed on the * Spreadsheet. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.action" argType="string" Gets the [action](ig.spreadsheet.SpreadsheetAction) that was executed. */ get: function () { var _this = this; if (this._ActionExecuted == null) { this._ActionExecuted = new EventEmitter(); this.i.actionExecuted = delegateCombine(this.i.actionExecuted, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActionExecutedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActionExecuted) { _this.beforeActionExecuted(_this, outerArgs); } _this._ActionExecuted.emit({ sender: _this, args: outerArgs }); }); }); } return this._ActionExecuted; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "ActionExecuting", { /** * Invoked when an action is about to be executed by the * Spreadsheet. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.action" argType="string" Gets the [action](ig.spreadsheet.SpreadsheetAction) that is about to be executed. */ get: function () { var _this = this; if (this._ActionExecuting == null) { this._ActionExecuting = new EventEmitter(); this.i.actionExecuting = delegateCombine(this.i.actionExecuting, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActionExecutingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActionExecuting) { _this.beforeActionExecuting(_this, outerArgs); } _this._ActionExecuting.emit({ sender: _this, args: outerArgs }); }); }); } return this._ActionExecuting; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeCellChanged", { /** * Invoked when the * activeCell of the * Spreadsheet has changed. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.oldValue" argType="string" Gets the previous active cell. * eventArgument="ui.newValue" argType="string" Gets the current active cell. */ get: function () { var _this = this; if (this._activeCellChanged == null) { this._activeCellChanged = new EventEmitter(); this.i.activeCellChanged = delegateCombine(this.i.activeCellChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActiveCellChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActiveCellChanged) { _this.beforeActiveCellChanged(_this, outerArgs); } _this._activeCellChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._activeCellChanged; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activePaneChanged", { /** * Invoked when the * activePane of the * Spreadsheet has changed. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.oldActivePane" argType="object" Gets the previous active [pane](ig.spreadsheet.SpreadsheetPane). * eventArgument="ui.newActivePane" argType="object" Gets the current active [pane](ig.spreadsheet.SpreadsheetPane). * eventArgument="ui.activeCell" argType="string" Gets the active cell of the new active pane or null if there is no active pane. * eventArgument="ui.visibleRange" argType="string" Gets the current visible range of the new active pane or null if there is no active pane. */ get: function () { var _this = this; if (this._activePaneChanged == null) { this._activePaneChanged = new EventEmitter(); this.i.activePaneChanged = delegateCombine(this.i.activePaneChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActivePaneChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActivePaneChanged) { _this.beforeActivePaneChanged(_this, outerArgs); } _this._activePaneChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._activePaneChanged; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeTableChanged", { /** * Invoked when the * activeTable of the * Spreadsheet has changed. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.oldActiveTable" argType="object" Gets the previous active [Table](ig.excel.WorksheetTable). * eventArgument="ui.newActiveTable" argType="object" Gets the current active [Table](ig.excel.WorksheetTable). */ get: function () { var _this = this; if (this._activeTableChanged == null) { this._activeTableChanged = new EventEmitter(); this.i.activeTableChanged = delegateCombine(this.i.activeTableChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActiveTableChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActiveTableChanged) { _this.beforeActiveTableChanged(_this, outerArgs); } _this._activeTableChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._activeTableChanged; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "activeWorksheetChanged", { /** * Invoked when the * activeWorksheet of the * Spreadsheet has changed. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.oldActiveWorksheet" argType="object" Gets the previous active [worksheet](ig.excel.Worksheet). * eventArgument="ui.oldActiveWorksheetName" argType="string" Gets the name of the previous active worksheet or null if oldActiveWorksheet is null. * eventArgument="ui.newActiveWorksheet" argType="object" Gets the current active [worksheet](ig.excel.Worksheet). * eventArgument="ui.newActiveWorksheetName" argType="string" Gets the name of the new active worksheet or null if newActiveWorksheet is null. */ get: function () { var _this = this; if (this._activeWorksheetChanged == null) { this._activeWorksheetChanged = new EventEmitter(); this.i.activeWorksheetChanged = delegateCombine(this.i.activeWorksheetChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetActiveWorksheetChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeActiveWorksheetChanged) { _this.beforeActiveWorksheetChanged(_this, outerArgs); } _this._activeWorksheetChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._activeWorksheetChanged; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editModeExiting", { /** * Invoked when the * Spreadsheet is about to end the in-place editing of the * activeCell. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.acceptChanges" argType="bool" Get or set a boolean indicating whether the changes will be made to the cell's value when edit mode ends. * eventArgument="ui.canCancel" argType="bool" Get a boolean indicating if the edit mode is being forced to exit edit mode in which case it cannot be cancelled. * eventArgument="ui.cell" argType="string" Gets the cell for which the control is exiting edit mode. * eventArgument="ui.editText" argType="string" Gets the edit text that will be used to update the cell(s). */ get: function () { var _this = this; if (this._editModeExiting == null) { this._editModeExiting = new EventEmitter(); this.i.editModeExiting = delegateCombine(this.i.editModeExiting, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetEditModeExitingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeEditModeExiting) { _this.beforeEditModeExiting(_this, outerArgs); } _this._editModeExiting.emit({ sender: _this, args: outerArgs }); }); }); } return this._editModeExiting; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editModeExited", { /** * Invoked when the * Spreadsheet has ended the in-place editing of the * activeCell. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.cell" argType="string" Gets the cell for which the control has exited edit mode. */ get: function () { var _this = this; if (this._editModeExited == null) { this._editModeExited = new EventEmitter(); this.i.editModeExited = delegateCombine(this.i.editModeExited, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetEditModeExitedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeEditModeExited) { _this.beforeEditModeExited(_this, outerArgs); } _this._editModeExited.emit({ sender: _this, args: outerArgs }); }); }); } return this._editModeExited; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editModeEntering", { /** * Invoked when the * Spreadsheet is about to start in-place editing of the * activeCell. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.cell" argType="string" Gets the cell for which the control is going into edit mode. */ get: function () { var _this = this; if (this._editModeEntering == null) { this._editModeEntering = new EventEmitter(); this.i.editModeEntering = delegateCombine(this.i.editModeEntering, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetEditModeEnteringEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeEditModeEntering) { _this.beforeEditModeEntering(_this, outerArgs); } _this._editModeEntering.emit({ sender: _this, args: outerArgs }); }); }); } return this._editModeEntering; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editModeEntered", { /** * Invoked when the * Spreadsheet has started in-place editing of the * activeCell. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.cell" argType="string" Gets the cell for which the control has entered edit mode. */ get: function () { var _this = this; if (this._editModeEntered == null) { this._editModeEntered = new EventEmitter(); this.i.editModeEntered = delegateCombine(this.i.editModeEntered, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetEditModeEnteredEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeEditModeEntered) { _this.beforeEditModeEntered(_this, outerArgs); } _this._editModeEntered.emit({ sender: _this, args: outerArgs }); }); }); } return this._editModeEntered; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editModeValidationError", { /** * Invoked when the * Spreadsheet is exiting edit mode and the new value for the * activeCell is not valid based on the criteria of that cell's * ig.excel.DataValidationRule. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.action" argType="string" Get or set the [action](ig.spreadsheet.SpreadsheetEditModeValidationErrorAction) to take in response to the failed validation. * eventArgument="ui.canStayInEditMode" argType="bool" Get a boolean indicating whether the cell is allowed to stay in edit mode. * eventArgument="ui.cell" argType="string" Gets the cell for which the control is in edit mode. * eventArgument="ui.validationRule" argType="string" Get the [rule](ig.excel.DataValidationRule) which failed validation. * The EditModeValidationError is raised while exiting edit mode if the new value for the * activeCell is not valid based on the criteria of that cell's * ig.excel.DataValidationRule. * Since the rule needs to evaluate the value of the cell and potentially other cell's in the Worksheet, the value is first applied to the cell(s) and then is validated. By default if the event is not handled and the * showErrorMessageForInvalidValue is true, a message box will be displayed to the end user to determine what action to take. One can handle this event and specify the action that should * be taken using the action. * Note: * The validation rule will not be evaluated if edit mode is being cancelled such as when the user presses Escape to cancel edit. * Note: * The action will default to * AcceptChange * if the ShowErrorMessageForInvalidValue of the validationRule is false; otherwise it will default to * ShowPrompt * . * Note: * Like Microsoft Excel, only the validation rule of the active cell is considered even if the update is affecting other cells in the selection. */ get: function () { var _this = this; if (this._editModeValidationError == null) { this._editModeValidationError = new EventEmitter(); this.i.editModeValidationError = delegateCombine(this.i.editModeValidationError, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxSpreadsheetEditModeValidationErrorEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeEditModeValidationError) { _this.beforeEditModeValidationError(_this, outerArgs); } _this._editModeValidationError.emit({ sender: _this, args: outerArgs }); }); }); } return this._editModeValidationError; }, enumerable: false, configurable: true }); Object.defineProperty(IgxSpreadsheetComponent.prototype, "editRangePasswordNeeded", { /** * Invoked when the * Spreadsheet is performing an operation on a protected Worksheet and there is a single range that may be unlocked to allow the operation to be performed. * eventArgument="evt" argType="event" jQuery event object. * eventArgument="ui.owner" argType="object" Gets a reference to the spreadsheet widget. * eventArgument="ui.ranges" ar