@lxlib/seed
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
182 lines (176 loc) • 5.39 kB
JavaScript
import { __decorate, __metadata } 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
*/
class QuickMenuComponent {
// #endregion
/**
* @param {?} cdr
* @param {?} el
* @param {?} render
*/
constructor(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 {?}
*/
_click() {
this.show = !this.show;
this.setStyle();
}
/**
* @private
* @return {?}
*/
setStyle() {
this.ctrlStyle = {
'background-color': this.bgColor,
'border-color': this.borderColor,
};
/** @type {?} */
const 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 {?}
*/
ngOnInit() {
this.initFlag = true;
this.setStyle();
}
/**
* @return {?}
*/
ngOnChanges() {
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 = () => [
{ 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);
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 {?} */
const COMPONENTS = [QuickMenuComponent];
class QuickMenuModule {
}
QuickMenuModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzIconModule, LxlibUtilModule, NzOutletModule],
declarations: [...COMPONENTS],
exports: [...COMPONENTS],
},] }
];
/**
* @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