jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
569 lines (568 loc) • 17.3 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxdraw from '../../jqwidgets/jqxdraw';
import * as jqxbargauge from '../../jqwidgets/jqxbargauge';
/**
* @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 jqxBarGaugeComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['animationDuration', 'backgroundColor', 'barSpacing', 'baseValue', 'colorScheme', 'customColorScheme', 'disabled', 'endAngle', 'formatFunction', 'height', 'labels', 'max', 'min', 'relativeInnerRadius', 'rendered', 'startAngle', 'title', 'tooltip', 'useGradient', 'values', 'width'];
// jqxBarGaugeComponent events
this.onDrawEnd = new EventEmitter();
this.onDrawStart = new EventEmitter();
this.onInitialized = new EventEmitter();
this.onTooltipClose = new EventEmitter();
this.onTooltipOpen = new EventEmitter();
this.onValueChanged = 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.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]);
}
}
}
}
}
/**
* @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]);
if (typeof options.width === 'string' && options.width.indexOf('%') !== -1) {
options.width = parseInt(options.width, 10) / 100 * this.host.parent().parent().parent().width();
}
if (typeof options.height === 'string' && options.height.indexOf('%') !== -1) {
options.height = parseInt(options.height, 10) / 100 * this.host.parent().parent().parent().height();
}
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxBarGauge', 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.jqxBarGauge('setOptions', options);
}
// jqxBarGaugeComponent properties
/**
* @param {?=} arg
* @return {?}
*/
animationDuration(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('animationDuration', arg);
}
else {
return this.host.jqxBarGauge('animationDuration');
}
}
/**
* @param {?=} arg
* @return {?}
*/
backgroundColor(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('backgroundColor', arg);
}
else {
return this.host.jqxBarGauge('backgroundColor');
}
}
/**
* @param {?=} arg
* @return {?}
*/
barSpacing(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('barSpacing', arg);
}
else {
return this.host.jqxBarGauge('barSpacing');
}
}
/**
* @param {?=} arg
* @return {?}
*/
baseValue(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('baseValue', arg);
}
else {
return this.host.jqxBarGauge('baseValue');
}
}
/**
* @param {?=} arg
* @return {?}
*/
colorScheme(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('colorScheme', arg);
}
else {
return this.host.jqxBarGauge('colorScheme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
customColorScheme(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('customColorScheme', arg);
}
else {
return this.host.jqxBarGauge('customColorScheme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('disabled', arg);
}
else {
return this.host.jqxBarGauge('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
endAngle(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('endAngle', arg);
}
else {
return this.host.jqxBarGauge('endAngle');
}
}
/**
* @param {?=} arg
* @return {?}
*/
formatFunction(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('formatFunction', arg);
}
else {
return this.host.jqxBarGauge('formatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('height', arg);
}
else {
return this.host.jqxBarGauge('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labels(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('labels', arg);
}
else {
return this.host.jqxBarGauge('labels');
}
}
/**
* @param {?=} arg
* @return {?}
*/
max(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('max', arg);
}
else {
return this.host.jqxBarGauge('max');
}
}
/**
* @param {?=} arg
* @return {?}
*/
min(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('min', arg);
}
else {
return this.host.jqxBarGauge('min');
}
}
/**
* @param {?=} arg
* @return {?}
*/
relativeInnerRadius(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('relativeInnerRadius', arg);
}
else {
return this.host.jqxBarGauge('relativeInnerRadius');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rendered(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('rendered', arg);
}
else {
return this.host.jqxBarGauge('rendered');
}
}
/**
* @param {?=} arg
* @return {?}
*/
startAngle(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('startAngle', arg);
}
else {
return this.host.jqxBarGauge('startAngle');
}
}
/**
* @param {?=} arg
* @return {?}
*/
title(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('title', arg);
}
else {
return this.host.jqxBarGauge('title');
}
}
/**
* @param {?=} arg
* @return {?}
*/
tooltip(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('tooltip', arg);
}
else {
return this.host.jqxBarGauge('tooltip');
}
}
/**
* @param {?=} arg
* @return {?}
*/
useGradient(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('useGradient', arg);
}
else {
return this.host.jqxBarGauge('useGradient');
}
}
/**
* @param {?=} arg
* @return {?}
*/
values(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('values', arg);
}
else {
return this.host.jqxBarGauge('values');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxBarGauge('width', arg);
}
else {
return this.host.jqxBarGauge('width');
}
}
// jqxBarGaugeComponent functions
/**
* @return {?}
*/
refresh() {
this.host.jqxBarGauge('refresh');
}
/**
* @return {?}
*/
render() {
this.host.jqxBarGauge('render');
}
/**
* @param {?=} value
* @return {?}
*/
val(value) {
if (value !== undefined) {
return this.host.jqxBarGauge('val', value);
}
else {
return this.host.jqxBarGauge('val');
}
}
;
/**
* @return {?}
*/
__wireEvents__() {
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
jqxBarGaugeComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxBarGauge',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxBarGaugeComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxBarGaugeComponent.propDecorators = {
attrAnimationDuration: [{ type: Input, args: ['animationDuration',] }],
attrBackgroundColor: [{ type: Input, args: ['backgroundColor',] }],
attrBarSpacing: [{ type: Input, args: ['barSpacing',] }],
attrBaseValue: [{ type: Input, args: ['baseValue',] }],
attrColorScheme: [{ type: Input, args: ['colorScheme',] }],
attrCustomColorScheme: [{ type: Input, args: ['customColorScheme',] }],
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrEndAngle: [{ type: Input, args: ['endAngle',] }],
attrFormatFunction: [{ type: Input, args: ['formatFunction',] }],
attrLabels: [{ type: Input, args: ['labels',] }],
attrMax: [{ type: Input, args: ['max',] }],
attrMin: [{ type: Input, args: ['min',] }],
attrRelativeInnerRadius: [{ type: Input, args: ['relativeInnerRadius',] }],
attrRendered: [{ type: Input, args: ['rendered',] }],
attrStartAngle: [{ type: Input, args: ['startAngle',] }],
attrTitle: [{ type: Input, args: ['title',] }],
attrTooltip: [{ type: Input, args: ['tooltip',] }],
attrUseGradient: [{ type: Input, args: ['useGradient',] }],
attrValues: [{ type: Input, args: ['values',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onDrawEnd: [{ type: Output }],
onDrawStart: [{ type: Output }],
onInitialized: [{ type: Output }],
onTooltipClose: [{ type: Output }],
onTooltipOpen: [{ type: Output }],
onValueChanged: [{ type: Output }]
};
if (false) {
/** @type {?} */
jqxBarGaugeComponent.prototype.attrAnimationDuration;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrBackgroundColor;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrBarSpacing;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrBaseValue;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrColorScheme;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrCustomColorScheme;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrDisabled;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrEndAngle;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrFormatFunction;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrLabels;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrMax;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrMin;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrRelativeInnerRadius;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrRendered;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrStartAngle;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrTitle;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrTooltip;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrUseGradient;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrValues;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrWidth;
/** @type {?} */
jqxBarGaugeComponent.prototype.attrHeight;
/** @type {?} */
jqxBarGaugeComponent.prototype.autoCreate;
/** @type {?} */
jqxBarGaugeComponent.prototype.properties;
/** @type {?} */
jqxBarGaugeComponent.prototype.host;
/** @type {?} */
jqxBarGaugeComponent.prototype.elementRef;
/** @type {?} */
jqxBarGaugeComponent.prototype.widgetObject;
/** @type {?} */
jqxBarGaugeComponent.prototype.onDrawEnd;
/** @type {?} */
jqxBarGaugeComponent.prototype.onDrawStart;
/** @type {?} */
jqxBarGaugeComponent.prototype.onInitialized;
/** @type {?} */
jqxBarGaugeComponent.prototype.onTooltipClose;
/** @type {?} */
jqxBarGaugeComponent.prototype.onTooltipOpen;
/** @type {?} */
jqxBarGaugeComponent.prototype.onValueChanged;
/* Skipping unhandled member: ;*/
/* Skipping unhandled member: ;*/
}