jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
588 lines (587 loc) • 17.3 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxdraw from '../../jqwidgets/jqxdraw';
import * as jqxgauge from '../../jqwidgets/jqxgauge';
/**
* @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 jqxLinearGaugeComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['animationDuration', 'background', 'colorScheme', 'disabled', 'easing', 'height', 'int64', 'labels', 'min', 'max', 'orientation', 'pointer', 'rangesOffset', 'rangeSize', 'ranges', 'showRanges', 'scaleStyle', 'scaleLength', 'ticksOffset', 'ticksPosition', 'ticksMinor', 'ticksMajor', 'value', 'width'];
// jqxLinearGaugeComponent events
this.onValueChanging = 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.jqxLinearGauge(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxLinearGauge(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxLinearGauge(this.properties[i])) {
this.host.jqxLinearGauge(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, 'jqxLinearGauge', 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.jqxLinearGauge('setOptions', options);
}
// jqxLinearGaugeComponent properties
/**
* @param {?=} arg
* @return {?}
*/
animationDuration(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('animationDuration', arg);
}
else {
return this.host.jqxLinearGauge('animationDuration');
}
}
/**
* @param {?=} arg
* @return {?}
*/
background(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('background', arg);
}
else {
return this.host.jqxLinearGauge('background');
}
}
/**
* @param {?=} arg
* @return {?}
*/
colorScheme(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('colorScheme', arg);
}
else {
return this.host.jqxLinearGauge('colorScheme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('disabled', arg);
}
else {
return this.host.jqxLinearGauge('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
easing(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('easing', arg);
}
else {
return this.host.jqxLinearGauge('easing');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('height', arg);
}
else {
return this.host.jqxLinearGauge('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
int64(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('int64', arg);
}
else {
return this.host.jqxLinearGauge('int64');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labels(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('labels', arg);
}
else {
return this.host.jqxLinearGauge('labels');
}
}
/**
* @param {?=} arg
* @return {?}
*/
min(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('min', arg);
}
else {
return this.host.jqxLinearGauge('min');
}
}
/**
* @param {?=} arg
* @return {?}
*/
max(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('max', arg);
}
else {
return this.host.jqxLinearGauge('max');
}
}
/**
* @param {?=} arg
* @return {?}
*/
orientation(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('orientation', arg);
}
else {
return this.host.jqxLinearGauge('orientation');
}
}
/**
* @param {?=} arg
* @return {?}
*/
pointer(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('pointer', arg);
}
else {
return this.host.jqxLinearGauge('pointer');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rangesOffset(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('rangesOffset', arg);
}
else {
return this.host.jqxLinearGauge('rangesOffset');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rangeSize(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('rangeSize', arg);
}
else {
return this.host.jqxLinearGauge('rangeSize');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ranges(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('ranges', arg);
}
else {
return this.host.jqxLinearGauge('ranges');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showRanges(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('showRanges', arg);
}
else {
return this.host.jqxLinearGauge('showRanges');
}
}
/**
* @param {?=} arg
* @return {?}
*/
scaleStyle(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('scaleStyle', arg);
}
else {
return this.host.jqxLinearGauge('scaleStyle');
}
}
/**
* @param {?=} arg
* @return {?}
*/
scaleLength(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('scaleLength', arg);
}
else {
return this.host.jqxLinearGauge('scaleLength');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ticksOffset(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('ticksOffset', arg);
}
else {
return this.host.jqxLinearGauge('ticksOffset');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ticksPosition(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('ticksPosition', arg);
}
else {
return this.host.jqxLinearGauge('ticksPosition');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ticksMinor(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('ticksMinor', arg);
}
else {
return this.host.jqxLinearGauge('ticksMinor');
}
}
/**
* @param {?=} arg
* @return {?}
*/
ticksMajor(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('ticksMajor', arg);
}
else {
return this.host.jqxLinearGauge('ticksMajor');
}
}
/**
* @param {?=} arg
* @return {?}
*/
value(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('value', arg);
}
else {
return this.host.jqxLinearGauge('value');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxLinearGauge('width', arg);
}
else {
return this.host.jqxLinearGauge('width');
}
}
// jqxLinearGaugeComponent functions
/**
* @return {?}
*/
disable() {
this.host.jqxLinearGauge('disable');
}
/**
* @return {?}
*/
enable() {
this.host.jqxLinearGauge('enable');
}
/**
* @param {?=} value
* @return {?}
*/
val(value) {
if (value !== undefined) {
return this.host.jqxLinearGauge('val', value);
}
else {
return this.host.jqxLinearGauge('val');
}
}
;
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('valueChanging', (eventData) => { this.onValueChanging.emit(eventData); });
this.host.on('valueChanged', (eventData) => { this.onValueChanged.emit(eventData); });
}
} //jqxLinearGaugeComponent
jqxLinearGaugeComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxLinearGauge',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxLinearGaugeComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxLinearGaugeComponent.propDecorators = {
attrAnimationDuration: [{ type: Input, args: ['animationDuration',] }],
attrBackground: [{ type: Input, args: ['background',] }],
attrColorScheme: [{ type: Input, args: ['colorScheme',] }],
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrEasing: [{ type: Input, args: ['easing',] }],
attrInt64: [{ type: Input, args: ['int64',] }],
attrLabels: [{ type: Input, args: ['labels',] }],
attrMin: [{ type: Input, args: ['min',] }],
attrMax: [{ type: Input, args: ['max',] }],
attrOrientation: [{ type: Input, args: ['orientation',] }],
attrPointer: [{ type: Input, args: ['pointer',] }],
attrRangesOffset: [{ type: Input, args: ['rangesOffset',] }],
attrRangeSize: [{ type: Input, args: ['rangeSize',] }],
attrRanges: [{ type: Input, args: ['ranges',] }],
attrShowRanges: [{ type: Input, args: ['showRanges',] }],
attrScaleStyle: [{ type: Input, args: ['scaleStyle',] }],
attrScaleLength: [{ type: Input, args: ['scaleLength',] }],
attrTicksOffset: [{ type: Input, args: ['ticksOffset',] }],
attrTicksPosition: [{ type: Input, args: ['ticksPosition',] }],
attrTicksMinor: [{ type: Input, args: ['ticksMinor',] }],
attrTicksMajor: [{ type: Input, args: ['ticksMajor',] }],
attrValue: [{ type: Input, args: ['value',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onValueChanging: [{ type: Output }],
onValueChanged: [{ type: Output }]
};
if (false) {
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrAnimationDuration;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrBackground;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrColorScheme;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrDisabled;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrEasing;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrInt64;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrLabels;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrMin;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrMax;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrOrientation;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrPointer;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrRangesOffset;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrRangeSize;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrRanges;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrShowRanges;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrScaleStyle;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrScaleLength;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrTicksOffset;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrTicksPosition;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrTicksMinor;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrTicksMajor;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrValue;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrWidth;
/** @type {?} */
jqxLinearGaugeComponent.prototype.attrHeight;
/** @type {?} */
jqxLinearGaugeComponent.prototype.autoCreate;
/** @type {?} */
jqxLinearGaugeComponent.prototype.properties;
/** @type {?} */
jqxLinearGaugeComponent.prototype.host;
/** @type {?} */
jqxLinearGaugeComponent.prototype.elementRef;
/** @type {?} */
jqxLinearGaugeComponent.prototype.widgetObject;
/** @type {?} */
jqxLinearGaugeComponent.prototype.onValueChanging;
/** @type {?} */
jqxLinearGaugeComponent.prototype.onValueChanged;
/* Skipping unhandled member: ;*/
/* Skipping unhandled member: ;*/
}