UNPKG

jqwidgets-scripts-custom

Version:

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

558 lines (557 loc) 16.6 kB
import * as jqxcore from '../../jqwidgets/jqxcore'; import * as jqxbuttons from '../../jqwidgets/jqxbuttons'; import * as jqxnotification from '../../jqwidgets/jqxnotification'; /** * @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 jqxNotificationComponent { /** * @param {?} containerElement */ constructor(containerElement) { this.autoCreate = true; this.properties = ['appendContainer', 'autoOpen', 'animationOpenDelay', 'animationCloseDelay', 'autoClose', 'autoCloseDelay', 'blink', 'browserBoundsOffset', 'closeOnClick', 'disabled', 'height', 'hoverOpacity', 'icon', 'notificationOffset', 'opacity', 'position', 'rtl', 'showCloseButton', 'template', 'theme', 'width']; // jqxNotificationComponent events this.onClose = new EventEmitter(); this.onClick = 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.jqxNotification(this.properties[i])); } if (areEqual) { return false; } this.host.jqxNotification(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxNotification(this.properties[i])) { this.host.jqxNotification(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, 'jqxNotification', 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.jqxNotification('setOptions', options); } // jqxNotificationComponent properties /** * @param {?=} arg * @return {?} */ appendContainer(arg) { if (arg !== undefined) { this.host.jqxNotification('appendContainer', arg); } else { return this.host.jqxNotification('appendContainer'); } } /** * @param {?=} arg * @return {?} */ autoOpen(arg) { if (arg !== undefined) { this.host.jqxNotification('autoOpen', arg); } else { return this.host.jqxNotification('autoOpen'); } } /** * @param {?=} arg * @return {?} */ animationOpenDelay(arg) { if (arg !== undefined) { this.host.jqxNotification('animationOpenDelay', arg); } else { return this.host.jqxNotification('animationOpenDelay'); } } /** * @param {?=} arg * @return {?} */ animationCloseDelay(arg) { if (arg !== undefined) { this.host.jqxNotification('animationCloseDelay', arg); } else { return this.host.jqxNotification('animationCloseDelay'); } } /** * @param {?=} arg * @return {?} */ autoClose(arg) { if (arg !== undefined) { this.host.jqxNotification('autoClose', arg); } else { return this.host.jqxNotification('autoClose'); } } /** * @param {?=} arg * @return {?} */ autoCloseDelay(arg) { if (arg !== undefined) { this.host.jqxNotification('autoCloseDelay', arg); } else { return this.host.jqxNotification('autoCloseDelay'); } } /** * @param {?=} arg * @return {?} */ blink(arg) { if (arg !== undefined) { this.host.jqxNotification('blink', arg); } else { return this.host.jqxNotification('blink'); } } /** * @param {?=} arg * @return {?} */ browserBoundsOffset(arg) { if (arg !== undefined) { this.host.jqxNotification('browserBoundsOffset', arg); } else { return this.host.jqxNotification('browserBoundsOffset'); } } /** * @param {?=} arg * @return {?} */ closeOnClick(arg) { if (arg !== undefined) { this.host.jqxNotification('closeOnClick', arg); } else { return this.host.jqxNotification('closeOnClick'); } } /** * @param {?=} arg * @return {?} */ disabled(arg) { if (arg !== undefined) { this.host.jqxNotification('disabled', arg); } else { return this.host.jqxNotification('disabled'); } } /** * @param {?=} arg * @return {?} */ height(arg) { if (arg !== undefined) { this.host.jqxNotification('height', arg); } else { return this.host.jqxNotification('height'); } } /** * @param {?=} arg * @return {?} */ hoverOpacity(arg) { if (arg !== undefined) { this.host.jqxNotification('hoverOpacity', arg); } else { return this.host.jqxNotification('hoverOpacity'); } } /** * @param {?=} arg * @return {?} */ icon(arg) { if (arg !== undefined) { this.host.jqxNotification('icon', arg); } else { return this.host.jqxNotification('icon'); } } /** * @param {?=} arg * @return {?} */ notificationOffset(arg) { if (arg !== undefined) { this.host.jqxNotification('notificationOffset', arg); } else { return this.host.jqxNotification('notificationOffset'); } } /** * @param {?=} arg * @return {?} */ opacity(arg) { if (arg !== undefined) { this.host.jqxNotification('opacity', arg); } else { return this.host.jqxNotification('opacity'); } } /** * @param {?=} arg * @return {?} */ position(arg) { if (arg !== undefined) { this.host.jqxNotification('position', arg); } else { return this.host.jqxNotification('position'); } } /** * @param {?=} arg * @return {?} */ rtl(arg) { if (arg !== undefined) { this.host.jqxNotification('rtl', arg); } else { return this.host.jqxNotification('rtl'); } } /** * @param {?=} arg * @return {?} */ showCloseButton(arg) { if (arg !== undefined) { this.host.jqxNotification('showCloseButton', arg); } else { return this.host.jqxNotification('showCloseButton'); } } /** * @param {?=} arg * @return {?} */ template(arg) { if (arg !== undefined) { this.host.jqxNotification('template', arg); } else { return this.host.jqxNotification('template'); } } /** * @param {?=} arg * @return {?} */ theme(arg) { if (arg !== undefined) { this.host.jqxNotification('theme', arg); } else { return this.host.jqxNotification('theme'); } } /** * @param {?=} arg * @return {?} */ width(arg) { if (arg !== undefined) { this.host.jqxNotification('width', arg); } else { return this.host.jqxNotification('width'); } } // jqxNotificationComponent functions /** * @return {?} */ closeAll() { this.host.jqxNotification('closeAll'); } /** * @return {?} */ closeLast() { this.host.jqxNotification('closeLast'); } /** * @return {?} */ destroy() { this.host.jqxNotification('destroy'); } /** * @return {?} */ open() { this.host.jqxNotification('open'); } /** * @return {?} */ refresh() { this.host.jqxNotification('refresh'); } /** * @return {?} */ render() { this.host.jqxNotification('render'); } /** * @return {?} */ __wireEvents__() { this.host.on('close', (eventData) => { this.onClose.emit(eventData); }); this.host.on('click', (eventData) => { this.onClick.emit(eventData); }); this.host.on('open', (eventData) => { this.onOpen.emit(eventData); }); } } //jqxNotificationComponent jqxNotificationComponent.decorators = [ { type: Component, args: [{ selector: 'jqxNotification', template: '<div><ng-content></ng-content></div>' }] } ]; /** @nocollapse */ jqxNotificationComponent.ctorParameters = () => [ { type: ElementRef } ]; jqxNotificationComponent.propDecorators = { attrAppendContainer: [{ type: Input, args: ['appendContainer',] }], attrAutoOpen: [{ type: Input, args: ['autoOpen',] }], attrAnimationOpenDelay: [{ type: Input, args: ['animationOpenDelay',] }], attrAnimationCloseDelay: [{ type: Input, args: ['animationCloseDelay',] }], attrAutoClose: [{ type: Input, args: ['autoClose',] }], attrAutoCloseDelay: [{ type: Input, args: ['autoCloseDelay',] }], attrBlink: [{ type: Input, args: ['blink',] }], attrBrowserBoundsOffset: [{ type: Input, args: ['browserBoundsOffset',] }], attrCloseOnClick: [{ type: Input, args: ['closeOnClick',] }], attrDisabled: [{ type: Input, args: ['disabled',] }], attrHoverOpacity: [{ type: Input, args: ['hoverOpacity',] }], attrIcon: [{ type: Input, args: ['icon',] }], attrNotificationOffset: [{ type: Input, args: ['notificationOffset',] }], attrOpacity: [{ type: Input, args: ['opacity',] }], attrPosition: [{ type: Input, args: ['position',] }], attrRtl: [{ type: Input, args: ['rtl',] }], attrShowCloseButton: [{ type: Input, args: ['showCloseButton',] }], 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 }], onClick: [{ type: Output }], onOpen: [{ type: Output }] }; if (false) { /** @type {?} */ jqxNotificationComponent.prototype.attrAppendContainer; /** @type {?} */ jqxNotificationComponent.prototype.attrAutoOpen; /** @type {?} */ jqxNotificationComponent.prototype.attrAnimationOpenDelay; /** @type {?} */ jqxNotificationComponent.prototype.attrAnimationCloseDelay; /** @type {?} */ jqxNotificationComponent.prototype.attrAutoClose; /** @type {?} */ jqxNotificationComponent.prototype.attrAutoCloseDelay; /** @type {?} */ jqxNotificationComponent.prototype.attrBlink; /** @type {?} */ jqxNotificationComponent.prototype.attrBrowserBoundsOffset; /** @type {?} */ jqxNotificationComponent.prototype.attrCloseOnClick; /** @type {?} */ jqxNotificationComponent.prototype.attrDisabled; /** @type {?} */ jqxNotificationComponent.prototype.attrHoverOpacity; /** @type {?} */ jqxNotificationComponent.prototype.attrIcon; /** @type {?} */ jqxNotificationComponent.prototype.attrNotificationOffset; /** @type {?} */ jqxNotificationComponent.prototype.attrOpacity; /** @type {?} */ jqxNotificationComponent.prototype.attrPosition; /** @type {?} */ jqxNotificationComponent.prototype.attrRtl; /** @type {?} */ jqxNotificationComponent.prototype.attrShowCloseButton; /** @type {?} */ jqxNotificationComponent.prototype.attrTemplate; /** @type {?} */ jqxNotificationComponent.prototype.attrTheme; /** @type {?} */ jqxNotificationComponent.prototype.attrWidth; /** @type {?} */ jqxNotificationComponent.prototype.attrHeight; /** @type {?} */ jqxNotificationComponent.prototype.autoCreate; /** @type {?} */ jqxNotificationComponent.prototype.properties; /** @type {?} */ jqxNotificationComponent.prototype.host; /** @type {?} */ jqxNotificationComponent.prototype.elementRef; /** @type {?} */ jqxNotificationComponent.prototype.widgetObject; /** @type {?} */ jqxNotificationComponent.prototype.onClose; /** @type {?} */ jqxNotificationComponent.prototype.onClick; /** @type {?} */ jqxNotificationComponent.prototype.onOpen; /* Skipping unhandled member: ;*/ }