ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
91 lines • 6.12 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Output, Renderer2, ViewEncapsulation } from '@angular/core';
var NzCheckboxWrapperComponent = /** @class */ (function () {
function NzCheckboxWrapperComponent(renderer, elementRef) {
this.nzOnChange = new EventEmitter();
this.checkboxList = [];
renderer.addClass(elementRef.nativeElement, 'ant-checkbox-group');
}
/**
* @param {?} value
* @return {?}
*/
NzCheckboxWrapperComponent.prototype.addCheckbox = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.checkboxList.push(value);
};
/**
* @param {?} value
* @return {?}
*/
NzCheckboxWrapperComponent.prototype.removeCheckbox = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.checkboxList.splice(this.checkboxList.indexOf(value), 1);
};
/**
* @return {?}
*/
NzCheckboxWrapperComponent.prototype.outputValue = /**
* @return {?}
*/
function () {
/** @type {?} */
var checkedList = this.checkboxList.filter((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.nzChecked; }));
return checkedList.map((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.nzValue; }));
};
/**
* @return {?}
*/
NzCheckboxWrapperComponent.prototype.onChange = /**
* @return {?}
*/
function () {
this.nzOnChange.emit(this.outputValue());
};
NzCheckboxWrapperComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-checkbox-wrapper',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-content></ng-content>"
}] }
];
/** @nocollapse */
NzCheckboxWrapperComponent.ctorParameters = function () { return [
{ type: Renderer2 },
{ type: ElementRef }
]; };
NzCheckboxWrapperComponent.propDecorators = {
nzOnChange: [{ type: Output }]
};
return NzCheckboxWrapperComponent;
}());
export { NzCheckboxWrapperComponent };
if (false) {
/** @type {?} */
NzCheckboxWrapperComponent.prototype.nzOnChange;
/**
* @type {?}
* @private
*/
NzCheckboxWrapperComponent.prototype.checkboxList;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotY2hlY2tib3gtd3JhcHBlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsiY2hlY2tib3gvbnotY2hlY2tib3gtd3JhcHBlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFVBQVUsRUFDVixZQUFZLEVBQ1osTUFBTSxFQUNOLFNBQVMsRUFDVCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFJdkI7SUE0QkUsb0NBQVksUUFBbUIsRUFBRSxVQUFzQjtRQXBCcEMsZUFBVSxHQUFHLElBQUksWUFBWSxFQUFZLENBQUM7UUFDckQsaUJBQVksR0FBMEIsRUFBRSxDQUFDO1FBb0IvQyxRQUFRLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxhQUFhLEVBQUUsb0JBQW9CLENBQUMsQ0FBQztJQUNwRSxDQUFDOzs7OztJQW5CRCxnREFBVzs7OztJQUFYLFVBQVksS0FBMEI7UUFDcEMsSUFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDaEMsQ0FBQzs7Ozs7SUFFRCxtREFBYzs7OztJQUFkLFVBQWUsS0FBMEI7UUFDdkMsSUFBSSxDQUFDLFlBQVksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7SUFDaEUsQ0FBQzs7OztJQUVELGdEQUFXOzs7SUFBWDs7WU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