UNPKG

jqwidgets-scripts-custom

Version:

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

621 lines (620 loc) 17.8 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 jqxlistbox from '../../jqwidgets/jqxlistbox'; import * as jqxdropdownlist from '../../jqwidgets/jqxdropdownlist'; import * as jqxdropdownbutton from '../../jqwidgets/jqxdropdownbutton'; import * as jqxwindow from '../../jqwidgets/jqxwindow'; import * as jqxeditor from '../../jqwidgets/jqxeditor'; import * as jqxcheckbox from '../../jqwidgets/jqxcheckbox'; import * as jqxtooltip from '../../jqwidgets/jqxtooltip'; import * as jqxcolorpicker from '../../jqwidgets/jqxcolorpicker'; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; /// <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 {?} */ var noop = function () { }; var ɵ0 = noop; /** @type {?} */ var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(function () { return jqxEditorComponent; }), multi: true }; var jqxEditorComponent = /** @class */ (function () { function jqxEditorComponent(containerElement) { this.autoCreate = true; this.properties = ['createCommand', 'disabled', 'editable', 'height', 'lineBreak', 'localization', 'pasteMode', 'rtl', 'stylesheets', 'theme', 'toolbarPosition', 'tools', 'width']; this.onTouchedCallback = noop; this.onChangeCallback = noop; // jqxEditorComponent events this.onChange = new EventEmitter(); this.elementRef = containerElement; } /** * @return {?} */ jqxEditorComponent.prototype.ngOnInit = /** * @return {?} */ function () { if (this.autoCreate) { this.createComponent(); } }; ; /** * @param {?} changes * @return {?} */ jqxEditorComponent.prototype.ngOnChanges = /** * @param {?} changes * @return {?} */ function (changes) { if (this.host) { for (var i = 0; i < this.properties.length; i++) { /** @type {?} */ var attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1); /** @type {?} */ var areEqual = false; if (this[attrName] !== undefined) { if (typeof this[attrName] === 'object') { if (this[attrName] instanceof Array) { areEqual = this.arraysEqual(this[attrName], this.host.jqxEditor(this.properties[i])); } if (areEqual) { return false; } this.host.jqxEditor(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxEditor(this.properties[i])) { this.host.jqxEditor(this.properties[i], this[attrName]); } } } } }; /** * @param {?} attrValue * @param {?} hostValue * @return {?} */ jqxEditorComponent.prototype.arraysEqual = /** * @param {?} attrValue * @param {?} hostValue * @return {?} */ function (attrValue, hostValue) { if ((attrValue && !hostValue) || (!attrValue && hostValue)) { return false; } if (attrValue.length != hostValue.length) { return false; } for (var i = 0; i < attrValue.length; i++) { if (attrValue[i] !== hostValue[i]) { return false; } } return true; }; /** * @return {?} */ jqxEditorComponent.prototype.manageAttributes = /** * @return {?} */ function () { /** @type {?} */ var options = {}; for (var i = 0; i < this.properties.length; i++) { /** @type {?} */ var 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 {?} */ jqxEditorComponent.prototype.moveClasses = /** * @param {?} parentEl * @param {?} childEl * @return {?} */ function (parentEl, childEl) { var _a; /** @type {?} */ var classes = parentEl.classList; if (classes.length > 0) { (_a = childEl.classList).add.apply(_a, tslib_1.__spread(classes)); } parentEl.className = ''; }; /** * @param {?} parentEl * @param {?} childEl * @return {?} */ jqxEditorComponent.prototype.moveStyles = /** * @param {?} parentEl * @param {?} childEl * @return {?} */ function (parentEl, childEl) { /** @type {?} */ var style = parentEl.style.cssText; childEl.style.cssText = style; parentEl.style.cssText = ''; }; /** * @param {?=} options * @return {?} */ jqxEditorComponent.prototype.createComponent = /** * @param {?=} options * @return {?} */ function (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.widgetObject = jqwidgets.createInstance(this.host, 'jqxEditor', options); this.host = this.widgetObject['host']; this.__wireEvents__(); }; /** * @param {?=} options * @return {?} */ jqxEditorComponent.prototype.createWidget = /** * @param {?=} options * @return {?} */ function (options) { this.createComponent(options); }; /** * @return {?} */ jqxEditorComponent.prototype.__updateRect__ = /** * @return {?} */ function () { if (this.host) this.host.css({ width: this.attrWidth, height: this.attrHeight }); }; /** * @param {?} value * @return {?} */ jqxEditorComponent.prototype.writeValue = /** * @param {?} value * @return {?} */ function (value) { if (this.widgetObject) { this.onChangeCallback(this.host.val()); } }; /** * @param {?} fn * @return {?} */ jqxEditorComponent.prototype.registerOnChange = /** * @param {?} fn * @return {?} */ function (fn) { this.onChangeCallback = fn; }; /** * @param {?} fn * @return {?} */ jqxEditorComponent.prototype.registerOnTouched = /** * @param {?} fn * @return {?} */ function (fn) { this.onTouchedCallback = fn; }; /** * @param {?} options * @return {?} */ jqxEditorComponent.prototype.setOptions = /** * @param {?} options * @return {?} */ function (options) { this.host.jqxEditor('setOptions', options); }; // jqxEditorComponent properties // jqxEditorComponent properties /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.createCommand = // jqxEditorComponent properties /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('createCommand', arg); } else { return this.host.jqxEditor('createCommand'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.disabled = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('disabled', arg); } else { return this.host.jqxEditor('disabled'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.editable = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('editable', arg); } else { return this.host.jqxEditor('editable'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.height = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('height', arg); } else { return this.host.jqxEditor('height'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.lineBreak = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('lineBreak', arg); } else { return this.host.jqxEditor('lineBreak'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.localization = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('localization', arg); } else { return this.host.jqxEditor('localization'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.pasteMode = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('pasteMode', arg); } else { return this.host.jqxEditor('pasteMode'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.rtl = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('rtl', arg); } else { return this.host.jqxEditor('rtl'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.stylesheets = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('stylesheets', arg); } else { return this.host.jqxEditor('stylesheets'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.theme = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('theme', arg); } else { return this.host.jqxEditor('theme'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.toolbarPosition = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('toolbarPosition', arg); } else { return this.host.jqxEditor('toolbarPosition'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.tools = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('tools', arg); } else { return this.host.jqxEditor('tools'); } }; /** * @param {?=} arg * @return {?} */ jqxEditorComponent.prototype.width = /** * @param {?=} arg * @return {?} */ function (arg) { if (arg !== undefined) { this.host.jqxEditor('width', arg); } else { return this.host.jqxEditor('width'); } }; // jqxEditorComponent functions // jqxEditorComponent functions /** * @return {?} */ jqxEditorComponent.prototype.destroy = // jqxEditorComponent functions /** * @return {?} */ function () { this.host.jqxEditor('destroy'); }; /** * @return {?} */ jqxEditorComponent.prototype.focus = /** * @return {?} */ function () { this.host.jqxEditor('focus'); }; /** * @return {?} */ jqxEditorComponent.prototype.print = /** * @return {?} */ function () { this.host.jqxEditor('print'); }; /** * @param {?} mode * @return {?} */ jqxEditorComponent.prototype.setMode = /** * @param {?} mode * @return {?} */ function (mode) { this.host.jqxEditor('setMode', mode); }; /** * @param {?=} value * @return {?} */ jqxEditorComponent.prototype.val = /** * @param {?=} value * @return {?} */ function (value) { if (value !== undefined) { return this.host.jqxEditor('val', value); } else { return this.host.jqxEditor('val'); } }; ; /** * @return {?} */ jqxEditorComponent.prototype.__wireEvents__ = /** * @return {?} */ function () { var _this = this; this.host.on('change', function (eventData) { _this.onChange.emit(eventData); _this.onChangeCallback(_this.host.val()); }); }; jqxEditorComponent.decorators = [ { type: Component, args: [{ selector: 'jqxEditor', template: '<div><ng-content></ng-content></div>', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush }] } ]; /** @nocollapse */ jqxEditorComponent.ctorParameters = function () { return [ { type: ElementRef } ]; }; jqxEditorComponent.propDecorators = { attrCreateCommand: [{ type: Input, args: ['createCommand',] }], attrDisabled: [{ type: Input, args: ['disabled',] }], attrEditable: [{ type: Input, args: ['editable',] }], attrLineBreak: [{ type: Input, args: ['lineBreak',] }], attrLocalization: [{ type: Input, args: ['localization',] }], attrPasteMode: [{ type: Input, args: ['pasteMode',] }], attrRtl: [{ type: Input, args: ['rtl',] }], attrStylesheets: [{ type: Input, args: ['stylesheets',] }], attrTheme: [{ type: Input, args: ['theme',] }], attrToolbarPosition: [{ type: Input, args: ['toolbarPosition',] }], attrTools: [{ type: Input, args: ['tools',] }], attrWidth: [{ type: Input, args: ['width',] }], attrHeight: [{ type: Input, args: ['height',] }], autoCreate: [{ type: Input, args: ['auto-create',] }], onChange: [{ type: Output }] }; return jqxEditorComponent; }()); //jqxEditorComponent export { jqxEditorComponent }; if (false) { /** @type {?} */ jqxEditorComponent.prototype.attrCreateCommand; /** @type {?} */ jqxEditorComponent.prototype.attrDisabled; /** @type {?} */ jqxEditorComponent.prototype.attrEditable; /** @type {?} */ jqxEditorComponent.prototype.attrLineBreak; /** @type {?} */ jqxEditorComponent.prototype.attrLocalization; /** @type {?} */ jqxEditorComponent.prototype.attrPasteMode; /** @type {?} */ jqxEditorComponent.prototype.attrRtl; /** @type {?} */ jqxEditorComponent.prototype.attrStylesheets; /** @type {?} */ jqxEditorComponent.prototype.attrTheme; /** @type {?} */ jqxEditorComponent.prototype.attrToolbarPosition; /** @type {?} */ jqxEditorComponent.prototype.attrTools; /** @type {?} */ jqxEditorComponent.prototype.attrWidth; /** @type {?} */ jqxEditorComponent.prototype.attrHeight; /** @type {?} */ jqxEditorComponent.prototype.autoCreate; /** @type {?} */ jqxEditorComponent.prototype.properties; /** @type {?} */ jqxEditorComponent.prototype.host; /** @type {?} */ jqxEditorComponent.prototype.elementRef; /** @type {?} */ jqxEditorComponent.prototype.widgetObject; /** * @type {?} * @private */ jqxEditorComponent.prototype.onTouchedCallback; /** * @type {?} * @private */ jqxEditorComponent.prototype.onChangeCallback; /** @type {?} */ jqxEditorComponent.prototype.onChange; /* Skipping unhandled member: ;*/ /* Skipping unhandled member: ;*/ } export { ɵ0 };