UNPKG

ng-zorro-antd-yj

Version:

An enterprise-class UI components based on Ant Design and Angular

297 lines 21.8 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, TemplateRef, ViewEncapsulation } from '@angular/core'; import { NzUpdateHostClassService } from '../core/services/update-host-class.service'; var NzTransferListComponent = /** @class */ (function () { // #endregion function NzTransferListComponent(el, updateHostClassService, cdr) { this.el = el; this.updateHostClassService = updateHostClassService; this.cdr = cdr; // #region fields this.direction = ''; this.titleText = ''; this.dataSource = []; this.itemUnit = ''; this.itemsUnit = ''; this.filter = ''; // events this.handleSelectAll = new EventEmitter(); this.handleSelect = new EventEmitter(); this.filterChange = new EventEmitter(); // #endregion // #region styles this.prefixCls = 'ant-transfer-list'; // #endregion // #region select all this.stat = { checkAll: false, checkHalf: false, checkCount: 0, shownCount: 0 }; } /** * @return {?} */ NzTransferListComponent.prototype.setClassMap = /** * @return {?} */ function () { var _a; /** @type {?} */ var classMap = (_a = {}, _a[this.prefixCls] = true, _a[this.prefixCls + "-with-footer"] = !!this.footer, _a); this.updateHostClassService.updateHostClass(this.el.nativeElement, classMap); }; /** * @param {?} status * @return {?} */ NzTransferListComponent.prototype.onHandleSelectAll = /** * @param {?} status * @return {?} */ function (status) { this.dataSource.forEach((/** * @param {?} item * @return {?} */ function (item) { if (!item.disabled && !item._hiden) { item.checked = status; } })); this.updateCheckStatus(); this.handleSelectAll.emit(status); }; /** * @private * @return {?} */ NzTransferListComponent.prototype.updateCheckStatus = /** * @private * @return {?} */ function () { /** @type {?} */ var validCount = this.dataSource.filter((/** * @param {?} w * @return {?} */ function (w) { return !w.disabled; })).length; this.stat.checkCount = this.dataSource.filter((/** * @param {?} w * @return {?} */ function (w) { return w.checked && !w.disabled; })).length; this.stat.shownCount = this.dataSource.filter((/** * @param {?} w * @return {?} */ function (w) { return !w._hiden; })).length; this.stat.checkAll = validCount > 0 && validCount === this.stat.checkCount; this.stat.checkHalf = this.stat.checkCount > 0 && !this.stat.checkAll; }; // #endregion // #region search // #endregion // #region search /** * @param {?} value * @return {?} */ NzTransferListComponent.prototype.handleFilter = // #endregion // #region search /** * @param {?} value * @return {?} */ function (value) { var _this = this; this.filter = value; this.dataSource.forEach((/** * @param {?} item * @return {?} */ function (item) { item._hiden = value.length > 0 && !_this.matchFilter(value, item); })); this.stat.shownCount = this.dataSource.filter((/** * @param {?} w * @return {?} */ function (w) { return !w._hiden; })).length; this.filterChange.emit({ direction: this.direction, value: value }); }; /** * @return {?} */ NzTransferListComponent.prototype.handleClear = /** * @return {?} */ function () { this.handleFilter(''); }; /** * @private * @param {?} text * @param {?} item * @return {?} */ NzTransferListComponent.prototype.matchFilter = /** * @private * @param {?} text * @param {?} item * @return {?} */ function (text, item) { if (this.filterOption) { return this.filterOption(text, item); } return item.title.includes(text); }; /** * @param {?} changes * @return {?} */ NzTransferListComponent.prototype.ngOnChanges = /** * @param {?} changes * @return {?} */ function (changes) { if ('footer' in changes) { this.setClassMap(); } }; /** * @return {?} */ NzTransferListComponent.prototype.ngOnInit = /** * @return {?} */ function () { this.setClassMap(); }; /** * @return {?} */ NzTransferListComponent.prototype.markForCheck = /** * @return {?} */ function () { this.updateCheckStatus(); this.cdr.markForCheck(); }; /** * @param {?} item * @return {?} */ NzTransferListComponent.prototype._handleSelect = /** * @param {?} item * @return {?} */ function (item) { if (this.disabled || item.disabled) { return; } item.checked = !item.checked; this.updateCheckStatus(); this.handleSelect.emit(item); }; NzTransferListComponent.decorators = [ { type: Component, args: [{ selector: 'nz-transfer-list', preserveWhitespaces: false, providers: [NzUpdateHostClassService], template: "<div class=\"ant-transfer-list-header\">\n <label nz-checkbox [nzChecked]=\"stat.checkAll\" (nzCheckedChange)=\"onHandleSelectAll($event)\"\n [nzIndeterminate]=\"stat.checkHalf\" [nzDisabled]=\"stat.shownCount == 0 || disabled\">\n </label>\n <span class=\"ant-transfer-list-header-selected\">\n <span>{{ (stat.checkCount > 0 ? stat.checkCount + '/' : '') + stat.shownCount }} {{ dataSource.length > 1 ? itemsUnit : itemUnit }}</span>\n <span *ngIf=\"titleText\" class=\"ant-transfer-list-header-title\">{{ titleText }}</span>\n </span>\n</div>\n<div class=\"{{showSearch ? 'ant-transfer-list-body ant-transfer-list-body-with-search' : 'ant-transfer-list-body'}}\"\n [ngClass]=\"{'ant-transfer__nodata': stat.shownCount === 0}\">\n <div *ngIf=\"showSearch\" class=\"ant-transfer-list-body-search-wrapper\">\n <div nz-transfer-search\n (valueChanged)=\"handleFilter($event)\"\n (valueClear)=\"handleClear()\"\n [placeholder]=\"searchPlaceholder\"\n [disabled]=\"disabled\"\n [value]=\"filter\"></div>\n </div>\n <ul *ngIf=\"stat.shownCount > 0\" class=\"ant-transfer-list-content\">\n <div class=\"LazyLoad\" *ngFor=\"let item of dataSource\">\n <li *ngIf=\"!item._hiden\" (click)=\"_handleSelect(item)\"\n class=\"ant-transfer-list-content-item\" [ngClass]=\"{'ant-transfer-list-content-item-disabled': disabled || item.disabled}\">\n <label nz-checkbox [nzChecked]=\"item.checked\" (nzCheckedChange)=\"_handleSelect(item)\"\n (click)=\"$event.stopPropagation()\" [nzDisabled]=\"disabled || item.disabled\">\n <ng-container *ngIf=\"!render; else renderContainer\">{{ item.title }}</ng-container>\n <ng-template #renderContainer [ngTemplateOutlet]=\"render\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n </label>\n </li>\n </div>\n </ul>\n <div *ngIf=\"stat.shownCount === 0\" class=\"ant-transfer-list-body-not-found\">\n <nz-embed-empty [nzComponentName]=\"'transfer'\" [specificContent]=\"notFoundContent\"></nz-embed-empty>\n </div>\n</div>\n<div *ngIf=\"footer\" class=\"ant-transfer-list-footer\">\n <ng-template [ngTemplateOutlet]=\"footer\" [ngTemplateOutletContext]=\"{ $implicit: direction }\"></ng-template>\n</div>", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }] } ]; /** @nocollapse */ NzTransferListComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: NzUpdateHostClassService }, { type: ChangeDetectorRef } ]; }; NzTransferListComponent.propDecorators = { direction: [{ type: Input }], titleText: [{ type: Input }], dataSource: [{ type: Input }], itemUnit: [{ type: Input }], itemsUnit: [{ type: Input }], filter: [{ type: Input }], disabled: [{ type: Input }], showSearch: [{ type: Input }], searchPlaceholder: [{ type: Input }], notFoundContent: [{ type: Input }], filterOption: [{ type: Input }], render: [{ type: Input }], footer: [{ type: Input }], handleSelectAll: [{ type: Output }], handleSelect: [{ type: Output }], filterChange: [{ type: Output }] }; return NzTransferListComponent; }()); export { NzTransferListComponent }; if (false) { /** @type {?} */ NzTransferListComponent.prototype.direction; /** @type {?} */ NzTransferListComponent.prototype.titleText; /** @type {?} */ NzTransferListComponent.prototype.dataSource; /** @type {?} */ NzTransferListComponent.prototype.itemUnit; /** @type {?} */ NzTransferListComponent.prototype.itemsUnit; /** @type {?} */ NzTransferListComponent.prototype.filter; /** @type {?} */ NzTransferListComponent.prototype.disabled; /** @type {?} */ NzTransferListComponent.prototype.showSearch; /** @type {?} */ NzTransferListComponent.prototype.searchPlaceholder; /** @type {?} */ NzTransferListComponent.prototype.notFoundContent; /** @type {?} */ NzTransferListComponent.prototype.filterOption; /** @type {?} */ NzTransferListComponent.prototype.render; /** @type {?} */ NzTransferListComponent.prototype.footer; /** @type {?} */ NzTransferListComponent.prototype.handleSelectAll; /** @type {?} */ NzTransferListComponent.prototype.handleSelect; /** @type {?} */ NzTransferListComponent.prototype.filterChange; /** @type {?} */ NzTransferListComponent.prototype.prefixCls; /** @type {?} */ NzTransferListComponent.prototype.stat; /** * @type {?} * @private */ NzTransferListComponent.prototype.el; /** * @type {?} * @private */ NzTransferListComponent.prototype.updateHostClassService; /** * @type {?} * @private */ NzTransferListComponent.prototype.cdr; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWx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