UNPKG

jqwidgets-scripts-custom

Version:

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

608 lines (607 loc) 17.5 kB
import * as jqxcore from '../../jqwidgets/jqxcore'; import * as jqxdata from '../../jqwidgets/jqxdata'; import * as jqxbuttons from '../../jqwidgets/jqxbuttons'; import * as jqxscrollbar from '../../jqwidgets/jqxscrollbar'; import * as jqxtextarea from '../../jqwidgets/jqxtextarea'; /** * @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, forwardRef, ChangeDetectionStrategy } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; /** @type {?} */ const noop = () => { }; const ɵ0 = noop; /** @type {?} */ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => jqxTextAreaComponent), multi: true }; export class jqxTextAreaComponent { /** * @param {?} containerElement */ constructor(containerElement) { this.autoCreate = true; this.properties = ['disabled', 'displayMember', 'dropDownWidth', 'height', 'items', 'maxLength', 'minLength', 'opened', 'placeHolder', 'popupZIndex', 'query', 'renderer', 'roundedCorners', 'rtl', 'scrollBarSize', 'searchMode', 'source', 'theme', 'valueMember', 'width']; this.onTouchedCallback = noop; this.onChangeCallback = noop; // jqxTextAreaComponent events this.onChange = new EventEmitter(); this.onClose = new EventEmitter(); this.onOpen = new EventEmitter(); this.onSelect = 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.jqxTextArea(this.properties[i])); } if (areEqual) { return false; } this.host.jqxTextArea(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxTextArea(this.properties[i])) { this.host.jqxTextArea(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, 'jqxTextArea', options); } /** * @param {?=} options * @return {?} */ createWidget(options) { this.createComponent(options); } /** * @return {?} */ __updateRect__() { if (this.host) this.host.css({ width: this.attrWidth, height: this.attrHeight }); } /** * @param {?} value * @return {?} */ writeValue(value) { if (this.widgetObject) { if (value !== null && value !== undefined) this.host.jqxTextArea('val', value); } } /** * @param {?} fn * @return {?} */ registerOnChange(fn) { this.onChangeCallback = fn; } /** * @param {?} fn * @return {?} */ registerOnTouched(fn) { this.onTouchedCallback = fn; } /** * @param {?} options * @return {?} */ setOptions(options) { this.host.jqxTextArea('setOptions', options); } // jqxTextAreaComponent properties /** * @param {?=} arg * @return {?} */ disabled(arg) { if (arg !== undefined) { this.host.jqxTextArea('disabled', arg); } else { return this.host.jqxTextArea('disabled'); } } /** * @param {?=} arg * @return {?} */ displayMember(arg) { if (arg !== undefined) { this.host.jqxTextArea('displayMember', arg); } else { return this.host.jqxTextArea('displayMember'); } } /** * @param {?=} arg * @return {?} */ dropDownWidth(arg) { if (arg !== undefined) { this.host.jqxTextArea('dropDownWidth', arg); } else { return this.host.jqxTextArea('dropDownWidth'); } } /** * @param {?=} arg * @return {?} */ height(arg) { if (arg !== undefined) { this.host.jqxTextArea('height', arg); } else { return this.host.jqxTextArea('height'); } } /** * @param {?=} arg * @return {?} */ items(arg) { if (arg !== undefined) { this.host.jqxTextArea('items', arg); } else { return this.host.jqxTextArea('items'); } } /** * @param {?=} arg * @return {?} */ maxLength(arg) { if (arg !== undefined) { this.host.jqxTextArea('maxLength', arg); } else { return this.host.jqxTextArea('maxLength'); } } /** * @param {?=} arg * @return {?} */ minLength(arg) { if (arg !== undefined) { this.host.jqxTextArea('minLength', arg); } else { return this.host.jqxTextArea('minLength'); } } /** * @param {?=} arg * @return {?} */ opened(arg) { if (arg !== undefined) { this.host.jqxTextArea('opened', arg); } else { return this.host.jqxTextArea('opened'); } } /** * @param {?=} arg * @return {?} */ placeHolder(arg) { if (arg !== undefined) { this.host.jqxTextArea('placeHolder', arg); } else { return this.host.jqxTextArea('placeHolder'); } } /** * @param {?=} arg * @return {?} */ popupZIndex(arg) { if (arg !== undefined) { this.host.jqxTextArea('popupZIndex', arg); } else { return this.host.jqxTextArea('popupZIndex'); } } /** * @param {?=} arg * @return {?} */ query(arg) { if (arg !== undefined) { this.host.jqxTextArea('query', arg); } else { return this.host.jqxTextArea('query'); } } /** * @param {?=} arg * @return {?} */ renderer(arg) { if (arg !== undefined) { this.host.jqxTextArea('renderer', arg); } else { return this.host.jqxTextArea('renderer'); } } /** * @param {?=} arg * @return {?} */ roundedCorners(arg) { if (arg !== undefined) { this.host.jqxTextArea('roundedCorners', arg); } else { return this.host.jqxTextArea('roundedCorners'); } } /** * @param {?=} arg * @return {?} */ rtl(arg) { if (arg !== undefined) { this.host.jqxTextArea('rtl', arg); } else { return this.host.jqxTextArea('rtl'); } } /** * @param {?=} arg * @return {?} */ scrollBarSize(arg) { if (arg !== undefined) { this.host.jqxTextArea('scrollBarSize', arg); } else { return this.host.jqxTextArea('scrollBarSize'); } } /** * @param {?=} arg * @return {?} */ searchMode(arg) { if (arg !== undefined) { this.host.jqxTextArea('searchMode', arg); } else { return this.host.jqxTextArea('searchMode'); } } /** * @param {?=} arg * @return {?} */ source(arg) { if (arg !== undefined) { this.host.jqxTextArea('source', arg); } else { return this.host.jqxTextArea('source'); } } /** * @param {?=} arg * @return {?} */ theme(arg) { if (arg !== undefined) { this.host.jqxTextArea('theme', arg); } else { return this.host.jqxTextArea('theme'); } } /** * @param {?=} arg * @return {?} */ valueMember(arg) { if (arg !== undefined) { this.host.jqxTextArea('valueMember', arg); } else { return this.host.jqxTextArea('valueMember'); } } /** * @param {?=} arg * @return {?} */ width(arg) { if (arg !== undefined) { this.host.jqxTextArea('width', arg); } else { return this.host.jqxTextArea('width'); } } // jqxTextAreaComponent functions /** * @return {?} */ destroy() { this.host.jqxTextArea('destroy'); } /** * @return {?} */ focus() { this.host.jqxTextArea('focus'); } /** * @return {?} */ refresh() { this.host.jqxTextArea('refresh'); } /** * @return {?} */ render() { this.host.jqxTextArea('render'); } /** * @return {?} */ selectAll() { this.host.jqxTextArea('selectAll'); } /** * @param {?=} value * @return {?} */ val(value) { if (value !== undefined) { return this.host.jqxTextArea('val', value); } else { return this.host.jqxTextArea('val'); } } ; /** * @return {?} */ __wireEvents__() { this.host.on('change', (eventData) => { this.onChange.emit(eventData); this.onChangeCallback(this.host.val()); }); this.host.on('close', (eventData) => { this.onClose.emit(eventData); }); this.host.on('open', (eventData) => { this.onOpen.emit(eventData); }); this.host.on('select', (eventData) => { this.onSelect.emit(eventData); }); this.host.on('keyup', () => { this.onChangeCallback(this.host.val()); }); } } //jqxTextAreaComponent jqxTextAreaComponent.decorators = [ { type: Component, args: [{ selector: 'jqxTextArea', template: '<div><ng-content></ng-content></div>', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush }] } ]; /** @nocollapse */ jqxTextAreaComponent.ctorParameters = () => [ { type: ElementRef } ]; jqxTextAreaComponent.propDecorators = { attrDisabled: [{ type: Input, args: ['disabled',] }], attrDisplayMember: [{ type: Input, args: ['displayMember',] }], attrDropDownWidth: [{ type: Input, args: ['dropDownWidth',] }], attrItems: [{ type: Input, args: ['items',] }], attrMaxLength: [{ type: Input, args: ['maxLength',] }], attrMinLength: [{ type: Input, args: ['minLength',] }], attrOpened: [{ type: Input, args: ['opened',] }], attrPlaceHolder: [{ type: Input, args: ['placeHolder',] }], attrPopupZIndex: [{ type: Input, args: ['popupZIndex',] }], attrQuery: [{ type: Input, args: ['query',] }], attrRenderer: [{ type: Input, args: ['renderer',] }], attrRoundedCorners: [{ type: Input, args: ['roundedCorners',] }], attrRtl: [{ type: Input, args: ['rtl',] }], attrScrollBarSize: [{ type: Input, args: ['scrollBarSize',] }], attrSearchMode: [{ type: Input, args: ['searchMode',] }], attrSource: [{ type: Input, args: ['source',] }], attrTheme: [{ type: Input, args: ['theme',] }], attrValueMember: [{ type: Input, args: ['valueMember',] }], attrWidth: [{ type: Input, args: ['width',] }], attrHeight: [{ type: Input, args: ['height',] }], autoCreate: [{ type: Input, args: ['auto-create',] }], onChange: [{ type: Output }], onClose: [{ type: Output }], onOpen: [{ type: Output }], onSelect: [{ type: Output }] }; if (false) { /** @type {?} */ jqxTextAreaComponent.prototype.attrDisabled; /** @type {?} */ jqxTextAreaComponent.prototype.attrDisplayMember; /** @type {?} */ jqxTextAreaComponent.prototype.attrDropDownWidth; /** @type {?} */ jqxTextAreaComponent.prototype.attrItems; /** @type {?} */ jqxTextAreaComponent.prototype.attrMaxLength; /** @type {?} */ jqxTextAreaComponent.prototype.attrMinLength; /** @type {?} */ jqxTextAreaComponent.prototype.attrOpened; /** @type {?} */ jqxTextAreaComponent.prototype.attrPlaceHolder; /** @type {?} */ jqxTextAreaComponent.prototype.attrPopupZIndex; /** @type {?} */ jqxTextAreaComponent.prototype.attrQuery; /** @type {?} */ jqxTextAreaComponent.prototype.attrRenderer; /** @type {?} */ jqxTextAreaComponent.prototype.attrRoundedCorners; /** @type {?} */ jqxTextAreaComponent.prototype.attrRtl; /** @type {?} */ jqxTextAreaComponent.prototype.attrScrollBarSize; /** @type {?} */ jqxTextAreaComponent.prototype.attrSearchMode; /** @type {?} */ jqxTextAreaComponent.prototype.attrSource; /** @type {?} */ jqxTextAreaComponent.prototype.attrTheme; /** @type {?} */ jqxTextAreaComponent.prototype.attrValueMember; /** @type {?} */ jqxTextAreaComponent.prototype.attrWidth; /** @type {?} */ jqxTextAreaComponent.prototype.attrHeight; /** @type {?} */ jqxTextAreaComponent.prototype.autoCreate; /** @type {?} */ jqxTextAreaComponent.prototype.properties; /** @type {?} */ jqxTextAreaComponent.prototype.host; /** @type {?} */ jqxTextAreaComponent.prototype.elementRef; /** @type {?} */ jqxTextAreaComponent.prototype.widgetObject; /** * @type {?} * @private */ jqxTextAreaComponent.prototype.onTouchedCallback; /** * @type {?} * @private */ jqxTextAreaComponent.prototype.onChangeCallback; /** @type {?} */ jqxTextAreaComponent.prototype.onChange; /** @type {?} */ jqxTextAreaComponent.prototype.onClose; /** @type {?} */ jqxTextAreaComponent.prototype.onOpen; /** @type {?} */ jqxTextAreaComponent.prototype.onSelect; /* Skipping unhandled member: ;*/ /* Skipping unhandled member: ;*/ } export { ɵ0 };