jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
437 lines (436 loc) • 12.6 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxnavbar from '../../jqwidgets/jqxnavbar';
/**
* @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 jqxNavBarComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['columns', 'disabled', 'height', 'minimized', 'minimizeButtonPosition', 'minimizedHeight', 'minimizedTitle', 'orientation', 'popupAnimationDelay', 'rtl', 'selection', 'selectedItem', 'theme', 'width'];
// jqxNavBarComponent 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.jqxNavBar(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxNavBar(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxNavBar(this.properties[i])) {
this.host.jqxNavBar(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, 'jqxNavBar', 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.jqxNavBar('setOptions', options);
}
// jqxNavBarComponent properties
/**
* @param {?=} arg
* @return {?}
*/
columns(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('columns', arg);
}
else {
return this.host.jqxNavBar('columns');
}
}
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('disabled', arg);
}
else {
return this.host.jqxNavBar('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('height', arg);
}
else {
return this.host.jqxNavBar('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
minimized(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('minimized', arg);
}
else {
return this.host.jqxNavBar('minimized');
}
}
/**
* @param {?=} arg
* @return {?}
*/
minimizeButtonPosition(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('minimizeButtonPosition', arg);
}
else {
return this.host.jqxNavBar('minimizeButtonPosition');
}
}
/**
* @param {?=} arg
* @return {?}
*/
minimizedHeight(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('minimizedHeight', arg);
}
else {
return this.host.jqxNavBar('minimizedHeight');
}
}
/**
* @param {?=} arg
* @return {?}
*/
minimizedTitle(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('minimizedTitle', arg);
}
else {
return this.host.jqxNavBar('minimizedTitle');
}
}
/**
* @param {?=} arg
* @return {?}
*/
orientation(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('orientation', arg);
}
else {
return this.host.jqxNavBar('orientation');
}
}
/**
* @param {?=} arg
* @return {?}
*/
popupAnimationDelay(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('popupAnimationDelay', arg);
}
else {
return this.host.jqxNavBar('popupAnimationDelay');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rtl(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('rtl', arg);
}
else {
return this.host.jqxNavBar('rtl');
}
}
/**
* @param {?=} arg
* @return {?}
*/
selection(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('selection', arg);
}
else {
return this.host.jqxNavBar('selection');
}
}
/**
* @param {?=} arg
* @return {?}
*/
selectedItem(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('selectedItem', arg);
}
else {
return this.host.jqxNavBar('selectedItem');
}
}
/**
* @param {?=} arg
* @return {?}
*/
theme(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('theme', arg);
}
else {
return this.host.jqxNavBar('theme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxNavBar('width', arg);
}
else {
return this.host.jqxNavBar('width');
}
}
// jqxNavBarComponent functions
/**
* @return {?}
*/
close() {
this.host.jqxNavBar('close');
}
/**
* @return {?}
*/
destroy() {
this.host.jqxNavBar('destroy');
}
/**
* @return {?}
*/
getSelectedIndex() {
return this.host.jqxNavBar('getSelectedIndex');
}
/**
* @return {?}
*/
open() {
this.host.jqxNavBar('open');
}
/**
* @param {?} index
* @return {?}
*/
selectAt(index) {
this.host.jqxNavBar('selectAt', index);
}
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('change', (eventData) => { this.onChange.emit(eventData); });
}
} //jqxNavBarComponent
jqxNavBarComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxNavBar',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxNavBarComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxNavBarComponent.propDecorators = {
attrColumns: [{ type: Input, args: ['columns',] }],
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrMinimized: [{ type: Input, args: ['minimized',] }],
attrMinimizeButtonPosition: [{ type: Input, args: ['minimizeButtonPosition',] }],
attrMinimizedHeight: [{ type: Input, args: ['minimizedHeight',] }],
attrMinimizedTitle: [{ type: Input, args: ['minimizedTitle',] }],
attrOrientation: [{ type: Input, args: ['orientation',] }],
attrPopupAnimationDelay: [{ type: Input, args: ['popupAnimationDelay',] }],
attrRtl: [{ type: Input, args: ['rtl',] }],
attrSelection: [{ type: Input, args: ['selection',] }],
attrSelectedItem: [{ type: Input, args: ['selectedItem',] }],
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 {?} */
jqxNavBarComponent.prototype.attrColumns;
/** @type {?} */
jqxNavBarComponent.prototype.attrDisabled;
/** @type {?} */
jqxNavBarComponent.prototype.attrMinimized;
/** @type {?} */
jqxNavBarComponent.prototype.attrMinimizeButtonPosition;
/** @type {?} */
jqxNavBarComponent.prototype.attrMinimizedHeight;
/** @type {?} */
jqxNavBarComponent.prototype.attrMinimizedTitle;
/** @type {?} */
jqxNavBarComponent.prototype.attrOrientation;
/** @type {?} */
jqxNavBarComponent.prototype.attrPopupAnimationDelay;
/** @type {?} */
jqxNavBarComponent.prototype.attrRtl;
/** @type {?} */
jqxNavBarComponent.prototype.attrSelection;
/** @type {?} */
jqxNavBarComponent.prototype.attrSelectedItem;
/** @type {?} */
jqxNavBarComponent.prototype.attrTheme;
/** @type {?} */
jqxNavBarComponent.prototype.attrWidth;
/** @type {?} */
jqxNavBarComponent.prototype.attrHeight;
/** @type {?} */
jqxNavBarComponent.prototype.autoCreate;
/** @type {?} */
jqxNavBarComponent.prototype.properties;
/** @type {?} */
jqxNavBarComponent.prototype.host;
/** @type {?} */
jqxNavBarComponent.prototype.elementRef;
/** @type {?} */
jqxNavBarComponent.prototype.widgetObject;
/** @type {?} */
jqxNavBarComponent.prototype.onChange;
/* Skipping unhandled member: ;*/
}