jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
500 lines (499 loc) • 15.1 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxbuttons from '../../jqwidgets/jqxbuttons';
import * as jqxdropdownbutton from '../../jqwidgets/jqxdropdownbutton';
/**
* @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 jqxDropDownButtonComponent {
/**
* @param {?} containerElement
*/
constructor(containerElement) {
this.autoCreate = true;
this.properties = ['animationType', 'arrowSize', 'autoOpen', 'closeDelay', 'disabled', 'dropDownHorizontalAlignment', 'dropDownVerticalAlignment', 'dropDownWidth', 'enableBrowserBoundsDetection', 'height', 'initContent', 'openDelay', 'popupZIndex', 'rtl', 'template', 'theme', 'width'];
// jqxDropDownButtonComponent events
this.onClose = new EventEmitter();
this.onOpen = 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.jqxDropDownButton(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxDropDownButton(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxDropDownButton(this.properties[i])) {
this.host.jqxDropDownButton(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, 'jqxDropDownButton', 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.jqxDropDownButton('setOptions', options);
}
// jqxDropDownButtonComponent properties
/**
* @param {?=} arg
* @return {?}
*/
animationType(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('animationType', arg);
}
else {
return this.host.jqxDropDownButton('animationType');
}
}
/**
* @param {?=} arg
* @return {?}
*/
arrowSize(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('arrowSize', arg);
}
else {
return this.host.jqxDropDownButton('arrowSize');
}
}
/**
* @param {?=} arg
* @return {?}
*/
autoOpen(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('autoOpen', arg);
}
else {
return this.host.jqxDropDownButton('autoOpen');
}
}
/**
* @param {?=} arg
* @return {?}
*/
closeDelay(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('closeDelay', arg);
}
else {
return this.host.jqxDropDownButton('closeDelay');
}
}
/**
* @param {?=} arg
* @return {?}
*/
disabled(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('disabled', arg);
}
else {
return this.host.jqxDropDownButton('disabled');
}
}
/**
* @param {?=} arg
* @return {?}
*/
dropDownHorizontalAlignment(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('dropDownHorizontalAlignment', arg);
}
else {
return this.host.jqxDropDownButton('dropDownHorizontalAlignment');
}
}
/**
* @param {?=} arg
* @return {?}
*/
dropDownVerticalAlignment(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('dropDownVerticalAlignment', arg);
}
else {
return this.host.jqxDropDownButton('dropDownVerticalAlignment');
}
}
/**
* @param {?=} arg
* @return {?}
*/
dropDownWidth(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('dropDownWidth', arg);
}
else {
return this.host.jqxDropDownButton('dropDownWidth');
}
}
/**
* @param {?=} arg
* @return {?}
*/
enableBrowserBoundsDetection(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('enableBrowserBoundsDetection', arg);
}
else {
return this.host.jqxDropDownButton('enableBrowserBoundsDetection');
}
}
/**
* @param {?=} arg
* @return {?}
*/
height(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('height', arg);
}
else {
return this.host.jqxDropDownButton('height');
}
}
/**
* @param {?=} arg
* @return {?}
*/
initContent(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('initContent', arg);
}
else {
return this.host.jqxDropDownButton('initContent');
}
}
/**
* @param {?=} arg
* @return {?}
*/
openDelay(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('openDelay', arg);
}
else {
return this.host.jqxDropDownButton('openDelay');
}
}
/**
* @param {?=} arg
* @return {?}
*/
popupZIndex(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('popupZIndex', arg);
}
else {
return this.host.jqxDropDownButton('popupZIndex');
}
}
/**
* @param {?=} arg
* @return {?}
*/
rtl(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('rtl', arg);
}
else {
return this.host.jqxDropDownButton('rtl');
}
}
/**
* @param {?=} arg
* @return {?}
*/
template(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('template', arg);
}
else {
return this.host.jqxDropDownButton('template');
}
}
/**
* @param {?=} arg
* @return {?}
*/
theme(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('theme', arg);
}
else {
return this.host.jqxDropDownButton('theme');
}
}
/**
* @param {?=} arg
* @return {?}
*/
width(arg) {
if (arg !== undefined) {
this.host.jqxDropDownButton('width', arg);
}
else {
return this.host.jqxDropDownButton('width');
}
}
// jqxDropDownButtonComponent functions
/**
* @return {?}
*/
close() {
this.host.jqxDropDownButton('close');
}
/**
* @return {?}
*/
destroy() {
this.host.jqxDropDownButton('destroy');
}
/**
* @return {?}
*/
focus() {
this.host.jqxDropDownButton('focus');
}
/**
* @return {?}
*/
getContent() {
return this.host.jqxDropDownButton('getContent');
}
/**
* @return {?}
*/
isOpened() {
return this.host.jqxDropDownButton('isOpened');
}
/**
* @return {?}
*/
open() {
this.host.jqxDropDownButton('open');
}
/**
* @param {?} content
* @return {?}
*/
setContent(content) {
this.host.jqxDropDownButton('setContent', content);
}
/**
* @return {?}
*/
__wireEvents__() {
this.host.on('close', (eventData) => { this.onClose.emit(eventData); });
this.host.on('open', (eventData) => { this.onOpen.emit(eventData); });
}
} //jqxDropDownButtonComponent
jqxDropDownButtonComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxDropDownButton',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxDropDownButtonComponent.ctorParameters = () => [
{ type: ElementRef }
];
jqxDropDownButtonComponent.propDecorators = {
attrAnimationType: [{ type: Input, args: ['animationType',] }],
attrArrowSize: [{ type: Input, args: ['arrowSize',] }],
attrAutoOpen: [{ type: Input, args: ['autoOpen',] }],
attrCloseDelay: [{ type: Input, args: ['closeDelay',] }],
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrDropDownHorizontalAlignment: [{ type: Input, args: ['dropDownHorizontalAlignment',] }],
attrDropDownVerticalAlignment: [{ type: Input, args: ['dropDownVerticalAlignment',] }],
attrDropDownWidth: [{ type: Input, args: ['dropDownWidth',] }],
attrEnableBrowserBoundsDetection: [{ type: Input, args: ['enableBrowserBoundsDetection',] }],
attrInitContent: [{ type: Input, args: ['initContent',] }],
attrOpenDelay: [{ type: Input, args: ['openDelay',] }],
attrPopupZIndex: [{ type: Input, args: ['popupZIndex',] }],
attrRtl: [{ type: Input, args: ['rtl',] }],
attrTemplate: [{ type: Input, args: ['template',] }],
attrTheme: [{ type: Input, args: ['theme',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onClose: [{ type: Output }],
onOpen: [{ type: Output }]
};
if (false) {
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrAnimationType;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrArrowSize;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrAutoOpen;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrCloseDelay;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrDisabled;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrDropDownHorizontalAlignment;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrDropDownVerticalAlignment;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrDropDownWidth;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrEnableBrowserBoundsDetection;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrInitContent;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrOpenDelay;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrPopupZIndex;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrRtl;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrTemplate;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrTheme;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrWidth;
/** @type {?} */
jqxDropDownButtonComponent.prototype.attrHeight;
/** @type {?} */
jqxDropDownButtonComponent.prototype.autoCreate;
/** @type {?} */
jqxDropDownButtonComponent.prototype.properties;
/** @type {?} */
jqxDropDownButtonComponent.prototype.host;
/** @type {?} */
jqxDropDownButtonComponent.prototype.elementRef;
/** @type {?} */
jqxDropDownButtonComponent.prototype.widgetObject;
/** @type {?} */
jqxDropDownButtonComponent.prototype.onClose;
/** @type {?} */
jqxDropDownButtonComponent.prototype.onOpen;
/* Skipping unhandled member: ;*/
}