igniteui-angular-spreadsheet
Version:
Ignite UI Angular spreadsheet component for displaying and editing Microsoft Excel workbooks for modern web apps.
139 lines (138 loc) • 5.4 kB
JavaScript
/*
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 { __extends } from "tslib";
import { SpreadsheetCellEditManager } from "./SpreadsheetCellEditManager";
import { SpreadsheetCommandExecutingEventArgs } from "./SpreadsheetCommandExecutingEventArgs";
import { SpreadsheetCommandExecutedEventArgs } from "./SpreadsheetCommandExecutedEventArgs";
import { SpreadsheetUtilities } from "./SpreadsheetUtilities";
import { toNullable, Boolean_$type, markType } from "igniteui-angular-core";
import { nullableEquals } from "igniteui-angular-core";
/**
* @hidden
*/
var SpreadsheetCellEditManager$1 = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(SpreadsheetCellEditManager$1, _super);
function SpreadsheetCellEditManager$1($tEditor, a) {
var _this = _super.call(this, a) || this;
_this.$tEditor = null;
_this.$tEditor = $tEditor;
_this.$type = _this.$type.specialize(_this.$tEditor);
return _this;
}
SpreadsheetCellEditManager$1.prototype.ac = function (a) {
var _this = this;
var b;
if (!((function () { var c = _this.a4(b); b = c.p0; return c.ret; })())) {
return false;
}
return this.a2(a, b);
};
SpreadsheetCellEditManager$1.prototype.ah = function (a, b) {
var _this = this;
if (b === void 0) {
b = true;
}
var c;
if (!((function () { var d = _this.a4(c); c = d.p0; return d.ret; })())) {
return false;
}
switch (a) {
case 86:
case 85:
b = false;
break;
}
if (b) {
var d = new SpreadsheetCommandExecutingEventArgs(a, null, c);
this.g._g0(d);
if (d.cancel) {
return true;
}
}
if (!this.a3(a, c)) {
return false;
}
if (b) {
this.g._gz(new SpreadsheetCommandExecutedEventArgs(a, null, c));
}
return true;
};
SpreadsheetCellEditManager$1.prototype.a2 = function (a, b) {
if (this.g.isInEditMode) {
switch (a) {
case 198:
case 125:
case 126:
case 119:
case 161:
case 120:
case 121:
case 163:
case 162:
case 160: return true;
}
}
return true;
};
SpreadsheetCellEditManager$1.prototype.a3 = function (a, b) {
if (this.g.isInEditMode) {
var c = this.g.activeSelectionCellRangeFormat.font;
switch (a) {
case 119:
c._bold$i = toNullable(Boolean_$type, nullableEquals(c._bold$i, true) ? false : true);
return true;
case 120:
c._italic$i = toNullable(Boolean_$type, nullableEquals(c._italic$i, true) ? false : true);
return true;
case 121:
c._strikeout$i = toNullable(Boolean_$type, nullableEquals(c._strikeout$i, true) ? false : true);
return true;
case 125:
c.height = SpreadsheetUtilities.cm(c.height, true);
return true;
case 126:
c.height = SpreadsheetUtilities.cm(c.height, false);
return true;
case 163:
c.superscriptSubscriptStyle = c.superscriptSubscriptStyle == 2 ? 0 : 2;
return true;
case 162:
c.superscriptSubscriptStyle = c.superscriptSubscriptStyle == 1 ? 0 : 1;
return true;
case 161:
c.underlineStyle = SpreadsheetUtilities.al(c.underlineStyle, this.g._d9());
return true;
case 160:
c.underlineStyle = SpreadsheetUtilities.am(c.underlineStyle, this.g._d9());
return true;
case 198:
this.g._iv();
return true;
}
}
return false;
};
SpreadsheetCellEditManager$1.prototype.a4 = function (a) {
if (!this.g.isInEditMode) {
a = null;
return {
ret: false,
p0: a
};
}
else {
a = this.a1;
return {
ret: a != null,
p0: a
};
}
};
SpreadsheetCellEditManager$1.$t = markType(SpreadsheetCellEditManager$1, 'SpreadsheetCellEditManager$1', SpreadsheetCellEditManager.$);
return SpreadsheetCellEditManager$1;
}(SpreadsheetCellEditManager));
export { SpreadsheetCellEditManager$1 };