jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
590 lines (589 loc) • 17.8 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxdata from '../../jqwidgets/jqxdata';
import * as jqxtooltip from '../../jqwidgets/jqxtooltip';
import * as jqxrangeselector from '../../jqwidgets/jqxrangeselector';
/**
* @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 jqxRangeSelectorComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['disabled', 'groupLabelsFormatFunction', 'height', 'labelsFormat', 'labelsFormatFunction', 'labelsOnTicks', 'markersFormat', 'markersFormatFunction', 'majorTicksInterval', 'minorTicksInterval', 'max', 'min', 'moveOnClick', 'padding', 'range', 'resizable', 'rtl', 'showGroupLabels', 'showMinorTicks', 'snapToTicks', 'showMajorLabels', 'showMarkers', 'theme', 'width'];
// jqxRangeSelectorComponent 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.jqxRangeSelector(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxRangeSelector(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxRangeSelector(this.properties[i])) {
this.host.jqxRangeSelector(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, 'jqxRangeSelector', 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.jqxRangeSelector('setOptions', options);
}
// jqxRangeSelectorComponent properties
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('disabled', arg);
}
else {
return this.host.jqxRangeSelector('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
groupLabelsFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('groupLabelsFormatFunction', arg);
}
else {
return this.host.jqxRangeSelector('groupLabelsFormatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('height', arg);
}
else {
return this.host.jqxRangeSelector('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labelsFormat(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('labelsFormat', arg);
}
else {
return this.host.jqxRangeSelector('labelsFormat');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labelsFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('labelsFormatFunction', arg);
}
else {
return this.host.jqxRangeSelector('labelsFormatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
labelsOnTicks(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('labelsOnTicks', arg);
}
else {
return this.host.jqxRangeSelector('labelsOnTicks');
}
}
/**
* @param {?=} arg
* @return {?}
*/
markersFormat(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('markersFormat', arg);
}
else {
return this.host.jqxRangeSelector('markersFormat');
}
}
/**
* @param {?=} arg
* @return {?}
*/
markersFormatFunction(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('markersFormatFunction', arg);
}
else {
return this.host.jqxRangeSelector('markersFormatFunction');
}
}
/**
* @param {?=} arg
* @return {?}
*/
majorTicksInterval(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('majorTicksInterval', arg);
}
else {
return this.host.jqxRangeSelector('majorTicksInterval');
}
}
/**
* @param {?=} arg
* @return {?}
*/
minorTicksInterval(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('minorTicksInterval', arg);
}
else {
return this.host.jqxRangeSelector('minorTicksInterval');
}
}
/**
* @param {?=} arg
* @return {?}
*/
max(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('max', arg);
}
else {
return this.host.jqxRangeSelector('max');
}
}
/**
* @param {?=} arg
* @return {?}
*/
min(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('min', arg);
}
else {
return this.host.jqxRangeSelector('min');
}
}
/**
* @param {?=} arg
* @return {?}
*/
moveOnClick(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('moveOnClick', arg);
}
else {
return this.host.jqxRangeSelector('moveOnClick');
}
}
/**
* @param {?=} arg
* @return {?}
*/
padding(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('padding', arg);
}
else {
return this.host.jqxRangeSelector('padding');
}
}
/**
* @param {?=} arg
* @return {?}
*/
range(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('range', arg);
}
else {
return this.host.jqxRangeSelector('range');
}
}
/**
* @param {?=} arg
* @return {?}
*/
resizable(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('resizable', arg);
}
else {
return this.host.jqxRangeSelector('resizable');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rtl(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('rtl', arg);
}
else {
return this.host.jqxRangeSelector('rtl');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showGroupLabels(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('showGroupLabels', arg);
}
else {
return this.host.jqxRangeSelector('showGroupLabels');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showMinorTicks(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('showMinorTicks', arg);
}
else {
return this.host.jqxRangeSelector('showMinorTicks');
}
}
/**
* @param {?=} arg
* @return {?}
*/
snapToTicks(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('snapToTicks', arg);
}
else {
return this.host.jqxRangeSelector('snapToTicks');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showMajorLabels(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('showMajorLabels', arg);
}
else {
return this.host.jqxRangeSelector('showMajorLabels');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showMarkers(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('showMarkers', arg);
}
else {
return this.host.jqxRangeSelector('showMarkers');
}
}
/**
* @param {?=} arg
* @return {?}
*/
theme(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('theme', arg);
}
else {
return this.host.jqxRangeSelector('theme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxRangeSelector('width', arg);
}
else {
return this.host.jqxRangeSelector('width');
}
}
// jqxRangeSelectorComponent functions
/**
* @return {?}
*/
destroy() {
this.host.jqxRangeSelector('destroy');
}
/**
* @return {?}
*/
getRange() {
return this.host.jqxRangeSelector('getRange');
}
/**
* @return {?}
*/
render() {
this.host.jqxRangeSelector('render');
}
/**
* @return {?}
*/
refresh() {
this.host.jqxRangeSelector('refresh');
}
/**
* @param {?} from
* @param {?} to
* @return {?}
*/
setRange(from, to) {
this.host.jqxRangeSelector('setRange', from, to);
}
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('change', (eventData) => { this.onChange.emit(eventData); });
}
} //jqxRangeSelectorComponent
jqxRangeSelectorComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxRangeSelector',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxRangeSelectorComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxRangeSelectorComponent.propDecorators = {
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrGroupLabelsFormatFunction: [{ type: Input, args: ['groupLabelsFormatFunction',] }],
attrLabelsFormat: [{ type: Input, args: ['labelsFormat',] }],
attrLabelsFormatFunction: [{ type: Input, args: ['labelsFormatFunction',] }],
attrLabelsOnTicks: [{ type: Input, args: ['labelsOnTicks',] }],
attrMarkersFormat: [{ type: Input, args: ['markersFormat',] }],
attrMarkersFormatFunction: [{ type: Input, args: ['markersFormatFunction',] }],
attrMajorTicksInterval: [{ type: Input, args: ['majorTicksInterval',] }],
attrMinorTicksInterval: [{ type: Input, args: ['minorTicksInterval',] }],
attrMax: [{ type: Input, args: ['max',] }],
attrMin: [{ type: Input, args: ['min',] }],
attrMoveOnClick: [{ type: Input, args: ['moveOnClick',] }],
attrPadding: [{ type: Input, args: ['padding',] }],
attrRange: [{ type: Input, args: ['range',] }],
attrResizable: [{ type: Input, args: ['resizable',] }],
attrRtl: [{ type: Input, args: ['rtl',] }],
attrShowGroupLabels: [{ type: Input, args: ['showGroupLabels',] }],
attrShowMinorTicks: [{ type: Input, args: ['showMinorTicks',] }],
attrSnapToTicks: [{ type: Input, args: ['snapToTicks',] }],
attrShowMajorLabels: [{ type: Input, args: ['showMajorLabels',] }],
attrShowMarkers: [{ type: Input, args: ['showMarkers',] }],
attrTheme: [{ type: Input, args: ['theme',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onChange: [{ type: Output }]
};
if (false) {
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrDisabled;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrGroupLabelsFormatFunction;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrLabelsFormat;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrLabelsFormatFunction;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrLabelsOnTicks;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMarkersFormat;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMarkersFormatFunction;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMajorTicksInterval;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMinorTicksInterval;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMax;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMin;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrMoveOnClick;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrPadding;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrRange;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrResizable;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrRtl;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrShowGroupLabels;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrShowMinorTicks;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrSnapToTicks;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrShowMajorLabels;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrShowMarkers;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrTheme;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrWidth;
/** @type {?} */
jqxRangeSelectorComponent.prototype.attrHeight;
/** @type {?} */
jqxRangeSelectorComponent.prototype.autoCreate;
/** @type {?} */
jqxRangeSelectorComponent.prototype.properties;
/** @type {?} */
jqxRangeSelectorComponent.prototype.host;
/** @type {?} */
jqxRangeSelectorComponent.prototype.elementRef;
/** @type {?} */
jqxRangeSelectorComponent.prototype.widgetObject;
/** @type {?} */
jqxRangeSelectorComponent.prototype.onChange;
/* Skipping unhandled member: ;*/
}