igniteui-react-grids
Version:
Ignite UI React grid components.
168 lines (167 loc) • 4.5 kB
JavaScript
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.
*/
export class IgrNumericColumn extends IgrDataGridColumn {
createImplementation() {
return new NumericColumn();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor(props) {
super(props);
}
/**
* Gets or sets the string to prefix a negative value. If FormatString is specificied this value is ignored.
*/
get negativePrefix() {
return this.i.ox;
}
set negativePrefix(v) {
this.i.ox = v;
}
/**
* Gets or sets the string to prefix a positive value. If FormatString is specificied this value is ignored.
*/
get positivePrefix() {
return this.i.o1;
}
set positivePrefix(v) {
this.i.o1 = v;
}
/**
* Gets or sets the string to suffix a negative value. If FormatString is specificied this value is ignored.
*/
get negativeSuffix() {
return this.i.oz;
}
set negativeSuffix(v) {
this.i.oz = v;
}
/**
* Gets or sets the string to suffix a positive value. If FormatString is specificied this value is ignored.
*/
get positiveSuffix() {
return this.i.o3;
}
set positiveSuffix(v) {
this.i.o3 = v;
}
/**
* Gets or sets the maximum fraction digits. If FormatString is specificied this value is ignored.
*/
get maxFractionDigits() {
return this.i.oc;
}
set maxFractionDigits(v) {
this.i.oc = +v;
}
/**
* Gets or sets the minimum fraction digits. If FormatString is specificied this value is ignored.
*/
get minFractionDigits() {
return this.i.od;
}
set minFractionDigits(v) {
this.i.od = +v;
}
/**
* Gets or sets the minimum integer digits. If FormatString is specificied this value is ignored.
*/
get minIntegerDigits() {
return this.i.oe;
}
set minIntegerDigits(v) {
this.i.oe = +v;
}
/**
* Gets or sets whether to show a grouping separator. If FormatString is specificied this value is ignored.
*/
get showGroupingSeparator() {
return this.i.n7;
}
set showGroupingSeparator(v) {
this.i.n7 = ensureBool(v);
}
/**
* Gets or sets the format string to apply to the value. If set, the other value formatting properties on this column are ignored.
*/
get formatString() {
return this.i.os;
}
set formatString(v) {
this.i.os = v;
}
get formatSpecifiers() {
return this.i.n3;
}
set formatSpecifiers(v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
const re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.n3 = v;
}
/**
* Gets or sets the INTL NumericFormat object to use for formatting the date values.
*/
get formatOverride() {
return this.i.oh;
}
set formatOverride(v) {
this.i.oh = v;
}
/**
* Gets or sets the editor type used for editing cells in this column.
*/
get editorType() {
return this.i.n5;
}
set editorType(v) {
this.i.n5 = ensureEnum(EditorType_$type, v);
}
/**
* Gets or sets the ComboBox data source.
*/
get editorDataSource() {
return this.i.og;
}
set editorDataSource(v) {
this.i.og = v;
}
/**
* Gets or sets the ComboBox text field.
*/
get editorTextField() {
return this.i.on;
}
set editorTextField(v) {
this.i.on = v;
}
/**
* Gets or sets the ComboBox value field.
*/
get editorValueField() {
return this.i.oo;
}
set editorValueField(v) {
this.i.oo = v;
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.formatSpecifiers != null && arrayFindByName(this.formatSpecifiers, name)) {
return arrayFindByName(this.formatSpecifiers, name);
}
return null;
}
}