igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
285 lines (282 loc) • 10.5 kB
JavaScript
import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component";
import { getAllPropertyNames, toSpinal, ensureBool } from "igniteui-webcomponents-core";
/**
* Represents an category-based horizontal X axis that uses a DateTime scale.
*
* Represents horizontal axis that uses a DateTime scale.
*/
export var IgcTimeAxisBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcTimeAxisBaseComponent, _super);
function IgcTimeAxisBaseComponent() {
var _this = _super.call(this) || this;
_this._actualMinimumValueChange = null;
_this._actualMinimumValueChange_wrapped = null;
_this._actualMaximumValueChange = null;
_this._actualMaximumValueChange_wrapped = null;
return _this;
}
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcTimeAxisBaseComponent.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();
}
};
IgcTimeAxisBaseComponent.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(IgcTimeAxisBaseComponent, "observedAttributes", {
get: function () {
if (IgcTimeAxisBaseComponent._observedAttributesIgcTimeAxisBaseComponent == null) {
var names = getAllPropertyNames(IgcTimeAxisBaseComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcTimeAxisBaseComponent._observedAttributesIgcTimeAxisBaseComponent = names;
}
return IgcTimeAxisBaseComponent._observedAttributesIgcTimeAxisBaseComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "dateTimeMemberPath", {
/**
* Gets or sets the DateTime mapping property for the axis.
*
* Use `DateTimeMemberPath` property for DateTime mapping with the axis.
*/
get: function () {
return this.i.dateTimeMemberPath;
},
set: function (v) {
this.i.dateTimeMemberPath = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "isDataPreSorted", {
/**
* Gets or sets whether the data assigned to the date time axis should be considered pre-sorted by date/time.
*
* Use `IsDataPreSorted` property to decide if the data assigned to the date time axis should be considered pre-sorted by date/time.
*/
get: function () {
return this.i.ri;
},
set: function (v) {
this.i.ri = ensureBool(v);
this._a("isDataPreSorted", this.i.ri);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "actualMinimumValue", {
/**
* Gets the coerced minimum value.
*
* Use `ActualMinimumValue` to get the coerced maximum value.
*/
get: function () {
return this.i.actualMinimumValue;
},
set: function (v) {
this.i.actualMinimumValue = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "actualMaximumValue", {
/**
* Gets the coerced maximum value.
*
* Use `ActualMaximumValue` to get the coerced maximum value
*/
get: function () {
return this.i.actualMaximumValue;
},
set: function (v) {
this.i.actualMaximumValue = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "minimumValue", {
/**
* Gets or sets the axis MinimumValue.
*
* Use `MinimumValue` property for axis minimum value.
*
* ```ts
* this.timeXAxis.maximumValue="2019-12-26";
* ```
*/
get: function () {
return this.i.minimumValue;
},
set: function (v) {
this.i.minimumValue = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "maximumValue", {
/**
* Gets or sets the axis MaximumValue.
*
* Use `MaximumValue` property for axis maximum value.
*
* ```ts
* this.timeXAxis.maximumValue="2019-12-26";
* ```
*/
get: function () {
return this.i.maximumValue;
},
set: function (v) {
this.i.maximumValue = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "isDateTime", {
/**
* Checks if the axis is of date time axis type
*
* Use `IsDateTime` property to Checks if the axis is of date time axis type.
*
* ```ts
* const isDT = this.timeXAxis.isDateTime;
* ```
*/
get: function () {
return this.i.dj;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "isSorting", {
/**
* Checks if axis requires sorting of items
*
* Use `IsSorting` property to Checks if axis requires sorting of items.
*
* ```ts
* const isDT = this.timeXAxis.isDateTime;
* ```
*/
get: function () {
return this.i.dv;
},
enumerable: false,
configurable: true
});
IgcTimeAxisBaseComponent.prototype.getMemberPathValue = function (memberPathName) {
var iv = this.i.i6(memberPathName);
return (iv);
};
IgcTimeAxisBaseComponent.prototype.getFullRange = function () {
var iv = this.i.ag();
return (iv);
};
IgcTimeAxisBaseComponent.prototype.getItemValue = function (item, memberPathName) {
var iv = this.i.hu(item, memberPathName);
return (iv);
};
/**
* Gets the index of the data item with the value nearest the given value.
* @param unscaledValue * The value to find a value close to.
*/
IgcTimeAxisBaseComponent.prototype.getIndexClosestToUnscaledValue = function (unscaledValue) {
var iv = this.i.i$f(unscaledValue);
return (iv);
};
/**
* Updates the axis when the data has been changed.
*/
IgcTimeAxisBaseComponent.prototype.notifyDataChanged = function () {
this.i.i$i();
};
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "actualMinimumValueChange", {
get: function () {
return this._actualMinimumValueChange;
},
set: function (ev) {
var _this = this;
if (this._actualMinimumValueChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinimumValueChange_wrapped);
this._actualMinimumValueChange_wrapped = null;
this._actualMinimumValueChange = null;
}
this._actualMinimumValueChange = ev;
this._actualMinimumValueChange_wrapped = function (o, e) {
var ext = _this.actualMinimumValue;
if (e.propertyName == 'ActualMinimumValue') {
if (_this.beforeActualMinimumValueChange) {
_this.beforeActualMinimumValueChange(_this, ext);
}
if (_this._actualMinimumValueChange) {
_this._actualMinimumValueChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinimumValueChange_wrapped);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcTimeAxisBaseComponent.prototype, "actualMaximumValueChange", {
get: function () {
return this._actualMaximumValueChange;
},
set: function (ev) {
var _this = this;
if (this._actualMaximumValueChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMaximumValueChange_wrapped);
this._actualMaximumValueChange_wrapped = null;
this._actualMaximumValueChange = null;
}
this._actualMaximumValueChange = ev;
this._actualMaximumValueChange_wrapped = function (o, e) {
var ext = _this.actualMaximumValue;
if (e.propertyName == 'ActualMaximumValue') {
if (_this.beforeActualMaximumValueChange) {
_this.beforeActualMaximumValueChange(_this, ext);
}
if (_this._actualMaximumValueChange) {
_this._actualMaximumValueChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMaximumValueChange_wrapped);
},
enumerable: false,
configurable: true
});
IgcTimeAxisBaseComponent._observedAttributesIgcTimeAxisBaseComponent = null;
return IgcTimeAxisBaseComponent;
}(IgcCategoryAxisBaseComponent));