UNPKG

igniteui-webcomponents-grids

Version:

Ignite UI Web Components grid components.

228 lines (227 loc) 8.13 kB
import { __extends } from "tslib"; import { DateTimeFormats_$type } from "./DateTimeFormats"; import { EditorType_$type } from "./EditorType"; import { IgcDataGridColumnComponent } from "./igc-data-grid-column-component"; import { DateTimeColumn } from "./DateTimeColumn"; import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, ensureBool, arrayFindByName } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * A column for displaying date/time values. */ var IgcDateTimeColumnComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcDateTimeColumnComponent, _super); function IgcDateTimeColumnComponent() { return _super.call(this) || this; } IgcDateTimeColumnComponent.prototype.createImplementation = function () { return new DateTimeColumn(); }; Object.defineProperty(IgcDateTimeColumnComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcDateTimeColumnComponent.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(); } }; IgcDateTimeColumnComponent.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(IgcDateTimeColumnComponent, "observedAttributes", { get: function () { if (IgcDateTimeColumnComponent._observedAttributesIgcDateTimeColumnComponent == null) { var names = getAllPropertyNames(IgcDateTimeColumnComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcDateTimeColumnComponent._observedAttributesIgcDateTimeColumnComponent = names; } return IgcDateTimeColumnComponent._observedAttributesIgcDateTimeColumnComponent; }, enumerable: false, configurable: true }); IgcDateTimeColumnComponent.register = function () { if (!IgcDateTimeColumnComponent._isElementRegistered) { IgcDateTimeColumnComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcDateTimeColumnComponent.htmlTagName, IgcDateTimeColumnComponent); } }; Object.defineProperty(IgcDateTimeColumnComponent.prototype, "dateTimeFormat", { /** * Gets or sets the date time format to use for this column. If FormatString is specificied this value is ignored. */ get: function () { return this.i.n8; }, set: function (v) { this.i.n8 = ensureEnum(DateTimeFormats_$type, v); this._a("dateTimeFormat", enumToString(DateTimeFormats_$type, this.i.n8)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.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.oq; }, set: function (v) { this.i.oq = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "editorFormatString", { /** * Gets or sets the format string to use when editing dates. */ get: function () { return this.i.oj; }, set: function (v) { this.i.oj = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.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(IgcDateTimeColumnComponent.prototype, "formatOverride", { /** * Gets or sets the INTL DateTimeFormat object to use for formatting the date values. */ get: function () { return this.i.of; }, set: function (v) { this.i.of = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "showTodayButton", { /** * Gets or sets the ShowTodayButton property to detirmine if the today button is shown */ get: function () { return this.i.ob; }, set: function (v) { this.i.ob = ensureBool(v); this._a("showTodayButton", this.i.ob); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "editorType", { /** * Gets or sets the editor type used for editing cells in this column. */ get: function () { return this.i.n9; }, set: function (v) { this.i.n9 = ensureEnum(EditorType_$type, v); this._a("editorType", enumToString(EditorType_$type, this.i.n9)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "editorDataSource", { /** * Gets or sets the ComboBox data source. */ get: function () { return this.i.oe; }, set: function (v) { this.i.oe = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "editorTextField", { /** * Gets or sets the ComboBox text field. */ get: function () { return this.i.ol; }, set: function (v) { this.i.ol = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDateTimeColumnComponent.prototype, "editorValueField", { /** * Gets or sets the ComboBox value field. */ get: function () { return this.i.om; }, set: function (v) { this.i.om = v; }, enumerable: false, configurable: true }); IgcDateTimeColumnComponent.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; }; IgcDateTimeColumnComponent._observedAttributesIgcDateTimeColumnComponent = null; IgcDateTimeColumnComponent.htmlTagName = "igc-date-time-column"; IgcDateTimeColumnComponent._isElementRegistered = false; return IgcDateTimeColumnComponent; }(IgcDataGridColumnComponent)); export { IgcDateTimeColumnComponent };