Skip to content

Commit

Permalink
Updated to version 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarD committed Nov 24, 2016
1 parent 5dd13e1 commit 842babd
Show file tree
Hide file tree
Showing 161 changed files with 6,676 additions and 3,098 deletions.
127 changes: 96 additions & 31 deletions jqwidgets-ts/angular_jqxbargauge.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,109 @@
/// <reference path="jqwidgets.d.ts" />
import {Component, Input, Output, EventEmitter, ElementRef, forwardRef} from '@angular/core';
import { Component, Input, Output, EventEmitter, ElementRef, forwardRef, OnChanges } from '@angular/core';
declare let $: any;

@Component({
selector: 'angularBarGauge',
template: '<div><ng-content></ng-content></div>'
})

export class jqxBarGaugeComponent {
@Input('width') containerWidth: any;
@Input('height') containerHeight: any;

elementRef: ElementRef;
export class jqxBarGaugeComponent implements OnChanges
{
@Input('animationDuration') attrAnimationDuration;
@Input('backgroundColor') attrBackgroundColor;
@Input('barSpacing') attrBarSpacing;
@Input('baseValue') attrBaseValue;
@Input('colorScheme') attrColorScheme;
@Input('customColorScheme') attrCustomColorScheme;
@Input('disabled') attrDisabled;
@Input('endAngle') attrEndAngle;
@Input('formatFunction') attrFormatFunction;
@Input('labels') attrLabels;
@Input('max') attrMax;
@Input('min') attrMin;
@Input('relativeInnerRadius') attrRelativeInnerRadius;
@Input('rendered') attrRendered;
@Input('startAngle') attrStartAngle;
@Input('title') attrTitle;
@Input('tooltip') attrTooltip;
@Input('useGradient') attrUseGradient;
@Input('values') attrValues;
@Input('width') attrWidth;
@Input('height') attrHeight;

properties: Array<string> = ['animationDuration','backgroundColor','barSpacing','baseValue','colorScheme','customColorScheme','disabled','endAngle','formatFunction','height','labels','max','min','relativeInnerRadius','rendered','startAngle','title','tooltip','useGradient','values','width'];
host;
elementRef: ElementRef;
widgetObject: jqwidgets.jqxBarGauge;

constructor(containerElement: ElementRef) {
this.elementRef = containerElement;
}

isHostReady(): boolean {
return (this.host !== undefined && this.host.length == 1);
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: boolean;

if (this[attrName]) {
if (typeof this[attrName] === 'object') {
if (this[attrName] instanceof Array) {
areEqual = this.arraysEqual(this[attrName], this.host.jqxBarGauge(this.properties[i]));
}
if (areEqual) {
return false;
}

this.host.jqxBarGauge(this.properties[i], this[attrName]);
continue;
}

if (this[attrName] !== this.host.jqxBarGauge(this.properties[i])) {
this.host.jqxBarGauge(this.properties[i], this[attrName]);
}
}
}
}
}

