ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
490 lines • 36.3 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { isNotNil } from '../core/util/check';
import { InputBoolean } from '../core/util/convert';
import { NzDropDownComponent } from '../dropdown/nz-dropdown.component';
import { NzI18nService } from '../i18n/nz-i18n.service';
/**
* @record
*/
export function NzThItemInterface() { }
if (false) {
/** @type {?} */
NzThItemInterface.prototype.text;
/** @type {?} */
NzThItemInterface.prototype.value;
/** @type {?} */
NzThItemInterface.prototype.checked;
}
var NzThComponent = /** @class */ (function () {
function NzThComponent(cdr, i18n) {
this.cdr = cdr;
this.i18n = i18n;
this.hasFilterValue = false;
this.filterVisible = false;
this.multipleFilterList = [];
this.singleFilterList = [];
/* tslint:disable-next-line:no-any */
this.locale = (/** @type {?} */ ({}));
this.nzWidthChange$ = new Subject();
this.destroy$ = new Subject();
this.hasDefaultFilter = false;
/* tslint:disable-next-line:no-any */
this.nzSelections = [];
this.nzChecked = false;
this.nzDisabled = false;
this.nzIndeterminate = false;
this.nzFilterMultiple = true;
this.nzSort = null;
this.nzFilters = [];
this.nzExpand = false;
this.nzShowCheckbox = false;
this.nzCustomFilter = false;
this.nzShowSort = false;
this.nzShowFilter = false;
this.nzShowRowSelection = false;
this.nzCheckedChange = new EventEmitter();
this.nzSortChange = new EventEmitter();
this.nzSortChangeWithKey = new EventEmitter();
/* tslint:disable-next-line:no-any */
this.nzFilterChange = new EventEmitter();
}
/**
* @return {?}
*/
NzThComponent.prototype.updateSortValue = /**
* @return {?}
*/
function () {
if (this.nzShowSort) {
if (this.nzSort === 'descend') {
this.setSortValue('ascend');
}
else if (this.nzSort === 'ascend') {
this.setSortValue(null);
}
else {
this.setSortValue('descend');
}
}
};
/**
* @param {?} value
* @return {?}
*/
NzThComponent.prototype.setSortValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.nzSort = value;
this.nzSortChangeWithKey.emit({ key: this.nzSortKey, value: this.nzSort });
this.nzSortChange.emit(this.nzSort);
};
Object.defineProperty(NzThComponent.prototype, "filterList", {
get: /**
* @return {?}
*/
function () {
return this.multipleFilterList.filter((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.checked; })).map((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.value; }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzThComponent.prototype, "filterValue", {
/* tslint:disable-next-line:no-any */
get: /* tslint:disable-next-line:no-any */
/**
* @return {?}
*/
function () {
/** @type {?} */
var checkedFilter = this.singleFilterList.find((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.checked; }));
return checkedFilter ? checkedFilter.value : null;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
NzThComponent.prototype.updateFilterStatus = /**
* @return {?}
*/
function () {
if (this.nzFilterMultiple) {
this.hasFilterValue = this.filterList.length > 0;
}
else {
this.hasFilterValue = isNotNil(this.filterValue);
}
};
/**
* @return {?}
*/
NzThComponent.prototype.search = /**
* @return {?}
*/
function () {
this.updateFilterStatus();
if (this.nzFilterMultiple) {
this.nzFilterChange.emit(this.filterList);
}
else {
this.nzFilterChange.emit(this.filterValue);
}
};
/**
* @return {?}
*/
NzThComponent.prototype.reset = /**
* @return {?}
*/
function () {
this.initMultipleFilterList(true);
this.initSingleFilterList(true);
this.hasFilterValue = false;
};
/**
* @param {?} filter
* @return {?}
*/
NzThComponent.prototype.checkMultiple = /**
* @param {?} filter
* @return {?}
*/
function (filter) {
filter.checked = !filter.checked;
};
/**
* @param {?} filter
* @return {?}
*/
NzThComponent.prototype.checkSingle = /**
* @param {?} filter
* @return {?}
*/
function (filter) {
this.singleFilterList.forEach((/**
* @param {?} item
* @return {?}
*/
function (item) { return (item.checked = item === filter); }));
};
/**
* @return {?}
*/
NzThComponent.prototype.hideDropDown = /**
* @return {?}
*/
function () {
this.nzDropDownComponent.setVisibleStateWhen(false);
this.filterVisible = false;
};
/**
* @param {?} value
* @return {?}
*/
NzThComponent.prototype.dropDownVisibleChange = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.filterVisible = value;
if (!value) {
this.search();
}
};
/**
* @param {?=} force
* @return {?}
*/
NzThComponent.prototype.initMultipleFilterList = /**
* @param {?=} force
* @return {?}
*/
function (force) {
var _this = this;
this.multipleFilterList = this.nzFilters.map((/**
* @param {?} item
* @return {?}
*/
function (item) {
/** @type {?} */
var checked = force ? false : !!item.byDefault;
if (checked) {
_this.hasDefaultFilter = true;
}
return { text: item.text, value: item.value, checked: checked };
}));
this.checkDefaultFilters();
};
/**
* @param {?=} force
* @return {?}
*/
NzThComponent.prototype.initSingleFilterList = /**
* @param {?=} force
* @return {?}
*/
function (force) {
var _this = this;
this.singleFilterList = this.nzFilters.map((/**
* @param {?} item
* @return {?}
*/
function (item) {
/** @type {?} */
var checked = force ? false : !!item.byDefault;
if (checked) {
_this.hasDefaultFilter = true;
}
return { text: item.text, value: item.value, checked: checked };
}));
this.checkDefaultFilters();
};
/**
* @return {?}
*/
NzThComponent.prototype.checkDefaultFilters = /**
* @return {?}
*/
function () {
if (!this.nzFilters || this.nzFilters.length === 0 || !this.hasDefaultFilter) {
return;
}
this.updateFilterStatus();
};
/**
* @return {?}
*/
NzThComponent.prototype.marForCheck = /**
* @return {?}
*/
function () {
this.cdr.markForCheck();
};
/**
* @return {?}
*/
NzThComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
function () {
_this.locale = _this.i18n.getLocaleData('Table');
_this.cdr.markForCheck();
}));
};
/**
* @param {?} changes
* @return {?}
*/
NzThComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes.nzFilters) {
this.initMultipleFilterList();
this.initSingleFilterList();
this.updateFilterStatus();
}
if (changes.nzWidth) {
this.nzWidthChange$.next(this.nzWidth);
}
};
/**
* @return {?}
*/
NzThComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroy$.next();
this.destroy$.complete();
};
NzThComponent.decorators = [
{ type: Component, args: [{
// tslint:disable-next-line:component-selector
selector: 'th:not(.nz-disable-th)',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template #checkboxTemplate>\n <label nz-checkbox\n [class.ant-table-selection-select-all-custom]=\"nzShowRowSelection\"\n [(ngModel)]=\"nzChecked\"\n [nzDisabled]=\"nzDisabled\"\n [nzIndeterminate]=\"nzIndeterminate\"\n (ngModelChange)=\"nzCheckedChange.emit($event)\">\n </label>\n</ng-template>\n<div [class.ant-table-column-sorters]=\"nzShowSort\" (click)=\"updateSortValue()\">\n <div class=\"ant-table-selection\" *ngIf=\"nzShowRowSelection\">\n <ng-container *ngIf=\"nzShowCheckbox\">\n <ng-template [ngTemplateOutlet]=\"checkboxTemplate\"></ng-template>\n </ng-container>\n <nz-dropdown nzPlacement=\"bottomLeft\">\n <div nz-dropdown class=\"ant-table-selection-down\">\n <i nz-icon type=\"down\"></i>\n </div>\n <ul nz-menu class=\"ant-table-selection-menu\">\n <li nz-menu-item *ngFor=\"let selection of nzSelections\" (click)=\"selection.onSelect()\">{{selection.text}}</li>\n </ul>\n </nz-dropdown>\n </div>\n <ng-container *ngIf=\"nzShowCheckbox && !nzShowRowSelection\">\n <ng-template [ngTemplateOutlet]=\"checkboxTemplate\"></ng-template>\n </ng-container>\n <ng-content></ng-content>\n <div class=\"ant-table-column-sorter\" *ngIf=\"nzShowSort\">\n <i nz-icon\n type=\"caret-up\"\n class=\"ant-table-column-sorter-up\"\n [class.on]=\"nzSort == 'ascend'\"\n [class.off]=\"nzSort != 'ascend'\"></i>\n <i nz-icon\n type=\"caret-down\"\n class=\"ant-table-column-sorter-down\"\n [class.on]=\"nzSort == 'descend'\"\n [class.off]=\"nzSort != 'descend'\"></i>\n </div>\n</div>\n<nz-dropdown nzTrigger=\"click\" *ngIf=\"nzShowFilter\" [nzClickHide]=\"false\" nzTableFilter (nzVisibleChange)=\"dropDownVisibleChange($event)\">\n <i nz-icon type=\"filter\" theme=\"fill\" [class.ant-table-filter-selected]=\"hasFilterValue\" [class.ant-table-filter-open]=\"filterVisible\" nz-dropdown></i>\n <ul nz-menu>\n <ng-container *ngIf=\"nzFilterMultiple\">\n <li nz-menu-item *ngFor=\"let filter of multipleFilterList\" (click)=\"checkMultiple(filter)\">\n <label nz-checkbox [ngModel]=\"filter.checked\" (ngModelChange)=\"checkMultiple(filter)\"></label><span>{{filter.text}}</span>\n </li>\n </ng-container>\n <ng-container *ngIf=\"!nzFilterMultiple\">\n <li nz-menu-item *ngFor=\"let filter of singleFilterList\" (click)=\"checkSingle(filter)\">\n <label nz-radio [ngModel]=\"filter.checked\" (ngModelChange)=\"checkSingle(filter)\">{{filter.text}}</label>\n </li>\n </ng-container>\n </ul>\n <div class=\"ant-table-filter-dropdown-btns\">\n <a class=\"ant-table-filter-dropdown-link confirm\" (click)=\"hideDropDown()\">\n <span>{{ locale.filterConfirm }}</span>\n </a>\n <a class=\"ant-table-filter-dropdown-link clear\" (click)=\"reset();hideDropDown()\">\n <span>{{ locale.filterReset }}</span>\n </a>\n </div>\n</nz-dropdown>\n",
host: {
'[class.ant-table-column-has-actions]': 'nzShowFilter || nzShowSort || nzCustomFilter',
'[class.ant-table-column-has-filters]': 'nzShowFilter || nzCustomFilter',
'[class.ant-table-column-has-sorters]': 'nzShowSort',
'[class.ant-table-selection-column-custom]': 'nzShowRowSelection',
'[class.ant-table-selection-column]': 'nzShowCheckbox',
'[class.ant-table-expand-icon-th]': 'nzExpand',
'[class.ant-table-th-left-sticky]': 'nzLeft',
'[class.ant-table-th-right-sticky]': 'nzRight',
'[class.ant-table-column-sort]': "nzSort === 'descend' || nzSort === 'ascend'",
'[style.left]': 'nzLeft',
'[style.right]': 'nzRight',
'[style.text-align]': 'nzAlign'
}
}] }
];
/** @nocollapse */
NzThComponent.ctorParameters = function () { return [
{ type: ChangeDetectorRef },
{ type: NzI18nService }
]; };
NzThComponent.propDecorators = {
nzDropDownComponent: [{ type: ViewChild, args: [NzDropDownComponent,] }],
nzSelections: [{ type: Input }],
nzChecked: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzIndeterminate: [{ type: Input }],
nzSortKey: [{ type: Input }],
nzFilterMultiple: [{ type: Input }],
nzWidth: [{ type: Input }],
nzLeft: [{ type: Input }],
nzRight: [{ type: Input }],
nzAlign: [{ type: Input }],
nzSort: [{ type: Input }],
nzFilters: [{ type: Input }],
nzExpand: [{ type: Input }],
nzShowCheckbox: [{ type: Input }],
nzCustomFilter: [{ type: Input }],
nzShowSort: [{ type: Input }],
nzShowFilter: [{ type: Input }],
nzShowRowSelection: [{ type: Input }],
nzCheckedChange: [{ type: Output }],
nzSortChange: [{ type: Output }],
nzSortChangeWithKey: [{ type: Output }],
nzFilterChange: [{ type: Output }]
};
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzExpand", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowCheckbox", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzCustomFilter", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowSort", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowFilter", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowRowSelection", void 0);
return NzThComponent;
}());
export { NzThComponent };
if (false) {
/** @type {?} */
NzThComponent.prototype.hasFilterValue;
/** @type {?} */
NzThComponent.prototype.filterVisible;
/** @type {?} */
NzThComponent.prototype.multipleFilterList;
/** @type {?} */
NzThComponent.prototype.singleFilterList;
/** @type {?} */
NzThComponent.prototype.locale;
/** @type {?} */
NzThComponent.prototype.nzWidthChange$;
/**
* @type {?}
* @private
*/
NzThComponent.prototype.destroy$;
/**
* @type {?}
* @private
*/
NzThComponent.prototype.hasDefaultFilter;
/** @type {?} */
NzThComponent.prototype.nzDropDownComponent;
/** @type {?} */
NzThComponent.prototype.nzSelections;
/** @type {?} */
NzThComponent.prototype.nzChecked;
/** @type {?} */
NzThComponent.prototype.nzDisabled;
/** @type {?} */
NzThComponent.prototype.nzIndeterminate;
/** @type {?} */
NzThComponent.prototype.nzSortKey;
/** @type {?} */
NzThComponent.prototype.nzFilterMultiple;
/** @type {?} */
NzThComponent.prototype.nzWidth;
/** @type {?} */
NzThComponent.prototype.nzLeft;
/** @type {?} */
NzThComponent.prototype.nzRight;
/** @type {?} */
NzThComponent.prototype.nzAlign;
/** @type {?} */
NzThComponent.prototype.nzSort;
/** @type {?} */
NzThComponent.prototype.nzFilters;
/** @type {?} */
NzThComponent.prototype.nzExpand;
/** @type {?} */
NzThComponent.prototype.nzShowCheckbox;
/** @type {?} */
NzThComponent.prototype.nzCustomFilter;
/** @type {?} */
NzThComponent.prototype.nzShowSort;
/** @type {?} */
NzThComponent.prototype.nzShowFilter;
/** @type {?} */
NzThComponent.prototype.nzShowRowSelection;
/** @type {?} */
NzThComponent.prototype.nzCheckedChange;
/** @type {?} */
NzThComponent.prototype.nzSortChange;
/** @type {?} */
NzThComponent.prototype.nzSortChangeWithKey;
/** @type {?} */
NzThComponent.prototype.nzFilterChange;
/**
* @type {?}
* @private
*/
NzThComponent.prototype.cdr;
/**
* @type {?}
* @private
*/
NzThComponent.prototype.i18n;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotdGguY29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