UNPKG

jqwidgets-scripts-custom

Version:

jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

755 lines (754 loc) 21.3 kB
import * as jqxcore from '../../jqwidgets/jqxcore'; import * as jqxdraw from '../../jqwidgets/jqxdraw'; import * as jqxknob from '../../jqwidgets/jqxknob'; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; /// <reference path="../../jqwidgets.d.ts" /> /// <reference path="../../jqwidgets.d.ts" /> import { Component, Input, Output, EventEmitter, ElementRef } from '@angular/core'; var jqxKnobComponent = /** @class */ (function () { function jqxKnobComponent(containerElement) { var _this = this; this.autoCreate = true; this.properties = ['allowValueChangeOnClick', 'allowValueChangeOnDrag', 'allowValueChangeOnMouseWheel', 'changing', 'dragEndAngle', 'dragStartAngle', 'disabled', 'dial', 'endAngle', 'height', 'labels', 'marks', 'min', 'max', 'progressBar', 'pointer', 'pointerGrabAction', 'rotation', 'startAngle', 'spinner', 'styles', 'step', 'snapToStep', 'value', 'width']; // jqxKnobComponent events this.onChange = new EventEmitter(); this.elementRef = containerElement; JQXLite(window).resize(function () { _this.__updateRect__(); }); } /** * @return {?} */ jqxKnobComponent.prototype.ngOnInit = /** * @return {?} */ function () { if (this.autoCreate) { this.createComponent(); } }; ; /** * @param {?} changes * @return {?} */ jqxKnobComponent.prototype.ngOnChanges = /** * @param {?} changes * @return {?} */ function (changes) { if (this.host) { for (var i = 0; i < this.properties.length; i++) { /** @type {?} */ var attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1); /** @type {?} */ var areEqual = false; if (this[attrName] !== undefined) { if (typeof this[attrName] === 'object') { if (this[attrName] instanceof Array) { areEqual = this.arraysEqual(this[attrName], this.host.jqxKnob(this.properties[i])); } if (areEqual) { return false; } this.host.jqxKnob(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxKnob(this.properties[i])) { this.host.jqxKnob(this.properties[i], this[attrName]); } } } } }; /** * @param {?} attrValue * @param {?} hostValue * @return {?} */ jqxKnobComponent.prototype.arraysEqual = /** * @param {?} attrValue * @param {?} hostValue * @return {?} */ function (attrValue, hostValue) { if ((attrValue && !hostValue) || (!attrValue && hostValue)) { return false; } if (attrValue.length != hostValue.length) { return false; } for (var i = 0; i < attrValue.length; i++) { if (attrValue[i] !== hostValue[i]) { return false; } } return true; }; /** * @return {?} */ jqxKnobComponent.prototype.manageAttributes = /** * @return {?} */ function () { /** @type {?} */ var options = {}; for (var i = 0; i < this.properties.length; i++) { /** @type {?} */ var 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 {?} */ jqxKnobComponent.prototype.moveClasses = /** * @param {?} parentEl * @param {?} childEl * @return {?} */ function (parentEl, childEl) { var _a; /** @type {?} */ var classes = parentEl.classList; if (classes.length > 0) { (_a = childEl.classList).add.apply(_a, tslib_1.__spread(classes)); } parentEl.className = ''; }; /** * @param {?} parentEl * @param {?} childEl * @return {?} */ jqxKnobComponent.prototype.moveStyles = /** * @param {?} parentEl * @param {?} childEl * @return {?} */ function (parentEl, childEl) { /** @type {?} */ var style = parentEl.style.cssText; childEl.style.cssText = style; parentEl.style.cssText = ''; }; /** * @param {?=} options * @return {?} */ jqxKnobComponent.prototype.createComponent = /** * @param {?=} options * @return {?} */ function (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, 'jqxKnob', options); this.__updateRect__(); }; /** * @param {?=} options * @return {?} */ jqxKnobComponent.prototype.createWidget = /** * @param {?=} options * @return {?} */ function (options) { this.createComponent(options); }; /** * @return {?} */ jqxKnobComponent.prototype.__updateRect__ = /** * @return {?} */ function () { if (this.host) this.host.css({ width: this.attrWidth, height: this.attrHeight }); }; /** * @param {?} options * @return {?} */ jqxKnobComponent.prototype.setOptions = /** * @param {?} options * @return {?} */ function (options) { this.host.jqxKnob('setOptions', options); }; // jqxKnobComponent properties // jqxKnobComponent properties /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.allowValueChangeOnClick = // jqxKnobComponent properties /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('allowValueChangeOnClick', arg); } else { return this.host.jqxKnob('allowValueChangeOnClick'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.allowValueChangeOnDrag = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('allowValueChangeOnDrag', arg); } else { return this.host.jqxKnob('allowValueChangeOnDrag'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.allowValueChangeOnMouseWheel = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('allowValueChangeOnMouseWheel', arg); } else { return this.host.jqxKnob('allowValueChangeOnMouseWheel'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.changing = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('changing', arg); } else { return this.host.jqxKnob('changing'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.dragEndAngle = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('dragEndAngle', arg); } else { return this.host.jqxKnob('dragEndAngle'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.dragStartAngle = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('dragStartAngle', arg); } else { return this.host.jqxKnob('dragStartAngle'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.disabled = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('disabled', arg); } else { return this.host.jqxKnob('disabled'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.dial = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('dial', arg); } else { return this.host.jqxKnob('dial'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.endAngle = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('endAngle', arg); } else { return this.host.jqxKnob('endAngle'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.height = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('height', arg); } else { return this.host.jqxKnob('height'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.labels = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('labels', arg); } else { return this.host.jqxKnob('labels'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.marks = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('marks', arg); } else { return this.host.jqxKnob('marks'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.min = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('min', arg); } else { return this.host.jqxKnob('min'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.max = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('max', arg); } else { return this.host.jqxKnob('max'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.progressBar = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('progressBar', arg); } else { return this.host.jqxKnob('progressBar'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.pointer = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('pointer', arg); } else { return this.host.jqxKnob('pointer'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.pointerGrabAction = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('pointerGrabAction', arg); } else { return this.host.jqxKnob('pointerGrabAction'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.rotation = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('rotation', arg); } else { return this.host.jqxKnob('rotation'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.startAngle = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('startAngle', arg); } else { return this.host.jqxKnob('startAngle'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.spinner = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('spinner', arg); } else { return this.host.jqxKnob('spinner'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.styles = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('styles', arg); } else { return this.host.jqxKnob('styles'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.step = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('step', arg); } else { return this.host.jqxKnob('step'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.snapToStep = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('snapToStep', arg); } else { return this.host.jqxKnob('snapToStep'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.value = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('value', arg); } else { return this.host.jqxKnob('value'); } }; /** * @param {?=} arg * @return {?} */ jqxKnobComponent.prototype.width = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxKnob('width', arg); } else { return this.host.jqxKnob('width'); } }; // jqxKnobComponent functions // jqxKnobComponent functions /** * @return {?} */ jqxKnobComponent.prototype.destroy = // jqxKnobComponent functions /** * @return {?} */ function () { this.host.jqxKnob('destroy'); }; /** * @param {?=} value * @return {?} */ jqxKnobComponent.prototype.val = /** * @param {?=} value * @return {?} */ function (value) { if (value !== undefined) { return this.host.jqxKnob('val', value); } else { return this.host.jqxKnob('val'); } }; ; /** * @return {?} */ jqxKnobComponent.prototype.__wireEvents__ = /** * @return {?} */ function () { var _this = this; this.host.on('change', function (eventData) { _this.onChange.emit(eventData); }); }; jqxKnobComponent.decorators = [ { type: Component, args: [{ selector: 'jqxKnob', template: '<div><ng-content></ng-content></div>' }] } ]; /** @nocollapse */ jqxKnobComponent.ctorParameters = function () { return [ { type: ElementRef } ]; }; jqxKnobComponent.propDecorators = { attrAllowValueChangeOnClick: [{ type: Input, args: ['allowValueChangeOnClick',] }], attrAllowValueChangeOnDrag: [{ type: Input, args: ['allowValueChangeOnDrag',] }], attrAllowValueChangeOnMouseWheel: [{ type: Input, args: ['allowValueChangeOnMouseWheel',] }], attrChanging: [{ type: Input, args: ['changing',] }], attrDragEndAngle: [{ type: Input, args: ['dragEndAngle',] }], attrDragStartAngle: [{ type: Input, args: ['dragStartAngle',] }], attrDisabled: [{ type: Input, args: ['disabled',] }], attrDial: [{ type: Input, args: ['dial',] }], attrEndAngle: [{ type: Input, args: ['endAngle',] }], attrLabels: [{ type: Input, args: ['labels',] }], attrMarks: [{ type: Input, args: ['marks',] }], attrMin: [{ type: Input, args: ['min',] }], attrMax: [{ type: Input, args: ['max',] }], attrProgressBar: [{ type: Input, args: ['progressBar',] }], attrPointer: [{ type: Input, args: ['pointer',] }], attrPointerGrabAction: [{ type: Input, args: ['pointerGrabAction',] }], attrRotation: [{ type: Input, args: ['rotation',] }], attrStartAngle: [{ type: Input, args: ['startAngle',] }], attrSpinner: [{ type: Input, args: ['spinner',] }], attrStyles: [{ type: Input, args: ['styles',] }], attrStep: [{ type: Input, args: ['step',] }], attrSnapToStep: [{ type: Input, args: ['snapToStep',] }], attrValue: [{ type: Input, args: ['value',] }], attrWidth: [{ type: Input, args: ['width',] }], attrHeight: [{ type: Input, args: ['height',] }], autoCreate: [{ type: Input, args: ['auto-create',] }], onChange: [{ type: Output }] }; return jqxKnobComponent; }()); //jqxKnobComponent export { jqxKnobComponent }; if (false) { /** @type {?} */ jqxKnobComponent.prototype.attrAllowValueChangeOnClick; /** @type {?} */ jqxKnobComponent.prototype.attrAllowValueChangeOnDrag; /** @type {?} */ jqxKnobComponent.prototype.attrAllowValueChangeOnMouseWheel; /** @type {?} */ jqxKnobComponent.prototype.attrChanging; /** @type {?} */ jqxKnobComponent.prototype.attrDragEndAngle; /** @type {?} */ jqxKnobComponent.prototype.attrDragStartAngle; /** @type {?} */ jqxKnobComponent.prototype.attrDisabled; /** @type {?} */ jqxKnobComponent.prototype.attrDial; /** @type {?} */ jqxKnobComponent.prototype.attrEndAngle; /** @type {?} */ jqxKnobComponent.prototype.attrLabels; /** @type {?} */ jqxKnobComponent.prototype.attrMarks; /** @type {?} */ jqxKnobComponent.prototype.attrMin; /** @type {?} */ jqxKnobComponent.prototype.attrMax; /** @type {?} */ jqxKnobComponent.prototype.attrProgressBar; /** @type {?} */ jqxKnobComponent.prototype.attrPointer; /** @type {?} */ jqxKnobComponent.prototype.attrPointerGrabAction; /** @type {?} */ jqxKnobComponent.prototype.attrRotation; /** @type {?} */ jqxKnobComponent.prototype.attrStartAngle; /** @type {?} */ jqxKnobComponent.prototype.attrSpinner; /** @type {?} */ jqxKnobComponent.prototype.attrStyles; /** @type {?} */ jqxKnobComponent.prototype.attrStep; /** @type {?} */ jqxKnobComponent.prototype.attrSnapToStep; /** @type {?} */ jqxKnobComponent.prototype.attrValue; /** @type {?} */ jqxKnobComponent.prototype.attrWidth; /** @type {?} */ jqxKnobComponent.prototype.attrHeight; /** @type {?} */ jqxKnobComponent.prototype.autoCreate; /** @type {?} */ jqxKnobComponent.prototype.properties; /** @type {?} */ jqxKnobComponent.prototype.host; /** @type {?} */ jqxKnobComponent.prototype.elementRef; /** @type {?} */ jqxKnobComponent.prototype.widgetObject; /** @type {?} */ jqxKnobComponent.prototype.onChange; /* Skipping unhandled member: ;*/ /* Skipping unhandled member: ;*/ }