jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
485 lines (484 loc) • 14.3 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxdata from '../../jqwidgets/jqxdata';
import * as jqxtooltip from '../../jqwidgets/jqxtooltip';
import * as jqxbulletchart from '../../jqwidgets/jqxbulletchart';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/// <reference path="../../jqwidgets.d.ts" />
/// <reference path="../../jqwidgets.d.ts" />
import { Component, Input, Output, EventEmitter, ElementRef } from '@angular/core';
export class jqxBulletChartComponent {
/**
* @param {?} containerElement
*/
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;
}
/**
* @return {?}
*/
ngOnInit() {
if (this.autoCreate) {
this.createComponent();
}
}
;
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (this.host) {
for (let i = 0; i < this.properties.length; i++) {
/** @type {?} */
let attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1);
/** @type {?} */
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]);
}
}
}
}
}
/**
* @param {?} attrValue
* @param {?} hostValue
* @return {?}
*/
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;
}
/**
* @return {?}
*/
manageAttributes() {
/** @type {?} */
let options = {};
for (let i = 0; i < this.properties.length; i++) {
/** @type {?} */
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;
}
/**
* @param {?} parentEl
* @param {?} childEl
* @return {?}
*/
moveClasses(parentEl, childEl) {
/** @type {?} */
let classes = parentEl.classList;
if (classes.length > 0) {
childEl.classList.add(...classes);
}
parentEl.className = '';
}
/**
* @param {?} parentEl
* @param {?} childEl
* @return {?}
*/
moveStyles(parentEl, childEl) {
/** @type {?} */
let style = parentEl.style.cssText;
childEl.style.cssText = style;
parentEl.style.cssText = '';
}
/**
* @param {?=} options
* @return {?}
*/
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);
}
/**
* @param {?=} options
* @return {?}
*/
createWidget(options) {
this.createComponent(options);
}
/**
* @return {?}
*/
__updateRect__() {
if (this.host)
this.host.css({ width: this.attrWidth, height: this.attrHeight });
}
/**
* @param {?} options
* @return {?}
*/
setOptions(options) {
this.host.jqxBulletChart('setOptions', options);
}
// jqxBulletChartComponent properties
/**
* @param {?=} arg
* @return {?}
*/
animationDuration(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('animationDuration', arg);
}
else {
return this.host.jqxBulletChart('animationDuration');
}
}
/**
* @param {?=} arg
* @return {?}
*/
barSize(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('barSize', arg);
}
else {
return this.host.jqxBulletChart('barSize');
}
}
/**
* @param {?=} arg
* @return {?}
*/
description(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('description', arg);
}
else {
return this.host.jqxBulletChart('description');
}
}
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('disabled', arg);
}
else {
return this.host.jqxBulletChart('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('height', arg);
}
else {
return this.host.jqxBulletChart('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labelsFormat(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('labelsFormat', arg);
}
else {
return this.host.jqxBulletChart('labelsFormat');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labelsFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('labelsFormatFunction', arg);
}
else {
return this.host.jqxBulletChart('labelsFormatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
orientation(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('orientation', arg);
}
else {
return this.host.jqxBulletChart('orientation');
}
}
/**
* @param {?=} arg
* @return {?}
*/
pointer(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('pointer', arg);
}
else {
return this.host.jqxBulletChart('pointer');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rtl(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('rtl', arg);
}
else {
return this.host.jqxBulletChart('rtl');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ranges(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('ranges', arg);
}
else {
return this.host.jqxBulletChart('ranges');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showTooltip(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('showTooltip', arg);
}
else {
return this.host.jqxBulletChart('showTooltip');
}
}
/**
* @param {?=} arg
* @return {?}
*/
target(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('target', arg);
}
else {
return this.host.jqxBulletChart('target');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ticks(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('ticks', arg);
}
else {
return this.host.jqxBulletChart('ticks');
}
}
/**
* @param {?=} arg
* @return {?}
*/
title(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('title', arg);
}
else {
return this.host.jqxBulletChart('title');
}
}
/**
* @param {?=} arg
* @return {?}
*/
tooltipFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('tooltipFormatFunction', arg);
}
else {
return this.host.jqxBulletChart('tooltipFormatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxBulletChart('width', arg);
}
else {
return this.host.jqxBulletChart('width');
}
}
// jqxBulletChartComponent functions
/**
* @return {?}
*/
destroy() {
this.host.jqxBulletChart('destroy');
}
/**
* @return {?}
*/
render() {
this.host.jqxBulletChart('render');
}
/**
* @return {?}
*/
refresh() {
this.host.jqxBulletChart('refresh');
}
/**
* @param {?=} value
* @return {?}
*/
val(value) {
if (value !== undefined) {
return this.host.jqxBulletChart('val', value);
}
else {
return this.host.jqxBulletChart('val');
}
}
;
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('change', (eventData) => { this.onChange.emit(eventData); });
}
} //jqxBulletChartComponent
jqxBulletChartComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxBulletChart',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxBulletChartComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxBulletChartComponent.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 }]
};
if (false) {
/** @type {?} */
jqxBulletChartComponent.prototype.attrAnimationDuration;
/** @type {?} */
jqxBulletChartComponent.prototype.attrBarSize;
/** @type {?} */
jqxBulletChartComponent.prototype.attrDescription;
/** @type {?} */
jqxBulletChartComponent.prototype.attrDisabled;
/** @type {?} */
jqxBulletChartComponent.prototype.attrLabelsFormat;
/** @type {?} */
jqxBulletChartComponent.prototype.attrLabelsFormatFunction;
/** @type {?} */
jqxBulletChartComponent.prototype.attrOrientation;
/** @type {?} */
jqxBulletChartComponent.prototype.attrPointer;
/** @type {?} */
jqxBulletChartComponent.prototype.attrRtl;
/** @type {?} */
jqxBulletChartComponent.prototype.attrRanges;
/** @type {?} */
jqxBulletChartComponent.prototype.attrShowTooltip;
/** @type {?} */
jqxBulletChartComponent.prototype.attrTarget;
/** @type {?} */
jqxBulletChartComponent.prototype.attrTicks;
/** @type {?} */
jqxBulletChartComponent.prototype.attrTitle;
/** @type {?} */
jqxBulletChartComponent.prototype.attrTooltipFormatFunction;
/** @type {?} */
jqxBulletChartComponent.prototype.attrWidth;
/** @type {?} */
jqxBulletChartComponent.prototype.attrHeight;
/** @type {?} */
jqxBulletChartComponent.prototype.autoCreate;
/** @type {?} */
jqxBulletChartComponent.prototype.properties;
/** @type {?} */
jqxBulletChartComponent.prototype.host;
/** @type {?} */
jqxBulletChartComponent.prototype.elementRef;
/** @type {?} */
jqxBulletChartComponent.prototype.widgetObject;
/** @type {?} */
jqxBulletChartComponent.prototype.onChange;
/* Skipping unhandled member: ;*/
/* Skipping unhandled member: ;*/
}