UNPKG

jqwidgets-scripts-custom

Version:

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

448 lines (447 loc) 13.8 kB
import * as jqxcore from '../../jqwidgets/jqxcore'; import * as jqxresponsivepanel from '../../jqwidgets/jqxresponsivepanel'; /** * @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 jqxResponsivePanelComponent { /** * @param {?} containerElement */ constructor(containerElement) { this.autoCreate = true; this.properties = ['animationDirection', 'animationHideDelay', 'animationShowDelay', 'animationType', 'autoClose', 'collapseBreakpoint', 'collapseWidth', 'height', 'initContent', 'theme', 'toggleButton', 'toggleButtonSize', 'width']; // jqxResponsivePanelComponent events this.onClose = new EventEmitter(); this.onCollapse = new EventEmitter(); this.onExpand = 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.jqxResponsivePanel(this.properties[i])); } if (areEqual) { return false; } this.host.jqxResponsivePanel(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxResponsivePanel(this.properties[i])) { this.host.jqxResponsivePanel(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, 'jqxResponsivePanel', 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.jqxResponsivePanel('setOptions', options); } // jqxResponsivePanelComponent properties /** * @param {?=} arg * @return {?} */ animationDirection(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('animationDirection', arg); } else { return this.host.jqxResponsivePanel('animationDirection'); } } /** * @param {?=} arg * @return {?} */ animationHideDelay(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('animationHideDelay', arg); } else { return this.host.jqxResponsivePanel('animationHideDelay'); } } /** * @param {?=} arg * @return {?} */ animationShowDelay(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('animationShowDelay', arg); } else { return this.host.jqxResponsivePanel('animationShowDelay'); } } /** * @param {?=} arg * @return {?} */ animationType(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('animationType', arg); } else { return this.host.jqxResponsivePanel('animationType'); } } /** * @param {?=} arg * @return {?} */ autoClose(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('autoClose', arg); } else { return this.host.jqxResponsivePanel('autoClose'); } } /** * @param {?=} arg * @return {?} */ collapseBreakpoint(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('collapseBreakpoint', arg); } else { return this.host.jqxResponsivePanel('collapseBreakpoint'); } } /** * @param {?=} arg * @return {?} */ collapseWidth(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('collapseWidth', arg); } else { return this.host.jqxResponsivePanel('collapseWidth'); } } /** * @param {?=} arg * @return {?} */ height(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('height', arg); } else { return this.host.jqxResponsivePanel('height'); } } /** * @param {?=} arg * @return {?} */ initContent(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('initContent', arg); } else { return this.host.jqxResponsivePanel('initContent'); } } /** * @param {?=} arg * @return {?} */ theme(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('theme', arg); } else { return this.host.jqxResponsivePanel('theme'); } } /** * @param {?=} arg * @return {?} */ toggleButton(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('toggleButton', arg); } else { return this.host.jqxResponsivePanel('toggleButton'); } } /** * @param {?=} arg * @return {?} */ toggleButtonSize(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('toggleButtonSize', arg); } else { return this.host.jqxResponsivePanel('toggleButtonSize'); } } /** * @param {?=} arg * @return {?} */ width(arg) { if (arg !== undefined) { this.host.jqxResponsivePanel('width', arg); } else { return this.host.jqxResponsivePanel('width'); } } // jqxResponsivePanelComponent functions /** * @return {?} */ close() { this.host.jqxResponsivePanel('close'); } /** * @return {?} */ destroy() { this.host.jqxResponsivePanel('destroy'); } /** * @return {?} */ isCollapsed() { return this.host.jqxResponsivePanel('isCollapsed'); } /** * @return {?} */ isOpened() { return this.host.jqxResponsivePanel('isOpened'); } /** * @return {?} */ open() { this.host.jqxResponsivePanel('open'); } /** * @return {?} */ refresh() { this.host.jqxResponsivePanel('refresh'); } /** * @return {?} */ render() { this.host.jqxResponsivePanel('render'); } /** * @return {?} */ __wireEvents__() { this.host.on('close', (eventData) => { this.onClose.emit(eventData); }); this.host.on('collapse', (eventData) => { this.onCollapse.emit(eventData); }); this.host.on('expand', (eventData) => { this.onExpand.emit(eventData); }); this.host.on('open', (eventData) => { this.onOpen.emit(eventData); }); } } //jqxResponsivePanelComponent jqxResponsivePanelComponent.decorators = [ { type: Component, args: [{ selector: 'jqxResponsivePanel', template: '<div><ng-content></ng-content></div>' }] } ]; /** @nocollapse */ jqxResponsivePanelComponent.ctorParameters = () => [ { type: ElementRef } ]; jqxResponsivePanelComponent.propDecorators = { attrAnimationDirection: [{ type: Input, args: ['animationDirection',] }], attrAnimationHideDelay: [{ type: Input, args: ['animationHideDelay',] }], attrAnimationShowDelay: [{ type: Input, args: ['animationShowDelay',] }], attrAnimationType: [{ type: Input, args: ['animationType',] }], attrAutoClose: [{ type: Input, args: ['autoClose',] }], attrCollapseBreakpoint: [{ type: Input, args: ['collapseBreakpoint',] }], attrCollapseWidth: [{ type: Input, args: ['collapseWidth',] }], attrInitContent: [{ type: Input, args: ['initContent',] }], attrTheme: [{ type: Input, args: ['theme',] }], attrToggleButton: [{ type: Input, args: ['toggleButton',] }], attrToggleButtonSize: [{ type: Input, args: ['toggleButtonSize',] }], attrWidth: [{ type: Input, args: ['width',] }], attrHeight: [{ type: Input, args: ['height',] }], autoCreate: [{ type: Input, args: ['auto-create',] }], onClose: [{ type: Output }], onCollapse: [{ type: Output }], onExpand: [{ type: Output }], onOpen: [{ type: Output }] }; if (false) { /** @type {?} */ jqxResponsivePanelComponent.prototype.attrAnimationDirection; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrAnimationHideDelay; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrAnimationShowDelay; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrAnimationType; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrAutoClose; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrCollapseBreakpoint; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrCollapseWidth; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrInitContent; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrTheme; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrToggleButton; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrToggleButtonSize; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrWidth; /** @type {?} */ jqxResponsivePanelComponent.prototype.attrHeight; /** @type {?} */ jqxResponsivePanelComponent.prototype.autoCreate; /** @type {?} */ jqxResponsivePanelComponent.prototype.properties; /** @type {?} */ jqxResponsivePanelComponent.prototype.host; /** @type {?} */ jqxResponsivePanelComponent.prototype.elementRef; /** @type {?} */ jqxResponsivePanelComponent.prototype.widgetObject; /** @type {?} */ jqxResponsivePanelComponent.prototype.onClose; /** @type {?} */ jqxResponsivePanelComponent.prototype.onCollapse; /** @type {?} */ jqxResponsivePanelComponent.prototype.onExpand; /** @type {?} */ jqxResponsivePanelComponent.prototype.onOpen; /* Skipping unhandled member: ;*/ }