jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
331 lines (330 loc) • 9.88 kB
JavaScript
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxbuttons from '../../jqwidgets/jqxbuttons';
/**
* @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, ElementRef } from '@angular/core';
var jqxLinkButtonComponent = /** @class */ (function () {
function jqxLinkButtonComponent(containerElement) {
this.autoCreate = true;
this.properties = ['disabled', 'height', 'rtl', 'theme', 'width'];
this.elementRef = containerElement;
}
/**
* @return {?}
*/
jqxLinkButtonComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
if (this.autoCreate) {
this.createComponent();
}
};
;
/**
* @param {?} changes
* @return {?}
*/
jqxLinkButtonComponent.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.jqxLinkButton(this.properties[i]));
}
if (areEqual) {
return false;
}
this.host.jqxLinkButton(this.properties[i], this[attrName]);
continue;
}
if (this[attrName] !== this.host.jqxLinkButton(this.properties[i])) {
this.host.jqxLinkButton(this.properties[i], this[attrName]);
}
}
}
}
};
/**
* @param {?} attrValue
* @param {?} hostValue
* @return {?}
*/
jqxLinkButtonComponent.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 {?}
*/
jqxLinkButtonComponent.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 {?}
*/
jqxLinkButtonComponent.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 {?}
*/
jqxLinkButtonComponent.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 {?}
*/
jqxLinkButtonComponent.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, 'jqxLinkButton', options);
};
/**
* @param {?=} options
* @return {?}
*/
jqxLinkButtonComponent.prototype.createWidget = /**
* @param {?=} options
* @return {?}
*/
function (options) {
this.createComponent(options);
};
/**
* @return {?}
*/
jqxLinkButtonComponent.prototype.__updateRect__ = /**
* @return {?}
*/
function () {
if (this.host)
this.host.css({ width: this.attrWidth, height: this.attrHeight });
};
/**
* @param {?} options
* @return {?}
*/
jqxLinkButtonComponent.prototype.setOptions = /**
* @param {?} options
* @return {?}
*/
function (options) {
this.host.jqxLinkButton('setOptions', options);
};
// jqxLinkButtonComponent properties
// jqxLinkButtonComponent properties
/**
* @param {?=} arg
* @return {?}
*/
jqxLinkButtonComponent.prototype.disabled =
// jqxLinkButtonComponent properties
/**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxLinkButton('disabled', arg);
}
else {
return this.host.jqxLinkButton('disabled');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxLinkButtonComponent.prototype.height = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxLinkButton('height', arg);
}
else {
return this.host.jqxLinkButton('height');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxLinkButtonComponent.prototype.rtl = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxLinkButton('rtl', arg);
}
else {
return this.host.jqxLinkButton('rtl');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxLinkButtonComponent.prototype.theme = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxLinkButton('theme', arg);
}
else {
return this.host.jqxLinkButton('theme');
}
};
/**
* @param {?=} arg
* @return {?}
*/
jqxLinkButtonComponent.prototype.width = /**
* @param {?=} arg
* @return {?}
*/
function (arg) {
if (arg !== undefined) {
this.host.jqxLinkButton('width', arg);
}
else {
return this.host.jqxLinkButton('width');
}
};
/**
* @return {?}
*/
jqxLinkButtonComponent.prototype.__wireEvents__ = /**
* @return {?}
*/
function () {
};
jqxLinkButtonComponent.decorators = [
{ type: Component, args: [{
selector: 'jqxLinkButton',
template: '<div><ng-content></ng-content></div>'
}] }
];
/** @nocollapse */
jqxLinkButtonComponent.ctorParameters = function () { return [
{ type: ElementRef }
]; };
jqxLinkButtonComponent.propDecorators = {
attrDisabled: [{ type: Input, args: ['disabled',] }],
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',] }]
};
return jqxLinkButtonComponent;
}()); //jqxLinkButtonComponent
export { jqxLinkButtonComponent };
if (false) {
/** @type {?} */
jqxLinkButtonComponent.prototype.attrDisabled;
/** @type {?} */
jqxLinkButtonComponent.prototype.attrRtl;
/** @type {?} */
jqxLinkButtonComponent.prototype.attrTheme;
/** @type {?} */
jqxLinkButtonComponent.prototype.attrWidth;
/** @type {?} */
jqxLinkButtonComponent.prototype.attrHeight;
/** @type {?} */
jqxLinkButtonComponent.prototype.autoCreate;
/** @type {?} */
jqxLinkButtonComponent.prototype.properties;
/** @type {?} */
jqxLinkButtonComponent.prototype.host;
/** @type {?} */
jqxLinkButtonComponent.prototype.elementRef;
/** @type {?} */
jqxLinkButtonComponent.prototype.widgetObject;
/* Skipping unhandled member: ;*/
}