igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
294 lines (293 loc) • 10.3 kB
JavaScript
import { __extends } from "tslib";
import { EditorType_$type } from "./EditorType";
import { IgcDataGridColumnComponent } from "./igc-data-grid-column-component";
import { NumericColumn } from "./NumericColumn";
import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, arrayFindByName } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a Numeric grid column, used to allow the developer to display a formatted number in a cell.
*/
var IgcNumericColumnComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcNumericColumnComponent, _super);
function IgcNumericColumnComponent() {
return _super.call(this) || this;
}
IgcNumericColumnComponent.prototype.createImplementation = function () {
return new NumericColumn();
};
Object.defineProperty(IgcNumericColumnComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcNumericColumnComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (this.updateContentChildren) {
this.updateContentChildren();
}
else if (this._updateAdapters) {
this._updateAdapters();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcNumericColumnComponent.prototype.disconnectedCallback = function () {
if (_super.prototype["disconnectedCallback"]) {
_super.prototype["disconnectedCallback"].call(this);
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
};
Object.defineProperty(IgcNumericColumnComponent, "observedAttributes", {
get: function () {
if (IgcNumericColumnComponent._observedAttributesIgcNumericColumnComponent == null) {
var names = getAllPropertyNames(IgcNumericColumnComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcNumericColumnComponent._observedAttributesIgcNumericColumnComponent = names;
}
return IgcNumericColumnComponent._observedAttributesIgcNumericColumnComponent;
},
enumerable: false,
configurable: true
});
IgcNumericColumnComponent.register = function () {
if (!IgcNumericColumnComponent._isElementRegistered) {
IgcNumericColumnComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcNumericColumnComponent.htmlTagName, IgcNumericColumnComponent);
}
};
Object.defineProperty(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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;
this._a("maxFractionDigits", this.i.od);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcNumericColumnComponent.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;
this._a("minFractionDigits", this.i.oe);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcNumericColumnComponent.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;
this._a("minIntegerDigits", this.i.of);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcNumericColumnComponent.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);
this._a("showGroupingSeparator", this.i.n8);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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);
this._a("editorType", enumToString(EditorType_$type, this.i.n6));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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(IgcNumericColumnComponent.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
});
IgcNumericColumnComponent.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;
};
IgcNumericColumnComponent._observedAttributesIgcNumericColumnComponent = null;
IgcNumericColumnComponent.htmlTagName = "igc-numeric-column";
IgcNumericColumnComponent._isElementRegistered = false;
return IgcNumericColumnComponent;
}(IgcDataGridColumnComponent));
export { IgcNumericColumnComponent };