jqwidgets-ng
Version:
[](https://jqwidgets.com/license/)
350 lines (345 loc) • 13.3 kB
JavaScript
import '../jqwidgets/modules/jqxbulletchart';
import * as i0 from '@angular/core';
import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
/// <reference path="../../jqwidgets.d.ts" />
class jqxBulletChartComponent {
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['animationDuration', 'barSize', 'description', 'disabled', 'height', 'labelsFormat', 'labelsFormatFunction', 'orientation', 'pointer', 'rtl', 'ranges', 'showTooltip', 'target', 'ticks', 'title', 'tooltipFormatFunction', 'width'];
// jqxBulletChartComponent events
this.onChange = new EventEmitter();
this.elementRef = containerElement;
}
ngOnInit() {
if (this.autoCreate) {
this.createComponent();
}
}
;
ngOnChanges(changes) {
if (this.host) {
for (let i = 0; i < this.properties.length; i++) {
let attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1);
let areEqual = false;
if (this[attrName] !== undefined) {
if (typeof this[attrName] === 'object') {
if (this[attrName] instanceof Array) {
areEqual = this.arraysEqual(this[attrName], this.host.jqxBulletChart(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxBulletChart(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxBulletChart(this.properties[i])) {
this.host.jqxBulletChart(this.properties[i], this[attrName]);
}
}
}
}
}
arraysEqual(attrValue, hostValue) {
if ((attrValue && !hostValue) || (!attrValue && hostValue)) {
return false;
}
if (attrValue.length != hostValue.length) {
return false;
}
for (let i = 0; i < attrValue.length; i++) {
if (attrValue[i] !== hostValue[i]) {
return false;
}
}
return true;
}
manageAttributes() {
let options = {};
for (let i = 0; i < this.properties.length; i++) {
let attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1);
if (this[attrName] !== undefined) {
options[this.properties[i]] = this[attrName];
}
}
return options;
}
moveClasses(parentEl, childEl) {
let classes = parentEl.classList;
if (classes.length > 0) {
childEl.classList.add(...classes);
}
parentEl.className = '';
}
moveStyles(parentEl, childEl) {
let style = parentEl.style.cssText;
childEl.style.cssText = style;
parentEl.style.cssText = '';
}
createComponent(options) {
if (this.host) {
return;
}
if (options) {
JQXLite.extend(options, this.manageAttributes());
}
else {
options = this.manageAttributes();
}
this.host = JQXLite(this.elementRef.nativeElement.firstChild);
this.moveClasses(this.elementRef.nativeElement, this.host[0]);
this.moveStyles(this.elementRef.nativeElement, this.host[0]);
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBulletChart', options);
}
createWidget(options) {
this.createComponent(options);
}
__updateRect__() {
if (this.host)
this.host.css({ width: this.attrWidth, height: this.attrHeight });
}
setOptions(options) {
this.host.jqxBulletChart('setOptions', options);
}
// jqxBulletChartComponent properties
animationDuration(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('animationDuration', arg);
}
else {
return this.host.jqxBulletChart('animationDuration');
}
}
barSize(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('barSize', arg);
}
else {
return this.host.jqxBulletChart('barSize');
}
}
description(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('description', arg);
}
else {
return this.host.jqxBulletChart('description');
}
}
disabled(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('disabled', arg);
}
else {
return this.host.jqxBulletChart('disabled');
}
}
height(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('height', arg);
}
else {
return this.host.jqxBulletChart('height');
}
}
labelsFormat(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('labelsFormat', arg);
}
else {
return this.host.jqxBulletChart('labelsFormat');
}
}
labelsFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('labelsFormatFunction', arg);
}
else {
return this.host.jqxBulletChart('labelsFormatFunction');
}
}
orientation(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('orientation', arg);
}
else {
return this.host.jqxBulletChart('orientation');
}
}
pointer(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('pointer', arg);
}
else {
return this.host.jqxBulletChart('pointer');
}
}
rtl(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('rtl', arg);
}
else {
return this.host.jqxBulletChart('rtl');
}
}
ranges(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('ranges', arg);
}
else {
return this.host.jqxBulletChart('ranges');
}
}
showTooltip(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('showTooltip', arg);
}
else {
return this.host.jqxBulletChart('showTooltip');
}
}
target(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('target', arg);
}
else {
return this.host.jqxBulletChart('target');
}
}
ticks(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('ticks', arg);
}
else {
return this.host.jqxBulletChart('ticks');
}
}
title(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('title', arg);
}
else {
return this.host.jqxBulletChart('title');
}
}
tooltipFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('tooltipFormatFunction', arg);
}
else {
return this.host.jqxBulletChart('tooltipFormatFunction');
}
}
width(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('width', arg);
}
else {
return this.host.jqxBulletChart('width');
}
}
// jqxBulletChartComponent functions
destroy() {
this.host.jqxBulletChart('destroy');
}
render() {
this.host.jqxBulletChart('render');
}
refresh() {
this.host.jqxBulletChart('refresh');
}
val(value) {
if (value !== undefined) {
return this.host.jqxBulletChart('val', value);
}
else {
return this.host.jqxBulletChart('val');
}
}
;
__wireEvents__() {
this.host.on('change', (eventData) => { this.onChange.emit(eventData); });
}
} //jqxBulletChartComponent
jqxBulletChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
jqxBulletChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: jqxBulletChartComponent, selector: "jqxBulletChart", inputs: { attrAnimationDuration: ["animationDuration", "attrAnimationDuration"], attrBarSize: ["barSize", "attrBarSize"], attrDescription: ["description", "attrDescription"], attrDisabled: ["disabled", "attrDisabled"], attrLabelsFormat: ["labelsFormat", "attrLabelsFormat"], attrLabelsFormatFunction: ["labelsFormatFunction", "attrLabelsFormatFunction"], attrOrientation: ["orientation", "attrOrientation"], attrPointer: ["pointer", "attrPointer"], attrRtl: ["rtl", "attrRtl"], attrRanges: ["ranges", "attrRanges"], attrShowTooltip: ["showTooltip", "attrShowTooltip"], attrTarget: ["target", "attrTarget"], attrTicks: ["ticks", "attrTicks"], attrTitle: ["title", "attrTitle"], attrTooltipFormatFunction: ["tooltipFormatFunction", "attrTooltipFormatFunction"], attrWidth: ["width", "attrWidth"], attrHeight: ["height", "attrHeight"], autoCreate: ["auto-create", "autoCreate"] }, outputs: { onChange: "onChange" }, usesOnChanges: true, ngImport: i0, template: '<div><ng-content></ng-content></div>', isInline: true });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartComponent, decorators: [{
type: Component,
args: [{
selector: 'jqxBulletChart',
template: '<div><ng-content></ng-content></div>'
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { attrAnimationDuration: [{
type: Input,
args: ['animationDuration']
}], attrBarSize: [{
type: Input,
args: ['barSize']
}], attrDescription: [{
type: Input,
args: ['description']
}], attrDisabled: [{
type: Input,
args: ['disabled']
}], attrLabelsFormat: [{
type: Input,
args: ['labelsFormat']
}], attrLabelsFormatFunction: [{
type: Input,
args: ['labelsFormatFunction']
}], attrOrientation: [{
type: Input,
args: ['orientation']
}], attrPointer: [{
type: Input,
args: ['pointer']
}], attrRtl: [{
type: Input,
args: ['rtl']
}], attrRanges: [{
type: Input,
args: ['ranges']
}], attrShowTooltip: [{
type: Input,
args: ['showTooltip']
}], attrTarget: [{
type: Input,
args: ['target']
}], attrTicks: [{
type: Input,
args: ['ticks']
}], attrTitle: [{
type: Input,
args: ['title']
}], attrTooltipFormatFunction: [{
type: Input,
args: ['tooltipFormatFunction']
}], attrWidth: [{
type: Input,
args: ['width']
}], attrHeight: [{
type: Input,
args: ['height']
}], autoCreate: [{
type: Input,
args: ['auto-create']
}], onChange: [{
type: Output
}] } });
class jqxBulletChartModule {
}
jqxBulletChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
jqxBulletChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartModule, declarations: [jqxBulletChartComponent], exports: [jqxBulletChartComponent] });
jqxBulletChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartModule, imports: [[]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: jqxBulletChartModule, decorators: [{
type: NgModule,
args: [{
imports: [],
declarations: [jqxBulletChartComponent],
exports: [jqxBulletChartComponent]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { jqxBulletChartComponent, jqxBulletChartModule };