igniteui-react-grids
Version:
Ignite UI React grid components.
236 lines (235 loc) • 7.44 kB
JavaScript
import { __extends } from "tslib";
import { EditorType_$type } from "./EditorType";
import { IgrDataGridColumn } from "./igr-data-grid-column";
import { NumericColumn } from "./NumericColumn";
import { ensureBool, ensureEnum, arrayFindByName } from "igniteui-react-core";
/**
* Represents a Numeric grid column, used to allow the developer to display a formatted number in a cell.
*/
var IgrNumericColumn = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrNumericColumn, _super);
function IgrNumericColumn(props) {
return _super.call(this, props) || this;
}
IgrNumericColumn.prototype.createImplementation = function () {
return new NumericColumn();
};
Object.defineProperty(IgrNumericColumn.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "negativePrefix", {
/**
* Gets or sets the string to prefix a negative value. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.oy;
},
set: function (v) {
this.i.oy = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "positivePrefix", {
/**
* Gets or sets the string to prefix a positive value. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.o2;
},
set: function (v) {
this.i.o2 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "negativeSuffix", {
/**
* Gets or sets the string to suffix a negative value. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.o0;
},
set: function (v) {
this.i.o0 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "positiveSuffix", {
/**
* Gets or sets the string to suffix a positive value. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.o4;
},
set: function (v) {
this.i.o4 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "maxFractionDigits", {
/**
* Gets or sets the maximum fraction digits. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.od;
},
set: function (v) {
this.i.od = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "minFractionDigits", {
/**
* Gets or sets the minimum fraction digits. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.oe;
},
set: function (v) {
this.i.oe = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "minIntegerDigits", {
/**
* Gets or sets the minimum integer digits. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.of;
},
set: function (v) {
this.i.of = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "showGroupingSeparator", {
/**
* Gets or sets whether to show a grouping separator. If FormatString is specificied this value is ignored.
*/
get: function () {
return this.i.n8;
},
set: function (v) {
this.i.n8 = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "formatString", {
/**
* Gets or sets the format string to apply to the value. If set, the other value formatting properties on this column are ignored.
*/
get: function () {
return this.i.ot;
},
set: function (v) {
this.i.ot = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "formatSpecifiers", {
get: function () {
return this.i.n4;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.n4 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "formatOverride", {
/**
* Gets or sets the INTL NumericFormat object to use for formatting the date values.
*/
get: function () {
return this.i.oi;
},
set: function (v) {
this.i.oi = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "editorType", {
/**
* Gets or sets the editor type used for editing cells in this column.
*/
get: function () {
return this.i.n6;
},
set: function (v) {
this.i.n6 = ensureEnum(EditorType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "editorDataSource", {
/**
* Gets or sets the ComboBox data source.
*/
get: function () {
return this.i.oh;
},
set: function (v) {
this.i.oh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "editorTextField", {
/**
* Gets or sets the ComboBox text field.
*/
get: function () {
return this.i.oo;
},
set: function (v) {
this.i.oo = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrNumericColumn.prototype, "editorValueField", {
/**
* Gets or sets the ComboBox value field.
*/
get: function () {
return this.i.op;
},
set: function (v) {
this.i.op = v;
},
enumerable: false,
configurable: true
});
IgrNumericColumn.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.formatSpecifiers != null && arrayFindByName(this.formatSpecifiers, name)) {
return arrayFindByName(this.formatSpecifiers, name);
}
return null;
};
return IgrNumericColumn;
}(IgrDataGridColumn));
export { IgrNumericColumn };