ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
226 lines • 18.7 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { Directive, ElementRef, Host, Input, Optional, Renderer2 } from '@angular/core';
import { Subject } from 'rxjs';
import { startWith, takeUntil } from 'rxjs/operators';
import { NzUpdateHostClassService } from '../core/services/update-host-class.service';
import { isNotNil } from '../core/util/check';
import { NzRowDirective } from './nz-row.directive';
/**
* @record
*/
export function EmbeddedProperty() { }
if (false) {
/** @type {?} */
EmbeddedProperty.prototype.span;
/** @type {?} */
EmbeddedProperty.prototype.pull;
/** @type {?} */
EmbeddedProperty.prototype.push;
/** @type {?} */
EmbeddedProperty.prototype.offset;
/** @type {?} */
EmbeddedProperty.prototype.order;
}
var NzColDirective = /** @class */ (function () {
function NzColDirective(nzUpdateHostClassService, elementRef, nzRowDirective, renderer) {
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.elementRef = elementRef;
this.nzRowDirective = nzRowDirective;
this.renderer = renderer;
this.el = this.elementRef.nativeElement;
this.prefixCls = 'ant-col';
this.destroy$ = new Subject();
}
/** temp solution since no method add classMap to host https://github.com/angular/angular/issues/7289*/
// tslint:disable-line:no-any
/**
* temp solution since no method add classMap to host https://github.com/angular/angular/issues/7289
* @return {?}
*/
NzColDirective.prototype.setClassMap =
// tslint:disable-line:no-any
/**
* temp solution since no method add classMap to host https://github.com/angular/angular/issues/7289
* @return {?}
*/
function () {
var _a;
/** @type {?} */
var classMap = tslib_1.__assign((_a = {}, _a[this.prefixCls + "-" + this.nzSpan] = isNotNil(this.nzSpan), _a[this.prefixCls + "-order-" + this.nzOrder] = isNotNil(this.nzOrder), _a[this.prefixCls + "-offset-" + this.nzOffset] = isNotNil(this.nzOffset), _a[this.prefixCls + "-pull-" + this.nzPull] = isNotNil(this.nzPull), _a[this.prefixCls + "-push-" + this.nzPush] = isNotNil(this.nzPush), _a), this.generateClass());
this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
};
/**
* @return {?}
*/
NzColDirective.prototype.generateClass = /**
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var listOfSizeInputName = ['nzXs', 'nzSm', 'nzMd', 'nzLg', 'nzXl', 'nzXXl'];
/** @type {?} */
var listClassMap = {};
listOfSizeInputName.forEach((/**
* @param {?} name
* @return {?}
*/
function (name) {
/** @type {?} */
var sizeName = name.replace('nz', '').toLowerCase();
if (isNotNil(_this[name])) {
if (typeof _this[name] === 'number' || typeof _this[name] === 'string') {
listClassMap[_this.prefixCls + "-" + sizeName + "-" + _this[name]] = true;
}
else {
listClassMap[_this.prefixCls + "-" + sizeName + "-" + _this[name].span] = _this[name] && isNotNil(_this[name].span);
listClassMap[_this.prefixCls + "-" + sizeName + "-pull-" + _this[name].pull] =
_this[name] && isNotNil(_this[name].pull);
listClassMap[_this.prefixCls + "-" + sizeName + "-push-" + _this[name].push] =
_this[name] && isNotNil(_this[name].push);
listClassMap[_this.prefixCls + "-" + sizeName + "-offset-" + _this[name].offset] =
_this[name] && isNotNil(_this[name].offset);
listClassMap[_this.prefixCls + "-" + sizeName + "-order-" + _this[name].order] =
_this[name] && isNotNil(_this[name].order);
}
}
}));
return listClassMap;
};
/**
* @return {?}
*/
NzColDirective.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this.setClassMap();
};
/**
* @return {?}
*/
NzColDirective.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this.nzRowDirective) {
this.nzRowDirective.actualGutter$
.pipe(startWith(this.nzRowDirective.actualGutter), takeUntil(this.destroy$))
.subscribe((/**
* @param {?} actualGutter
* @return {?}
*/
function (actualGutter) {
_this.renderer.setStyle(_this.el, 'padding-left', actualGutter / 2 + "px");
_this.renderer.setStyle(_this.el, 'padding-right', actualGutter / 2 + "px");
}));
}
};
/**
* @return {?}
*/
NzColDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this.setClassMap();
};
/**
* @return {?}
*/
NzColDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroy$.next();
this.destroy$.complete();
};
NzColDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-col],nz-col',
providers: [NzUpdateHostClassService]
},] }
];
/** @nocollapse */
NzColDirective.ctorParameters = function () { return [
{ type: NzUpdateHostClassService },
{ type: ElementRef },
{ type: NzRowDirective, decorators: [{ type: Optional }, { type: Host }] },
{ type: Renderer2 }
]; };
NzColDirective.propDecorators = {
nzSpan: [{ type: Input }],
nzOrder: [{ type: Input }],
nzOffset: [{ type: Input }],
nzPush: [{ type: Input }],
nzPull: [{ type: Input }],
nzXs: [{ type: Input }],
nzSm: [{ type: Input }],
nzMd: [{ type: Input }],
nzLg: [{ type: Input }],
nzXl: [{ type: Input }],
nzXXl: [{ type: Input }]
};
return NzColDirective;
}());
export { NzColDirective };
if (false) {
/**
* @type {?}
* @private
*/
NzColDirective.prototype.el;
/**
* @type {?}
* @private
*/
NzColDirective.prototype.prefixCls;
/**
* @type {?}
* @protected
*/
NzColDirective.prototype.destroy$;
/** @type {?} */
NzColDirective.prototype.nzSpan;
/** @type {?} */
NzColDirective.prototype.nzOrder;
/** @type {?} */
NzColDirective.prototype.nzOffset;
/** @type {?} */
NzColDirective.prototype.nzPush;
/** @type {?} */
NzColDirective.prototype.nzPull;
/** @type {?} */
NzColDirective.prototype.nzXs;
/** @type {?} */
NzColDirective.prototype.nzSm;
/** @type {?} */
NzColDirective.prototype.nzMd;
/** @type {?} */
NzColDirective.prototype.nzLg;
/** @type {?} */
NzColDirective.prototype.nzXl;
/** @type {?} */
NzColDirective.prototype.nzXXl;
/**
* @type {?}
* @private
*/
NzColDirective.prototype.nzUpdateHostClassService;
/**
* @type {?}
* @private
*/
NzColDirective.prototype.elementRef;
/** @type {?} */
NzColDirective.prototype.nzRowDirective;
/** @type {?} */
NzColDirective.prototype.renderer;
/* Skipping unhandled member: [property: string]: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