@lxlib/seed
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
194 lines (188 loc) • 6.03 kB
JavaScript
import { __decorate, __metadata, __spread } from 'tslib';
import { Component, ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, ElementRef, Renderer2, Input, NgModule } from '@angular/core';
import { InputNumber, LxlibUtilModule } from '@lxlib/util';
import { CommonModule } from '@angular/common';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import { NzIconModule } from 'ng-zorro-antd/icon';
/**
* @fileoverview added by tsickle
* Generated from: quick-menu.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var QuickMenuComponent = /** @class */ (function () {
// #endregion
function QuickMenuComponent(cdr, el, render) {
this.cdr = cdr;
this.el = el;
this.render = render;
this.ctrlStyle = {};
// #region fields
this.icon = 'question-circle';
this.top = 120;
this.width = 200;
this.bgColor = '#fff';
this.borderColor = '#ddd';
this.show = false;
this.initFlag = false;
}
/**
* @return {?}
*/
QuickMenuComponent.prototype._click = /**
* @return {?}
*/
function () {
this.show = !this.show;
this.setStyle();
};
/**
* @private
* @return {?}
*/
QuickMenuComponent.prototype.setStyle = /**
* @private
* @return {?}
*/
function () {
this.ctrlStyle = {
'background-color': this.bgColor,
'border-color': this.borderColor,
};
/** @type {?} */
var res = [
"top:" + this.top + "px",
"width:" + this.width + "px",
"background-color:" + this.bgColor,
"border-color:" + this.borderColor,
"margin-right:-" + (this.show ? 0 : this.width) + "px",
];
this.render.setAttribute(this.el.nativeElement, 'style', res.join(';'));
this.cdr.detectChanges();
};
/**
* @return {?}
*/
QuickMenuComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this.initFlag = true;
this.setStyle();
};
/**
* @return {?}
*/
QuickMenuComponent.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
if (this.initFlag)
this.setStyle();
};
QuickMenuComponent.decorators = [
{ type: Component, args: [{
selector: 'quick-menu',
exportAs: 'quickMenu',
template: "<div class=\"quick-menu__inner\">\n <div class=\"quick-menu__ctrl\" [ngStyle]=\"ctrlStyle\">\n <div class=\"quick-menu__ctrl-icon\">\n <ng-container *nzStringTemplateOutlet=\"icon\">\n <i nz-icon [nzType]=\"icon\"></i>\n </ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</div>\n",
host: {
'[class.quick-menu]': 'true',
'(click)': '_click()',
},
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
}] }
];
/** @nocollapse */
QuickMenuComponent.ctorParameters = function () { return [
{ type: ChangeDetectorRef },
{ type: ElementRef },
{ type: Renderer2 }
]; };
QuickMenuComponent.propDecorators = {
icon: [{ type: Input }],
top: [{ type: Input }],
width: [{ type: Input }],
bgColor: [{ type: Input }],
borderColor: [{ type: Input }]
};
__decorate([
InputNumber(),
__metadata("design:type", Object)
], QuickMenuComponent.prototype, "top", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], QuickMenuComponent.prototype, "width", void 0);
return QuickMenuComponent;
}());
if (false) {
/** @type {?} */
QuickMenuComponent.prototype.ctrlStyle;
/** @type {?} */
QuickMenuComponent.prototype.icon;
/** @type {?} */
QuickMenuComponent.prototype.top;
/** @type {?} */
QuickMenuComponent.prototype.width;
/** @type {?} */
QuickMenuComponent.prototype.bgColor;
/** @type {?} */
QuickMenuComponent.prototype.borderColor;
/**
* @type {?}
* @private
*/
QuickMenuComponent.prototype.show;
/**
* @type {?}
* @private
*/
QuickMenuComponent.prototype.initFlag;
/**
* @type {?}
* @private
*/
QuickMenuComponent.prototype.cdr;
/**
* @type {?}
* @private
*/
QuickMenuComponent.prototype.el;
/**
* @type {?}
* @private
*/
QuickMenuComponent.prototype.render;
}
/**
* @fileoverview added by tsickle
* Generated from: quick-menu.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var COMPONENTS = [QuickMenuComponent];
var QuickMenuModule = /** @class */ (function () {
function QuickMenuModule() {
}
QuickMenuModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzIconModule, LxlibUtilModule, NzOutletModule],
declarations: __spread(COMPONENTS),
exports: __spread(COMPONENTS),
},] }
];
return QuickMenuModule;
}());
/**
* @fileoverview added by tsickle
* Generated from: public_api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* Generated from: quickMenu.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { QuickMenuComponent, QuickMenuModule };
//# sourceMappingURL=quickMenu.js.map