igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
257 lines (256 loc) • 10.7 kB
JavaScript
import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType";
import { IgcTimeAxisBaseComponent } from "./igc-time-axis-base-component";
import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis";
import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a category-based horizontal X axis that uses a DateTime scale.
*
* `CategoryDateTimeXAxis` class represents a category-based horizontal X axis that uses a DateTime scale.
*/
var IgcCategoryDateTimeXAxisComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcCategoryDateTimeXAxisComponent, _super);
function IgcCategoryDateTimeXAxisComponent() {
var _this = _super.call(this) || this;
_this._actualIntervalChange = null;
_this._actualIntervalChange_wrapped = null;
_this._actualMinorIntervalChange = null;
_this._actualMinorIntervalChange_wrapped = null;
return _this;
}
IgcCategoryDateTimeXAxisComponent.prototype.createImplementation = function () {
return new CategoryDateTimeXAxis();
};
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcCategoryDateTimeXAxisComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcCategoryDateTimeXAxisComponent.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(IgcCategoryDateTimeXAxisComponent, "observedAttributes", {
get: function () {
if (IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent == null) {
var names = getAllPropertyNames(IgcCategoryDateTimeXAxisComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent = names;
}
return IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent;
},
enumerable: false,
configurable: true
});
IgcCategoryDateTimeXAxisComponent.register = function () {
if (!IgcCategoryDateTimeXAxisComponent._isElementRegistered) {
IgcCategoryDateTimeXAxisComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcCategoryDateTimeXAxisComponent.htmlTagName, IgcCategoryDateTimeXAxisComponent);
}
};
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "isContinuous", {
/**
* Gets if the current axis is a continuous rather than a discrete scale
*/
get: function () {
return this.i.cd;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "unevenlySpacedLabels", {
/**
* Gets or sets whether the axis labels can be unevenly spaced
*/
get: function () {
return this.i.nw;
},
set: function (v) {
this.i.nw = ensureBool(v);
this._a("unevenlySpacedLabels", this.i.nw);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "displayType", {
/**
* Gets or sets the axis display type.
* Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points.
* Discrete display type will not use a constant interval, but will align each label with its data point.
*
* `displayType` property is used for axis display type.
*
* Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. Discrete display type will not use a constant interval, but will align each label with its data point.
*/
get: function () {
return this.i.nt;
},
set: function (v) {
this.i.nt = ensureEnum(TimeAxisDisplayType_$type, v);
this._a("displayType", enumToString(TimeAxisDisplayType_$type, this.i.nt));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "interval", {
/**
* Gets or sets the X axis time interval.
*
* `Interval` property is used to get/sets the frequency of displayed labels.
*/
get: function () {
return this.i.n5;
},
set: function (v) {
this.i.n5 = +v;
this._a("interval", this.i.n5);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "actualInterval", {
/**
* Gets the effective value for the current Interval.
*/
get: function () {
return this.i.n2;
},
set: function (v) {
this.i.n2 = +v;
this._a("actualInterval", this.i.n2);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "minorInterval", {
/**
* Gets or sets the frequency of displayed minor lines.
* The set value is a factor that determines how the minor lines will be displayed.
*/
get: function () {
return this.i.n6;
},
set: function (v) {
this.i.n6 = +v;
this._a("minorInterval", this.i.n6);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "actualMinorInterval", {
/**
* Gets the effective value for the current MinorInterval.
*/
get: function () {
return this.i.n3;
},
set: function (v) {
this.i.n3 = +v;
this._a("actualMinorInterval", this.i.n3);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "isCategoryDateTime", {
/**
* Gets if the current axis is of category date time axis type
*/
get: function () {
return this.i.cc;
},
enumerable: false,
configurable: true
});
IgcCategoryDateTimeXAxisComponent.prototype.scrollDateRangeIntoView = function (minimum, maximum) {
this.i.od(minimum, maximum);
};
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "actualIntervalChange", {
get: function () {
return this._actualIntervalChange;
},
set: function (ev) {
var _this = this;
if (this._actualIntervalChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualIntervalChange_wrapped);
this._actualIntervalChange_wrapped = null;
this._actualIntervalChange = null;
}
this._actualIntervalChange = ev;
this._actualIntervalChange_wrapped = function (o, e) {
var ext = _this.actualInterval;
if (e.propertyName == 'N2') {
if (_this.beforeActualIntervalChange) {
_this.beforeActualIntervalChange(_this, ext);
}
if (_this._actualIntervalChange) {
_this._actualIntervalChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryDateTimeXAxisComponent.prototype, "actualMinorIntervalChange", {
get: function () {
return this._actualMinorIntervalChange;
},
set: function (ev) {
var _this = this;
if (this._actualMinorIntervalChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
this._actualMinorIntervalChange_wrapped = null;
this._actualMinorIntervalChange = null;
}
this._actualMinorIntervalChange = ev;
this._actualMinorIntervalChange_wrapped = function (o, e) {
var ext = _this.actualMinorInterval;
if (e.propertyName == 'N3') {
if (_this.beforeActualMinorIntervalChange) {
_this.beforeActualMinorIntervalChange(_this, ext);
}
if (_this._actualMinorIntervalChange) {
_this._actualMinorIntervalChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
},
enumerable: false,
configurable: true
});
IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent = null;
IgcCategoryDateTimeXAxisComponent.htmlTagName = "igc-category-date-time-x-axis";
IgcCategoryDateTimeXAxisComponent._isElementRegistered = false;
return IgcCategoryDateTimeXAxisComponent;
}(IgcTimeAxisBaseComponent));
export { IgcCategoryDateTimeXAxisComponent };