jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
634 lines (633 loc) • 19 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxtooltip from '../../jqwidgets/jqxtooltip';
import * as jqxpasswordinput from '../../jqwidgets/jqxpasswordinput';
/**
* @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 jqxPasswordInputComponent; }),
multi: true
};
var jqxPasswordInputComponent = /** @class */ (function () {
function jqxPasswordInputComponent(containerElement) {
this.autoCreate = true;
this.properties = ['disabled', 'height', 'localization', 'maxLength', 'placeHolder', 'passwordStrength', 'rtl', 'strengthColors', 'showStrength', 'showStrengthPosition', 'strengthTypeRenderer', 'showPasswordIcon', 'theme', 'width'];
this.onTouchedCallback = noop;
this.onChangeCallback = noop;
// jqxPasswordInputComponent events
this.onChange = new EventEmitter();
this.elementRef = containerElement;
}
/**
* @return {?}
*/
jqxPasswordInputComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (this.autoCreate) {
this.createComponent();
}
};
;
/**
* @param {?} changes
* @return {?}
*/
jqxPasswordInputComponent.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.jqxPasswordInput(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxPasswordInput(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxPasswordInput(this.properties[i])) {
this.host.jqxPasswordInput(this.properties[i], this[attrName]);
}
}
}
}
};
/**
* @param {?} attrValue
* @param {?} hostValue
* @return {?}
*/
jqxPasswordInputComponent.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 {?}
*/
jqxPasswordInputComponent.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 {?}
*/
jqxPasswordInputComponent.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 {?}
*/
jqxPasswordInputComponent.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 {?}
*/
jqxPasswordInputComponent.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.__wireEvents__();
this.widgetObject = jqwidgets.createInstance(this.host, 'jqxPasswordInput', options);
};
/**
* @param {?=} options
* @return {?}
*/
jqxPasswordInputComponent.prototype.createWidget = /**
* @param {?=} options
* @return {?}
*/
function (options) {
this.createComponent(options);
};
/**
* @return {?}
*/
jqxPasswordInputComponent.prototype.__updateRect__ = /**
* @return {?}
*/
function () {
if (this.host)
this.host.css({ width: this.attrWidth, height: this.attrHeight });
};
Object.defineProperty(jqxPasswordInputComponent.prototype, "ngValue", {
get: /**
* @return {?}
*/
function () {
if (this.widgetObject) {
/** @type {?} */
var value = this.host.val();
return value;
}
return '';
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this.widgetObject) {
this.onChangeCallback(value);
}
},
enumerable: true,
configurable: true
});
/**
* @param {?} value
* @return {?}
*/
jqxPasswordInputComponent.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this.widgetObject) {
this.host.jqxPasswordInput('val', value);
}
};
/**
* @param {?} fn
* @return {?}
*/
jqxPasswordInputComponent.prototype.registerOnChange = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onChangeCallback = fn;
};
/**
* @param {?} fn
* @return {?}
*/
jqxPasswordInputComponent.prototype.registerOnTouched = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onTouchedCallback = fn;
};
/**
* @param {?} options
* @return {?}
*/
jqxPasswordInputComponent.prototype.setOptions = /**
* @param {?} options
* @return {?}
*/
function (options) {
this.host.jqxPasswordInput('setOptions', options);
};
// jqxPasswordInputComponent properties
// jqxPasswordInputComponent properties
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.disabled =
// jqxPasswordInputComponent properties
/**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('disabled', arg);
}
else {
return this.host.jqxPasswordInput('disabled');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.height = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('height', arg);
}
else {
return this.host.jqxPasswordInput('height');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.localization = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('localization', arg);
}
else {
return this.host.jqxPasswordInput('localization');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.maxLength = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('maxLength', arg);
}
else {
return this.host.jqxPasswordInput('maxLength');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.placeHolder = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('placeHolder', arg);
}
else {
return this.host.jqxPasswordInput('placeHolder');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.passwordStrength = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('passwordStrength', arg);
}
else {
return this.host.jqxPasswordInput('passwordStrength');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.rtl = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('rtl', arg);
}
else {
return this.host.jqxPasswordInput('rtl');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.strengthColors = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('strengthColors', arg);
}
else {
return this.host.jqxPasswordInput('strengthColors');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.showStrength = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('showStrength', arg);
}
else {
return this.host.jqxPasswordInput('showStrength');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.showStrengthPosition = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('showStrengthPosition', arg);
}
else {
return this.host.jqxPasswordInput('showStrengthPosition');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.strengthTypeRenderer = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('strengthTypeRenderer', arg);
}
else {
return this.host.jqxPasswordInput('strengthTypeRenderer');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.showPasswordIcon = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('showPasswordIcon', arg);
}
else {
return this.host.jqxPasswordInput('showPasswordIcon');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.theme = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('theme', arg);
}
else {
return this.host.jqxPasswordInput('theme');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxPasswordInputComponent.prototype.width = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxPasswordInput('width', arg);
}
else {
return this.host.jqxPasswordInput('width');
}
};
// jqxPasswordInputComponent functions
// jqxPasswordInputComponent functions
/**
* @return {?}
*/
jqxPasswordInputComponent.prototype.render =
// jqxPasswordInputComponent functions
/**
* @return {?}
*/
function () {
this.host.jqxPasswordInput('render');
};
/**
* @return {?}
*/
jqxPasswordInputComponent.prototype.refresh = /**
* @return {?}
*/
function () {
this.host.jqxPasswordInput('refresh');
};
/**
* @param {?=} value
* @return {?}
*/
jqxPasswordInputComponent.prototype.val = /**
* @param {?=} value
* @return {?}
*/
function (value) {
if (value !== undefined) {
return this.host.jqxPasswordInput('val', value);
}
else {
return this.host.jqxPasswordInput('val');
}
};
;
/**
* @return {?}
*/
jqxPasswordInputComponent.prototype.__wireEvents__ = /**
* @return {?}
*/
function () {
var _this = this;
this.host.on('change', function (eventData) { _this.onChange.emit(eventData); });
};
jqxPasswordInputComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxPasswordInput',
template: '<input type="password" [(ngModel)]="ngValue">',
providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
jqxPasswordInputComponent.ctorParameters = function () { return [
{ type: ElementRef }
]; };
jqxPasswordInputComponent.propDecorators = {
attrDisabled: [{ type: Input, args: ['disabled',] }],
attrLocalization: [{ type: Input, args: ['localization',] }],
attrMaxLength: [{ type: Input, args: ['maxLength',] }],
attrPlaceHolder: [{ type: Input, args: ['placeHolder',] }],
attrPasswordStrength: [{ type: Input, args: ['passwordStrength',] }],
attrRtl: [{ type: Input, args: ['rtl',] }],
attrStrengthColors: [{ type: Input, args: ['strengthColors',] }],
attrShowStrength: [{ type: Input, args: ['showStrength',] }],
attrShowStrengthPosition: [{ type: Input, args: ['showStrengthPosition',] }],
attrStrengthTypeRenderer: [{ type: Input, args: ['strengthTypeRenderer',] }],
attrShowPasswordIcon: [{ type: Input, args: ['showPasswordIcon',] }],
attrTheme: [{ type: Input, args: ['theme',] }],
attrWidth: [{ type: Input, args: ['width',] }],
attrHeight: [{ type: Input, args: ['height',] }],
autoCreate: [{ type: Input, args: ['auto-create',] }],
onChange: [{ type: Output }]
};
return jqxPasswordInputComponent;
}()); //jqxPasswordInputComponent
export { jqxPasswordInputComponent };
if (false) {
/** @type {?} */
jqxPasswordInputComponent.prototype.attrDisabled;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrLocalization;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrMaxLength;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrPlaceHolder;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrPasswordStrength;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrRtl;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrStrengthColors;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrShowStrength;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrShowStrengthPosition;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrStrengthTypeRenderer;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrShowPasswordIcon;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrTheme;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrWidth;
/** @type {?} */
jqxPasswordInputComponent.prototype.attrHeight;
/** @type {?} */
jqxPasswordInputComponent.prototype.autoCreate;
/** @type {?} */
jqxPasswordInputComponent.prototype.properties;
/** @type {?} */
jqxPasswordInputComponent.prototype.host;
/** @type {?} */
jqxPasswordInputComponent.prototype.elementRef;
/** @type {?} */
jqxPasswordInputComponent.prototype.widgetObject;
/**
* @type {?}
* @private
*/
jqxPasswordInputComponent.prototype.onTouchedCallback;
/**
* @type {?}
* @private
*/
jqxPasswordInputComponent.prototype.onChangeCallback;
/** @type {?} */
jqxPasswordInputComponent.prototype.onChange;
/* Skipping unhandled member: ;*/
/* Skipping unhandled member: ;*/
}
export { ɵ0 };