UNPKG

jqwidgets-scripts-custom

Version:

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

375 lines (374 loc) 10.9 kB
import * as jqxcore from '../../jqwidgets/jqxcore'; import * as jqxbuttons from '../../jqwidgets/jqxbuttons'; import * as jqxribbon from '../../jqwidgets/jqxribbon'; import * as jqxmenu from '../../jqwidgets/jqxmenu'; import * as jqxlayout from '../../jqwidgets/jqxlayout'; /** * @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 jqxLayoutComponent { /** * @param {?} containerElement */ constructor(containerElement) { this.autoCreate = true; this.properties = ['contextMenu', 'height', 'layout', 'minGroupHeight', 'minGroupWidth', 'resizable', 'rtl', 'theme', 'width']; // jqxLayoutComponent events this.onPin = new EventEmitter(); this.onResize = new EventEmitter(); this.onUnpin = 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.jqxLayout(this.properties[i])); } if (areEqual) { return false; } this.host.jqxLayout(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxLayout(this.properties[i])) { this.host.jqxLayout(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, 'jqxLayout', 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.jqxLayout('setOptions', options); } // jqxLayoutComponent properties /** * @param {?=} arg * @return {?} */ contextMenu(arg) { if (arg !== undefined) { this.host.jqxLayout('contextMenu', arg); } else { return this.host.jqxLayout('contextMenu'); } } /** * @param {?=} arg * @return {?} */ height(arg) { if (arg !== undefined) { this.host.jqxLayout('height', arg); } else { return this.host.jqxLayout('height'); } } /** * @param {?=} arg * @return {?} */ layout(arg) { if (arg !== undefined) { this.host.jqxLayout('layout', arg); } else { return this.host.jqxLayout('layout'); } } /** * @param {?=} arg * @return {?} */ minGroupHeight(arg) { if (arg !== undefined) { this.host.jqxLayout('minGroupHeight', arg); } else { return this.host.jqxLayout('minGroupHeight'); } } /** * @param {?=} arg * @return {?} */ minGroupWidth(arg) { if (arg !== undefined) { this.host.jqxLayout('minGroupWidth', arg); } else { return this.host.jqxLayout('minGroupWidth'); } } /** * @param {?=} arg * @return {?} */ resizable(arg) { if (arg !== undefined) { this.host.jqxLayout('resizable', arg); } else { return this.host.jqxLayout('resizable'); } } /** * @param {?=} arg * @return {?} */ rtl(arg) { if (arg !== undefined) { this.host.jqxLayout('rtl', arg); } else { return this.host.jqxLayout('rtl'); } } /** * @param {?=} arg * @return {?} */ theme(arg) { if (arg !== undefined) { this.host.jqxLayout('theme', arg); } else { return this.host.jqxLayout('theme'); } } /** * @param {?=} arg * @return {?} */ width(arg) { if (arg !== undefined) { this.host.jqxLayout('width', arg); } else { return this.host.jqxLayout('width'); } } // jqxLayoutComponent functions /** * @return {?} */ destroy() { this.host.jqxLayout('destroy'); } /** * @param {?} Layout * @return {?} */ loadLayout(Layout) { this.host.jqxLayout('loadLayout', Layout); } /** * @return {?} */ refresh() { this.host.jqxLayout('refresh'); } /** * @return {?} */ render() { this.host.jqxLayout('render'); } /** * @return {?} */ saveLayout() { return this.host.jqxLayout('saveLayout'); } /** * @return {?} */ __wireEvents__() { this.host.on('pin', (eventData) => { this.onPin.emit(eventData); }); this.host.on('resize', (eventData) => { this.onResize.emit(eventData); }); this.host.on('unpin', (eventData) => { this.onUnpin.emit(eventData); }); } } //jqxLayoutComponent jqxLayoutComponent.decorators = [ { type: Component, args: [{ selector: 'jqxLayout', template: '<div><ng-content></ng-content></div>' }] } ]; /** @nocollapse */ jqxLayoutComponent.ctorParameters = () => [ { type: ElementRef } ]; jqxLayoutComponent.propDecorators = { attrContextMenu: [{ type: Input, args: ['contextMenu',] }], attrLayout: [{ type: Input, args: ['layout',] }], attrMinGroupHeight: [{ type: Input, args: ['minGroupHeight',] }], attrMinGroupWidth: [{ type: Input, args: ['minGroupWidth',] }], attrResizable: [{ type: Input, args: ['resizable',] }], attrRtl: [{ type: Input, args: ['rtl',] }], attrTheme: [{ type: Input, args: ['theme',] }], attrWidth: [{ type: Input, args: ['width',] }], attrHeight: [{ type: Input, args: ['height',] }], autoCreate: [{ type: Input, args: ['auto-create',] }], onPin: [{ type: Output }], onResize: [{ type: Output }], onUnpin: [{ type: Output }] }; if (false) { /** @type {?} */ jqxLayoutComponent.prototype.attrContextMenu; /** @type {?} */ jqxLayoutComponent.prototype.attrLayout; /** @type {?} */ jqxLayoutComponent.prototype.attrMinGroupHeight; /** @type {?} */ jqxLayoutComponent.prototype.attrMinGroupWidth; /** @type {?} */ jqxLayoutComponent.prototype.attrResizable; /** @type {?} */ jqxLayoutComponent.prototype.attrRtl; /** @type {?} */ jqxLayoutComponent.prototype.attrTheme; /** @type {?} */ jqxLayoutComponent.prototype.attrWidth; /** @type {?} */ jqxLayoutComponent.prototype.attrHeight; /** @type {?} */ jqxLayoutComponent.prototype.autoCreate; /** @type {?} */ jqxLayoutComponent.prototype.properties; /** @type {?} */ jqxLayoutComponent.prototype.host; /** @type {?} */ jqxLayoutComponent.prototype.elementRef; /** @type {?} */ jqxLayoutComponent.prototype.widgetObject; /** @type {?} */ jqxLayoutComponent.prototype.onPin; /** @type {?} */ jqxLayoutComponent.prototype.onResize; /** @type {?} */ jqxLayoutComponent.prototype.onUnpin; /* Skipping unhandled member: ;*/ }