jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
481 lines (480 loc) • 14.2 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxdata from '../../jqwidgets/jqxdata';
import * as jqxtreemap from '../../jqwidgets/jqxtreemap';
import * as jqxtooltip from '../../jqwidgets/jqxtooltip';
/**
* @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 jqxTreeMapComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['baseColor', 'colorRanges', 'colorRange', 'colorMode', 'displayMember', 'height', 'hoverEnabled', 'headerHeight', 'legendLabel', 'legendPosition', 'legendScaleCallback', 'renderCallbacks', 'selectionEnabled', 'showLegend', 'source', 'theme', 'valueMember', 'width'];
// jqxTreeMapComponent events
this.onBindingComplete = 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.jqxTreeMap(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxTreeMap(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxTreeMap(this.properties[i])) {
this.host.jqxTreeMap(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.host[0].style.marginLeft = '1px';
this.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxTreeMap', 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.jqxTreeMap('setOptions', options);
}
// jqxTreeMapComponent properties
/**
* @param {?=} arg
* @return {?}
*/
baseColor(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('baseColor', arg);
}
else {
return this.host.jqxTreeMap('baseColor');
}
}
/**
* @param {?=} arg
* @return {?}
*/
colorRanges(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('colorRanges', arg);
}
else {
return this.host.jqxTreeMap('colorRanges');
}
}
/**
* @param {?=} arg
* @return {?}
*/
colorRange(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('colorRange', arg);
}
else {
return this.host.jqxTreeMap('colorRange');
}
}
/**
* @param {?=} arg
* @return {?}
*/
colorMode(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('colorMode', arg);
}
else {
return this.host.jqxTreeMap('colorMode');
}
}
/**
* @param {?=} arg
* @return {?}
*/
displayMember(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('displayMember', arg);
}
else {
return this.host.jqxTreeMap('displayMember');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('height', arg);
}
else {
return this.host.jqxTreeMap('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
hoverEnabled(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('hoverEnabled', arg);
}
else {
return this.host.jqxTreeMap('hoverEnabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
headerHeight(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('headerHeight', arg);
}
else {
return this.host.jqxTreeMap('headerHeight');
}
}
/**
* @param {?=} arg
* @return {?}
*/
legendLabel(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('legendLabel', arg);
}
else {
return this.host.jqxTreeMap('legendLabel');
}
}
/**
* @param {?=} arg
* @return {?}
*/
legendPosition(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('legendPosition', arg);
}
else {
return this.host.jqxTreeMap('legendPosition');
}
}
/**
* @param {?=} arg
* @return {?}
*/
legendScaleCallback(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('legendScaleCallback', arg);
}
else {
return this.host.jqxTreeMap('legendScaleCallback');
}
}
/**
* @param {?=} arg
* @return {?}
*/
renderCallbacks(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('renderCallbacks', arg);
}
else {
return this.host.jqxTreeMap('renderCallbacks');
}
}
/**
* @param {?=} arg
* @return {?}
*/
selectionEnabled(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('selectionEnabled', arg);
}
else {
return this.host.jqxTreeMap('selectionEnabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
showLegend(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('showLegend', arg);
}
else {
return this.host.jqxTreeMap('showLegend');
}
}
/**
* @param {?=} arg
* @return {?}
*/
source(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('source', arg);
}
else {
return this.host.jqxTreeMap('source');
}
}
/**
* @param {?=} arg
* @return {?}
*/
theme(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('theme', arg);
}
else {
return this.host.jqxTreeMap('theme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
valueMember(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('valueMember', arg);
}
else {
return this.host.jqxTreeMap('valueMember');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxTreeMap('width', arg);
}
else {
return this.host.jqxTreeMap('width');
}
}
// jqxTreeMapComponent functions
/**
* @return {?}
*/
destroy() {
this.host.jqxTreeMap('destroy');
}
/**
* @return {?}
*/
render() {
this.host.jqxTreeMap('render');
}
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('bindingComplete', (eventData) => { this.onBindingComplete.emit(eventData); });
}
} //jqxTreeMapComponent
jqxTreeMapComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxTreeMap',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxTreeMapComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxTreeMapComponent.propDecorators = {
attrBaseColor: [{ type: Input, args: ['baseColor',] }],
attrColorRanges: [{ type: Input, args: ['colorRanges',] }],
attrColorRange: [{ type: Input, args: ['colorRange',] }],
attrColorMode: [{ type: Input, args: ['colorMode',] }],
attrDisplayMember: [{ type: Input, args: ['displayMember',] }],
attrHoverEnabled: [{ type: Input, args: ['hoverEnabled',] }],
attrHeaderHeight: [{ type: Input, args: ['headerHeight',] }],
attrLegendLabel: [{ type: Input, args: ['legendLabel',] }],
attrLegendPosition: [{ type: Input, args: ['legendPosition',] }],
attrLegendScaleCallback: [{ type: Input, args: ['legendScaleCallback',] }],
attrRenderCallbacks: [{ type: Input, args: ['renderCallbacks',] }],
attrSelectionEnabled: [{ type: Input, args: ['selectionEnabled',] }],
attrShowLegend: [{ type: Input, args: ['showLegend',] }],
attrSource: [{ type: Input, args: ['source',] }],
attrTheme: [{ type: Input, args: ['theme',] }],
attrValueMember: [{ type: Input, args: ['valueMember',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onBindingComplete: [{ type: Output }]
};
if (false) {
/** @type {?} */
jqxTreeMapComponent.prototype.attrBaseColor;
/** @type {?} */
jqxTreeMapComponent.prototype.attrColorRanges;
/** @type {?} */
jqxTreeMapComponent.prototype.attrColorRange;
/** @type {?} */
jqxTreeMapComponent.prototype.attrColorMode;
/** @type {?} */
jqxTreeMapComponent.prototype.attrDisplayMember;
/** @type {?} */
jqxTreeMapComponent.prototype.attrHoverEnabled;
/** @type {?} */
jqxTreeMapComponent.prototype.attrHeaderHeight;
/** @type {?} */
jqxTreeMapComponent.prototype.attrLegendLabel;
/** @type {?} */
jqxTreeMapComponent.prototype.attrLegendPosition;
/** @type {?} */
jqxTreeMapComponent.prototype.attrLegendScaleCallback;
/** @type {?} */
jqxTreeMapComponent.prototype.attrRenderCallbacks;
/** @type {?} */
jqxTreeMapComponent.prototype.attrSelectionEnabled;
/** @type {?} */
jqxTreeMapComponent.prototype.attrShowLegend;
/** @type {?} */
jqxTreeMapComponent.prototype.attrSource;
/** @type {?} */
jqxTreeMapComponent.prototype.attrTheme;
/** @type {?} */
jqxTreeMapComponent.prototype.attrValueMember;
/** @type {?} */
jqxTreeMapComponent.prototype.attrWidth;
/** @type {?} */
jqxTreeMapComponent.prototype.attrHeight;
/** @type {?} */
jqxTreeMapComponent.prototype.autoCreate;
/** @type {?} */
jqxTreeMapComponent.prototype.properties;
/** @type {?} */
jqxTreeMapComponent.prototype.host;
/** @type {?} */
jqxTreeMapComponent.prototype.elementRef;
/** @type {?} */
jqxTreeMapComponent.prototype.widgetObject;
/** @type {?} */
jqxTreeMapComponent.prototype.onBindingComplete;
/* Skipping unhandled member: ;*/
}