ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1,176 lines (1,141 loc) • 181 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/cdk/scrolling'), require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('ng-zorro-antd/button'), require('ng-zorro-antd/checkbox'), require('ng-zorro-antd/core/outlet'), require('ng-zorro-antd/core/resize-observers'), require('ng-zorro-antd/dropdown'), require('ng-zorro-antd/empty'), require('ng-zorro-antd/i18n'), require('ng-zorro-antd/icon'), require('ng-zorro-antd/menu'), require('ng-zorro-antd/pagination'), require('ng-zorro-antd/radio'), require('ng-zorro-antd/spin'), require('rxjs'), require('rxjs/operators'), require('ng-zorro-antd/core/util'), require('ng-zorro-antd/core/logger'), require('ng-zorro-antd/core/services'), require('ng-zorro-antd/core/config')) :
typeof define === 'function' && define.amd ? define('ng-zorro-antd/table', ['exports', '@angular/cdk/platform', '@angular/cdk/scrolling', '@angular/common', '@angular/core', '@angular/forms', 'ng-zorro-antd/button', 'ng-zorro-antd/checkbox', 'ng-zorro-antd/core/outlet', 'ng-zorro-antd/core/resize-observers', 'ng-zorro-antd/dropdown', 'ng-zorro-antd/empty', 'ng-zorro-antd/i18n', 'ng-zorro-antd/icon', 'ng-zorro-antd/menu', 'ng-zorro-antd/pagination', 'ng-zorro-antd/radio', 'ng-zorro-antd/spin', 'rxjs', 'rxjs/operators', 'ng-zorro-antd/core/util', 'ng-zorro-antd/core/logger', 'ng-zorro-antd/core/services', 'ng-zorro-antd/core/config'], factory) :
(global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].table = {}), global.ng.cdk.platform, global.ng.cdk.scrolling, global.ng.common, global.ng.core, global.ng.forms, global['ng-zorro-antd'].button, global['ng-zorro-antd'].checkbox, global['ng-zorro-antd'].core.outlet, global['ng-zorro-antd'].core['resize-observers'], global['ng-zorro-antd'].dropdown, global['ng-zorro-antd'].empty, global['ng-zorro-antd'].i18n, global['ng-zorro-antd'].icon, global['ng-zorro-antd'].menu, global['ng-zorro-antd'].pagination, global['ng-zorro-antd'].radio, global['ng-zorro-antd'].spin, global.rxjs, global.rxjs.operators, global['ng-zorro-antd'].core.util, global['ng-zorro-antd'].core.logger, global['ng-zorro-antd'].core.services, global['ng-zorro-antd'].core.config));
}(this, (function (exports, platform, scrolling, common, core, forms, button, checkbox, outlet, resizeObservers, dropdown, empty, i18n, icon, menu, pagination, radio, spin, rxjs, operators, util, logger, services, config) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result.default = mod;
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
}
function __classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/filter-trigger.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzFilterTriggerComponent = /** @class */ (function () {
function NzFilterTriggerComponent(cdr) {
this.cdr = cdr;
this.nzActive = false;
this.nzVisible = false;
this.nzVisibleChange = new core.EventEmitter();
}
/**
* @param {?} visible
* @return {?}
*/
NzFilterTriggerComponent.prototype.onVisibleChange = /**
* @param {?} visible
* @return {?}
*/
function (visible) {
this.nzVisible = visible;
this.nzVisibleChange.next(visible);
};
/**
* @param {?} $event
* @return {?}
*/
NzFilterTriggerComponent.prototype.onFilterClick = /**
* @param {?} $event
* @return {?}
*/
function ($event) {
$event.stopPropagation();
};
/**
* @return {?}
*/
NzFilterTriggerComponent.prototype.hide = /**
* @return {?}
*/
function () {
this.nzVisible = false;
this.cdr.markForCheck();
};
/**
* @return {?}
*/
NzFilterTriggerComponent.prototype.show = /**
* @return {?}
*/
function () {
this.nzVisible = true;
this.cdr.markForCheck();
};
NzFilterTriggerComponent.decorators = [
{ type: core.Component, args: [{
selector: 'nz-filter-trigger',
exportAs: "nzFilterTrigger",
changeDetection: core.ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
encapsulation: core.ViewEncapsulation.None,
template: "\n <span\n nz-dropdown\n class=\"ant-table-filter-trigger\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n [nzClickHide]=\"false\"\n [nzDropdownMenu]=\"nzDropdownMenu\"\n [class.active]=\"nzActive\"\n [class.ant-table-filter-open]=\"nzVisible\"\n [nzVisible]=\"nzVisible\"\n (nzVisibleChange)=\"onVisibleChange($event)\"\n (click)=\"onFilterClick($event)\"\n >\n <ng-content></ng-content>\n </span>\n ",
host: {
'[class.ant-table-filter-trigger-container]': 'true',
'[class.ant-table-filter-trigger-container-open]': 'nzVisible'
}
}] }
];
/** @nocollapse */
NzFilterTriggerComponent.ctorParameters = function () { return [
{ type: core.ChangeDetectorRef }
]; };
NzFilterTriggerComponent.propDecorators = {
nzActive: [{ type: core.Input }],
nzDropdownMenu: [{ type: core.Input }],
nzVisible: [{ type: core.Input }],
nzVisibleChange: [{ type: core.Output }]
};
return NzFilterTriggerComponent;
}());
if (false) {
/** @type {?} */
NzFilterTriggerComponent.prototype.nzActive;
/** @type {?} */
NzFilterTriggerComponent.prototype.nzDropdownMenu;
/** @type {?} */
NzFilterTriggerComponent.prototype.nzVisible;
/** @type {?} */
NzFilterTriggerComponent.prototype.nzVisibleChange;
/**
* @type {?}
* @private
*/
NzFilterTriggerComponent.prototype.cdr;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/filter.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @record
*/
function NzThItemInterface() { }
if (false) {
/** @type {?} */
NzThItemInterface.prototype.text;
/** @type {?} */
NzThItemInterface.prototype.value;
/** @type {?} */
NzThItemInterface.prototype.checked;
}
var NzTableFilterComponent = /** @class */ (function () {
function NzTableFilterComponent(cdr, i18n) {
this.cdr = cdr;
this.i18n = i18n;
this.contentTemplate = null;
this.customFilter = false;
this.extraTemplate = null;
this.filterMultiple = true;
this.listOfFilter = [];
this.filterChange = new core.EventEmitter();
this.destroy$ = new rxjs.Subject();
this.locale = (/** @type {?} */ ({}));
this.isChanged = false;
this.isChecked = false;
this.isVisible = false;
this.listOfParsedFilter = [];
}
/**
* @param {?} _
* @param {?} item
* @return {?}
*/
NzTableFilterComponent.prototype.trackByValue = /**
* @param {?} _
* @param {?} item
* @return {?}
*/
function (_, item) {
return item.value;
};
/**
* @param {?} filter
* @return {?}
*/
NzTableFilterComponent.prototype.check = /**
* @param {?} filter
* @return {?}
*/
function (filter) {
this.isChanged = true;
if (this.filterMultiple) {
this.listOfParsedFilter = this.listOfParsedFilter.map((/**
* @param {?} item
* @return {?}
*/
function (item) {
if (item === filter) {
return __assign(__assign({}, item), { checked: !filter.checked });
}
else {
return item;
}
}));
filter.checked = !filter.checked;
}
else {
this.listOfParsedFilter = this.listOfParsedFilter.map((/**
* @param {?} item
* @return {?}
*/
function (item) {
return __assign(__assign({}, item), { checked: item === filter });
}));
}
this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
};
/**
* @return {?}
*/
NzTableFilterComponent.prototype.confirm = /**
* @return {?}
*/
function () {
this.isVisible = false;
this.emitFilterData();
};
/**
* @return {?}
*/
NzTableFilterComponent.prototype.reset = /**
* @return {?}
*/
function () {
this.isChanged = true;
this.isVisible = false;
this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter, true);
this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
this.emitFilterData();
};
/**
* @param {?} value
* @return {?}
*/
NzTableFilterComponent.prototype.onVisibleChange = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.isVisible = value;
if (!value) {
this.emitFilterData();
}
};
/**
* @return {?}
*/
NzTableFilterComponent.prototype.emitFilterData = /**
* @return {?}
*/
function () {
if (this.isChanged) {
/** @type {?} */
var listOfChecked = this.listOfParsedFilter.filter((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.checked; })).map((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.value; }));
if (this.filterMultiple) {
this.filterChange.emit(listOfChecked);
}
else {
this.filterChange.emit(listOfChecked[0] || null);
}
this.isChanged = false;
}
};
/**
* @param {?} listOfFilter
* @param {?=} reset
* @return {?}
*/
NzTableFilterComponent.prototype.parseListOfFilter = /**
* @param {?} listOfFilter
* @param {?=} reset
* @return {?}
*/
function (listOfFilter, reset) {
return listOfFilter.map((/**
* @param {?} item
* @return {?}
*/
function (item) {
/** @type {?} */
var checked = reset ? false : !!item.byDefault;
return { text: item.text, value: item.value, checked: checked };
}));
};
/**
* @param {?} listOfParsedFilter
* @return {?}
*/
NzTableFilterComponent.prototype.getCheckedStatus = /**
* @param {?} listOfParsedFilter
* @return {?}
*/
function (listOfParsedFilter) {
return listOfParsedFilter.some((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.checked; }));
};
/**
* @return {?}
*/
NzTableFilterComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this.i18n.localeChange.pipe(operators.takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
function () {
_this.locale = _this.i18n.getLocaleData('Table');
_this.cdr.markForCheck();
}));
};
/**
* @param {?} changes
* @return {?}
*/
NzTableFilterComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
var listOfFilter = changes.listOfFilter;
if (listOfFilter && this.listOfFilter && this.listOfFilter.length) {
this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter);
this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
}
};
/**
* @return {?}
*/
NzTableFilterComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroy$.next();
this.destroy$.complete();
};
NzTableFilterComponent.decorators = [
{ type: core.Component, args: [{
selector: 'nz-table-filter',
preserveWhitespaces: false,
changeDetection: core.ChangeDetectionStrategy.OnPush,
encapsulation: core.ViewEncapsulation.None,
template: "\n <span class=\"ant-table-filter-column-title\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n </span>\n <ng-container *ngIf=\"!customFilter; else extraTemplate\">\n <nz-filter-trigger\n [nzVisible]=\"isVisible\"\n [nzActive]=\"isChecked\"\n [nzDropdownMenu]=\"filterMenu\"\n (nzVisibleChange)=\"onVisibleChange($event)\"\n >\n <i nz-icon nzType=\"filter\" nzTheme=\"fill\"></i>\n </nz-filter-trigger>\n <nz-dropdown-menu #filterMenu=\"nzDropdownMenu\">\n <div class=\"ant-table-filter-dropdown\">\n <ul nz-menu>\n <li nz-menu-item [nzSelected]=\"f.checked\" *ngFor=\"let f of listOfParsedFilter; trackBy: trackByValue\" (click)=\"check(f)\">\n <label nz-radio *ngIf=\"!filterMultiple\" [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n <label nz-checkbox *ngIf=\"filterMultiple\" [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n <span>{{ f.text }}</span>\n </li>\n </ul>\n <div class=\"ant-table-filter-dropdown-btns\">\n <button nz-button nzType=\"link\" nzSize=\"small\" (click)=\"reset()\" [disabled]=\"!isChecked\">{{ locale.filterReset }}</button>\n <button nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"confirm()\">{{ locale.filterConfirm }}</button>\n </div>\n </div>\n </nz-dropdown-menu>\n </ng-container>\n ",
host: {
'[class.ant-table-filter-column]': 'true'
}
}] }
];
/** @nocollapse */
NzTableFilterComponent.ctorParameters = function () { return [
{ type: core.ChangeDetectorRef },
{ type: i18n.NzI18nService }
]; };
NzTableFilterComponent.propDecorators = {
contentTemplate: [{ type: core.Input }],
customFilter: [{ type: core.Input }],
extraTemplate: [{ type: core.Input }],
filterMultiple: [{ type: core.Input }],
listOfFilter: [{ type: core.Input }],
filterChange: [{ type: core.Output }]
};
return NzTableFilterComponent;
}());
if (false) {
/** @type {?} */
NzTableFilterComponent.prototype.contentTemplate;
/** @type {?} */
NzTableFilterComponent.prototype.customFilter;
/** @type {?} */
NzTableFilterComponent.prototype.extraTemplate;
/** @type {?} */
NzTableFilterComponent.prototype.filterMultiple;
/** @type {?} */
NzTableFilterComponent.prototype.listOfFilter;
/** @type {?} */
NzTableFilterComponent.prototype.filterChange;
/**
* @type {?}
* @private
*/
NzTableFilterComponent.prototype.destroy$;
/** @type {?} */
NzTableFilterComponent.prototype.locale;
/** @type {?} */
NzTableFilterComponent.prototype.isChanged;
/** @type {?} */
NzTableFilterComponent.prototype.isChecked;
/** @type {?} */
NzTableFilterComponent.prototype.isVisible;
/** @type {?} */
NzTableFilterComponent.prototype.listOfParsedFilter;
/**
* @type {?}
* @private
*/
NzTableFilterComponent.prototype.cdr;
/**
* @type {?}
* @private
*/
NzTableFilterComponent.prototype.i18n;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/row-expand-button.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzRowExpandButtonDirective = /** @class */ (function () {
function NzRowExpandButtonDirective() {
this.expand = false;
this.spaceMode = false;
this.expandChange = new core.EventEmitter();
}
/**
* @return {?}
*/
NzRowExpandButtonDirective.prototype.onHostClick = /**
* @return {?}
*/
function () {
if (!this.spaceMode) {
this.expand = !this.expand;
this.expandChange.next(this.expand);
}
};
NzRowExpandButtonDirective.decorators = [
{ type: core.Directive, args: [{
selector: 'button[nz-row-expand-button]',
host: {
'[type]': "'button'",
'[class.ant-table-row-expand-icon]': 'true',
'[class.ant-table-row-expand-icon-expanded]': "!spaceMode && expand === true",
'[class.ant-table-row-expand-icon-collapsed]': "!spaceMode && expand === false",
'[class.ant-table-row-expand-icon-spaced]': 'spaceMode',
'(click)': 'onHostClick()'
}
},] }
];
NzRowExpandButtonDirective.propDecorators = {
expand: [{ type: core.Input }],
spaceMode: [{ type: core.Input }],
expandChange: [{ type: core.Output }]
};
return NzRowExpandButtonDirective;
}());
if (false) {
/** @type {?} */
NzRowExpandButtonDirective.prototype.expand;
/** @type {?} */
NzRowExpandButtonDirective.prototype.spaceMode;
/** @type {?} */
NzRowExpandButtonDirective.prototype.expandChange;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/row-indent.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzRowIndentDirective = /** @class */ (function () {
function NzRowIndentDirective() {
this.indentSize = 0;
}
NzRowIndentDirective.decorators = [
{ type: core.Directive, args: [{
selector: 'nz-row-indent',
host: {
'[class.ant-table-row-indent]': 'true',
'[style.padding-left.px]': 'indentSize'
}
},] }
];
NzRowIndentDirective.propDecorators = {
indentSize: [{ type: core.Input }]
};
return NzRowIndentDirective;
}());
if (false) {
/** @type {?} */
NzRowIndentDirective.prototype.indentSize;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/selection.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzTableSelectionComponent = /** @class */ (function () {
function NzTableSelectionComponent() {
this.listOfSelections = [];
this.checked = false;
this.disabled = false;
this.indeterminate = false;
this.showCheckbox = false;
this.showRowSelection = false;
this.checkedChange = new core.EventEmitter();
}
/**
* @param {?} checked
* @return {?}
*/
NzTableSelectionComponent.prototype.onCheckedChange = /**
* @param {?} checked
* @return {?}
*/
function (checked) {
this.checked = checked;
this.checkedChange.emit(checked);
};
NzTableSelectionComponent.decorators = [
{ type: core.Component, args: [{
selector: 'nz-table-selection',
preserveWhitespaces: false,
changeDetection: core.ChangeDetectionStrategy.OnPush,
encapsulation: core.ViewEncapsulation.None,
template: "\n <label\n *ngIf=\"showCheckbox\"\n nz-checkbox\n [class.ant-table-selection-select-all-custom]=\"showRowSelection\"\n [ngModel]=\"checked\"\n [nzDisabled]=\"disabled\"\n [nzIndeterminate]=\"indeterminate\"\n (ngModelChange)=\"onCheckedChange($event)\"\n >\n </label>\n <div class=\"ant-table-selection-extra\" *ngIf=\"showRowSelection\">\n <span nz-dropdown class=\"ant-table-selection-down\" nzPlacement=\"bottomLeft\" [nzDropdownMenu]=\"selectionMenu\">\n <i nz-icon nzType=\"down\"></i>\n </span>\n <nz-dropdown-menu #selectionMenu=\"nzDropdownMenu\">\n <ul nz-menu class=\"ant-table-selection-menu\">\n <li nz-menu-item *ngFor=\"let selection of listOfSelections\" (click)=\"selection.onSelect()\">\n {{ selection.text }}\n </li>\n </ul>\n </nz-dropdown-menu>\n </div>\n ",
host: {
'[class.ant-table-selection]': 'true'
}
}] }
];
NzTableSelectionComponent.propDecorators = {
listOfSelections: [{ type: core.Input }],
checked: [{ type: core.Input }],
disabled: [{ type: core.Input }],
indeterminate: [{ type: core.Input }],
showCheckbox: [{ type: core.Input }],
showRowSelection: [{ type: core.Input }],
checkedChange: [{ type: core.Output }]
};
return NzTableSelectionComponent;
}());
if (false) {
/** @type {?} */
NzTableSelectionComponent.prototype.listOfSelections;
/** @type {?} */
NzTableSelectionComponent.prototype.checked;
/** @type {?} */
NzTableSelectionComponent.prototype.disabled;
/** @type {?} */
NzTableSelectionComponent.prototype.indeterminate;
/** @type {?} */
NzTableSelectionComponent.prototype.showCheckbox;
/** @type {?} */
NzTableSelectionComponent.prototype.showRowSelection;
/** @type {?} */
NzTableSelectionComponent.prototype.checkedChange;
}
/**
* @fileoverview added by tsickle
* Generated from: src/addon/sorters.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzTableSortersComponent = /** @class */ (function () {
function NzTableSortersComponent() {
this.sortDirections = ['ascend', 'descend', null];
this.sortOrder = null;
this.contentTemplate = null;
this.isUp = false;
this.isDown = false;
}
/**
* @param {?} changes
* @return {?}
*/
NzTableSortersComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
var sortDirections = changes.sortDirections;
if (sortDirections) {
this.isUp = this.sortDirections.indexOf('ascend') !== -1;
this.isDown = this.sortDirections.indexOf('descend') !== -1;
}
};
NzTableSortersComponent.decorators = [
{ type: core.Component, args: [{
selector: 'nz-table-sorters',
preserveWhitespaces: false,
changeDetection: core.ChangeDetectionStrategy.OnPush,
encapsulation: core.ViewEncapsulation.None,
template: "\n <span><ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template></span>\n <span class=\"ant-table-column-sorter\" [class.ant-table-column-sorter-full]=\"isDown && isUp\">\n <span class=\"ant-table-column-sorter-inner\">\n <i nz-icon nzType=\"caret-up\" *ngIf=\"isUp\" class=\"ant-table-column-sorter-up\" [class.active]=\"sortOrder == 'ascend'\"></i>\n <i nz-icon nzType=\"caret-down\" *ngIf=\"isDown\" class=\"ant-table-column-sorter-down\" [class.active]=\"sortOrder == 'descend'\"></i>\n </span>\n </span>\n ",
host: {
'[class.ant-table-column-sorters]': 'true'
}
}] }
];
NzTableSortersComponent.propDecorators = {
sortDirections: [{ type: core.Input }],
sortOrder: [{ type: core.Input }],
contentTemplate: [{ type: core.Input }]
};
return NzTableSortersComponent;
}());
if (false) {
/** @type {?} */
NzTableSortersComponent.prototype.sortDirections;
/** @type {?} */
NzTableSortersComponent.prototype.sortOrder;
/** @type {?} */
NzTableSortersComponent.prototype.contentTemplate;
/** @type {?} */
NzTableSortersComponent.prototype.isUp;
/** @type {?} */
NzTableSortersComponent.prototype.isDown;
}
/**
* @fileoverview added by tsickle
* Generated from: src/cell/cell-fixed.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzCellFixedDirective = /** @class */ (function () {
function NzCellFixedDirective(cdr, renderer, elementRef) {
this.cdr = cdr;
this.renderer = renderer;
this.elementRef = elementRef;
this.nzRight = false;
this.nzLeft = false;
this.colspan = null;
this.changes$ = new rxjs.Subject();
this.isFirstRight = false;
this.isLastLeft = false;
this.isAutoLeft = false;
this.isAutoRight = false;
this.isFixedLeft = false;
this.isFixedRight = false;
this.isFixed = false;
}
/**
* @param {?} isRightFirst
* @return {?}
*/
NzCellFixedDirective.prototype.setIsFirstRight = /**
* @param {?} isRightFirst
* @return {?}
*/
function (isRightFirst) {
this.isFirstRight = isRightFirst;
this.cdr.markForCheck();
};
/**
* @param {?} isLeftLast
* @return {?}
*/
NzCellFixedDirective.prototype.setIsLastLeft = /**
* @param {?} isLeftLast
* @return {?}
*/
function (isLeftLast) {
this.isLastLeft = isLeftLast;
this.cdr.markForCheck();
};
/**
* @param {?} autoLeft
* @return {?}
*/
NzCellFixedDirective.prototype.setAutoLeftWidth = /**
* @param {?} autoLeft
* @return {?}
*/
function (autoLeft) {
this.renderer.setStyle(this.elementRef.nativeElement, 'left', autoLeft);
};
/**
* @param {?} autoRight
* @return {?}
*/
NzCellFixedDirective.prototype.setAutoRightWidth = /**
* @param {?} autoRight
* @return {?}
*/
function (autoRight) {
this.renderer.setStyle(this.elementRef.nativeElement, 'right', autoRight);
};
/**
* @return {?}
*/
NzCellFixedDirective.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this.isFirstRight = false;
this.isLastLeft = false;
this.isAutoLeft = this.nzLeft === '' || this.nzLeft === true;
this.isAutoRight = this.nzRight === '' || this.nzRight === true;
this.isFixedLeft = this.nzLeft !== false;
this.isFixedRight = this.nzRight !== false;
this.isFixed = this.isFixedLeft || this.isFixedRight;
/** @type {?} */
var validatePx = (/**
* @param {?} value
* @return {?}
*/
function (value) {
if (typeof value === 'string' && value !== '') {
return value;
}
else {
return null;
}
});
this.setAutoLeftWidth(validatePx(this.nzLeft));
this.setAutoRightWidth(validatePx(this.nzRight));
this.changes$.next();
};
NzCellFixedDirective.decorators = [
{ type: core.Directive, args: [{
selector: 'td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]',
host: {
'[class.ant-table-cell-fix-right]': "isFixedRight",
'[class.ant-table-cell-fix-left]': "isFixedLeft",
'[class.ant-table-cell-fix-right-first]': "isFirstRight",
'[class.ant-table-cell-fix-left-last]': "isLastLeft",
'[style.position]': "isFixed? 'sticky' : null"
}
},] }
];
/** @nocollapse */
NzCellFixedDirective.ctorParameters = function () { return [
{ type: core.ChangeDetectorRef },
{ type: core.Renderer2 },
{ type: core.ElementRef }
]; };
NzCellFixedDirective.propDecorators = {
nzRight: [{ type: core.Input }],
nzLeft: [{ type: core.Input }],
colspan: [{ type: core.Input }]
};
return NzCellFixedDirective;
}());
if (false) {
/** @type {?} */
NzCellFixedDirective.prototype.nzRight;
/** @type {?} */
NzCellFixedDirective.prototype.nzLeft;
/** @type {?} */
NzCellFixedDirective.prototype.colspan;
/** @type {?} */
NzCellFixedDirective.prototype.changes$;
/** @type {?} */
NzCellFixedDirective.prototype.isFirstRight;
/** @type {?} */
NzCellFixedDirective.prototype.isLastLeft;
/** @type {?} */
NzCellFixedDirective.prototype.isAutoLeft;
/** @type {?} */
NzCellFixedDirective.prototype.isAutoRight;
/** @type {?} */
NzCellFixedDirective.prototype.isFixedLeft;
/** @type {?} */
NzCellFixedDirective.prototype.isFixedRight;
/** @type {?} */
NzCellFixedDirective.prototype.isFixed;
/**
* @type {?}
* @private
*/
NzCellFixedDirective.prototype.cdr;
/**
* @type {?}
* @private
*/
NzCellFixedDirective.prototype.renderer;
/**
* @type {?}
* @private
*/
NzCellFixedDirective.prototype.elementRef;
}
/**
* @fileoverview added by tsickle
* Generated from: src/table-style.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzTableStyleService = /** @class */ (function () {
function NzTableStyleService() {
this.theadTemplate$ = new rxjs.ReplaySubject(1);
this.hasFixLeft$ = new rxjs.ReplaySubject(1);
this.hasFixRight$ = new rxjs.ReplaySubject(1);
this.hostWidth$ = new rxjs.ReplaySubject(1);
this.columnCount$ = new rxjs.ReplaySubject(1);
this.showEmpty$ = new rxjs.ReplaySubject(1);
this.noResult$ = new rxjs.ReplaySubject(1);
this.listOfThWidthConfigPx$ = new rxjs.BehaviorSubject([]);
this.tableWidthConfigPx$ = new rxjs.BehaviorSubject([]);
this.manualWidthConfigPx$ = rxjs.combineLatest([this.tableWidthConfigPx$, this.listOfThWidthConfigPx$]).pipe(operators.map((/**
* @param {?} __0
* @return {?}
*/
function (_a) {
var _b = __read(_a, 2), widthConfig = _b[0], listOfWidth = _b[1];
return (widthConfig.length ? widthConfig : listOfWidth);
})));
this.listOfAutoWidthPx$ = new rxjs.ReplaySubject(1);
this.listOfListOfThWidthPx$ = rxjs.merge(this.manualWidthConfigPx$, rxjs.combineLatest([this.listOfAutoWidthPx$, this.manualWidthConfigPx$]).pipe(operators.map((/**
* @param {?} __0
* @return {?}
*/
function (_a) {
var _b = __read(_a, 2), autoWidth = _b[0], manualWidth = _b[1];
/** use autoWidth until column length match **/
return autoWidth.length !== manualWidth.length ? manualWidth : autoWidth;
}))));
this.listOfMeasureColumn$ = new rxjs.ReplaySubject(1);
this.listOfListOfThWidth$ = this.listOfAutoWidthPx$.pipe(operators.map((/**
* @param {?} list
* @return {?}
*/
function (list) { return list.map((/**
* @param {?} width
* @return {?}
*/
function (width) { return parseInt(width, 10); })); })));
this.enableAutoMeasure$ = new rxjs.ReplaySubject(1);
}
/**
* @param {?} template
* @return {?}
*/
NzTableStyleService.prototype.setTheadTemplate = /**
* @param {?} template
* @return {?}
*/
function (template) {
this.theadTemplate$.next(template);
};
/**
* @param {?} hasFixLeft
* @return {?}
*/
NzTableStyleService.prototype.setHasFixLeft = /**
* @param {?} hasFixLeft
* @return {?}
*/
function (hasFixLeft) {
this.hasFixLeft$.next(hasFixLeft);
};
/**
* @param {?} hasFixRight
* @return {?}
*/
NzTableStyleService.prototype.setHasFixRight = /**
* @param {?} hasFixRight
* @return {?}
*/
function (hasFixRight) {
this.hasFixRight$.next(hasFixRight);
};
/**
* @param {?} widthConfig
* @return {?}
*/
NzTableStyleService.prototype.setTableWidthConfig = /**
* @param {?} widthConfig
* @return {?}
*/
function (widthConfig) {
this.tableWidthConfigPx$.next(widthConfig);
};
/**
* @param {?} listOfTh
* @return {?}
*/
NzTableStyleService.prototype.setListOfTh = /**
* @param {?} listOfTh
* @return {?}
*/
function (listOfTh) {
/** @type {?} */
var columnCount = 0;
listOfTh.forEach((/**
* @param {?} th
* @return {?}
*/
function (th) {
columnCount += th.colspan || 1;
}));
/** @type {?} */
var listOfThPx = listOfTh.map((/**
* @param {?} item
* @return {?}
*/
function (item) { return item.nzWidth; }));
this.columnCount$.next(columnCount);
this.listOfThWidthConfigPx$.next(listOfThPx);
};
/**
* @param {?} listOfTh
* @return {?}
*/
NzTableStyleService.prototype.setListOfMeasureColumn = /**
* @param {?} listOfTh
* @return {?}
*/
function (listOfTh) {
/** @type {?} */
var listOfKeys = [];
listOfTh.forEach((/**
* @param {?} th
* @return {?}
*/
function (th) {
/** @type {?} */
var length = th.colspan || 1;
for (var i = 0; i < length; i++) {
listOfKeys.push("measure_key_" + i);
}
}));
this.listOfMeasureColumn$.next(listOfKeys);
};
/**
* @param {?} listOfAutoWidth
* @return {?}
*/
NzTableStyleService.prototype.setListOfAutoWidth = /**
* @param {?} listOfAutoWidth
* @return {?}
*/
function (listOfAutoWidth) {
this.listOfAutoWidthPx$.next(listOfAutoWidth.map((/**
* @param {?} width
* @return {?}
*/
function (width) { return width + "px"; })));
};
/**
* @param {?} showEmpty
* @return {?}
*/
NzTableStyleService.prototype.setShowEmpty = /**
* @param {?} showEmpty
* @return {?}
*/
function (showEmpty) {
this.showEmpty$.next(showEmpty);
};
/**
* @param {?} noResult
* @return {?}
*/
NzTableStyleService.prototype.setNoResult = /**
* @param {?} noResult
* @return {?}
*/
function (noResult) {
this.noResult$.next(noResult);
};
/**
* @param {?} scrollX
* @param {?} scrollY
* @return {?}
*/
NzTableStyleService.prototype.setScroll = /**
* @param {?} scrollX
* @param {?} scrollY
* @return {?}
*/
function (scrollX, scrollY) {
/** @type {?} */
var enableAutoMeasure = !!(scrollX || scrollY);
if (!enableAutoMeasure) {
this.setListOfAutoWidth([]);
}
this.enableAutoMeasure$.next(enableAutoMeasure);
};