createWidget(options: any): void {
if (!this.isHostReady()) {

this.host = $(this.elementRef.nativeElement.firstChild);
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBarGauge', options);
this.__updateRect__();
arraysEqual(attrValue: any, hostValue: any): boolean {
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(): any {
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;
}
createWidget(options?: any): void {
if (options) {
$.extend(options, this.manageAttributes());
}
else {
options = this.manageAttributes();
}
this.host = $(this.elementRef.nativeElement.firstChild);
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBarGauge', options);
this.__updateRect__();
}

__updateRect__() : void {
this.host.css({width: this.containerWidth, height: this.containerHeight});
this.host.css({width: this.attrWidth, height: this.attrHeight});
}

setOptions(options: any) : void {
Expand Down Expand Up @@ -215,32 +283,29 @@ export class jqxBarGaugeComponent {
// jqxBarGaugeComponent functions
refresh(): void {
this.host.jqxBarGauge('refresh');

}
render(): void {
this.host.jqxBarGauge('render');

}
val(value: Array<Number>): Array<Number> {
return this.host.jqxBarGauge('val', value);

}

// jqxBarGaugeComponent events
@Output() OnDrawEnd = new EventEmitter();
@Output() OnDrawStart = new EventEmitter();
@Output() OnInitialized = new EventEmitter();
@Output() OnTooltipClose = new EventEmitter();
@Output() OnTooltipOpen = new EventEmitter();
@Output() OnValueChanged = new EventEmitter();
@Output() onDrawEnd = new EventEmitter();
@Output() onDrawStart = new EventEmitter();
@Output() onInitialized = new EventEmitter();
@Output() onTooltipClose = new EventEmitter();
@Output() onTooltipOpen = new EventEmitter();
@Output() onValueChanged = new EventEmitter();

__wireEvents__(): void {
this.host.on('drawEnd', (eventData) => { this.OnDrawEnd.emit(eventData); });
this.host.on('drawStart', (eventData) => { this.OnDrawStart.emit(eventData); });
this.host.on('initialized', (eventData) => { this.OnInitialized.emit(eventData); });
this.host.on('tooltipClose', (eventData) => { this.OnTooltipClose.emit(eventData); });
this.host.on('tooltipOpen', (eventData) => { this.OnTooltipOpen.emit(eventData); });
this.host.on('valueChanged', (eventData) => { this.OnValueChanged.emit(eventData); });
this.host.on('drawEnd', (eventData) => { this.onDrawEnd.emit(eventData); });
this.host.on('drawStart', (eventData) => { this.onDrawStart.emit(eventData); });
this.host.on('initialized', (eventData) => { this.onInitialized.emit(eventData); });
this.host.on('tooltipClose', (eventData) => { this.onTooltipClose.emit(eventData); });
this.host.on('tooltipOpen', (eventData) => { this.onTooltipOpen.emit(eventData); });
this.host.on('valueChanged', (eventData) => { this.onValueChanged.emit(eventData); });
}

} //jqxBarGaugeComponent
104 changes: 82 additions & 22 deletions jqwidgets-ts/angular_jqxbulletchart.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,105 @@
/// <reference path="jqwidgets.d.ts" />
import {Component, Input, Output, EventEmitter, ElementRef, forwardRef} from '@angular/core';
import { Component, Input, Output, EventEmitter, ElementRef, forwardRef, OnChanges } from '@angular/core';
declare let $: any;

@Component({
selector: 'angularBulletChart',
template: '<div><ng-content></ng-content></div>'
})

export class jqxBulletChartComponent {
@Input('width') containerWidth: any;
@Input('height') containerHeight: any;

elementRef: ElementRef;
export class jqxBulletChartComponent implements OnChanges
{
@Input('animationDuration') attrAnimationDuration;
@Input('barSize') attrBarSize;
@Input('description') attrDescription;
@Input('disabled') attrDisabled;
@Input('labelsFormat') attrLabelsFormat;
@Input('labelsFormatFunction') attrLabelsFormatFunction;
@Input('orientation') attrOrientation;
@Input('pointer') attrPointer;
@Input('rtl') attrRtl;
@Input('ranges') attrRanges;
@Input('showTooltip') attrShowTooltip;
@Input('target') attrTarget;
@Input('ticks') attrTicks;
@Input('title') attrTitle;
@Input('tooltipFormatFunction') attrTooltipFormatFunction;
@Input('width') attrWidth;
@Input('height') attrHeight;

properties: Array<string> = ['animationDuration','barSize','description','disabled','height','labelsFormat','labelsFormatFunction','orientation','pointer','rtl','ranges','showTooltip','target','ticks','title','tooltipFormatFunction','width'];
host;
elementRef: ElementRef;
widgetObject: jqwidgets.jqxBulletChart;

constructor(containerElement: ElementRef) {
this.elementRef = containerElement;
}

isHostReady(): boolean {
return (this.host !== undefined && this.host.length == 1);
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: boolean;

if (this[attrName]) {
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]);
}
}
}
}
}

createWidget(options: any): void {
if (!this.isHostReady()) {

this.host = $(this.elementRef.nativeElement.firstChild);
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBulletChart', options);
this.__updateRect__();
arraysEqual(attrValue: any, hostValue: any): boolean {
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(): any {
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;
}
createWidget(options?: any): void {
if (options) {
$.extend(options, this.manageAttributes());
}
else {
options = this.manageAttributes();
}
this.host = $(this.elementRef.nativeElement.firstChild);
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBulletChart', options);
this.__updateRect__();
}

__updateRect__() : void {
this.host.css({width: this.containerWidth, height: this.containerHeight});
this.host.css({width: this.attrWidth, height: this.attrHeight});
}

setOptions(options: any) : void {
Expand Down Expand Up @@ -183,26 +247,22 @@ export class jqxBulletChartComponent {
// jqxBulletChartComponent functions
destroy(): void {
this.host.jqxBulletChart('destroy');

}
render(): void {
this.host.jqxBulletChart('render');

}
refresh(): void {
this.host.jqxBulletChart('refresh');

}
val(value: number): number {
return this.host.jqxBulletChart('val', value);

}

// jqxBulletChartComponent events
@Output() OnChange = new EventEmitter();
@Output() onChange = new EventEmitter();

__wireEvents__(): void {
this.host.on('change', (eventData) => { this.OnChange.emit(eventData); });
this.host.on('change', (eventData) => { this.onChange.emit(eventData); });
}

} //jqxBulletChartComponent
Loading

0 comments on commit 842babd

Please sign in to comment.