ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
38,542 lines • 1.32 MB
JavaScript
import { IconService, IconDirective } from '@ant-design/icons-angular';
import { BarsOutline, CalendarOutline, CaretDownFill, CaretDownOutline, CaretUpFill, CaretUpOutline, CheckCircleFill, CheckCircleOutline, CheckOutline, ClockCircleOutline, CloseCircleFill, CloseCircleOutline, CloseOutline, DoubleLeftOutline, DoubleRightOutline, DownOutline, EllipsisOutline, ExclamationCircleFill, ExclamationCircleOutline, EyeOutline, FileFill, FileOutline, FilterFill, InfoCircleFill, InfoCircleOutline, LeftOutline, LoadingOutline, PaperClipOutline, QuestionCircleOutline, RightOutline, SearchOutline, StarFill, UploadOutline, UpOutline } from '@ant-design/icons-angular/icons';
import { ActivatedRoute, NavigationEnd, PRIMARY_OUTLET, Router } from '@angular/router';
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
import fnsFormat from 'date-fns/format';
import fnsGetISOWeek from 'date-fns/get_iso_week';
import fnsParse from 'date-fns/parse';
import { coerceBooleanProperty, coerceCssPixelValue, _isNumberValue, coerceElement } from '@angular/cdk/coercion';
import addDays from 'date-fns/add_days';
import differenceInCalendarDays from 'date-fns/difference_in_calendar_days';
import differenceInCalendarMonths from 'date-fns/difference_in_calendar_months';
import differenceInCalendarWeeks from 'date-fns/difference_in_calendar_weeks';
import isSameDay from 'date-fns/is_same_day';
import isSameMonth from 'date-fns/is_same_month';
import isSameYear from 'date-fns/is_same_year';
import isThisMonth from 'date-fns/is_this_month';
import isThisYear from 'date-fns/is_this_year';
import setYear from 'date-fns/set_year';
import startOfMonth from 'date-fns/start_of_month';
import startOfWeek from 'date-fns/start_of_week';
import startOfYear from 'date-fns/start_of_year';
import { DomSanitizer } from '@angular/platform-browser';
import addMonths from 'date-fns/add_months';
import addYears from 'date-fns/add_years';
import endOfMonth from 'date-fns/end_of_month';
import setDay from 'date-fns/set_day';
import setMonth from 'date-fns/set_month';
import { MediaMatcher, LayoutModule } from '@angular/cdk/layout';
import { Platform, PlatformModule } from '@angular/cdk/platform';
import { FocusMonitor, FocusTrapFactory } from '@angular/cdk/a11y';
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
import { ObserversModule } from '@angular/cdk/observers';
import { Directionality } from '@angular/cdk/bidi';
import { DOCUMENT, CommonModule, DatePipe, getLocaleNumberSymbol, NumberSymbol } from '@angular/common';
import { NG_VALUE_ACCESSOR, FormsModule, NgControl, FormControl, FormControlName } from '@angular/forms';
import { DOWN_ARROW, ENTER, ESCAPE, TAB, UP_ARROW, BACKSPACE, SPACE, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes';
import { HttpBackend, HttpRequest, HttpHeaders, HttpEventType, HttpResponse, HttpClient } from '@angular/common/http';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { __decorate, __metadata } from 'tslib';
import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayModule, CdkConnectedOverlay, CdkOverlayOrigin, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal, ComponentPortal, PortalInjector, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
import { fromEvent, defer, merge, Subscription, Subject, BehaviorSubject, combineLatest, ReplaySubject, EMPTY, interval, of, Observable } from 'rxjs';
import { distinctUntilChanged, throttleTime, filter, switchMap, take, delay, distinct, map, takeUntil, startWith, share, skip, tap, flatMap, debounceTime, auditTime, mapTo, pluck } from 'rxjs/operators';
import { Inject, Injectable, Optional, SkipSelf, TemplateRef, Type, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild, ViewEncapsulation, NgModule, Directive, Renderer2, ViewContainerRef, InjectionToken, RendererFactory2, ChangeDetectorRef, ContentChild, SecurityContext, ContentChildren, NgZone, forwardRef, Host, Pipe, Self, ComponentFactoryResolver, HostListener, Injector, ViewChildren, Version, defineInjectable, inject, LOCALE_ID, HostBinding, ApplicationRef, INJECTOR } from '@angular/core';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// tslint:disable:no-any typedef no-invalid-this
/** @type {?} */
const availablePrefixs = ['moz', 'ms', 'webkit'];
/**
* @return {?}
*/
function requestAnimationFramePolyfill() {
/** @type {?} */
let lastTime = 0;
return (/**
* @param {?} callback
* @return {?}
*/
function (callback) {
/** @type {?} */
const currTime = new Date().getTime();
/** @type {?} */
const timeToCall = Math.max(0, 16 - (currTime - lastTime));
/** @type {?} */
const id = setTimeout((/**
* @return {?}
*/
() => {
callback(currTime + timeToCall);
}), timeToCall);
lastTime = currTime + timeToCall;
return id;
});
}
/**
* @return {?}
*/
function getRequestAnimationFrame() {
if (typeof window === 'undefined') {
return (/**
* @return {?}
*/
() => null);
}
if (window.requestAnimationFrame) {
// https://github.com/vuejs/vue/issues/4465
return window.requestAnimationFrame.bind(window);
}
/** @type {?} */
const prefix = availablePrefixs.filter((/**
* @param {?} key
* @return {?}
*/
key => `${key}RequestAnimationFrame` in window))[0];
return prefix
? window[`${prefix}RequestAnimationFrame`]
: requestAnimationFramePolyfill();
}
/**
* @param {?} id
* @return {?}
*/
function cancelRequestAnimationFrame(id) {
if (typeof window === 'undefined') {
return null;
}
if (window.cancelAnimationFrame) {
return window.cancelAnimationFrame(id);
}
/** @type {?} */
const prefix = availablePrefixs.filter((/**
* @param {?} key
* @return {?}
*/
key => `${key}CancelAnimationFrame` in window || `${key}CancelRequestAnimationFrame` in window))[0];
return prefix ?
(((/** @type {?} */ (window)))[`${prefix}CancelAnimationFrame`] ||
((/** @type {?} */ (window)))[`${prefix}CancelRequestAnimationFrame`]).call(this, id) : clearTimeout(id);
}
/** @type {?} */
const reqAnimFrame = getRequestAnimationFrame();
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} t
* @param {?} b
* @param {?} c
* @param {?} d
* @return {?}
*/
function easeInOutCubic(t, b, c, d) {
/** @type {?} */
const cc = c - b;
/** @type {?} */
let tt = t / (d / 2);
if (tt < 1) {
return cc / 2 * tt * tt * tt + b;
}
else {
return cc / 2 * ((tt -= 2) * tt * tt + 2) + b;
}
}
class NzScrollService {
/* tslint:disable-next-line:no-any */
/**
* @param {?} doc
*/
constructor(doc) {
this.doc = doc;
}
/**
* 设置 `el` 滚动条位置
* @param {?} el
* @param {?=} topValue
* @return {?}
*/
setScrollTop(el, topValue = 0) {
if (el === window) {
this.doc.body.scrollTop = topValue;
this.doc.documentElement.scrollTop = topValue;
}
else {
((/** @type {?} */ (el))).scrollTop = topValue;
}
}
/**
* 获取 `el` 相对于视窗距离
* @param {?} el
* @return {?}
*/
getOffset(el) {
/** @type {?} */
const ret = {
top: 0,
left: 0
};
if (!el || !el.getClientRects().length)
return ret;
/** @type {?} */
const rect = el.getBoundingClientRect();
if (rect.width || rect.height) {
/** @type {?} */
const doc = el.ownerDocument.documentElement;
ret.top = rect.top - doc.clientTop;
ret.left = rect.left - doc.clientLeft;
}
else {
ret.top = rect.top;
ret.left = rect.left;
}
return ret;
}
/**
* 获取 `el` 滚动条位置
* @param {?=} el
* @param {?=} top
* @return {?}
*/
// TODO: remove '| Window' as the fallback already happens here
getScroll(el, top = true) {
/** @type {?} */
const target = el ? el : window;
/** @type {?} */
const prop = top ? 'pageYOffset' : 'pageXOffset';
/** @type {?} */
const method = top ? 'scrollTop' : 'scrollLeft';
/** @type {?} */
const isWindow = target === window;
/** @type {?} */
let ret = isWindow ? target[prop] : target[method];
if (isWindow && typeof ret !== 'number') {
ret = this.doc.documentElement[method];
}
return ret;
}
/**
* 使用动画形式将 `el` 滚动至某位置
*
* @param {?} containerEl 容器,默认 `window`
* @param {?=} targetTopValue 滚动至目标 `top` 值,默认:0,相当于顶部
* @param {?=} easing 动作算法,默认:`easeInOutCubic`
* @param {?=} callback 动画结束后回调
* @return {?}
*/
scrollTo(containerEl, targetTopValue = 0, easing, callback) {
/** @type {?} */
const target = containerEl ? containerEl : window;
/** @type {?} */
const scrollTop = this.getScroll(target);
/** @type {?} */
const startTime = Date.now();
/** @type {?} */
const frameFunc = (/**
* @return {?}
*/
() => {
/** @type {?} */
const timestamp = Date.now();
/** @type {?} */
const time = timestamp - startTime;
this.setScrollTop(target, (easing || easeInOutCubic)(time, scrollTop, targetTopValue, 450));
if (time < 450) {
reqAnimFrame(frameFunc);
}
else {
if (callback)
callback();
}
});
reqAnimFrame(frameFunc);
}
}
NzScrollService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzScrollService.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
/**
* @param {?} doc
* @param {?} scrollService
* @return {?}
*/
function SCROLL_SERVICE_PROVIDER_FACTORY(doc, scrollService) {
return scrollService || new NzScrollService(doc);
}
/** @type {?} */
const SCROLL_SERVICE_PROVIDER = {
provide: NzScrollService,
useFactory: SCROLL_SERVICE_PROVIDER_FACTORY,
deps: [DOCUMENT, [new Optional(), new SkipSelf(), NzScrollService]]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isNotNil(value) {
return (typeof (value) !== 'undefined') && value !== null;
}
/**
* Examine if two objects are shallowly equaled.
* @param {?} objA
* @param {?} objB
* @return {?}
*/
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {
return false;
}
/** @type {?} */
const keysA = Object.keys(objA);
/** @type {?} */
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
/** @type {?} */
const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
// tslint:disable-next-line:prefer-for-of
for (let idx = 0; idx < keysA.length; idx++) {
/** @type {?} */
const key = keysA[idx];
if (!bHasOwnProperty(key)) {
return false;
}
if (objA[key] !== objB[key]) {
return false;
}
}
return true;
}
/**
* @param {?} value
* @return {?}
*/
function isInteger(value) {
return typeof value === 'number' &&
isFinite(value) &&
Math.floor(value) === value;
}
/**
* @param {?} element
* @return {?}
*/
function isEmpty(element) {
/** @type {?} */
const nodes = element.childNodes;
for (let i = 0; i < nodes.length; i++) {
if (filterNotEmptyNode(nodes.item(i))) {
return false;
}
}
return true;
}
/**
* @param {?} node
* @return {?}
*/
function filterNotEmptyNode(node) {
if (node) {
if ((node.nodeType === 1) && (((/** @type {?} */ (node))).outerHTML.toString().trim().length !== 0)) {
// ELEMENT_NODE
return node;
}
else if ((node.nodeType === 3) && (node.textContent.toString().trim().length !== 0)) {
// TEXT_NODE
return node;
}
return null;
}
return null;
}
/**
* @param {?} value
* @return {?}
*/
function isNonEmptyString(value) {
return typeof value === 'string' && value !== '';
}
/**
* @param {?} value
* @return {?}
*/
function isTemplateRef(value) {
return value instanceof TemplateRef;
}
/**
* @param {?} value
* @return {?}
*/
function isComponent(value) {
return value instanceof Type;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} value
* @return {?}
*/
function toBoolean(value) {
return coerceBooleanProperty(value);
}
/**
* @param {?} value
* @param {?=} fallbackValue
* @return {?}
*/
function toNumber(value, fallbackValue = 0) {
return _isNumberValue(value) ? Number(value) : fallbackValue;
}
/**
* @param {?} value
* @return {?}
*/
function toCssPixel(value) {
return coerceCssPixelValue(value);
}
// Get the function-property type's value
/**
* @template T
* @param {?} prop
* @param {...?} args
* @return {?}
*/
function valueFunctionProp(prop, ...args) {
return typeof prop === 'function' ? prop(...args) : prop;
}
// tslint:disable-next-line: no-any
/**
* @template T, D
* @param {?} name
* @param {?} fallback
* @return {?}
*/
function propDecoratorFactory(name, fallback) {
// tslint:disable-next-line: no-any
/**
* @param {?} target
* @param {?} propName
* @return {?}
*/
function propDecorator(target, propName) {
/** @type {?} */
const privatePropName = `$$__${propName}`;
if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
console.warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
}
Object.defineProperty(target, privatePropName, {
configurable: true,
writable: true
});
Object.defineProperty(target, propName, {
/**
* @return {?}
*/
get() {
return this[privatePropName]; // tslint:disable-line:no-invalid-this
},
/**
* @param {?} value
* @return {?}
*/
set(value) {
this[privatePropName] = fallback(value); // tslint:disable-line:no-invalid-this
}
});
}
return propDecorator;
}
/**
* Input decorator that handle a prop to do get/set automatically with toBoolean
*
* Why not using \@InputBoolean alone without \@Input? AOT needs \@Input to be visible
*
* \@howToUse
* ```
* \@Input() \@InputBoolean() visible: boolean = false;
*
* // Act as below:
* // \@Input()
* // get visible() { return this.__visibile; }
* // set visible(value) { this.__visible = value; }
* // __visible = false;
* ```
* @return {?}
*/
function InputBoolean() {
return propDecoratorFactory('InputBoolean', toBoolean);
}
/**
* @return {?}
*/
function InputCssPixel() {
return propDecoratorFactory('InputCssPixel', toCssPixel);
}
/**
* @return {?}
*/
function InputNumber() {
return propDecoratorFactory('InputNumber', toNumber);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} fn
* @return {?}
*/
function throttleByAnimationFrame(fn) {
/** @type {?} */
let requestId;
/** @type {?} */
const later = (/**
* @param {?} args
* @return {?}
*/
(args) => (/**
* @return {?}
*/
() => {
requestId = null;
fn(...args);
}));
/** @type {?} */
const throttled = (/**
* @param {...?} args
* @return {?}
*/
(...args) => {
if (requestId == null) {
requestId = reqAnimFrame(later(args));
}
});
// tslint:disable-next-line:no-non-null-assertion
((/** @type {?} */ (throttled))).cancel = (/**
* @return {?}
*/
() => cancelRequestAnimationFrame((/** @type {?} */ (requestId))));
return throttled;
}
/**
* @return {?}
*/
function throttleByAnimationFrameDecorator() {
return (/**
* @param {?} target
* @param {?} key
* @param {?} descriptor
* @return {?}
*/
function (target, key, descriptor) {
/** @type {?} */
const fn = descriptor.value;
/** @type {?} */
let definingProperty = false;
return {
configurable: true,
/**
* @return {?}
*/
get() {
if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
return fn;
}
/** @type {?} */
const boundFn = throttleByAnimationFrame(fn.bind(this));
definingProperty = true;
Object.defineProperty(this, key, {
value: boundFn,
configurable: true,
writable: true
});
definingProperty = false;
return boundFn;
}
};
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAffixComponent {
// tslint:disable-next-line:no-any
/**
* @param {?} _el
* @param {?} scrollSrv
* @param {?} doc
*/
constructor(_el, scrollSrv, doc) {
this.scrollSrv = scrollSrv;
this.doc = doc;
this.nzChange = new EventEmitter();
this.events = [
'resize',
'scroll',
'touchstart',
'touchmove',
'touchend',
'pageshow',
'load'
];
this._target = window;
this.placeholderNode = _el.nativeElement;
}
/**
* @param {?} value
* @return {?}
*/
set nzTarget(value) {
this.clearEventListeners();
this._target = typeof value === 'string' ? this.doc.querySelector(value) : value || window;
this.setTargetEventListeners();
this.updatePosition((/** @type {?} */ ({})));
}
/**
* @param {?} value
* @return {?}
*/
set nzOffsetTop(value) {
if (typeof value === 'undefined') {
return;
}
this._offsetTop = toNumber(value, null);
this.updatePosition((/** @type {?} */ ({})));
}
/**
* @return {?}
*/
get nzOffsetTop() {
return this._offsetTop;
}
/**
* @param {?} value
* @return {?}
*/
set nzOffsetBottom(value) {
if (typeof value === 'undefined') {
return;
}
this._offsetBottom = toNumber(value, null);
this.updatePosition((/** @type {?} */ ({})));
}
/**
* @return {?}
*/
ngOnInit() {
this.timeout = setTimeout((/**
* @return {?}
*/
() => {
this.setTargetEventListeners();
this.updatePosition((/** @type {?} */ ({})));
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.clearEventListeners();
clearTimeout(this.timeout);
// tslint:disable-next-line:no-any
((/** @type {?} */ (this.updatePosition))).cancel();
}
/**
* @param {?} element
* @param {?} target
* @return {?}
*/
getOffset(element, target) {
/** @type {?} */
const elemRect = element.getBoundingClientRect();
/** @type {?} */
const targetRect = this.getTargetRect(target);
/** @type {?} */
const scrollTop = this.scrollSrv.getScroll(target, true);
/** @type {?} */
const scrollLeft = this.scrollSrv.getScroll(target, false);
/** @type {?} */
const docElem = this.doc.body;
/** @type {?} */
const clientTop = docElem.clientTop || 0;
/** @type {?} */
const clientLeft = docElem.clientLeft || 0;
return {
top: elemRect.top - targetRect.top + scrollTop - clientTop,
left: elemRect.left - targetRect.left + scrollLeft - clientLeft,
width: elemRect.width,
height: elemRect.height
};
}
/**
* @private
* @return {?}
*/
setTargetEventListeners() {
this.clearEventListeners();
this.events.forEach((/**
* @param {?} eventName
* @return {?}
*/
(eventName) => {
this._target.addEventListener(eventName, this.updatePosition, false);
}));
}
/**
* @private
* @return {?}
*/
clearEventListeners() {
this.events.forEach((/**
* @param {?} eventName
* @return {?}
*/
eventName => {
this._target.removeEventListener(eventName, this.updatePosition, false);
}));
}
/**
* @private
* @param {?} target
* @return {?}
*/
getTargetRect(target) {
return target !== window ?
((/** @type {?} */ (target))).getBoundingClientRect() :
(/** @type {?} */ ({ top: 0, left: 0, bottom: 0 }));
}
/**
* @private
* @param {?} affixStyle
* @return {?}
*/
genStyle(affixStyle) {
if (affixStyle == null) {
return '';
}
return Object.keys(affixStyle).map((/**
* @param {?} key
* @return {?}
*/
key => {
/** @type {?} */
const val = affixStyle[key];
return `${key}:${typeof val === 'string' ? val : val + 'px'}`;
})).join(';');
}
/**
* @private
* @param {?} e
* @param {?} affixStyle
* @return {?}
*/
setAffixStyle(e, affixStyle) {
/** @type {?} */
const originalAffixStyle = this.affixStyle;
/** @type {?} */
const isWindow = this._target === window;
if (e.type === 'scroll' && originalAffixStyle && affixStyle && isWindow) {
return;
}
if (shallowEqual(originalAffixStyle, affixStyle)) {
return;
}
/** @type {?} */
const fixed = !!affixStyle;
/** @type {?} */
const wrapEl = (/** @type {?} */ (this.fixedEl.nativeElement));
wrapEl.style.cssText = this.genStyle(affixStyle);
this.affixStyle = affixStyle;
/** @type {?} */
const cls = 'ant-affix';
if (fixed) {
wrapEl.classList.add(cls);
}
else {
wrapEl.classList.remove(cls);
}
if ((affixStyle && !originalAffixStyle) || (!affixStyle && originalAffixStyle)) {
this.nzChange.emit(fixed);
}
}
/**
* @private
* @param {?} placeholderStyle
* @return {?}
*/
setPlaceholderStyle(placeholderStyle) {
/** @type {?} */
const originalPlaceholderStyle = this.placeholderStyle;
if (shallowEqual(placeholderStyle, originalPlaceholderStyle)) {
return;
}
this.placeholderNode.style.cssText = this.genStyle(placeholderStyle);
this.placeholderStyle = placeholderStyle;
}
/**
* @private
* @param {?} e
* @return {?}
*/
syncPlaceholderStyle(e) {
if (!this.affixStyle) {
return;
}
this.placeholderNode.style.cssText = '';
/** @type {?} */
const widthObj = { width: this.placeholderNode.offsetWidth };
this.setAffixStyle(e, Object.assign({}, this.affixStyle, widthObj));
this.setPlaceholderStyle(widthObj);
}
/**
* @param {?} e
* @return {?}
*/
updatePosition(e) {
/** @type {?} */
const targetNode = this._target;
// Backwards support
/** @type {?} */
let offsetTop = this.nzOffsetTop;
/** @type {?} */
const scrollTop = this.scrollSrv.getScroll(targetNode, true);
/** @type {?} */
const elemOffset = this.getOffset(this.placeholderNode, targetNode);
/** @type {?} */
const fixedNode = (/** @type {?} */ (this.fixedEl.nativeElement));
/** @type {?} */
const elemSize = {
width: fixedNode.offsetWidth,
height: fixedNode.offsetHeight
};
/** @type {?} */
const offsetMode = {
top: false,
bottom: false
};
// Default to `offsetTop=0`.
if (typeof offsetTop !== 'number' && typeof this._offsetBottom !== 'number') {
offsetMode.top = true;
offsetTop = 0;
}
else {
offsetMode.top = typeof offsetTop === 'number';
offsetMode.bottom = typeof this._offsetBottom === 'number';
}
/** @type {?} */
const targetRect = this.getTargetRect(targetNode);
/** @type {?} */
const targetInnerHeight = ((/** @type {?} */ (targetNode))).innerHeight || ((/** @type {?} */ (targetNode))).clientHeight;
if (scrollTop >= elemOffset.top - ((/** @type {?} */ (offsetTop))) && offsetMode.top) {
/** @type {?} */
const width = elemOffset.width;
/** @type {?} */
const top = targetRect.top + ((/** @type {?} */ (offsetTop)));
this.setAffixStyle(e, {
position: 'fixed',
top,
left: targetRect.left + elemOffset.left,
maxHeight: `calc(100vh - ${top}px)`,
width
});
this.setPlaceholderStyle({
width,
height: elemSize.height
});
}
else if (scrollTop <= elemOffset.top + elemSize.height + ((/** @type {?} */ (this._offsetBottom))) - targetInnerHeight &&
offsetMode.bottom) {
/** @type {?} */
const targetBottomOffet = targetNode === window ? 0 : (window.innerHeight - targetRect.bottom);
/** @type {?} */
const width = elemOffset.width;
this.setAffixStyle(e, {
position: 'fixed',
bottom: targetBottomOffet + ((/** @type {?} */ (this._offsetBottom))),
left: targetRect.left + elemOffset.left,
width
});
this.setPlaceholderStyle({
width,
height: elemOffset.height
});
}
else {
if (e.type === 'resize' && this.affixStyle && this.affixStyle.position === 'fixed' && this.placeholderNode.offsetWidth) {
this.setAffixStyle(e, Object.assign({}, this.affixStyle, { width: this.placeholderNode.offsetWidth }));
}
else {
this.setAffixStyle(e, null);
}
this.setPlaceholderStyle(null);
}
if (e.type === 'resize') {
this.syncPlaceholderStyle(e);
}
}
}
NzAffixComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-affix',
template: "<div #fixedEl>\n <ng-content></ng-content>\n</div>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styles: [`
nz-affix {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzAffixComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzScrollService },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
NzAffixComponent.propDecorators = {
nzTarget: [{ type: Input }],
nzOffsetTop: [{ type: Input }],
nzOffsetBottom: [{ type: Input }],
nzChange: [{ type: Output }],
fixedEl: [{ type: ViewChild, args: ['fixedEl',] }]
};
__decorate([
throttleByAnimationFrameDecorator(),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Event]),
__metadata("design:returntype", void 0)
], NzAffixComponent.prototype, "updatePosition", null);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAffixModule {
}
NzAffixModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzAffixComponent],
exports: [NzAffixComponent],
imports: [CommonModule],
providers: [SCROLL_SERVICE_PROVIDER]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzClassListAddDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.classList = [];
}
/**
* @param {?} list
* @return {?}
*/
set nzClassListAdd(list) {
this.classList.forEach((/**
* @param {?} name
* @return {?}
*/
name => {
this.renderer.removeClass(this.elementRef.nativeElement, name);
}));
list.forEach((/**
* @param {?} name
* @return {?}
*/
name => {
this.renderer.addClass(this.elementRef.nativeElement, name);
}));
this.classList = list;
}
}
NzClassListAddDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzClassListAdd]'
},] }
];
/** @nocollapse */
NzClassListAddDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzClassListAddDirective.propDecorators = {
nzClassListAdd: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStringTemplateOutletDirective {
/**
* @param {?} viewContainer
* @param {?} defaultTemplate
*/
constructor(viewContainer, defaultTemplate) {
this.viewContainer = viewContainer;
this.defaultTemplate = defaultTemplate;
this.inputTemplate = null;
this.inputViewRef = null;
this.defaultViewRef = null;
}
/**
* @param {?} value
* @return {?}
*/
set nzStringTemplateOutlet(value) {
if (value instanceof TemplateRef) {
this.isTemplate = true;
this.inputTemplate = value;
}
else {
this.isTemplate = false;
}
this.updateView();
}
/**
* @return {?}
*/
updateView() {
if (!this.isTemplate) {
/** use default template when input is string **/
if (!this.defaultViewRef) {
this.viewContainer.clear();
this.inputViewRef = null;
if (this.defaultTemplate) {
this.defaultViewRef = this.viewContainer.createEmbeddedView(this.defaultTemplate);
}
}
}
else {
/** use input template when input is templateRef **/
if (!this.inputViewRef) {
this.viewContainer.clear();
this.defaultViewRef = null;
if (this.inputTemplate) {
this.inputViewRef = this.viewContainer.createEmbeddedView(this.inputTemplate);
}
}
}
}
}
NzStringTemplateOutletDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzStringTemplateOutlet]'
},] }
];
/** @nocollapse */
NzStringTemplateOutletDirective.ctorParameters = () => [
{ type: ViewContainerRef },
{ type: TemplateRef }
];
NzStringTemplateOutletDirective.propDecorators = {
nzStringTemplateOutlet: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAddOnModule {
}
NzAddOnModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule],
exports: [NzStringTemplateOutletDirective, NzClassListAddDirective],
declarations: [NzStringTemplateOutletDirective, NzClassListAddDirective]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} prefix
* @return {?}
*/
function getRegExp(prefix) {
/** @type {?} */
const prefixArray = Array.isArray(prefix) ? prefix : [prefix];
/** @type {?} */
let prefixToken = prefixArray.join('').replace(/(\$|\^)/g, '\\$1');
if (prefixArray.length > 1) {
prefixToken = `[${prefixToken}]`;
}
return new RegExp(`(\\s|^)(${prefixToken})[^\\s]*`, 'g');
}
/**
* @param {?} value
* @param {?=} prefix
* @return {?}
*/
function getMentions(value, prefix = '@') {
if (typeof value !== 'string') {
return [];
}
/** @type {?} */
const regex = getRegExp(prefix);
/** @type {?} */
const mentions = value.match(regex);
return mentions !== null ? mentions.map((/**
* @param {?} e
* @return {?}
*/
e => e.trim())) : [];
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Much like lodash.
* @param {?} toPad
* @param {?} length
* @param {?} element
* @return {?}
*/
function padStart(toPad, length, element) {
if (toPad.length > length) {
return toPad;
}
/** @type {?} */
const joined = `${getRepeatedElement(length, element)}${toPad}`;
return joined.slice(joined.length - length, joined.length);
}
/**
* @param {?} toPad
* @param {?} length
* @param {?} element
* @return {?}
*/
function padEnd(toPad, length, element) {
/** @type {?} */
const joined = `${toPad}${getRepeatedElement(length, element)}`;
return joined.slice(0, length);
}
/**
* @param {?} length
* @param {?} element
* @return {?}
*/
function getRepeatedElement(length, element) {
return Array(length).fill(element).join('');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// from https://github.com/component/textarea-caret-position
// We'll copy the properties below into the mirror div.
// Note that some browsers, such as Firefox, do not concatenate properties
// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),
// so we have to list every single property explicitly.
/** @type {?} */
const properties = [
'direction',
'boxSizing',
'width',
'height',
'overflowX',
'overflowY',
'borderTopWidth',
'borderRightWidth',
'borderBottomWidth',
'borderLeftWidth',
'borderStyle',
'paddingTop',
'paddingRight',
'paddingBottom',
'paddingLeft',
// https://developer.mozilla.org/en-US/docs/Web/CSS/font
'fontStyle',
'fontVariant',
'fontWeight',
'fontStretch',
'fontSize',
'fontSizeAdjust',
'lineHeight',
'fontFamily',
'textAlign',
'textTransform',
'textIndent',
'textDecoration',
'letterSpacing',
'wordSpacing',
'tabSize',
'MozTabSize'
];
/** @type {?} */
const isBrowser = (typeof window !== 'undefined');
// tslint:disable-next-line:no-any
/** @type {?} */
const isFirefox = (isBrowser && ((/** @type {?} */ (window))).mozInnerScreenX != null);
/** @type {?} */
const _parseInt = (/**
* @param {?} str
* @return {?}
*/
(str) => parseInt(str, 10));
/**
* @param {?} element
* @param {?} position
* @param {?=} options
* @return {?}
*/
function getCaretCoordinates(element, position, options) {
if (!isBrowser) {
throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');
}
/** @type {?} */
const debug = options && options.debug || false;
if (debug) {
/** @type {?} */
const el = document.querySelector('#input-textarea-caret-position-mirror-div');
if (el) {
el.parentNode.removeChild(el);
}
}
// The mirror div will replicate the textarea's style
/** @type {?} */
const div = document.createElement('div');
div.id = 'input-textarea-caret-position-mirror-div';
document.body.appendChild(div);
/** @type {?} */
const style$$1 = div.style;
// tslint:disable-next-line:no-any
/** @type {?} */
const computed = window.getComputedStyle ? window.getComputedStyle(element) : ((/** @type {?} */ (element))).currentStyle;
// currentStyle for IE < 9
/** @type {?} */
const isInput = element.nodeName === 'INPUT';
// Default textarea styles
style$$1.whiteSpace = 'pre-wrap';
if (!isInput) {
style$$1.wordWrap = 'break-word'; // only for textarea-s
}
// Position off-screen
style$$1.position = 'absolute'; // required to return coordinates properly
if (!debug) {
style$$1.visibility = 'hidden';
} // not 'display: none' because we want rendering
// Transfer the element's properties to the div
properties.forEach((/**
* @param {?} prop
* @return {?}
*/
(prop) => {
if (isInput && prop === 'lineHeight') {
// Special case for <input>s because text is rendered centered and line height may be != height
style$$1.lineHeight = computed.height;
}
else {
style$$1[prop] = computed[prop];
}
}));
if (isFirefox) {
// Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275
if (element.scrollHeight > _parseInt(computed.height)) {
style$$1.overflowY = 'scroll';
}
}
else {
style$$1.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'
}
div.textContent = element.value.substring(0, position);
// The second special handling for input type="text" vs textarea:
// spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037
if (isInput) {
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
}
/** @type {?} */
const span = document.createElement('span');
// Wrapping must be replicated *exactly*, including when a long word gets
// onto the next line, with whitespace at the end of the line before (#7).
// The *only* reliable way to do that is to copy the *entire* rest of the
// textarea's content into the <span> created at the caret position.
// For inputs, just '.' would be enough, but no need to bother.
span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all
div.appendChild(span);
/** @type {?} */
const coordinates = {
top: span.offsetTop + _parseInt(computed.borderTopWidth),
left: span.offsetLeft + _parseInt(computed.borderLeftWidth),
height: _parseInt(computed.lineHeight)
};
if (debug) {
span.style.backgroundColor = '#eee';
createDebugEle(element, coordinates);
}
else {
document.body.removeChild(div);
}
return coordinates;
}
/**
* @param {?} element
* @param {?} coordinates
* @return {?}
*/
function createDebugEle(element, coordinates) {
/** @type {?} */
const fontSize = getComputedStyle(element).getPropertyValue('font-size');
/** @type {?} */
const rect = ((/** @type {?} */ (document.querySelector('#DEBUG'))))
|| document.createElement('div');
document.body.appendChild(rect);
rect.id = 'DEBUG';
rect.style.position = 'absolute';
rect.style.backgroundColor = 'red';
rect.style.height = fontSize;
rect.style.width = '1px';
rect.style.top = `${element.getBoundingClientRect().top - element.scrollTop + window.pageYOffset + coordinates.top}px`;
rect.style.left = `${element.getBoundingClientRect().left - element.scrollLeft + window.pageXOffset + coordinates.left}px`;
console.log(rect.style.top);
console.log(rect.style.left);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const timeUnits = [
['Y', 1000 * 60 * 60 * 24 * 365],
['M', 1000 * 60 * 60 * 24 * 30],
['D', 1000 * 60 * 60 * 24],
['H', 1000 * 60 * 60],
['m', 1000 * 60],
['s', 1000],
['S', 1] // million seconds
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_ICONS$$1 = new InjectionToken('nz_icons');
/** @type {?} */
const NZ_ICON_DEFAULT_TWOTONE_COLOR$$1 = new InjectionToken('nz_icon_default_twotone_color');
/** @type {?} */
const DEFAULT_TWOTONE_COLOR$$1 = '#1890ff';
/** @type {?} */
const NZ_ICONS_USED_BY_ZORRO$$1 = [
BarsOutline,
CalendarOutline,
CaretUpFill,
CaretUpOutline,
CaretDownFill,
CaretDownOutline,
CheckCircleFill,
CheckCircleOutline,
CheckOutline,
ClockCircleOutline,
CloseCircleOutline,
CloseCircleFill,
CloseOutline,
DoubleLeftOutline,
DoubleRightOutline,
DownOutline,
EllipsisOutline,
ExclamationCircleFill,
ExclamationCircleOutline,
EyeOutline,
FileFill,
FileOutline,
FilterFill,
InfoCircleFill,
InfoCircleOutline,
LeftOutline,
LoadingOutline,
PaperClipOutline,
QuestionCircleOutline,
RightOutline,
StarFill,
SearchOutline,
StarFill,
UploadOutline,
UpOutline
];
/**
* It should be a global singleton, otherwise registered icons could not be found.
*/
class NzIconService$$1 extends IconService {
/**
* @param {?} rendererFactory
* @param {?} sanitizer
* @param {?} handler
* @param {?} document
* @param {?} icons
* @param {?} defaultColor
*/
constructor(rendererFactory, sanitizer, handler, document, icons, defaultColor) {
super(rendererFactory, handler, document, sanitizer);
this.rendererFactory = rendererFactory;
this.sanitizer = sanitizer;
this.handler = handler;
this.document = document;
this.icons = icons;
this.defaultColor = defaultColor;
this.iconfontCache = new Set();
this.warnedAboutAPI = false;
this.warnedAboutCross = false;
this.warnedAboutVertical = false;
this.addIcon(...NZ_ICONS_USED_BY_ZORRO$$1, ...(this.icons || []));
/** @type {?} */
let primaryColor = DEFAULT_TWOTONE_COLOR$$1;
if (this.defaultColor) {
if (this.defaultColor.startsWith('#')) {
primaryColor = this.defaultColor;
}
else {
console.warn('[NG-ZORRO]: twotone color must be a hex color!');
}
}
this.twoToneColor = { primaryColor };
}
/**
* @param {?} type
* @return {?}
*/
warnAPI(type) {
if (type === 'old' && !this.warnedAboutAPI) {
console.warn(`<i class="anticon"></i> would be deprecated soon. Please use <i nz-icon type=""></i> API.`);
this.warnedAboutAPI = true;
}
if (type === 'cross' && !this.warnedAboutCross) {
console.warn(`'cross' icon is replaced by 'close' icon.`);
this.warnedAboutCross = true;
}
if (type === 'vertical' && !this.warnedAboutVertical) {
console.warn(`'verticle' is misspelled, would be corrected in the next major version.`);
this.warnedAboutVertical = true;
}
}
/**
* @param {?} svg
* @return {?}
*/
normalizeSvgElement(svg) {
if (!svg.getAttribute('viewBox')) {
this._renderer.setAttribute(svg, 'viewBox', '0 0 1024 1024');
}
if (!svg.getAttribute('width') || !svg.getAttribute('height')) {
this._renderer.setAttribute(svg, 'width', '1em');
this._renderer.setAttribute(svg, 'height', '1em');
}
if (!svg.getAttribute('fill')) {
this._renderer.setAttribute(svg, 'fill', 'currentColor');
}
}
/**
* @param {?} opt
* @return {?}
*/
fetchFromIconfont(opt) {
const { scriptUrl } = opt;
if (this.document && !this.iconfontCache.has(scriptUrl)) {
/** @type {?} */
const script = this._renderer.createElement('script');
this._renderer.setAttribute(script, 'src', scriptUrl);
this._renderer.setAttribute(script, 'data-namespace', scriptUrl.replace(/^(https?|http):/g, ''));
this._renderer.appendChild(this.document.body, script);
this.iconfontCache.add(scriptUrl);
}
}
/**
* @param {?} type
* @return {?}
*/
createIconfontIcon(type) {
return this._createSVGElementFromString(`<svg><use xlink:href="${type}"></svg>`);
}
}
NzIconService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzIconService$$1.ctorParameters = () => [
{ type: RendererFactory2 },
{ type: DomSanitizer },
{ type: HttpBackend, decorators: [{ type: Optional }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
{ type: Array, decorators: [{ type: Optional }, { type: Inject, args: [NZ_ICONS$$1,] }] },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [NZ_ICON_DEFAULT_TWOTONE_COLOR$$1,] }] }
];
/** @nocollapse */ NzIconService$$1.ngInjectableDef = defineInjectable({ factory: function NzIconService_Factory() { return new NzIconService$$1(inject(RendererFactory2), inject(DomSanitizer), inject(HttpBackend, 8), inject(DOCUMENT, 8), inject(NZ_ICONS$$1, 8), inject(NZ_ICON_DEFAULT_TWOTONE_COLOR$$1, 8)); }, token: NzIconService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const iconTypeRE = /^anticon\-\w/;
/** @type {?} */
const getIconTypeClass = (/**
* @param {?} className
* @return {?}
*/
(className) => {
if (!className) {
return undefined;
}
else {
/** @type {?} */
const classArr = className.split(/\s/);
/** @type {?} */
const index = classArr.findIndex(((/**
* @param {?} cls
* @return {?}
*/
cls => cls !== 'anticon' && cls !== 'anticon-spin' && !!cls.match(iconTypeRE))));
return index === -1 ? undefined : { name: classArr[index], index };
}
});
/** @type {?} */
const normalizeType = (/**
* @param {?} rawType
* @return {?}
*/
(rawType) => {
/** @type {?} */
const ret = { type: rawType, crossError: false, verticalError: false };
ret.type = rawType ? rawType.replace('anticon-', '') : '';
if (ret.type.includes('verticle')) {
ret.type = 'up';
ret.verticalError = true;
}
if (ret.type.startsWith('cross')) {
ret.type = 'close';
ret.crossError = true;
}
return ret;
});
/**
* This directive extends IconDirective to provide:
*
* - IconFont support
* - spinning
* - old API compatibility
*
* \@break-changes
*
* - old API compatibility, icon class names would not be supported.
* - properties that not started with `nz`.
*/
class NzIconDirective extends IconDirective {
/**
* @param {?} iconService
* @param {?} elementRef
* @param {?} renderer
*/
constructor(iconService, elementRef, renderer) {
super(iconService, elementRef, renderer);
this.iconService = iconService;
this.elementRef = elementRef;
this.renderer = renderer;
this.nzRotate = 0;
/**
* @deprecated 8.0.0 avoid exposing low layer API.
*/
this.spin = false;
this.el = this.elementRef.nativeElement;
}
/**
* Properties with `nz` prefix.
* @param {?} value
* @return {?}
*/
set nzSpin(value) { this.spin = value; }
/**
* @param {?} value
* @return {?}
*/
set nzType(value) { this.type = value; }
/**
* @param {?} value
* @return {?}
*/
set nzTheme(value) { this.theme = value; }
/**
* @param {?} value
* @return {?}
*/
set nzTwotoneColor(value) { this.twoToneColor = value; }
/**
* @param {?} value
* @return {?}
*/
set nzIconfont(value) { this.iconfont = value; }
/**
* @param {?} value
* @return {?}
*/
set type(value) {
if (value && value.startsWith('anticon')) {
/** @type {?} */
const rawClass = getIconTypeClass(value);
/** @type {?} */
const type = rawClass ? normalizeType(rawClass.name).type : '';
if (type && this.type !== type) {
this._type = type;
}
}
else {
this._type = value;
}
}
/**
* @return {?}
*/
get type() {
return this._type;
}
/**
* Replacement of `changeIcon` for more modifications.
* @private
* @param {?=} oldAPI
* @return {?}
*/
changeIcon2(oldAPI = false) {
if (!oldAPI) {
this.setClassName();
}
this._changeIcon()
.then((/**
* @param {?} svg
* @return {?}
*/
svg => {
this.setSVGData(svg);
if (!oldAPI && svg) {
this.handleSpin(svg);
this.handleRotate(svg);
}
}));
}
/**
* @private
* @param {?} className
* @return {?}
*/
classChangeHandler(className) {
/** @type {?} */
const ret = getIconTypeClass(className);
if (ret) {
const { type, crossError, verticalError } = normalizeType(ret.name);
if (crossError) {
this.iconService.warnAPI('cross');
}
if (verticalError) {
this.iconService.warnAPI('vertical');
}
if (this.type !== type) {
this._type = type;
this.changeIcon2(true);
}
}
}
/**
* @private
* @param {?} svg
* @return {?}
*/
handleSpin(svg) {
if ((this.spin || this.type === 'loading') && !this.elementRef.nativeElement.classList.contains('anticon-spin')) {
this.renderer.addClass(svg, 'anticon-spin');
}
else {
this.renderer.removeClass(svg, 'anticon-spin');
}
}
/**
* @private
* @param {?} svg
* @return {?}
*/
handleRotate(svg) {
if (this.nzRotate) {
this.renderer.setAttribute(svg, 'style', `transform: rotate(${this.nzRotate}deg)`);
}
else {
this.renderer.removeAttribute(svg, 'style');
}
}
/**
* @private
* @return {?}
*/
setClassName() {
if (typeof this.type === 'string') {
/** @type {?} */
const iconClassNameArr = this.el.className.split(/\s/);
/** @type {?} */
const ret = getIconTypeClass(this.el.className);
if (ret) {
iconClassNameArr.splice(ret.index, 1, `anticon-${this.type}`);
this.renderer.setAttribute(this.el, 'class', iconClassNameArr.join(' '));
}
else {
this.renderer.addClass(this.el, `anticon-${this.type}`);
}
}
}
/**
* @private
* @param {?} svg
* @return {?}
*/
setSVGData(svg) {
if (typeof this.type === 'string' && svg) {
this.renderer.setAttribute(svg, 'data-icon', this.type);
this.renderer.setAttribute(svg, 'aria-hidden', 'true');
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { type, nzType, nzTwotoneColor, twoToneColor, spin, nzSpin, theme, nzTheme, nzRotate } = changes;
if (type || nzType || nzTwotoneColor || twoToneColor || spin || nzSpin || theme || nzTheme) {
this.changeIcon2();
}
else if (nzRotate) {
this.handleRotate(this.el.firstChild);
}
else {
this._setSVGElement(this.iconService.createIconfontIcon(`#${this.iconfont}`));
}
}
/**
* @return {?}
*/
ngOnInit() {
// If `this.type` is not specified and `classList` contains `anticon`, it should be an icon using old API.
if (!this.type && this.el.classList.contains('anticon')) {
this.iconService.warnAPI('old');
// Get `type` from `className`. If not, initial rendering would be missed.
this.classChangeHandler(this.el.className);
// Add `class` mutation observer.
this.classNameObserver = new MutationObserver((/**
* @param {?} mutations
* @return {?}
*/
(mutations) => {
mutations
.filter((/**
* @param {?} mutation
* @return {?}
*/
(mutation) => mutation.attributeName === 'class'))
.forEach((/**
* @param {?} mutation
* @return {?}
*/
(mutation) => this.classChangeHandler(((/** @type {?} */ (mutation.target))).className)));
}));
this.classNameObserver.observe(this.el, { attributes: true });
}
// If `classList` does not contain `anticon`, add it before other class names.
if (!this.el.classList.contains('anticon')) {
this.renderer.setAttribute(this.el, 'class', `anticon ${this.el.className}`.trim());
}
}
/**
* @return {?}
*/
ngOnDestroy() {
if (this.classNameObserver) {
this.classNameObserver.disconnect();
}
}
/**
* If custom content is provided, try to normalize SVG elements.
* @return {?}
*/
ngAfterContentChecked() {
/** @type {?} */
const children = this.el.children;
/** @type {?} */
let length = children.length;
if (!this.type && children.length) {
while (length--) {
/** @type {?} */
const child = children[length];
if (child.tagName.toLowerCase() === 'svg') {
this.iconService.normalizeSvgElement((/** @type {?} */ (child)));
}
}
}
}
}
NzIconDirective.decorators = [
{ type: Directive, args: [{
selector: 'i.anticon, [nz-icon]'
},] }
];
/** @nocollapse */
NzIconDirective.ctorParameters = () => [
{ type: NzIconService$$1 },
{ type: ElementRef },
{ type: Renderer2 }
];
NzIconDirective.propDecorators = {
nzSpin: [{ type: Input }],
nzRotate: [{ type: Input }],
nzType: [{ type: Input }],
nzTheme: [{ type: Input }],
nzTwotoneColor: [{ type: Input }],
nzIconfont: [{ type: Input }],
spin: [{ type: Input }],
iconfont: [{ type: Input }],
type: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NzIconDirective.prototype, "nzSpin", null);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzIconModule {
}
NzIconModule.decorators = [
{ type: NgModule, args: [{
exports: [NzIconDirective],
declarations: [NzIconDirective]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class AnimationDuration {
}
AnimationDuration.SLOW = '0.3s'; // Modal
// Modal
AnimationDuration.BASE = '0.2s';
AnimationDuration.FAST = '0.1s'; // Tooltip
class AnimationCurves {
}
AnimationCurves.EASE_BASE_OUT = 'cubic-bezier(0.7, 0.3, 0.1, 1)';
AnimationCurves.EASE_BASE_IN = 'cubic-bezier(0.9, 0, 0.3, 0.7)';
AnimationCurves.EASE_OUT = 'cubic-bezier(0.215, 0.61, 0.355, 1)';
AnimationCurves.EASE_IN = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
AnimationCurves.EASE_IN_OUT = 'cubic-bezier(0.645, 0.045, 0.355, 1)';
AnimationCurves.EASE_OUT_BACK = 'cubic-bezier(0.12, 0.4, 0.29, 1.46)';
AnimationCurves.EASE_IN_BACK = 'cubic-bezier(0.71, -0.46, 0.88, 0.6)';
AnimationCurves.EASE_IN_OUT_BACK = 'cubic-bezier(0.71, -0.46, 0.29, 1.46)';
AnimationCurves.EASE_OUT_CIRC = 'cubic-bezier(0.08, 0.82, 0.17, 1)';
AnimationCurves.EASE_IN_CIRC = 'cubic-bezier(0.6, 0.04, 0.98, 0.34)';
AnimationCurves.EASE_IN_OUT_CIRC = 'cubic-bezier(0.78, 0.14, 0.15, 0.86)';
AnimationCurves.EASE_OUT_QUINT = 'cubic-bezier(0.23, 1, 0.32, 1)';
AnimationCurves.EASE_IN_QUINT = 'cubic-bezier(0.755, 0.05, 0.855, 0.06)';
AnimationCurves.EASE_IN_OUT_QUINT = 'cubic-bezier(0.86, 0, 0.07, 1)';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const ANIMATION_TRANSITION_IN = `${AnimationDuration.BASE} ${AnimationCurves.EASE_OUT_QUINT}`;
/** @type {?} */
const ANIMATION_TRANSITION_OUT = `${AnimationDuration.BASE} ${AnimationCurves.EASE_IN_QUINT}`;
/** @type {?} */
const slideMotion = trigger('slideMotion', [
state('bottom', style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 0%'
})),
state('top', style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 100%'
})),
transition('void => bottom', [
style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
}),
animate(ANIMATION_TRANSITION_IN)
]),
transition('bottom => void', [
animate(ANIMATION_TRANSITION_OUT, style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
}))
]),
transition('void => top', [
style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 100%'
}),
animate(ANIMATION_TRANSITION_IN)
]),
transition('top => void', [
animate(ANIMATION_TRANSITION_OUT, style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 100%'
}))
])
]);
/** @type {?} */
const slideAlertMotion = trigger('slideAlertMotion', [
transition(':leave', [
style({ opacity: 1, transform: 'scaleY(1)', transformOrigin: '0% 0%' }),
animate(`${AnimationDuration.SLOW} ${AnimationCurves.EASE_IN_OUT_CIRC}`, style({
opacity: 0,
transform: 'scaleY(0)',
transformOrigin: '0% 0%'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAlertComponent {
constructor() {
this.destroy = false;
this.iconType = 'info-circle';
this.iconTheme = 'fill';
this.isTypeSet = false;
this.isShowIconSet = false;
this.nzType = 'info';
this.nzCloseable = false;
this.nzShowIcon = false;
this.nzBanner = false;
this.nzOnClose = new EventEmitter();
}
/**
* @return {?}
*/
closeAlert() {
this.destroy = true;
}
/**
* @return {?}
*/
onFadeAnimationDone() {
if (this.destroy) {
this.nzOnClose.emit(true);
}
}
/**
* @return {?}
*/
updateIconClassMap() {
switch (this.nzType) {
case 'error':
this.iconType = 'close-circle';
break;
case 'success':
this.iconType = 'check-circle';
break;
case 'info':
this.iconType = 'info-circle';
break;
case 'warning':
this.iconType = 'exclamation-circle';
break;
}
this.iconTheme = this.nzDescription ? 'outline' : 'fill';
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { nzShowIcon, nzDescription, nzType, nzBanner } = changes;
if (nzShowIcon) {
this.isShowIconSet = true;
}
if (nzDescription || nzType) {
this.updateIconClassMap();
}
if (nzType) {
this.isTypeSet = true;
}
if (nzBanner) {
if (!this.isTypeSet) {
this.nzType = 'warning';
}
if (!this.isShowIconSet) {
this.nzShowIcon = true;
}
}
}
}
NzAlertComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-alert',
animations: [slideAlertMotion],
template: "<div *ngIf=\"!destroy\"\n class=\"ant-alert\"\n [class.ant-alert-success]=\"nzType === 'success'\"\n [class.ant-alert-info]=\"nzType === 'info'\"\n [class.ant-alert-warning]=\"nzType === 'warning'\"\n [class.ant-alert-error]=\"nzType === 'error'\"\n [class.ant-alert-no-icon]=\"!nzShowIcon\"\n [class.ant-alert-banner]=\"nzBanner\"\n [class.ant-alert-closable]=\"nzCloseable\"\n [class.ant-alert-with-description]=\"!!nzDescription\"\n [@slideAlertMotion]\n (@slideAlertMotion.done)=\"onFadeAnimationDone()\">\n <ng-container *ngIf=\"nzShowIcon\">\n <i class=\"ant-alert-icon\" [ngClass]=\"nzIconType\" *ngIf=\"nzIconType; else iconTemplate\"></i>\n <ng-template #iconTemplate>\n <i nz-icon class=\"ant-alert-icon\" [type]=\"iconType\" [theme]=\"iconTheme\"></i>\n </ng-template>\n </ng-container>\n <span class=\"ant-alert-message\" *ngIf=\"nzMessage\">\n <ng-container *nzStringTemplateOutlet=\"nzMessage\">{{ nzMessage }}</ng-container>\n </span>\n <span class=\"ant-alert-description\" *ngIf=\"nzDescription\">\n <ng-container *nzStringTemplateOutlet=\"nzDescription\">{{ nzDescription }}</ng-container>\n </span>\n <a *ngIf=\"nzCloseable || nzCloseText\"\n class=\"ant-alert-close-icon\"\n (click)=\"closeAlert()\">\n <ng-template #closeDefaultTemplate>\n <i nz-icon type=\"close\" class=\"anticon-close\"></i>\n </ng-template>\n <ng-container *ngIf=\"nzCloseText; else closeDefaultTemplate\">\n <ng-container *nzStringTemplateOutlet=\"nzCloseText\">{{ nzCloseText }}</ng-container>\n </ng-container>\n </a>\n</div>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
styles: [`nz-alert {
display: block;
}`]
}] }
];
NzAlertComponent.propDecorators = {
nzCloseText: [{ type: Input }],
nzIconType: [{ type: Input }],
nzMessage: [{ type: Input }],
nzDescription: [{ type: Input }],
nzType: [{ type: Input }],
nzCloseable: [{ type: Input }],
nzShowIcon: [{ type: Input }],
nzBanner: [{ type: Input }],
nzOnClose: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAlertComponent.prototype, "nzCloseable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAlertComponent.prototype, "nzShowIcon", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAlertComponent.prototype, "nzBanner", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAlertModule {
}
NzAlertModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzAlertComponent],
exports: [NzAlertComponent],
imports: [CommonModule, NzIconModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const sharpMatcherRegx = /#([^#]+)$/;
class NzAnchorComponent {
// endregion
/* tslint:disable-next-line:no-any */
/**
* @param {?} scrollSrv
* @param {?} doc
* @param {?} cdr
*/
constructor(scrollSrv, doc, cdr) {
this.scrollSrv = scrollSrv;
this.doc = doc;
this.cdr = cdr;
this.links = [];
this.animating = false;
this.target = null;
this.scroll$ = null;
this.destroyed = false;
this.visible = false;
this.wrapperStyle = { 'max-height': '100vh' };
// region: fields
this._affix = true;
this._bounds = 5;
this._showInkInFixed = false;
this.nzClick = new EventEmitter();
this.nzScroll = new EventEmitter();
}
/**
* @param {?} value
* @return {?}
*/
set nzAffix(value) {
this._affix = toBoolean(value);
}
/**
* @return {?}
*/
get nzAffix() {
return this._affix;
}
/**
* @param {?} value
* @return {?}
*/
set nzBounds(value) {
this._bounds = toNumber(value, 5);
}
/**
* @return {?}
*/
get nzBounds() {
return this._bounds;
}
/**
* @param {?} value
* @return {?}
*/
set nzOffsetTop(value) {
this._offsetTop = toNumber(value, 0);
this.wrapperStyle = {
'max-height': `calc(100vh - ${this._offsetTop}px)`
};
}
/**
* @return {?}
*/
get nzOffsetTop() {
return this._offsetTop;
}
/**
* @param {?} value
* @return {?}
*/
set nzShowInkInFixed(value) {
this._showInkInFixed = toBoolean(value);
}
/**
* @return {?}
*/
get nzShowInkInFixed() {
return this._showInkInFixed;
}
/**
* @param {?} el
* @return {?}
*/
set nzTarget(el) {
this.target = typeof el === 'string' ? this.doc.querySelector(el) : el;
this.registerScrollEvent();
}
/**
* @param {?} link
* @return {?}
*/
registerLink(link) {
this.links.push(link);
}
/**
* @param {?} link
* @return {?}
*/
unregisterLink(link) {
this.links.splice(this.links.indexOf(link), 1);
}
/**
* @private
* @return {?}
*/
getTarget() {
return this.target || window;
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.registerScrollEvent();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroyed = true;
this.removeListen();
}
/**
* @private
* @return {?}
*/
registerScrollEvent() {
this.removeListen();
this.scroll$ = fromEvent(this.getTarget(), 'scroll')
.pipe(throttleTime(50), distinctUntilChanged())
.subscribe((/**
* @return {?}
*/
() => this.handleScroll()));
// 浏览器在刷新时保持滚动位置,会倒置在dom未渲染完成时计算不正确,因此延迟重新计算
// 与之相对应可能会引起组件移除后依然触发 `handleScroll` 的 `detectChanges`
setTimeout((/**
* @return {?}
*/
() => this.handleScroll()));
}
/**
* @private
* @return {?}
*/
removeListen() {
if (this.scroll$) {
this.scroll$.unsubscribe();
}
}
/**
* @private
* @param {?} element
* @return {?}
*/
getOffsetTop(element) {
if (!element || !element.getClientRects().length) {
return 0;
}
/** @type {?} */
const rect = element.getBoundingClientRect();
if (!rect.width && !rect.height) {
return rect.top;
}
return rect.top - element.ownerDocument.documentElement.clientTop;
}
/**
* @return {?}
*/
handleScroll() {
if (this.destroyed || this.animating) {
return;
}
/** @type {?} */
const sections = [];
/** @type {?} */
const scope = (this.nzOffsetTop || 0) + this.nzBounds;
this.links.forEach((/**
* @param {?} comp
* @return {?}
*/
comp => {
/** @type {?} */
const sharpLinkMatch = sharpMatcherRegx.exec(comp.nzHref.toString());
if (!sharpLinkMatch) {
return;
}
/** @type {?} */
const target = this.doc.getElementById(sharpLinkMatch[1]);
if (target && this.getOffsetTop(target) < scope) {
/** @type {?} */
const top = this.getOffsetTop(target);
sections.push({
top,
comp
});
}
}));
this.visible = !!sections.length;
if (!this.visible) {
this.clearActive();
this.cdr.detectChanges();
}
else {
/** @type {?} */
const maxSection = sections.reduce((/**
* @param {?} prev
* @param {?} curr
* @return {?}
*/
(prev, curr) => curr.top > prev.top ? curr : prev));
this.handleActive(maxSection.comp);
}
}
/**
* @private
* @return {?}
*/
clearActive() {
this.links.forEach((/**
* @param {?} i
* @return {?}
*/
i => {
i.active = false;
i.markForCheck();
}));
}
/**
* @private
* @param {?} comp
* @return {?}
*/
handleActive(comp) {
this.clearActive();
comp.active = true;
comp.markForCheck();
/** @type {?} */
const linkNode = (/** @type {?} */ (((/** @type {?} */ (comp.elementRef.nativeElement))).querySelector('.ant-anchor-link-title')));
this.ink.nativeElement.style.top = `${linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5}px`;
this.cdr.detectChanges();
this.nzScroll.emit(comp);
}
/**
* @param {?} linkComp
* @return {?}
*/
handleScrollTo(linkComp) {
/** @type {?} */
const el = this.doc.querySelector(linkComp.nzHref);
if (!el) {
return;
}
this.animating = true;
/** @type {?} */
const containerScrollTop = this.scrollSrv.getScroll(this.getTarget());
/** @type {?} */
const elOffsetTop = this.scrollSrv.getOffset(el).top;
/** @type {?} */
const targetScrollTop = containerScrollTop + elOffsetTop - (this.nzOffsetTop || 0);
this.scrollSrv.scrollTo(this.getTarget(), targetScrollTop, null, (/**
* @return {?}
*/
() => {
this.animating = false;
this.handleActive(linkComp);
}));
this.nzClick.emit(linkComp.nzHref);
}
}
NzAnchorComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-anchor',
preserveWhitespaces: false,
template: "<nz-affix *ngIf=\"nzAffix;else content\" [nzOffsetTop]=\"nzOffsetTop\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n</nz-affix>\n<ng-template #content>\n <div class=\"ant-anchor-wrapper\" [ngStyle]=\"wrapperStyle\">\n <div class=\"ant-anchor\" [ngClass]=\"{'fixed': !nzAffix && !nzShowInkInFixed}\">\n <div class=\"ant-anchor-ink\">\n <div class=\"ant-anchor-ink-ball\" [class.visible]=\"visible\" #ink></div>\n </div>\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzAnchorComponent.ctorParameters = () => [
{ type: NzScrollService },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
{ type: ChangeDetectorRef }
];
NzAnchorComponent.propDecorators = {
ink: [{ type: ViewChild, args: ['ink',] }],
nzAffix: [{ type: Input }],
nzBounds: [{ type: Input }],
nzOffsetTop: [{ type: Input }],
nzShowInkInFixed: [{ type: Input }],
nzTarget: [{ type: Input }],
nzClick: [{ type: Output }],
nzScroll: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAnchorLinkComponent {
/**
* @param {?} elementRef
* @param {?} anchorComp
* @param {?} cdr
* @param {?} renderer
*/
constructor(elementRef, anchorComp, cdr, renderer) {
this.elementRef = elementRef;
this.anchorComp = anchorComp;
this.cdr = cdr;
this.nzHref = '#';
this.titleStr = '';
this.active = false;
renderer.addClass(elementRef.nativeElement, 'ant-anchor-link');
}
/**
* @param {?} value
* @return {?}
*/
set nzTitle(value) {
if (value instanceof TemplateRef) {
this.titleStr = null;
this.titleTpl = value;
}
else {
this.titleStr = value;
}
}
/**
* @return {?}
*/
ngOnInit() {
this.anchorComp.registerLink(this);
}
/**
* @param {?} e
* @return {?}
*/
goToClick(e) {
e.preventDefault();
e.stopPropagation();
this.anchorComp.handleScrollTo(this);
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.anchorComp.unregisterLink(this);
}
}
NzAnchorLinkComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-link',
preserveWhitespaces: false,
template: "<a (click)=\"goToClick($event)\" href=\"{{nzHref}}\" class=\"ant-anchor-link-title\" title=\"{{titleStr}}\">\n <span *ngIf=\"titleStr; else (titleTpl || nzTemplate)\">{{ titleStr }}</span>\n</a>\n<ng-content></ng-content>",
host: {
'[class.ant-anchor-link-active]': 'active'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [`
nz-link {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzAnchorLinkComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzAnchorComponent },
{ type: ChangeDetectorRef },
{ type: Renderer2 }
];
NzAnchorLinkComponent.propDecorators = {
nzHref: [{ type: Input }],
nzTitle: [{ type: Input }],
nzTemplate: [{ type: ContentChild, args: ['nzTemplate',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAnchorModule {
}
NzAnchorModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzAnchorComponent, NzAnchorLinkComponent],
exports: [NzAnchorComponent, NzAnchorLinkComponent],
imports: [CommonModule, NzAffixModule],
providers: [SCROLL_SERVICE_PROVIDER]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const DISABLED_CLASSNAME = 'nz-animate-disabled';
class NzNoAnimationDirective {
/**
* @param {?} element
* @param {?} renderer
* @param {?} animationType
*/
constructor(element, renderer, animationType) {
this.element = element;
this.renderer = renderer;
this.animationType = animationType;
this.nzNoAnimation = false;
}
/**
* @return {?}
*/
ngOnChanges() {
this.updateClass();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.updateClass();
}
/**
* @private
* @return {?}
*/
updateClass() {
/** @type {?} */
const element = coerceElement(this.element);
if (!element) {
return;
}
if (this.nzNoAnimation || this.animationType === 'NoopAnimations') {
this.renderer.addClass(element, DISABLED_CLASSNAME);
}
else {
this.renderer.removeClass(element, DISABLED_CLASSNAME);
}
}
}
NzNoAnimationDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzNoAnimation]',
host: {
'[@.disabled]': 'nzNoAnimation'
}
},] }
];
/** @nocollapse */
NzNoAnimationDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
];
NzNoAnimationDirective.propDecorators = {
nzNoAnimation: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzNoAnimationDirective.prototype, "nzNoAnimation", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzNoAnimationModule {
}
NzNoAnimationModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzNoAnimationDirective],
exports: [NzNoAnimationDirective],
imports: [CommonModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAutocompleteOptgroupComponent {
constructor() {
}
}
NzAutocompleteOptgroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-auto-optgroup',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div class=\"ant-select-dropdown-menu-item-group-title\">\n <ng-container *nzStringTemplateOutlet=\"nzLabel\">{{nzLabel}}</ng-container>\n</div>\n<ul class=\"ant-select-dropdown-menu-item-group-list\">\n <ng-content select=\"nz-auto-option\"></ng-content>\n</ul>\n",
host: {
'role': 'group',
'class': 'ant-select-dropdown-menu-item-group'
}
}] }
];
/** @nocollapse */
NzAutocompleteOptgroupComponent.ctorParameters = () => [];
NzAutocompleteOptgroupComponent.propDecorators = {
nzLabel: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} node
* @return {?}
*/
function scrollIntoView(node) {
// Non-standard
/* tslint:disable-next-line:no-string-literal */
if (node['scrollIntoViewIfNeeded']) {
/* tslint:disable-next-line:no-string-literal */
node['scrollIntoViewIfNeeded'](false);
return;
}
if (node.scrollIntoView) {
node.scrollIntoView(false);
return;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOptionSelectionChange {
/**
* @param {?} source
* @param {?=} isUserInput
*/
constructor(source, isUserInput = false) {
this.source = source;
this.isUserInput = isUserInput;
}
}
class NzAutocompleteOptionComponent {
/**
* @param {?} changeDetectorRef
* @param {?} element
*/
constructor(changeDetectorRef, element) {
this.changeDetectorRef = changeDetectorRef;
this.element = element;
this.nzDisabled = false;
this.selectionChange = new EventEmitter();
this.active = false;
this.selected = false;
}
/**
* @return {?}
*/
select() {
this.selected = true;
this.changeDetectorRef.markForCheck();
this.emitSelectionChangeEvent();
}
/**
* @return {?}
*/
deselect() {
this.selected = false;
this.changeDetectorRef.markForCheck();
this.emitSelectionChangeEvent();
}
/**
* Git display label
* @return {?}
*/
getLabel() {
return this.nzLabel || this.nzValue.toString();
}
/**
* Set active (only styles)
* @return {?}
*/
setActiveStyles() {
if (!this.active) {
this.active = true;
this.changeDetectorRef.markForCheck();
}
}
/**
* Unset active (only styles)
* @return {?}
*/
setInactiveStyles() {
if (this.active) {
this.active = false;
this.changeDetectorRef.markForCheck();
}
}
/**
* @return {?}
*/
scrollIntoViewIfNeeded() {
scrollIntoView(this.element.nativeElement);
}
/**
* @return {?}
*/
selectViaInteraction() {
if (!this.nzDisabled) {
this.selected = !this.selected;
if (this.selected) {
this.setActiveStyles();
}
else {
this.setInactiveStyles();
}
this.emitSelectionChangeEvent(true);
this.changeDetectorRef.markForCheck();
}
}
/**
* @private
* @param {?=} isUserInput
* @return {?}
*/
emitSelectionChangeEvent(isUserInput = false) {
this.selectionChange.emit(new NzOptionSelectionChange(this, isUserInput));
}
}
NzAutocompleteOptionComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-auto-option',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-content></ng-content>",
host: {
'role': 'menuitem',
'class': 'ant-select-dropdown-menu-item',
'[class.ant-select-dropdown-menu-item-selected]': 'selected',
'[class.ant-select-dropdown-menu-item-active]': 'active',
'[class.ant-select-dropdown-menu-item-disabled]': 'nzDisabled',
'[attr.aria-selected]': 'selected.toString()',
'[attr.aria-disabled]': 'nzDisabled.toString()',
'(click)': 'selectViaInteraction()',
'(mousedown)': '$event.preventDefault()'
}
}] }
];
/** @nocollapse */
NzAutocompleteOptionComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: ElementRef }
];
NzAutocompleteOptionComponent.propDecorators = {
nzValue: [{ type: Input }],
nzLabel: [{ type: Input }],
nzDisabled: [{ type: Input }],
selectionChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAutocompleteOptionComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAutocompleteComponent {
/**
* @param {?} changeDetectorRef
* @param {?} ngZone
* @param {?=} noAnimation
*/
constructor(changeDetectorRef, ngZone, noAnimation) {
this.changeDetectorRef = changeDetectorRef;
this.ngZone = ngZone;
this.noAnimation = noAnimation;
this.nzOverlayClassName = '';
this.nzOverlayStyle = {};
this.nzDefaultActiveFirstOption = true;
this.nzBackfill = false;
this.selectionChange = new EventEmitter();
this.showPanel = false;
this.isOpen = false;
this.dropDownPosition = 'bottom';
this.activeItemIndex = -1;
this.selectionChangeSubscription = Subscription.EMPTY;
this.dataSourceChangeSubscription = Subscription.EMPTY;
/**
* Options changes listener
*/
this.optionSelectionChanges = defer((/**
* @return {?}
*/
() => {
if (this.options) {
return merge(...this.options.map((/**
* @param {?} option
* @return {?}
*/
option => option.selectionChange)));
}
return this.ngZone.onStable
.asObservable()
.pipe(take(1), switchMap((/**
* @return {?}
*/
() => this.optionSelectionChanges)));
}));
}
/**
* Options accessor, its source may be content or dataSource
* @return {?}
*/
get options() {
// first dataSource
if (this.nzDataSource) {
return this.fromDataSourceOptions;
}
else {
return this.fromContentOptions;
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.optionsInit();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.dataSourceChangeSubscription.unsubscribe();
this.selectionChangeSubscription.unsubscribe();
}
/**
* @return {?}
*/
setVisibility() {
this.showPanel = !!this.options.length;
this.changeDetectorRef.markForCheck();
}
/**
* @param {?} index
* @return {?}
*/
setActiveItem(index) {
/** @type {?} */
const activeItem = this.options.toArray()[index];
if (activeItem && !activeItem.active) {
this.activeItem = activeItem;
this.activeItemIndex = index;
this.clearSelectedOptions(this.activeItem);
this.activeItem.setActiveStyles();
this.changeDetectorRef.markForCheck();
}
}
/**
* @return {?}
*/
setNextItemActive() {
/** @type {?} */
const nextIndex = this.activeItemIndex + 1 <= this.options.length - 1 ? this.activeItemIndex + 1 : 0;
this.setActiveItem(nextIndex);
}
/**
* @return {?}
*/
setPreviousItemActive() {
/** @type {?} */
const previousIndex = this.activeItemIndex - 1 < 0 ? this.options.length - 1 : this.activeItemIndex - 1;
this.setActiveItem(previousIndex);
}
/**
* @param {?} option
* @return {?}
*/
getOptionIndex(option) {
return this.options.reduce((/**
* @param {?} result
* @param {?} current
* @param {?} index
* @return {?}
*/
(result, current, index) => {
return result === undefined ? (option === current ? index : undefined) : result;
}), undefined);
}
/**
* @private
* @return {?}
*/
optionsInit() {
this.setVisibility();
this.subscribeOptionChanges();
/** @type {?} */
const changes = this.nzDataSource ? this.fromDataSourceOptions.changes : this.fromContentOptions.changes;
// async
this.dataSourceChangeSubscription = changes.subscribe((/**
* @param {?} e
* @return {?}
*/
e => {
if (!e.dirty && this.isOpen) {
setTimeout((/**
* @return {?}
*/
() => this.setVisibility()));
}
this.subscribeOptionChanges();
}));
}
/**
* Clear the status of options
* @private
* @param {?=} skip
* @param {?=} deselect
* @return {?}
*/
clearSelectedOptions(skip$$1, deselect = false) {
this.options.forEach((/**
* @param {?} option
* @return {?}
*/
option => {
if (option !== skip$$1) {
if (deselect) {
option.deselect();
}
option.setInactiveStyles();
}
}));
}
/**
* @private
* @return {?}
*/
subscribeOptionChanges() {
this.selectionChangeSubscription.unsubscribe();
this.selectionChangeSubscription = this.optionSelectionChanges
.pipe(filter((/**
* @param {?} event
* @return {?}
*/
(event) => event.isUserInput)))
.subscribe((/**
* @param {?} event
* @return {?}
*/
(event) => {
event.source.select();
event.source.setActiveStyles();
this.activeItem = event.source;
this.activeItemIndex = this.getOptionIndex(this.activeItem);
this.clearSelectedOptions(event.source, true);
this.selectionChange.emit(event.source);
}));
}
}
NzAutocompleteComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-autocomplete',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-template>\n <div class=\"ant-select-dropdown ant-select-dropdown--single ant-select-dropdown-placement-bottomLeft\"\n #panel\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@slideMotion]=\"dropDownPosition\"\n [class.ant-select-dropdown-hidden]=\"!showPanel\" [ngClass]=\"nzOverlayClassName\" [ngStyle]=\"nzOverlayStyle\">\n <div style=\"overflow: auto;\">\n <ul class=\"ant-select-dropdown-menu ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical\"\n role=\"menu\"\n aria-activedescendant>\n <ng-template *ngTemplateOutlet=\"nzDataSource ? optionsTemplate : contentTemplate\"></ng-template>\n </ul>\n </div>\n </div>\n <ng-template #contentTemplate>\n <ng-content></ng-content>\n </ng-template>\n <ng-template #optionsTemplate>\n <nz-auto-option *ngFor=\"let option of nzDataSource\" [nzValue]=\"option\">{{option}}</nz-auto-option>\n </ng-template>\n</ng-template>",
animations: [
slideMotion
],
styles: [`
.ant-select-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzAutocompleteComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NgZone },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzAutocompleteComponent.propDecorators = {
nzWidth: [{ type: Input }],
nzOverlayClassName: [{ type: Input }],
nzOverlayStyle: [{ type: Input }],
nzDefaultActiveFirstOption: [{ type: Input }],
nzBackfill: [{ type: Input }],
nzDataSource: [{ type: Input }],
selectionChange: [{ type: Output }],
fromContentOptions: [{ type: ContentChildren, args: [NzAutocompleteOptionComponent, { descendants: true },] }],
fromDataSourceOptions: [{ type: ViewChildren, args: [NzAutocompleteOptionComponent,] }],
template: [{ type: ViewChild, args: [TemplateRef,] }],
panel: [{ type: ViewChild, args: ['panel',] }],
content: [{ type: ViewChild, args: ['content',] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAutocompleteComponent.prototype, "nzDefaultActiveFirstOption", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzAutocompleteComponent.prototype, "nzBackfill", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_AUTOCOMPLETE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzAutocompleteTriggerDirective)),
multi: true
};
/**
* @return {?}
*/
function getNzAutocompleteMissingPanelError() {
return Error('Attempting to open an undefined instance of `nz-autocomplete`. ' +
'Make sure that the id passed to the `nzAutocomplete` is correct and that ' +
'you\'re attempting to open it after the ngAfterContentInit hook.');
}
class NzAutocompleteTriggerDirective {
/**
* @param {?} elementRef
* @param {?} _overlay
* @param {?} viewContainerRef
* @param {?} document
*/
constructor(elementRef, _overlay, viewContainerRef, document) {
this.elementRef = elementRef;
this._overlay = _overlay;
this.viewContainerRef = viewContainerRef;
this.document = document;
this._onChange = (/**
* @return {?}
*/
() => { });
this._onTouched = (/**
* @return {?}
*/
() => { });
this.panelOpen = false;
}
/**
* Current active option
* @return {?}
*/
get activeOption() {
if (this.nzAutocomplete && this.nzAutocomplete.options.length) {
return this.nzAutocomplete.activeItem;
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroyPanel();
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.setTriggerValue(value);
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this._onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this._onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
/** @type {?} */
const element = this.elementRef.nativeElement;
element.disabled = isDisabled;
this.closePanel();
}
/**
* @return {?}
*/
openPanel() {
this.attachOverlay();
}
/**
* @return {?}
*/
closePanel() {
if (this.panelOpen) {
this.nzAutocomplete.isOpen = this.panelOpen = false;
if (this.overlayRef && this.overlayRef.hasAttached()) {
this.selectionChangeSubscription.unsubscribe();
this.overlayBackdropClickSubscription.unsubscribe();
this.overlayPositionChangeSubscription.unsubscribe();
this.optionsChangeSubscription.unsubscribe();
this.overlayRef.detach();
this.overlayRef = null;
this.portal = null;
}
}
}
/**
* @param {?} event
* @return {?}
*/
handleKeydown(event) {
/** @type {?} */
const keyCode = event.keyCode;
/** @type {?} */
const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
if (keyCode === ESCAPE) {
event.preventDefault();
}
if (this.panelOpen && (keyCode === ESCAPE || keyCode === TAB)) {
// Reset value when tab / ESC close
if (this.activeOption && this.activeOption.getLabel() !== this.previousValue) {
this.setTriggerValue(this.previousValue);
}
this.closePanel();
}
else if (this.panelOpen && keyCode === ENTER) {
event.preventDefault();
if (this.nzAutocomplete.showPanel && this.activeOption) {
this.activeOption.selectViaInteraction();
}
}
else if (this.panelOpen && isArrowKey && this.nzAutocomplete.showPanel) {
event.stopPropagation();
if (keyCode === UP_ARROW) {
this.nzAutocomplete.setPreviousItemActive();
}
else {
this.nzAutocomplete.setNextItemActive();
}
if (this.activeOption) {
this.activeOption.scrollIntoViewIfNeeded();
}
this.doBackfill();
}
}
/**
* @param {?} event
* @return {?}
*/
handleInput(event) {
/** @type {?} */
const target = (/** @type {?} */ (event.target));
/** @type {?} */
let value = target.value;
if (target.type === 'number') {
value = value === '' ? null : parseFloat(value);
}
if (this.canOpen() && document.activeElement === event.target &&
this.previousValue !== value) {
this.previousValue = value;
this._onChange(value);
this.openPanel();
}
}
/**
* @return {?}
*/
handleFocus() {
if (this.canOpen()) {
this.previousValue = this.elementRef.nativeElement.value;
this.openPanel();
}
}
/**
* @return {?}
*/
handleBlur() {
this.closePanel();
this._onTouched();
}
/**
* Subscription data source changes event
* @private
* @return {?}
*/
subscribeOptionsChange() {
return this.nzAutocomplete.options.changes.pipe(delay(0)).subscribe((/**
* @return {?}
*/
() => {
this.resetActiveItem();
}));
}
/**
* Subscription option changes event and set the value
* @private
* @return {?}
*/
subscribeSelectionChange() {
return this.nzAutocomplete.selectionChange
.subscribe((/**
* @param {?} option
* @return {?}
*/
(option) => {
this.setValueAndClose(option);
}));
}
/**
* Subscription external click and close panel
* @private
* @return {?}
*/
subscribeOverlayBackdropClick() {
return merge(fromEvent(this.document, 'click'), fromEvent(this.document, 'touchend'))
.subscribe((/**
* @param {?} event
* @return {?}
*/
(event) => {
/** @type {?} */
const clickTarget = (/** @type {?} */ (event.target));
// Make sure is not self
if (clickTarget !== this.elementRef.nativeElement && !this.overlayRef.overlayElement.contains(clickTarget) && this.panelOpen) {
this.closePanel();
}
}));
}
/**
* Subscription overlay position changes and reset dropdown position
* @private
* @return {?}
*/
subscribeOverlayPositionChange() {
return this.positionStrategy.positionChanges
.pipe(map((/**
* @param {?} position
* @return {?}
*/
(position) => position.connectionPair.originY)), distinct())
.subscribe((/**
* @param {?} position
* @return {?}
*/
(position) => {
this.nzAutocomplete.dropDownPosition = position;
}));
}
/**
* @private
* @return {?}
*/
attachOverlay() {
if (!this.nzAutocomplete) {
throw getNzAutocompleteMissingPanelError();
}
if (!this.portal) {
this.portal = new TemplatePortal(this.nzAutocomplete.template, this.viewContainerRef);
}
if (!this.overlayRef) {
this.overlayRef = this._overlay.create(this.getOverlayConfig());
}
if (this.overlayRef && !this.overlayRef.hasAttached()) {
this.overlayRef.attach(this.portal);
this.overlayPositionChangeSubscription = this.subscribeOverlayPositionChange();
this.selectionChangeSubscription = this.subscribeSelectionChange();
this.overlayBackdropClickSubscription = this.subscribeOverlayBackdropClick();
this.optionsChangeSubscription = this.subscribeOptionsChange();
}
this.nzAutocomplete.isOpen = this.panelOpen = true;
this.nzAutocomplete.setVisibility();
this.overlayRef.updateSize({ width: this.nzAutocomplete.nzWidth || this.getHostWidth() });
setTimeout((/**
* @return {?}
*/
() => {
if (this.overlayRef) {
this.overlayRef.updatePosition();
}
}), 150);
this.resetActiveItem();
if (this.activeOption) {
this.activeOption.scrollIntoViewIfNeeded();
}
}
/**
* @private
* @return {?}
*/
destroyPanel() {
if (this.overlayRef) {
this.closePanel();
}
}
/**
* @private
* @return {?}
*/
getOverlayConfig() {
return new OverlayConfig({
positionStrategy: this.getOverlayPosition(),
scrollStrategy: this._overlay.scrollStrategies.reposition(),
// default host element width
width: this.nzAutocomplete.nzWidth || this.getHostWidth()
});
}
/**
* @private
* @return {?}
*/
getConnectedElement() {
return this.elementRef;
}
/**
* @private
* @return {?}
*/
getHostWidth() {
return this.getConnectedElement().nativeElement.getBoundingClientRect().width;
}
/**
* @private
* @return {?}
*/
getOverlayPosition() {
/** @type {?} */
const positions = [
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
];
this.positionStrategy = this._overlay.position()
.flexibleConnectedTo(this.getConnectedElement())
.withPositions(positions)
.withFlexibleDimensions(false)
.withPush(false);
return this.positionStrategy;
}
/**
* @private
* @return {?}
*/
resetActiveItem() {
if (this.nzAutocomplete.activeItem && this.nzAutocomplete.getOptionIndex(this.nzAutocomplete.activeItem)) {
this.nzAutocomplete.setActiveItem(this.nzAutocomplete.getOptionIndex(this.nzAutocomplete.activeItem));
}
else {
this.nzAutocomplete.setActiveItem(this.nzAutocomplete.nzDefaultActiveFirstOption ? 0 : -1);
}
}
/**
* @private
* @param {?} option
* @return {?}
*/
setValueAndClose(option) {
/** @type {?} */
const value = option.nzValue;
this.setTriggerValue(option.getLabel());
this._onChange(value);
this.elementRef.nativeElement.focus();
this.closePanel();
}
/**
* @private
* @param {?} value
* @return {?}
*/
setTriggerValue(value) {
this.elementRef.nativeElement.value = value || '';
}
/**
* @private
* @return {?}
*/
doBackfill() {
if (this.nzAutocomplete.nzBackfill && this.nzAutocomplete.activeItem) {
this.setTriggerValue(this.nzAutocomplete.activeItem.getLabel());
}
}
/**
* @private
* @return {?}
*/
canOpen() {
/** @type {?} */
const element = this.elementRef.nativeElement;
return !element.readOnly && !element.disabled;
}
}
NzAutocompleteTriggerDirective.decorators = [
{ type: Directive, args: [{
selector: `input[nzAutocomplete], textarea[nzAutocomplete]`,
providers: [NZ_AUTOCOMPLETE_VALUE_ACCESSOR],
host: {
'autocomplete': 'off',
'aria-autocomplete': 'list',
'(focusin)': 'handleFocus()',
'(blur)': 'handleBlur()',
'(input)': 'handleInput($event)',
'(keydown)': 'handleKeydown($event)'
}
},] }
];
/** @nocollapse */
NzAutocompleteTriggerDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Overlay },
{ type: ViewContainerRef },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] }
];
NzAutocompleteTriggerDirective.propDecorators = {
nzAutocomplete: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAutocompleteModule {
}
NzAutocompleteModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzAutocompleteComponent, NzAutocompleteOptionComponent, NzAutocompleteTriggerDirective, NzAutocompleteOptgroupComponent],
exports: [NzAutocompleteComponent, NzAutocompleteOptionComponent, NzAutocompleteTriggerDirective, NzAutocompleteOptgroupComponent],
imports: [CommonModule, OverlayModule, FormsModule, NzAddOnModule, NzNoAnimationModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzUpdateHostClassService {
/**
* @param {?} rendererFactory2
*/
constructor(rendererFactory2) {
this.classMap = {};
this.renderer = rendererFactory2.createRenderer(null, null);
}
/**
* @param {?} el
* @param {?} classMap
* @return {?}
*/
updateHostClass(el, classMap) {
this.removeClass(el, this.classMap, this.renderer);
this.classMap = Object.assign({}, classMap);
this.addClass(el, this.classMap, this.renderer);
}
/**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
removeClass(el, classMap, renderer) {
for (const i in classMap) {
if (classMap.hasOwnProperty(i)) {
renderer.removeClass(el, i);
}
}
}
/**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
addClass(el, classMap, renderer) {
for (const i in classMap) {
if (classMap.hasOwnProperty(i)) {
if (classMap[i]) {
renderer.addClass(el, i);
}
}
}
}
}
NzUpdateHostClassService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzUpdateHostClassService.ctorParameters = () => [
{ type: RendererFactory2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAvatarComponent {
/**
* @param {?} elementRef
* @param {?} cd
* @param {?} updateHostClassService
* @param {?} renderer
*/
constructor(elementRef, cd, updateHostClassService, renderer) {
this.elementRef = elementRef;
this.cd = cd;
this.updateHostClassService = updateHostClassService;
this.renderer = renderer;
this.nzShape = 'circle';
this.nzSize = 'default';
this.oldAPIIcon = true; // Make the user defined icon compatible to old API. Should be removed in 2.0.
// Make the user defined icon compatible to old API. Should be removed in 2.0.
this.hasText = false;
this.hasSrc = true;
this.hasIcon = false;
this.el = this.elementRef.nativeElement;
this.prefixCls = 'ant-avatar';
this.sizeMap = { large: 'lg', small: 'sm' };
}
/**
* @template THIS
* @this {THIS}
* @return {THIS}
*/
setClass() {
/** @type {?} */
const classMap = {
[(/** @type {?} */ (this)).prefixCls]: true,
[`${(/** @type {?} */ (this)).prefixCls}-${(/** @type {?} */ (this)).sizeMap[(/** @type {?} */ (this)).nzSize]}`]: (/** @type {?} */ (this)).sizeMap[(/** @type {?} */ (this)).nzSize],
[`${(/** @type {?} */ (this)).prefixCls}-${(/** @type {?} */ (this)).nzShape}`]: (/** @type {?} */ (this)).nzShape,
[`${(/** @type {?} */ (this)).prefixCls}-icon`]: (/** @type {?} */ (this)).nzIcon,
[`${(/** @type {?} */ (this)).prefixCls}-image`]: (/** @type {?} */ (this)).hasSrc // downgrade after image error
};
(/** @type {?} */ (this)).updateHostClassService.updateHostClass((/** @type {?} */ (this)).el, classMap);
(/** @type {?} */ (this)).cd.detectChanges();
return (/** @type {?} */ (this));
}
/**
* @return {?}
*/
imgError() {
this.hasSrc = false;
this.hasIcon = false;
this.hasText = false;
if (this.nzIcon) {
this.hasIcon = true;
}
else if (this.nzText) {
this.hasText = true;
}
this.setClass().notifyCalc();
this.setSizeStyle();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.hasOwnProperty('nzIcon') && changes.nzIcon.currentValue) {
this.oldAPIIcon = changes.nzIcon.currentValue.indexOf('anticon') > -1;
}
this.hasText = !this.nzSrc && !!this.nzText;
this.hasIcon = !this.nzSrc && !!this.nzIcon;
this.hasSrc = !!this.nzSrc;
this.setClass().notifyCalc();
this.setSizeStyle();
}
/**
* @private
* @return {?}
*/
calcStringSize() {
if (!this.hasText) {
return;
}
/** @type {?} */
const childrenWidth = this.textEl.nativeElement.offsetWidth;
/** @type {?} */
const avatarWidth = this.el.getBoundingClientRect().width;
/** @type {?} */
const scale = avatarWidth - 8 < childrenWidth ? (avatarWidth - 8) / childrenWidth : 1;
this.textStyles = {
transform: `scale(${scale}) translateX(-50%)`
};
if (typeof this.nzSize === 'number') {
Object.assign(this.textStyles, {
lineHeight: `${this.nzSize}px`
});
}
this.cd.detectChanges();
}
/**
* @private
* @template THIS
* @this {THIS}
* @return {THIS}
*/
notifyCalc() {
// If use ngAfterViewChecked, always demands more computations, so......
setTimeout((/**
* @return {?}
*/
() => {
(/** @type {?} */ (this)).calcStringSize();
}));
return (/** @type {?} */ (this));
}
/**
* @private
* @return {?}
*/
setSizeStyle() {
if (typeof this.nzSize === 'string') {
return;
}
this.renderer.setStyle(this.el, 'width', `${this.nzSize}px`);
this.renderer.setStyle(this.el, 'height', `${this.nzSize}px`);
this.renderer.setStyle(this.el, 'line-height', `${this.nzSize}px`);
if (this.hasIcon) {
this.renderer.setStyle(this.el, 'font-size', `${this.nzSize / 2}px`);
}
}
}
NzAvatarComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-avatar',
template: "<i nz-icon *ngIf=\"nzIcon && hasIcon\" [type]=\"!oldAPIIcon && nzIcon\" [ngClass]=\"oldAPIIcon && nzIcon\"></i>\n<img [src]=\"nzSrc\" *ngIf=\"nzSrc && hasSrc\" (error)=\"imgError()\"/>\n<span class=\"ant-avatar-string\" #textEl [ngStyle]=\"textStyles\" *ngIf=\"nzText && hasText\">{{ nzText }}</span>",
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
}] }
];
/** @nocollapse */
NzAvatarComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: ChangeDetectorRef },
{ type: NzUpdateHostClassService },
{ type: Renderer2 }
];
NzAvatarComponent.propDecorators = {
nzShape: [{ type: Input }],
nzSize: [{ type: Input }],
nzText: [{ type: Input }],
nzSrc: [{ type: Input }],
nzIcon: [{ type: Input }],
textEl: [{ type: ViewChild, args: ['textEl',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAvatarModule {
}
NzAvatarModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzAvatarComponent],
exports: [NzAvatarComponent],
imports: [CommonModule, NzIconModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const fadeMotion = trigger('fadeMotion', [
transition(':enter', [
style({ opacity: 0 }),
animate(`${AnimationDuration.BASE}`, style({ opacity: 1 }))
]),
transition(':leave', [
style({ opacity: 1 }),
animate(`${AnimationDuration.BASE}`, style({ opacity: 0 }))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBackTopComponent {
// tslint:disable-next-line:no-any
/**
* @param {?} scrollSrv
* @param {?} doc
* @param {?} cd
*/
constructor(scrollSrv, doc, cd) {
this.scrollSrv = scrollSrv;
this.doc = doc;
this.cd = cd;
this.scroll$ = null;
this.target = null;
this.visible = false;
this._visibilityHeight = 400;
this.nzClick = new EventEmitter();
}
/**
* @param {?} value
* @return {?}
*/
set nzVisibilityHeight(value) {
this._visibilityHeight = toNumber(value, 400);
}
/**
* @return {?}
*/
get nzVisibilityHeight() {
return this._visibilityHeight;
}
/**
* @param {?} el
* @return {?}
*/
set nzTarget(el) {
this.target = typeof el === 'string' ? this.doc.querySelector(el) : el;
this.registerScrollEvent();
}
/**
* @return {?}
*/
ngOnInit() {
if (!this.scroll$) {
this.registerScrollEvent();
}
}
/**
* @return {?}
*/
clickBackTop() {
this.scrollSrv.scrollTo(this.getTarget(), 0);
this.nzClick.emit(true);
}
/**
* @private
* @return {?}
*/
getTarget() {
return this.target || window;
}
/**
* @private
* @return {?}
*/
handleScroll() {
if (this.visible === this.scrollSrv.getScroll(this.getTarget()) > this.nzVisibilityHeight) {
return;
}
this.visible = !this.visible;
this.cd.markForCheck();
}
/**
* @private
* @return {?}
*/
removeListen() {
if (this.scroll$) {
this.scroll$.unsubscribe();
}
}
/**
* @private
* @return {?}
*/
registerScrollEvent() {
this.removeListen();
this.handleScroll();
this.scroll$ = fromEvent(this.getTarget(), 'scroll').pipe(throttleTime(50), distinctUntilChanged())
.subscribe((/**
* @return {?}
*/
() => this.handleScroll()));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.removeListen();
}
}
NzBackTopComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-back-top',
animations: [fadeMotion],
template: "<div class=\"ant-back-top\" (click)=\"clickBackTop()\" @fadeMotion *ngIf=\"visible\">\n <ng-template #defaultContent>\n <div class=\"ant-back-top-content\">\n <div class=\"ant-back-top-icon\"></div>\n </div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"nzTemplate || defaultContent\"></ng-template>\n</div>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false
}] }
];
/** @nocollapse */
NzBackTopComponent.ctorParameters = () => [
{ type: NzScrollService },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
{ type: ChangeDetectorRef }
];
NzBackTopComponent.propDecorators = {
nzTemplate: [{ type: Input }],
nzVisibilityHeight: [{ type: Input }],
nzTarget: [{ type: Input }],
nzClick: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBackTopModule {
}
NzBackTopModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzBackTopComponent],
exports: [NzBackTopComponent],
imports: [CommonModule],
providers: [SCROLL_SERVICE_PROVIDER]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const zoomMotion = trigger('zoomMotion', [
transition(':enter', [
style({ opacity: 0, transform: 'scale(0.2)' }),
animate(`${AnimationDuration.BASE} ${AnimationCurves.EASE_OUT_CIRC}`, style({
opacity: 1,
transform: 'scale(1)'
}))
]),
transition(':leave', [
style({ opacity: 1, transform: 'scale(1)' }),
animate(`${AnimationDuration.BASE} ${AnimationCurves.EASE_IN_OUT_CIRC}`, style({
opacity: 0,
transform: 'scale(0.2)'
}))
])
]);
/** @type {?} */
const zoomBigMotion = trigger('zoomBigMotion', [
transition('void => active', [
style({ opacity: 0, transform: 'scale(0.8)' }),
animate(`${AnimationDuration.BASE} ${AnimationCurves.EASE_OUT_CIRC}`, style({
opacity: 1,
transform: 'scale(1)'
}))
]),
transition('active => void', [
style({ opacity: 1, transform: 'scale(1)' }),
animate(`${AnimationDuration.BASE} ${AnimationCurves.EASE_IN_OUT_CIRC}`, style({
opacity: 0,
transform: 'scale(0.8)'
}))
])
]);
/** @type {?} */
const zoomBadgeMotion = trigger('zoomBadgeMotion', [
transition(':enter', [
style({ opacity: 0, transform: 'scale(0) translate(50%, -50%)' }),
animate(`${AnimationDuration.SLOW} ${AnimationCurves.EASE_OUT_BACK}`, style({
opacity: 1,
transform: 'scale(1) translate(50%, -50%)'
}))
]),
transition(':leave', [
style({ opacity: 1, transform: 'scale(1) translate(50%, -50%)' }),
animate(`${AnimationDuration.SLOW} ${AnimationCurves.EASE_IN_BACK}`, style({
opacity: 0,
transform: 'scale(0) translate(50%, -50%)'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBadgeComponent {
/**
* @param {?} renderer
* @param {?} elementRef
*/
constructor(renderer, elementRef) {
this.renderer = renderer;
this.elementRef = elementRef;
this.maxNumberArray = [];
this.countArray = [];
this.countSingleArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
this.nzShowZero = false;
this.nzShowDot = true;
this.nzDot = false;
this.nzOverflowCount = 99;
renderer.addClass(elementRef.nativeElement, 'ant-badge');
}
/**
* @return {?}
*/
checkContent() {
if (isEmpty(this.contentElement.nativeElement)) {
this.renderer.addClass(this.elementRef.nativeElement, 'ant-badge-not-a-wrapper');
}
else {
this.renderer.removeClass(this.elementRef.nativeElement, 'ant-badge-not-a-wrapper');
}
}
/**
* @return {?}
*/
get showSup() {
return (this.nzShowDot && this.nzDot) || this.count > 0 || (this.count === 0 && this.nzShowZero);
}
/**
* @return {?}
*/
generateMaxNumberArray() {
this.maxNumberArray = this.nzOverflowCount.toString().split('');
}
/**
* @return {?}
*/
ngOnInit() {
this.generateMaxNumberArray();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.checkContent();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { nzOverflowCount, nzCount } = changes;
if (nzCount && !(nzCount.currentValue instanceof TemplateRef)) {
this.count = Math.max(0, nzCount.currentValue);
this.countArray = this.count.toString().split('').map((/**
* @param {?} item
* @return {?}
*/
item => +item));
}
if (nzOverflowCount) {
this.generateMaxNumberArray();
}
}
}
NzBadgeComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-badge',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [zoomBadgeMotion],
template: "<span (cdkObserveContent)=\"checkContent()\" #contentElement><ng-content></ng-content></span>\n<span class=\"ant-badge-status-dot ant-badge-status-{{nzStatus}}\" *ngIf=\"nzStatus\" [ngStyle]=\"nzStyle\"></span>\n<span class=\"ant-badge-status-text\" *ngIf=\"nzStatus\">{{ nzText }}</span>\n<ng-container *nzStringTemplateOutlet=\"nzCount\">\n <sup class=\"ant-scroll-number\"\n *ngIf=\"showSup\"\n @zoomBadgeMotion\n [ngStyle]=\"nzStyle\"\n [class.ant-badge-count]=\"!nzDot\"\n [class.ant-badge-dot]=\"nzDot\"\n [class.ant-badge-multiple-words]=\"countArray.length>=2\">\n <ng-container *ngFor=\"let n of maxNumberArray;let i = index;\">\n <span class=\"ant-scroll-number-only\"\n *ngIf=\"count <= nzOverflowCount\"\n [style.transform]=\"'translateY(' + (-countArray[i] * 100) + '%)'\">\n <ng-container *ngIf=\"(!nzDot)&&(countArray[i]!=null)\">\n <p *ngFor=\"let p of countSingleArray\" [class.current]=\"p === countArray[i]\">{{ p }}</p>\n </ng-container>\n </span>\n </ng-container>\n <ng-container *ngIf=\"count > nzOverflowCount\">{{ nzOverflowCount }}+</ng-container>\n </sup>\n</ng-container>",
host: {
'[class.ant-badge-status]': 'nzStatus'
}
}] }
];
/** @nocollapse */
NzBadgeComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ElementRef }
];
NzBadgeComponent.propDecorators = {
contentElement: [{ type: ViewChild, args: ['contentElement',] }],
nzShowZero: [{ type: Input }],
nzShowDot: [{ type: Input }],
nzDot: [{ type: Input }],
nzOverflowCount: [{ type: Input }],
nzText: [{ type: Input }],
nzStyle: [{ type: Input }],
nzStatus: [{ type: Input }],
nzCount: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzBadgeComponent.prototype, "nzShowZero", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzBadgeComponent.prototype, "nzShowDot", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzBadgeComponent.prototype, "nzDot", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBadgeModule {
}
NzBadgeModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzBadgeComponent],
exports: [NzBadgeComponent],
imports: [CommonModule, ObserversModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_ROUTE_DATA_BREADCRUMB = 'breadcrumb';
class NzBreadCrumbComponent {
/**
* @param {?} injector
* @param {?} ngZone
* @param {?} cd
* @param {?} elementRef
* @param {?} renderer
*/
constructor(injector, ngZone, cd, elementRef, renderer) {
this.injector = injector;
this.ngZone = ngZone;
this.cd = cd;
this.nzAutoGenerate = false;
this.nzSeparator = '/';
this.breadcrumbs = [];
this.destroy$ = new Subject();
renderer.addClass(elementRef.nativeElement, 'ant-breadcrumb');
}
/**
* @return {?}
*/
ngOnInit() {
if (this.nzAutoGenerate) {
try {
/** @type {?} */
const activatedRoute = this.injector.get(ActivatedRoute);
/** @type {?} */
const router = this.injector.get(Router);
router.events.pipe(filter((/**
* @param {?} e
* @return {?}
*/
e => e instanceof NavigationEnd)), takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.breadcrumbs = this.getBreadcrumbs(activatedRoute.root);
this.cd.markForCheck();
}));
}
catch (e) {
throw new Error('[NG-ZORRO] You should import RouterModule if you want to use NzAutoGenerate');
}
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
/**
* @param {?} url
* @param {?} e
* @return {?}
*/
navigate(url, e) {
e.preventDefault();
this.ngZone.run((/**
* @return {?}
*/
() => this.injector.get(Router).navigateByUrl(url).then())).then();
}
/**
* @private
* @param {?} route
* @param {?=} url
* @param {?=} breadcrumbs
* @return {?}
*/
getBreadcrumbs(route, url = '', breadcrumbs = []) {
/** @type {?} */
const children = route.children;
// If there's no sub root, then stop the recurse and returns the generated breadcrumbs.
if (children.length === 0) {
return breadcrumbs;
}
for (const child of children) {
if (child.outlet === PRIMARY_OUTLET) {
// Only parse components in primary router-outlet (in another word, router-outlet without a specific name).
// Parse this layer and generate a breadcrumb item.
/** @type {?} */
const routeURL = child.snapshot.url.map((/**
* @param {?} segment
* @return {?}
*/
segment => segment.path)).join('/');
/** @type {?} */
const nextUrl = url + `/${routeURL}`;
// If have data, go to generate a breadcrumb for it.
if (child.snapshot.data.hasOwnProperty(NZ_ROUTE_DATA_BREADCRUMB)) {
/** @type {?} */
const breadcrumb = {
label: child.snapshot.data[NZ_ROUTE_DATA_BREADCRUMB] || 'Breadcrumb',
params: child.snapshot.params,
url: nextUrl
};
breadcrumbs.push(breadcrumb);
}
return this.getBreadcrumbs(child, nextUrl, breadcrumbs);
}
}
}
}
NzBreadCrumbComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-breadcrumb',
preserveWhitespaces: false,
template: "<ng-content></ng-content>\n<ng-container *ngIf=\"nzAutoGenerate\">\n <nz-breadcrumb-item *ngFor=\"let breadcrumb of breadcrumbs\">\n <a [attr.href]=\"breadcrumb.url\" (click)=\"navigate(breadcrumb.url, $event)\">{{ breadcrumb.label }}</a>\n </nz-breadcrumb-item>\n</ng-container>",
styles: [`
nz-breadcrumb {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzBreadCrumbComponent.ctorParameters = () => [
{ type: Injector },
{ type: NgZone },
{ type: ChangeDetectorRef },
{ type: ElementRef },
{ type: Renderer2 }
];
NzBreadCrumbComponent.propDecorators = {
nzAutoGenerate: [{ type: Input }],
nzSeparator: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBreadCrumbItemComponent {
/**
* @param {?} nzBreadCrumbComponent
*/
constructor(nzBreadCrumbComponent) {
this.nzBreadCrumbComponent = nzBreadCrumbComponent;
}
}
NzBreadCrumbItemComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-breadcrumb-item',
preserveWhitespaces: false,
template: "<span class=\"ant-breadcrumb-link\">\n <ng-content></ng-content>\n</span>\n<span class=\"ant-breadcrumb-separator\">\n <ng-container *nzStringTemplateOutlet=\"nzBreadCrumbComponent.nzSeparator\">\n {{ nzBreadCrumbComponent.nzSeparator }}\n </ng-container>\n</span>",
styles: [`
nz-breadcrumb-item:last-child {
color: rgba(0, 0, 0, 0.65);
}
nz-breadcrumb-item:last-child .ant-breadcrumb-separator {
display: none;
}
`]
}] }
];
/** @nocollapse */
NzBreadCrumbItemComponent.ctorParameters = () => [
{ type: NzBreadCrumbComponent }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzBreadCrumbModule {
}
NzBreadCrumbModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzAddOnModule],
declarations: [NzBreadCrumbComponent, NzBreadCrumbItemComponent],
exports: [NzBreadCrumbComponent, NzBreadCrumbItemComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzWaveRenderer {
/**
* @param {?} triggerElement
* @param {?} ngZone
* @param {?} insertExtraNode
*/
constructor(triggerElement, ngZone, insertExtraNode) {
this.triggerElement = triggerElement;
this.ngZone = ngZone;
this.insertExtraNode = insertExtraNode;
this.waveTransitionDuration = 400;
this.lastTime = 0;
this.onClick = (/**
* @param {?} event
* @return {?}
*/
(event) => {
if (!this.triggerElement ||
!this.triggerElement.getAttribute ||
this.triggerElement.getAttribute('disabled') ||
((/** @type {?} */ (event.target))).tagName === 'INPUT' ||
this.triggerElement.className.indexOf('disabled') >= 0) {
return;
}
this.fadeOutWave();
});
/** @type {?} */
const platform = new Platform();
if (platform.isBrowser) {
this.bindTriggerEvent();
}
}
/**
* @return {?}
*/
get waveAttributeName() {
return this.insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';
}
/**
* @return {?}
*/
bindTriggerEvent() {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
if (this.triggerElement) {
this.triggerElement.addEventListener('click', this.onClick, true);
}
}));
}
/**
* @return {?}
*/
removeTriggerEvent() {
if (this.triggerElement) {
this.triggerElement.removeEventListener('click', this.onClick, true);
}
}
/**
* @return {?}
*/
removeStyleAndExtraNode() {
if (this.styleForPseudo && document.body.contains(this.styleForPseudo)) {
document.body.removeChild(this.styleForPseudo);
this.styleForPseudo = null;
}
if (this.insertExtraNode && this.triggerElement.contains(this.extraNode)) {
this.triggerElement.removeChild(this.extraNode);
}
}
/**
* @return {?}
*/
destroy() {
this.removeTriggerEvent();
this.removeStyleAndExtraNode();
}
/**
* @private
* @return {?}
*/
fadeOutWave() {
/** @type {?} */
const node = this.triggerElement;
/** @type {?} */
const waveColor = this.getWaveColor(node);
node.setAttribute(this.waveAttributeName, 'true');
if (Date.now() < this.lastTime + this.waveTransitionDuration) {
return;
}
if (this.isValidColor(waveColor)) {
if (!this.styleForPseudo) {
this.styleForPseudo = document.createElement('style');
}
this.styleForPseudo.innerHTML =
`[ant-click-animating-without-extra-node]:after { border-color: ${waveColor}; }`;
document.body.appendChild(this.styleForPseudo);
}
if (this.insertExtraNode) {
if (!this.extraNode) {
this.extraNode = document.createElement('div');
}
this.extraNode.className = 'ant-click-animating-node';
node.appendChild(this.extraNode);
}
this.lastTime = Date.now();
this.runTimeoutOutsideZone((/**
* @return {?}
*/
() => {
node.removeAttribute(this.waveAttributeName);
this.removeStyleAndExtraNode();
}), this.waveTransitionDuration);
}
/**
* @private
* @param {?} color
* @return {?}
*/
isValidColor(color) {
return color
&& color !== '#ffffff'
&& color !== 'rgb(255, 255, 255)'
&& this.isNotGrey(color)
&& !/rgba\(\d*, \d*, \d*, 0\)/.test(color)
&& color !== 'transparent';
}
/**
* @private
* @param {?} color
* @return {?}
*/
isNotGrey(color) {
/** @type {?} */
const match = color.match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);
if (match && match[1] && match[2] && match[3]) {
return !(match[1] === match[2] && match[2] === match[3]);
}
return true;
}
/**
* @private
* @param {?} node
* @return {?}
*/
getWaveColor(node) {
/** @type {?} */
const nodeStyle = getComputedStyle(node);
return nodeStyle.getPropertyValue('border-top-color') || // Firefox Compatible
nodeStyle.getPropertyValue('border-color') ||
nodeStyle.getPropertyValue('background-color');
}
/**
* @private
* @param {?} fn
* @param {?} delay
* @return {?}
*/
runTimeoutOutsideZone(fn, delay$$1) {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => setTimeout(fn, delay$$1)));
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_WAVE_GLOBAL_DEFAULT_CONFIG = {
disabled: false
};
/** @type {?} */
const NZ_WAVE_GLOBAL_CONFIG = new InjectionToken('nz-wave-global-options', {
providedIn: 'root',
factory: NZ_WAVE_GLOBAL_CONFIG_FACTORY
});
/**
* @return {?}
*/
function NZ_WAVE_GLOBAL_CONFIG_FACTORY() {
return NZ_WAVE_GLOBAL_DEFAULT_CONFIG;
}
class NzWaveDirective {
/**
* @param {?} ngZone
* @param {?} elementRef
* @param {?} config
* @param {?} animationType
*/
constructor(ngZone, elementRef, config, animationType) {
this.ngZone = ngZone;
this.elementRef = elementRef;
this.animationType = animationType;
this.nzWaveExtraNode = false;
this.waveDisabled = false;
if (config && typeof config.disabled === 'boolean') {
this.waveDisabled = config.disabled;
}
if (this.animationType === 'NoopAnimations') {
this.waveDisabled = true;
}
}
/**
* @return {?}
*/
ngOnDestroy() {
if (this.waveRenderer) {
this.waveRenderer.destroy();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.renderWaveIfEnabled();
}
/**
* @return {?}
*/
renderWaveIfEnabled() {
if (!this.waveDisabled && this.elementRef.nativeElement) {
this.waveRenderer = new NzWaveRenderer(this.elementRef.nativeElement, this.ngZone, this.nzWaveExtraNode);
}
}
}
NzWaveDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-wave]'
},] }
];
/** @nocollapse */
NzWaveDirective.ctorParameters = () => [
{ type: NgZone },
{ type: ElementRef },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_WAVE_GLOBAL_CONFIG,] }] },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
];
NzWaveDirective.propDecorators = {
nzWaveExtraNode: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzWaveModule {
}
NzWaveModule.decorators = [
{ type: NgModule, args: [{
imports: [PlatformModule],
exports: [NzWaveDirective],
declarations: [NzWaveDirective]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzButtonGroupComponent {
/**
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
*/
constructor(nzUpdateHostClassService, elementRef) {
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.elementRef = elementRef;
this.prefixCls = 'ant-btn-group';
}
/**
* @return {?}
*/
get nzSize() {
return this._size;
}
/**
* @param {?} value
* @return {?}
*/
set nzSize(value) {
this._size = value;
this.setClassMap();
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const classMap = {
[this.prefixCls]: true,
[`${this.prefixCls}-lg`]: this.nzSize === 'large',
[`${this.prefixCls}-sm`]: this.nzSize === 'small'
};
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, classMap);
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
}
}
NzButtonGroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-button-group',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
providers: [NzUpdateHostClassService],
template: "<ng-content></ng-content>\n"
}] }
];
/** @nocollapse */
NzButtonGroupComponent.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: ElementRef }
];
NzButtonGroupComponent.propDecorators = {
nzSize: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Silent an event by stopping and preventing it.
* @param {?} e
* @return {?}
*/
function silentEvent(e) {
e.stopPropagation();
e.preventDefault();
}
/**
* @param {?} elem
* @return {?}
*/
function getElementOffset(elem) {
if (!elem.getClientRects().length) {
return { top: 0, left: 0 };
}
/** @type {?} */
const rect = elem.getBoundingClientRect();
/** @type {?} */
const win = elem.ownerDocument.defaultView;
return {
top: rect.top + win.pageYOffset,
left: rect.left + win.pageXOffset
};
}
/**
* @param {?} element
* @return {?}
*/
function findFirstNotEmptyNode(element) {
/** @type {?} */
const children = element.childNodes;
for (let i = 0; i < children.length; i++) {
/** @type {?} */
const node = children.item(i);
if (filterNotEmptyNode(node)) {
return node;
}
}
return null;
}
/**
* @param {?} element
* @return {?}
*/
function findLastNotEmptyNode(element) {
/** @type {?} */
const children = element.childNodes;
for (let i = children.length - 1; i >= 0; i--) {
/** @type {?} */
const node = children.item(i);
if (filterNotEmptyNode(node)) {
return node;
}
}
return null;
}
/**
* @param {?} parent
* @return {?}
*/
function reverseChildNodes(parent) {
/** @type {?} */
const children = parent.childNodes;
/** @type {?} */
let length = children.length;
if (length) {
/** @type {?} */
const nodes = [];
children.forEach((/**
* @param {?} node
* @param {?} i
* @return {?}
*/
(node, i) => nodes[i] = node));
while (length--) {
parent.appendChild(nodes[length]);
}
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzButtonComponent {
/**
* @param {?} elementRef
* @param {?} cdr
* @param {?} renderer
* @param {?} nzUpdateHostClassService
* @param {?} ngZone
* @param {?} waveConfig
* @param {?} animationType
*/
constructor(elementRef, cdr, renderer, nzUpdateHostClassService, ngZone, waveConfig, animationType) {
this.elementRef = elementRef;
this.cdr = cdr;
this.renderer = renderer;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.ngZone = ngZone;
this.waveConfig = waveConfig;
this.animationType = animationType;
this.el = this.elementRef.nativeElement;
this.iconOnly = false;
this.nzWave = new NzWaveDirective(this.ngZone, this.elementRef, this.waveConfig, this.animationType);
this.nzBlock = false;
this.nzGhost = false;
this.nzSearch = false;
this.nzLoading = false;
this.nzType = 'default';
this.nzShape = null;
this.nzSize = 'default';
}
/**
* temp solution since no method add classMap to host https://github.com/angular/angular/issues/7289
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixCls = 'ant-btn';
/** @type {?} */
const sizeMap = { large: 'lg', small: 'sm' };
this.nzUpdateHostClassService.updateHostClass(this.el, {
[`${prefixCls}`]: true,
[`${prefixCls}-${this.nzType}`]: this.nzType,
[`${prefixCls}-${this.nzShape}`]: this.nzShape,
[`${prefixCls}-${sizeMap[this.nzSize]}`]: sizeMap[this.nzSize],
[`${prefixCls}-loading`]: this.nzLoading,
[`${prefixCls}-icon-only`]: this.iconOnly,
[`${prefixCls}-background-ghost`]: this.nzGhost,
[`${prefixCls}-block`]: this.nzBlock,
[`ant-input-search-button`]: this.nzSearch
});
}
/**
* @param {?} value
* @return {?}
*/
updateIconDisplay(value) {
if (this.iconElement) {
this.renderer.setStyle(this.iconElement, 'display', value ? 'none' : 'inline-block');
}
}
/**
* @return {?}
*/
checkContent() {
/** @type {?} */
const hasIcon = this.listOfIconElement && this.listOfIconElement.length;
if (hasIcon) {
this.moveIcon();
}
this.renderer.removeStyle(this.contentElement.nativeElement, 'display');
/** https://github.com/angular/angular/issues/12530 **/
if (isEmpty(this.contentElement.nativeElement)) {
this.renderer.setStyle(this.contentElement.nativeElement, 'display', 'none');
this.iconOnly = !!hasIcon;
}
else {
this.renderer.removeStyle(this.contentElement.nativeElement, 'display');
this.iconOnly = false;
}
this.setClassMap();
this.updateIconDisplay(this.nzLoading);
this.cdr.detectChanges();
}
/**
* @return {?}
*/
moveIcon() {
if (this.listOfIconElement && this.listOfIconElement.length) {
/** @type {?} */
const firstChildElement = findFirstNotEmptyNode(this.contentElement.nativeElement);
/** @type {?} */
const lastChildElement = findLastNotEmptyNode(this.contentElement.nativeElement);
if (firstChildElement && (firstChildElement === this.listOfIconElement.first.nativeElement)) {
this.renderer.insertBefore(this.el, firstChildElement, this.contentElement.nativeElement);
this.iconElement = (/** @type {?} */ (firstChildElement));
}
else if (lastChildElement && (lastChildElement === this.listOfIconElement.last.nativeElement)) {
this.renderer.appendChild(this.el, lastChildElement);
}
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.checkContent();
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.nzWave.ngOnInit();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.nzWave.ngOnDestroy();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzBlock || changes.nzGhost || changes.nzSearch || changes.nzType || changes.nzShape || changes.nzSize || changes.nzLoading) {
this.setClassMap();
}
if (changes.nzLoading) {
this.updateIconDisplay(this.nzLoading);
}
}
}
NzButtonComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-button]',
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<i nz-icon type=\"loading\" *ngIf=\"nzLoading\"></i>\n<span (cdkObserveContent)=\"checkContent()\" #contentElement><ng-content></ng-content></span>"
}] }
];
/** @nocollapse */
NzButtonComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: NzUpdateHostClassService },
{ type: NgZone },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_WAVE_GLOBAL_CONFIG,] }] },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
];
NzButtonComponent.propDecorators = {
contentElement: [{ type: ViewChild, args: ['contentElement',] }],
listOfIconElement: [{ type: ContentChildren, args: [NzIconDirective, { read: ElementRef },] }],
nzWave: [{ type: HostBinding, args: ['attr.nz-wave',] }],
nzBlock: [{ type: Input }],
nzGhost: [{ type: Input }],
nzSearch: [{ type: Input }],
nzLoading: [{ type: Input }],
nzType: [{ type: Input }],
nzShape: [{ type: Input }],
nzSize: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzButtonComponent.prototype, "nzBlock", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzButtonComponent.prototype, "nzGhost", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzButtonComponent.prototype, "nzSearch", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzButtonComponent.prototype, "nzLoading", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzButtonModule {
}
NzButtonModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzButtonComponent, NzButtonGroupComponent],
exports: [NzButtonComponent, NzButtonGroupComponent],
imports: [CommonModule, ObserversModule, NzWaveModule, NzIconModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_LOGGER_STATE = new InjectionToken('nz-logger-state');
// Whether print the log
class LoggerService {
/**
* @param {?} _loggerState
*/
constructor(_loggerState) {
this._loggerState = _loggerState;
}
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
log(...args) {
if (this._loggerState) {
console.log(...args);
}
}
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
warn(...args) {
if (this._loggerState) {
console.warn(...args);
}
}
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
error(...args) {
if (this._loggerState) {
console.error(...args);
}
}
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
info(...args) {
if (this._loggerState) {
console.log(...args);
}
}
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
debug(...args) {
if (this._loggerState) {
console.log('[NG-ZORRO-DEBUG]', ...args);
}
}
}
LoggerService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
LoggerService.ctorParameters = () => [
{ type: Boolean, decorators: [{ type: Inject, args: [NZ_LOGGER_STATE,] }] }
];
/**
* @param {?} exist
* @param {?} loggerState
* @return {?}
*/
function LOGGER_SERVICE_PROVIDER_FACTORY(exist, loggerState) { return exist || new LoggerService(loggerState); }
/** @type {?} */
const LOGGER_SERVICE_PROVIDER = {
provide: LoggerService,
useFactory: LOGGER_SERVICE_PROVIDER_FACTORY,
deps: [[new Optional(), new SkipSelf(), LoggerService], NZ_LOGGER_STATE]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class LoggerModule {
}
LoggerModule.decorators = [
{ type: NgModule, args: [{
providers: [
{ provide: NZ_LOGGER_STATE, useValue: false },
LOGGER_SERVICE_PROVIDER
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale = {
today: '今天',
now: '此刻',
backToToday: '返回今天',
ok: '确定',
timeSelect: '选择时间',
dateSelect: '选择日期',
clear: '清除',
month: '月',
year: '年',
previousMonth: '上个月 (翻页上键)',
nextMonth: '下个月 (翻页下键)',
monthSelect: '选择月份',
yearSelect: '选择年份',
decadeSelect: '选择年代',
yearFormat: 'YYYY年',
dayFormat: 'D日',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
previousYear: '上一年 (Control键加左方向键)',
nextYear: '下一年 (Control键加右方向键)',
previousDecade: '上一年代',
nextDecade: '下一年代',
previousCentury: '上一世纪',
nextCentury: '下一世纪',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale = {
placeholder: '请选择时间',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$1 = {
lang: Object.assign({ placeholder: '请选择日期', rangePlaceholder: ['开始日期', '结束日期'] }, CalendarLocale),
timePickerLocale: Object.assign({}, locale),
};
// should add whitespace between char in Button
locale$1.lang.ok = '确 定';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination = {
// Options.jsx
items_per_page: '条/页',
jump_to: '跳至',
jump_to_confirm: '确定',
page: '页',
// Pagination.jsx
prev_page: '上一页',
next_page: '下一页',
prev_5: '向前 5 页',
next_5: '向后 5 页',
prev_3: '向前 3 页',
next_3: '向后 3 页',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var zh_CN = {
locale: 'zh-cn',
Pagination,
DatePicker: locale$1,
TimePicker: locale,
Calendar: CalendarLocale,
// locales for all comoponents
global: {
placeholder: '请选择',
},
Table: {
filterTitle: '筛选',
filterConfirm: '确定',
filterReset: '重置',
selectAll: '全选当页',
selectInvert: '反选当页',
sortTitle: '排序',
},
Modal: {
okText: '确定',
cancelText: '取消',
justOkText: '知道了',
},
Popconfirm: {
cancelText: '取消',
okText: '确定',
},
Transfer: {
searchPlaceholder: '请输入搜索内容',
itemUnit: '项',
itemsUnit: '项',
},
Upload: {
uploading: '文件上传中',
removeFile: '删除文件',
uploadError: '上传错误',
previewFile: '预览文件',
},
Empty: {
description: '暂无数据',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_I18N = new InjectionToken('nz-i18n');
/**
* Locale for date operations, should import from date-fns, see example: https://github.com/date-fns/date-fns/blob/v1.30.1/src/locale/zh_cn/index.js
* @type {?}
*/
const NZ_DATE_LOCALE = new InjectionToken('nz-date-locale');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_DATE_CONFIG = new InjectionToken('date-config');
/** @type {?} */
const NZ_DATE_CONFIG_DEFAULT = {
firstDayOfWeek: null
};
/**
* @param {?} config
* @return {?}
*/
function mergeDateConfig(config) {
return Object.assign({}, NZ_DATE_CONFIG_DEFAULT, config);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} injector
* @param {?} config
* @param {?} datePipe
* @return {?}
*/
function DATE_HELPER_SERVICE_FACTORY(injector, config, datePipe) {
/** @type {?} */
const i18n = injector.get(NzI18nService$$1);
return i18n.getDateLocale() ? new DateHelperByDateFns(i18n, config) : new DateHelperByDatePipe(i18n, config, datePipe);
}
/**
* Abstract DateHelperService(Token via Class)
* Compatibility: compact for original usage by default which using DatePipe
* @abstract
*/
class DateHelperService$$1 {
// Indicate whether this service is rely on DatePipe
/**
* @param {?} i18n
* @param {?} config
*/
constructor(i18n, config) {
this.i18n = i18n;
this.config = config;
this.relyOnDatePipe = this instanceof DateHelperByDatePipe; // Indicate whether this service is rely on DatePipe
this.config = mergeDateConfig(this.config);
}
/**
* @param {?} text
* @return {?}
*/
parseDate(text) {
if (!text) {
return;
}
return fnsParse(text);
}
/**
* @param {?} text
* @return {?}
*/
parseTime(text) {
if (!text) {
return;
}
return fnsParse(`1970-01-01 ${text}`);
}
}
DateHelperService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root',
useFactory: DATE_HELPER_SERVICE_FACTORY,
deps: [Injector, [new Optional(), NZ_DATE_CONFIG], DatePipe]
},] }
];
/** @nocollapse */
DateHelperService$$1.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_DATE_CONFIG,] }] }
];
/** @nocollapse */ DateHelperService$$1.ngInjectableDef = defineInjectable({ factory: function DateHelperService_Factory() { return DATE_HELPER_SERVICE_FACTORY(inject(INJECTOR), inject(NZ_DATE_CONFIG, 8), inject(DatePipe)); }, token: DateHelperService$$1, providedIn: "root" });
/**
* DateHelper that handles date formats with date-fns
*/
class DateHelperByDateFns extends DateHelperService$$1 {
/**
* @param {?} date
* @return {?}
*/
getISOWeek(date) {
return fnsGetISOWeek(date);
}
// TODO: Use date-fns's "weekStartsOn" to support different locale when "config.firstDayOfWeek" is null
// when v2.0 is ready: https://github.com/date-fns/date-fns/blob/v2.0.0-alpha.27/src/locale/en-US/index.js#L23
/**
* @return {?}
*/
getFirstDayOfWeek() {
return this.config.firstDayOfWeek == null ? 1 : this.config.firstDayOfWeek;
}
/**
* Format a date
* @see https://date-fns.org/docs/format#description
* @param {?} date Date
* @param {?} formatStr format string
* @return {?}
*/
format(date, formatStr) {
return fnsFormat(date, formatStr, { locale: this.i18n.getDateLocale() });
}
}
/** @nocollapse */ DateHelperByDateFns.ngInjectableDef = defineInjectable({ factory: function DateHelperByDateFns_Factory() { return DATE_HELPER_SERVICE_FACTORY(inject(INJECTOR), inject(NZ_DATE_CONFIG, 8), inject(DatePipe)); }, token: DateHelperByDateFns, providedIn: "root" });
/**
* DateHelper that handles date formats with angular's date-pipe
* [BUG] Use DatePipe may cause non-standard week bug, see: https://github.com/NG-ZORRO/ng-zorro-antd/issues/2406
*
* @deprecated Maybe removed in next major version due to this serious bug
*/
class DateHelperByDatePipe extends DateHelperService$$1 {
/**
* @param {?} i18n
* @param {?} config
* @param {?} datePipe
*/
constructor(i18n, config, datePipe) {
super(i18n, config);
this.datePipe = datePipe;
}
/**
* @param {?} date
* @return {?}
*/
getISOWeek(date) {
return +this.format(date, 'w');
}
/**
* @return {?}
*/
getFirstDayOfWeek() {
if (this.config.firstDayOfWeek == null) {
/** @type {?} */
const locale = this.i18n.getLocaleId();
return locale && ['zh-cn', 'zh-tw'].indexOf(locale.toLowerCase()) > -1 ? 1 : 0;
}
return this.config.firstDayOfWeek;
}
/**
* @param {?} date
* @param {?} formatStr
* @return {?}
*/
format(date, formatStr) {
return date ? this.datePipe.transform(date, formatStr, null, this.i18n.getLocaleId()) : '';
}
/**
* Compatible translate the moment-like format pattern to angular's pattern
* Why? For now, we need to support the existing language formats in AntD, and AntD uses the default temporal syntax.
*
* TODO: compare and complete all format patterns
* Each format docs as below:
* @link https://momentjs.com/docs/#/displaying/format/ / https://angular.io/api/common/DatePipe#description
* @param {?} format input format pattern
* @return {?}
*/
transCompatFormat(format) {
return format && format
.replace(/Y/g, 'y') // only support y, yy, yyy, yyyy
.replace(/D/g, 'd'); // d, dd represent of D, DD for momentjs, others are not support
}
}
/** @nocollapse */
DateHelperByDatePipe.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_DATE_CONFIG,] }] },
{ type: DatePipe }
];
/** @nocollapse */ DateHelperByDatePipe.ngInjectableDef = defineInjectable({ factory: function DateHelperByDatePipe_Factory() { return DATE_HELPER_SERVICE_FACTORY(inject(INJECTOR), inject(NZ_DATE_CONFIG, 8), inject(DatePipe)); }, token: DateHelperByDatePipe, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$1 = {
today: 'اليوم',
now: 'الأن',
backToToday: 'العودة إلى اليوم',
ok: 'تأكيد',
clear: 'مسح',
month: 'الشهر',
year: 'السنة',
timeSelect: 'اختيار الوقت',
dateSelect: 'اختيار التاريخ',
monthSelect: 'اختيار الشهر',
yearSelect: 'اختيار السنة',
decadeSelect: 'اختيار العقد',
yearFormat: 'YYYY',
dateFormat: 'M/D/YYYY',
dayFormat: 'D',
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'الشهر السابق (PageUp)',
nextMonth: 'الشهر التالى(PageDown)',
previousYear: 'العام السابق (Control + left)',
nextYear: 'العام التالى (Control + right)',
previousDecade: 'العقد السابق',
nextDecade: 'العقد التالى',
previousCentury: 'القرن السابق',
nextCentury: 'القرن التالى',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$2 = {
placeholder: 'اختيار الوقت',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$3 = {
lang: Object.assign({ placeholder: 'اختيار التاريخ', rangePlaceholder: ['البداية', 'النهاية'] }, CalendarLocale$1),
timePickerLocale: Object.assign({}, locale$2),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$1 = {
// Options.jsx
items_per_page: '/ الصفحة',
jump_to: 'الذهاب إلى',
jump_to_confirm: 'تأكيد',
page: '',
// Pagination.jsx
prev_page: 'الصفحة السابقة',
next_page: 'الصفحة التالية',
prev_5: 'خمس صفحات سابقة',
next_5: 'خمس صفحات تالية',
prev_3: 'ثلاث صفحات سابقة',
next_3: 'ثلاث صفحات تالية',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ar_EG = {
locale: 'ar',
Pagination: Pagination$1,
DatePicker: locale$3,
TimePicker: locale$2,
Calendar: CalendarLocale$1,
Table: {
filterTitle: 'الفلاتر',
filterConfirm: 'تأكيد',
filterReset: 'إعادة ضبط',
selectAll: 'اختيار الكل',
selectInvert: 'إلغاء الاختيار',
},
Modal: {
okText: 'تأكيد',
cancelText: 'إلغاء',
justOkText: 'تأكيد',
},
Popconfirm: {
okText: 'تأكيد',
cancelText: 'إلغاء',
},
Transfer: {
searchPlaceholder: 'ابحث هنا',
itemUnit: 'عنصر',
itemsUnit: 'عناصر',
},
Upload: {
uploading: 'جاري الرفع...',
removeFile: 'احذف الملف',
uploadError: 'مشكلة فى الرفع',
previewFile: 'استعرض الملف',
},
Empty: {
description: 'لا توجد بيانات',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$2 = {
today: 'Днес',
now: 'Сега',
backToToday: 'Към днес',
ok: 'Добре',
clear: 'Изчистване',
month: 'Месец',
year: 'Година',
timeSelect: 'Избор на час',
dateSelect: 'Избор на дата',
monthSelect: 'Избор на месец',
yearSelect: 'Избор на година',
decadeSelect: 'Десетилетие',
yearFormat: 'YYYY',
dateFormat: 'D M YYYY',
dayFormat: 'D',
dateTimeFormat: 'D M YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Предишен месец (PageUp)',
nextMonth: 'Следващ месец (PageDown)',
previousYear: 'Последна година (Control + left)',
nextYear: 'Следваща година (Control + right)',
previousDecade: 'Предишно десетилетие',
nextDecade: 'Следващо десетилетие',
previousCentury: 'Последен век',
nextCentury: 'Следващ век',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$4 = {
placeholder: 'Избор на час',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$5 = {
lang: Object.assign({ placeholder: 'Избор на дата', rangePlaceholder: ['Начална', 'Крайна'] }, CalendarLocale$2),
timePickerLocale: Object.assign({}, locale$4),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$2 = {
// Options.jsx
items_per_page: '/ страница',
jump_to: 'Към',
jump_to_confirm: 'потвърждавам',
page: '',
// Pagination.jsx
prev_page: 'Предишна страница',
next_page: 'Следваща страница',
prev_5: 'Предишни 5 страници',
next_5: 'Следващи 5 страници',
prev_3: 'Предишни 3 страници',
next_3: 'Следващи 3 страници',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var bg_BG = {
locale: 'bg',
Pagination: Pagination$2,
DatePicker: locale$5,
TimePicker: locale$4,
Calendar: CalendarLocale$2,
Table: {
filterTitle: 'Филтриране',
filterConfirm: 'Добре',
filterReset: 'Нулриане',
selectAll: 'Избор на текуща страница',
selectInvert: 'Обръщане',
},
Modal: {
okText: 'Добре',
cancelText: 'Отказ',
justOkText: 'Добре',
},
Popconfirm: {
okText: 'Добре',
cancelText: 'Отказ',
},
Transfer: {
searchPlaceholder: 'Търсене',
itemUnit: 'избор',
itemsUnit: 'избори',
},
Upload: {
uploading: 'Качване...',
removeFile: 'Премахване',
uploadError: 'Грешка при качването',
previewFile: 'Преглед',
},
Empty: {
description: 'Няма данни',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$3 = {
today: 'Avui',
now: 'Ara',
backToToday: 'Tornar a avui',
ok: 'Acceptar',
clear: 'Netejar',
month: 'Mes',
year: 'Any',
timeSelect: 'Seleccionar hora',
dateSelect: 'Seleccionar data',
monthSelect: 'Escollir un mes',
yearSelect: 'Escollir un any',
decadeSelect: 'Escollir una dècada',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes següent (PageDown)',
previousYear: 'Any anterior (Control + left)',
nextYear: 'Mes següent (Control + right)',
previousDecade: 'Dècada anterior',
nextDecade: 'Dècada següent',
previousCentury: 'Segle anterior',
nextCentury: 'Segle següent',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$6 = {
placeholder: 'Seleccionar hora',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$7 = {
lang: Object.assign({ placeholder: 'Seleccionar data', rangePlaceholder: ['Data inicial', 'Data final'] }, CalendarLocale$3),
timePickerLocale: Object.assign({}, locale$6),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$3 = {
// Options.jsx
items_per_page: '/ pàgina',
jump_to: 'Anar a',
jump_to_confirm: 'Confirma',
page: '',
// Pagination.jsx
prev_page: 'Pàgina prèvia',
next_page: 'Pàgina següent',
prev_5: '5 pàgines prèvies',
next_5: '5 pàgines següents',
prev_3: '3 pàgines prèvies',
next_3: '3 pàgines següents',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ca_ES = {
locale: 'ca',
Pagination: Pagination$3,
DatePicker: locale$7,
TimePicker: locale$6,
Calendar: CalendarLocale$3,
Table: {
filterTitle: 'Filtrar Menu',
filterConfirm: 'OK',
filterReset: 'Restablir',
},
Modal: {
okText: 'OK',
cancelText: 'Cancel·lar',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancel·lar',
},
Transfer: {
searchPlaceholder: 'Cercar aquí',
itemUnit: 'item',
itemsUnit: 'items',
},
Empty: {
description: 'Sense dades',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$4 = {
today: 'Dnes',
now: 'Nyní',
backToToday: 'Zpět na dnešek',
ok: 'Ok',
clear: 'Vymazat',
month: 'Měsíc',
year: 'Rok',
timeSelect: 'Vybrat čas',
dateSelect: 'Vybrat datum',
monthSelect: 'Vyberte měsíc',
yearSelect: 'Vyberte rok',
decadeSelect: 'Vyberte dekádu',
yearFormat: 'YYYY',
dateFormat: 'D.M.YYYY',
dayFormat: 'D',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Předchozí měsíc (PageUp)',
nextMonth: 'Následující (PageDown)',
previousYear: 'Předchozí rok (Control + left)',
nextYear: 'Následující rok (Control + right)',
previousDecade: 'Předchozí dekáda',
nextDecade: 'Následující dekáda',
previousCentury: 'Předchozí století',
nextCentury: 'Následující století',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$8 = {
placeholder: 'Vybrat čas',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$9 = {
lang: Object.assign({ placeholder: 'Vybrat datum', rangePlaceholder: ['Od', 'Do'] }, CalendarLocale$4),
timePickerLocale: Object.assign({}, locale$8),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$4 = {
// Options.jsx
items_per_page: '/ strana',
jump_to: 'Přejít',
jump_to_confirm: 'potvrdit',
page: '',
// Pagination.jsx
prev_page: 'Předchozí strana',
next_page: 'Následující strana',
prev_5: 'Předchozích 5 stran',
next_5: 'Následujících 5 stran',
prev_3: 'Předchozí 3 strany',
next_3: 'Následující 3 strany',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var cs_CZ = {
locale: 'cs',
Pagination: Pagination$4,
DatePicker: locale$9,
TimePicker: locale$8,
Calendar: CalendarLocale$4,
Table: {
filterTitle: 'Filtr',
filterConfirm: 'Potvrdit',
filterReset: 'Obnovit',
},
Modal: {
okText: 'Ok',
cancelText: 'Storno',
justOkText: 'Ok',
},
Popconfirm: {
okText: 'Ok',
cancelText: 'Storno',
},
Transfer: {
searchPlaceholder: 'Vyhledávání',
itemUnit: 'položka',
itemsUnit: 'položek',
},
Upload: {
uploading: 'Nahrávání...',
removeFile: 'Odstranit soubor',
uploadError: 'Chyba při nahrávání',
previewFile: 'Zobrazit soubor',
},
Empty: {
description: 'Žádná data',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$5 = {
today: 'I dag',
now: 'Nu',
backToToday: 'Gå til i dag',
ok: 'Ok',
clear: 'Annuller',
month: 'Måned',
year: 'År',
timeSelect: 'Vælg tidspunkt',
dateSelect: 'Vælg dato',
monthSelect: 'Vælg måned',
yearSelect: 'Vælg år',
decadeSelect: 'Vælg årti',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Forrige måned(PageUp)',
nextMonth: 'Næste måned (PageDown)',
previousYear: 'Forrige år (Control + left)',
nextYear: 'Næste r (Control + right)',
previousDecade: 'Forrige årti',
nextDecade: 'Næste årti',
previousCentury: 'Forrige århundrede',
nextCentury: 'Næste århundrede',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$a = {
placeholder: 'Vælg tid',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$b = {
lang: Object.assign({ placeholder: 'Vælg dato', rangePlaceholder: ['Startdato', 'Slutdato'] }, CalendarLocale$5),
timePickerLocale: Object.assign({}, locale$a),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$5 = {
// Options.jsx
items_per_page: '/ side',
jump_to: 'Gå til',
jump_to_confirm: 'bekræft',
page: '',
// Pagination.jsx
prev_page: 'Forrige Side',
next_page: 'Næste Side',
prev_5: 'Forrige 5 Sider',
next_5: 'Næste 5 Sider',
prev_3: 'Forrige 3 Sider',
next_3: 'Næste 3 Sider',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var da_DK = {
locale: 'da',
DatePicker: locale$b,
TimePicker: locale$a,
Calendar: CalendarLocale$5,
Pagination: Pagination$5,
Table: {
filterTitle: 'Filtermenu',
filterConfirm: 'OK',
filterReset: 'Nulstil',
selectAll: 'Vælg alle',
selectInvert: 'Inverter valg',
},
Modal: {
okText: 'OK',
cancelText: 'Afbryd',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Afbryd',
},
Transfer: {
searchPlaceholder: 'Søg her',
itemUnit: 'element',
itemsUnit: 'elementer',
},
Upload: {
uploading: 'Uploader...',
removeFile: 'Fjern fil',
uploadError: 'Fejl ved upload',
previewFile: 'Forhåndsvisning',
},
Empty: {
description: 'Ingen data',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$6 = {
today: 'Heute',
now: 'Jetzt',
backToToday: 'Zurück zu Heute',
ok: 'OK',
clear: 'Zurücksetzen',
month: 'Monat',
year: 'Jahr',
timeSelect: 'Zeit wählen',
dateSelect: 'Datum wählen',
monthSelect: 'Wähle einen Monat',
yearSelect: 'Wähle ein Jahr',
decadeSelect: 'Wähle ein Jahrzehnt',
yearFormat: 'YYYY',
dateFormat: 'D.M.YYYY',
dayFormat: 'D',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Vorheriger Monat (PageUp)',
nextMonth: 'Nächster Monat (PageDown)',
previousYear: 'Vorheriges Jahr (Ctrl + left)',
nextYear: 'Nächstes Jahr (Ctrl + right)',
previousDecade: 'Vorheriges Jahrzehnt',
nextDecade: 'Nächstes Jahrzehnt',
previousCentury: 'Vorheriges Jahrhundert',
nextCentury: 'Nächstes Jahrhundert',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$c = {
placeholder: 'Zeit auswählen',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$d = {
lang: Object.assign({ placeholder: 'Datum auswählen', rangePlaceholder: ['Startdatum', 'Enddatum'] }, CalendarLocale$6),
timePickerLocale: Object.assign({}, locale$c),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$6 = {
// Options.jsx
items_per_page: '/ Seite',
jump_to: 'Gehe zu',
jump_to_confirm: 'bestätigen',
page: '',
// Pagination.jsx
prev_page: 'Vorherige Seite',
next_page: 'Nächste Seite',
prev_5: '5 Seiten zurück',
next_5: '5 Seiten vor',
prev_3: '3 Seiten zurück',
next_3: '3 Seiten vor',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var de_DE = {
locale: 'de',
Pagination: Pagination$6,
DatePicker: locale$d,
TimePicker: locale$c,
Calendar: CalendarLocale$6,
Table: {
filterTitle: 'Filter-Menü',
filterConfirm: 'OK',
filterReset: 'Zurücksetzen',
selectAll: 'Selektiere Alle',
selectInvert: 'Selektion Invertieren',
},
Modal: {
okText: 'OK',
cancelText: 'Abbrechen',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Abbrechen',
},
Transfer: {
searchPlaceholder: 'Suchen',
itemUnit: 'Eintrag',
itemsUnit: 'Einträge',
},
Upload: {
uploading: 'Hochladen...',
removeFile: 'Datei entfernen',
uploadError: 'Fehler beim Hochladen',
previewFile: 'Dateivorschau',
},
Empty: {
description: 'Keine Daten',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$7 = {
today: 'Σήμερα',
now: 'Τώρα',
backToToday: 'Πίσω στη σημερινή μέρα',
ok: 'Ok',
clear: 'Καθαρισμός',
month: 'Μήνας',
year: 'Έτος',
timeSelect: 'Επιλογή ώρας',
dateSelect: 'Επιλογή ημερομηνίας',
monthSelect: 'Επιλογή μήνα',
yearSelect: 'Επιλογή έτους',
decadeSelect: 'Επιλογή δεκαετίας',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Προηγούμενος μήνας (PageUp)',
nextMonth: 'Επόμενος μήνας (PageDown)',
previousYear: 'Προηγούμενο έτος (Control + αριστερά)',
nextYear: 'Επόμενο έτος (Control + δεξιά)',
previousDecade: 'Προηγούμενη δεκαετία',
nextDecade: 'Επόμενη δεκαετία',
previousCentury: 'Προηγούμενος αιώνας',
nextCentury: 'Επόμενος αιώνας',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$e = {
placeholder: 'Επιλέξτε ώρα',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$f = {
lang: Object.assign({ placeholder: 'Επιλέξτε ημερομηνία', rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'] }, CalendarLocale$7),
timePickerLocale: Object.assign({}, locale$e),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$7 = {
// Options.jsx
items_per_page: '/ σελίδα',
jump_to: 'Μετάβαση',
jump_to_confirm: 'επιβεβαιώνω',
page: '',
// Pagination.jsx
prev_page: 'Προηγούμενη Σελίδα',
next_page: 'Επόμενη Σελίδα',
prev_5: 'Προηγούμενες 5 Σελίδες',
next_5: 'Επόμενες 5 σελίδες',
prev_3: 'Προηγούμενες 3 Σελίδες',
next_3: 'Επόμενες 3 Σελίδες',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var el_GR = {
locale: 'el',
Pagination: Pagination$7,
DatePicker: locale$f,
TimePicker: locale$e,
Calendar: CalendarLocale$7,
Table: {
filterTitle: 'Μενού φίλτρων',
filterConfirm: 'ΟΚ',
filterReset: 'Επαναφορά',
selectAll: 'Επιλογή τρέχουσας σελίδας',
selectInvert: 'Αντιστροφή τρέχουσας σελίδας',
},
Modal: {
okText: 'ΟΚ',
cancelText: 'Άκυρο',
justOkText: 'ΟΚ',
},
Popconfirm: {
okText: 'ΟΚ',
cancelText: 'Άκυρο',
},
Transfer: {
searchPlaceholder: 'Αναζήτηση',
itemUnit: 'αντικείμενο',
itemsUnit: 'αντικείμενα',
},
Upload: {
uploading: 'Μεταφόρτωση...',
removeFile: 'Αφαίρεση αρχείου',
uploadError: 'Σφάλμα μεταφόρτωσης',
previewFile: 'Προεπισκόπηση αρχείου',
},
Empty: {
description: 'Δεν υπάρχουν δεδομένα',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$8 = {
today: 'Today',
now: 'Now',
backToToday: 'Back to today',
ok: 'Ok',
clear: 'Clear',
month: 'Month',
year: 'Year',
timeSelect: 'Select time',
dateSelect: 'Select date',
monthSelect: 'Choose a month',
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
nextYear: 'Next year (Control + right)',
previousDecade: 'Last decade',
nextDecade: 'Next decade',
previousCentury: 'Last century',
nextCentury: 'Next century',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$g = {
placeholder: 'Select time',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$h = {
lang: Object.assign({ placeholder: 'Select date', rangePlaceholder: ['Start date', 'End date'] }, CalendarLocale$8),
timePickerLocale: Object.assign({}, locale$g),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$8 = {
// Options.jsx
items_per_page: '/ page',
jump_to: 'Goto',
jump_to_confirm: 'confirm',
page: '',
// Pagination.jsx
prev_page: 'Previous Page',
next_page: 'Next Page',
prev_5: 'Previous 5 Pages',
next_5: 'Next 5 Pages',
prev_3: 'Previous 3 Pages',
next_3: 'Next 3 Pages',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var en_GB = {
locale: 'en-gb',
Pagination: Pagination$8,
DatePicker: locale$h,
TimePicker: locale$g,
Calendar: CalendarLocale$8,
Table: {
filterTitle: 'Filter menu',
filterConfirm: 'OK',
filterReset: 'Reset',
selectAll: 'Select current page',
selectInvert: 'Invert current page',
},
Modal: {
okText: 'OK',
cancelText: 'Cancel',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancel',
},
Transfer: {
searchPlaceholder: 'Search here',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Uploading...',
removeFile: 'Remove file',
uploadError: 'Upload error',
previewFile: 'Preview file',
},
Empty: {
description: 'No data',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$9 = {
today: 'Today',
now: 'Now',
backToToday: 'Back to today',
ok: 'Ok',
clear: 'Clear',
month: 'Month',
year: 'Year',
timeSelect: 'Select time',
dateSelect: 'Select date',
monthSelect: 'Choose a month',
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',
yearFormat: 'YYYY',
dateFormat: 'M/D/YYYY',
dayFormat: 'D',
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
nextYear: 'Next year (Control + right)',
previousDecade: 'Last decade',
nextDecade: 'Next decade',
previousCentury: 'Last century',
nextCentury: 'Next century',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$i = {
placeholder: 'Select time',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$j = {
lang: Object.assign({ placeholder: 'Select date', rangePlaceholder: ['Start date', 'End date'] }, CalendarLocale$9),
timePickerLocale: Object.assign({}, locale$i),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$9 = {
// Options.jsx
items_per_page: '/ page',
jump_to: 'Goto',
jump_to_confirm: 'confirm',
page: '',
// Pagination.jsx
prev_page: 'Previous Page',
next_page: 'Next Page',
prev_5: 'Previous 5 Pages',
next_5: 'Next 5 Pages',
prev_3: 'Previous 3 Pages',
next_3: 'Next 3 Pages',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var en_US = {
locale: 'en',
Pagination: Pagination$9,
DatePicker: locale$j,
TimePicker: locale$i,
Calendar: CalendarLocale$9,
global: {
placeholder: 'Please select',
},
Table: {
filterTitle: 'Filter menu',
filterConfirm: 'OK',
filterReset: 'Reset',
selectAll: 'Select current page',
selectInvert: 'Invert current page',
sortTitle: 'Sort',
},
Modal: {
okText: 'OK',
cancelText: 'Cancel',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancel',
},
Transfer: {
titles: ['', ''],
searchPlaceholder: 'Search here',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Uploading...',
removeFile: 'Remove file',
uploadError: 'Upload error',
previewFile: 'Preview file',
},
Empty: {
description: 'No Data',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$a = {
today: 'Hoy',
now: 'Ahora',
backToToday: 'Volver a hoy',
ok: 'Aceptar',
clear: 'Limpiar',
month: 'Mes',
year: 'Año',
timeSelect: 'Seleccionar hora',
dateSelect: 'Seleccionar fecha',
monthSelect: 'Elegir un mes',
yearSelect: 'Elegir un año',
decadeSelect: 'Elegir una década',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes siguiente (PageDown)',
previousYear: 'Año anterior (Control + left)',
nextYear: 'Año siguiente (Control + right)',
previousDecade: 'Década anterior',
nextDecade: 'Década siguiente',
previousCentury: 'Siglo anterior',
nextCentury: 'Siglo siguiente',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$k = {
placeholder: 'Seleccionar hora',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$l = {
lang: Object.assign({ placeholder: 'Seleccionar fecha', rangePlaceholder: ['Fecha inicial', 'Fecha final'] }, CalendarLocale$a),
timePickerLocale: Object.assign({}, locale$k),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$a = {
// Options.jsx
items_per_page: '/ página',
jump_to: 'Ir a',
jump_to_confirm: 'confirmar',
page: '',
// Pagination.jsx
prev_page: 'Página anterior',
next_page: 'Página siguiente',
prev_5: '5 páginas previas',
next_5: '5 páginas siguientes',
prev_3: '3 páginas previas',
next_3: '3 páginas siguientes',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var es_ES = {
locale: 'es',
Pagination: Pagination$a,
DatePicker: locale$l,
TimePicker: locale$k,
Calendar: CalendarLocale$a,
Table: {
filterTitle: 'Filtrar menú',
filterConfirm: 'Aceptar',
filterReset: 'Reiniciar',
selectAll: 'Seleccionar todo',
selectInvert: 'Invertir selección',
},
Modal: {
okText: 'Aceptar',
cancelText: 'Cancelar',
justOkText: 'Aceptar',
},
Popconfirm: {
okText: 'Aceptar',
cancelText: 'Cancelar',
},
Transfer: {
searchPlaceholder: 'Buscar aquí',
itemUnit: 'elemento',
itemsUnit: 'elementos',
},
Upload: {
uploading: 'Subiendo...',
removeFile: 'Eliminar archivo',
uploadError: 'Error al subir el archivo',
previewFile: 'Vista previa',
},
Empty: {
description: 'No hay datos',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$b = {
today: 'Täna',
now: 'Praegu',
backToToday: 'Tagasi tänase juurde',
ok: 'Ok',
clear: 'Tühista',
month: 'Kuu',
year: 'Aasta',
timeSelect: 'Vali aeg',
dateSelect: 'Vali kuupäev',
monthSelect: 'Vali kuu',
yearSelect: 'Vali aasta',
decadeSelect: 'Vali dekaad',
yearFormat: 'YYYY',
dateFormat: 'D.M.YYYY',
dayFormat: 'D',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Eelmine kuu (PageUp)',
nextMonth: 'Järgmine kuu (PageDown)',
previousYear: 'Eelmine aasta (Control + left)',
nextYear: 'Järgmine aasta (Control + right)',
previousDecade: 'Eelmine dekaad',
nextDecade: 'Järgmine dekaad',
previousCentury: 'Eelmine sajand',
nextCentury: 'Järgmine sajand',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$m = {
placeholder: 'Vali aeg',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// 统一合并为完整的 Locale
/** @type {?} */
const locale$n = {
lang: Object.assign({ placeholder: 'Vali kuupäev', rangePlaceholder: ['Algus kuupäev', 'Lõpu kuupäev'] }, CalendarLocale$b),
timePickerLocale: Object.assign({}, locale$m),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$b = {
// Options.jsx
items_per_page: '/ leheküljel',
jump_to: 'Hüppa',
jump_to_confirm: 'Kinnitage',
page: '',
// Pagination.jsx
prev_page: 'Eelmine leht',
next_page: 'Järgmine leht',
prev_5: 'Eelmised 5 lehekülge',
next_5: 'Järgmised 5 lehekülge',
prev_3: 'Eelmised 3 lehekülge',
next_3: 'Järgmised 3 lehekülge',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var et_EE = {
locale: 'et',
Pagination: Pagination$b,
DatePicker: locale$n,
TimePicker: locale$m,
Calendar: CalendarLocale$b,
Table: {
filterTitle: 'Filtri menüü',
filterConfirm: 'OK',
filterReset: 'Nulli',
selectAll: 'Vali kõik',
selectInvert: 'Inverteeri valik',
},
Modal: {
okText: 'OK',
cancelText: 'Tühista',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Tühista',
},
Transfer: {
searchPlaceholder: 'Otsi siit',
itemUnit: 'kogus',
itemsUnit: 'kogus',
},
Upload: {
uploading: 'Üleslaadimine...',
removeFile: 'Eemalda fail',
uploadError: 'Üleslaadimise tõrge',
previewFile: 'Faili eelvaade',
},
Empty: {
description: 'Andmed puuduvad',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$c = {
today: 'امروز',
now: 'اکنون',
backToToday: 'بازگشت به روز',
ok: 'باشه',
clear: 'پاک کردن',
month: 'ماه',
year: 'سال',
timeSelect: 'انتخاب زمان',
dateSelect: 'انتخاب تاریخ',
monthSelect: 'یک ماه را انتخاب کنید',
yearSelect: 'یک سال را انتخاب کنید',
decadeSelect: 'یک دهه را انتخاب کنید',
yearFormat: 'YYYY',
dateFormat: 'M/D/YYYY',
dayFormat: 'D',
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'ماه قبل (PageUp)',
nextMonth: 'ماه بعد (PageDown)',
previousYear: 'سال قبل (Control + left)',
nextYear: 'سال بعد (Control + right)',
previousDecade: 'دهه قبل',
nextDecade: 'دهه بعد',
previousCentury: 'قرن قبل',
nextCentury: 'قرن بعد',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$o = {
placeholder: 'انتخاب زمان',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$p = {
lang: Object.assign({ placeholder: 'انتخاب تاریخ', rangePlaceholder: ['تاریخ شروع', 'تاریخ پایان'] }, CalendarLocale$c),
timePickerLocale: Object.assign({}, locale$o),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$c = {
// Options.jsx
items_per_page: '/ صفحه',
jump_to: 'برو به',
jump_to_confirm: 'تایید',
page: '',
// Pagination.jsx
prev_page: 'صفحه قبلی',
next_page: 'صفحه بعدی',
prev_5: '۵ صفحه قبلی',
next_5: '۵ صفحه بعدی',
prev_3: '۳ صفحه قبلی',
next_3: '۳ صفحه بعدی',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var fa_IR = {
locale: 'fa',
Pagination: Pagination$c,
DatePicker: locale$p,
TimePicker: locale$o,
Calendar: CalendarLocale$c,
Table: {
filterTitle: 'منوی فیلتر',
filterConfirm: 'تایید',
filterReset: 'پاک کردن',
selectAll: 'انتخاب صفحهی کنونی',
selectInvert: 'معکوس کردن انتخابها در صفحه ی کنونی',
},
Modal: {
okText: 'تایید',
cancelText: 'لغو',
justOkText: 'تایید',
},
Popconfirm: {
okText: 'تایید',
cancelText: 'لغو',
},
Transfer: {
searchPlaceholder: 'جستجو',
itemUnit: '',
itemsUnit: '',
},
Upload: {
uploading: 'در حال آپلود...',
removeFile: 'حذف فایل',
uploadError: 'خطا در آپلود',
previewFile: 'مشاهدهی فایل',
},
Empty: {
description: 'دادهای موجود نیست',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$d = {
today: 'Tänään',
now: 'Nyt',
backToToday: 'Tämä päivä',
ok: 'Ok',
clear: 'Tyhjennä',
month: 'Kuukausi',
year: 'Vuosi',
timeSelect: 'Valise aika',
dateSelect: 'Valitse päivä',
monthSelect: 'Valitse kuukausi',
yearSelect: 'Valitse vuosi',
decadeSelect: 'Valitse vuosikymmen',
yearFormat: 'YYYY',
dateFormat: 'D.M.YYYY',
dayFormat: 'D',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Edellinen kuukausi (PageUp)',
nextMonth: 'Seuraava kuukausi (PageDown)',
previousYear: 'Edellinen vuosi (Control + left)',
nextYear: 'Seuraava vuosi (Control + right)',
previousDecade: 'Edellinen vuosikymmen',
nextDecade: 'Seuraava vuosikymmen',
previousCentury: 'Edellinen vuosisata',
nextCentury: 'Seuraava vuosisata',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$q = {
placeholder: 'Valitse aika',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$r = {
lang: Object.assign({ placeholder: 'Valitse päivä', rangePlaceholder: ['Alku päivä', 'Loppu päivä'] }, CalendarLocale$d),
timePickerLocale: Object.assign({}, locale$q),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$d = {
// Options.jsx
items_per_page: '/ sivu',
jump_to: 'Mene',
jump_to_confirm: 'Potvrdite',
page: '',
// Pagination.jsx
prev_page: 'Edellinen sivu',
next_page: 'Seuraava sivu',
prev_5: 'Edelliset 5 sivua',
next_5: 'Seuraavat 5 sivua',
prev_3: 'Edelliset 3 sivua',
next_3: 'Seuraavat 3 sivua',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var fi_FI = {
locale: 'fi',
Pagination: Pagination$d,
DatePicker: locale$r,
TimePicker: locale$q,
Calendar: CalendarLocale$d,
Table: {
filterTitle: 'Suodatus valikko',
filterConfirm: 'OK',
filterReset: 'Tyhjennä',
selectAll: 'Valitse kaikki',
selectInvert: 'Valitse päinvastoin',
sortTitle: 'Lajittele',
},
Modal: {
okText: 'OK',
cancelText: 'Peruuta',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Peruuta',
},
Transfer: {
searchPlaceholder: 'Etsi täältä',
itemUnit: 'kohde',
itemsUnit: 'kohdetta',
},
Upload: {
uploading: 'Lähetetään...',
removeFile: 'Poista tiedosto',
uploadError: 'Virhe lähetyksessä',
previewFile: 'Esikatsele tiedostoa',
},
Empty: {
description: 'Ei kohteita',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$e = {
today: 'Aujourd\'hui',
now: 'Maintenant',
backToToday: 'Aujourd\'hui',
ok: 'Ok',
clear: 'Rétablir',
month: 'Mois',
year: 'Année',
timeSelect: 'Sélectionner l\'heure',
dateSelect: 'Sélectionner l\'heure',
monthSelect: 'Choisissez un mois',
yearSelect: 'Choisissez une année',
decadeSelect: 'Choisissez une décennie',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Mois précédent (PageUp)',
nextMonth: 'Mois suivant (PageDown)',
previousYear: 'Année précédente (Ctrl + gauche)',
nextYear: 'Année prochaine (Ctrl + droite)',
previousDecade: 'Décennie précédente',
nextDecade: 'Décennie suivante',
previousCentury: 'Siècle précédent',
nextCentury: 'Siècle suivant',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$s = {
placeholder: 'Sélectionner l\'heure',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$t = {
lang: Object.assign({ placeholder: 'Sélectionner une date', rangePlaceholder: ['Date de début', 'Date de fin'] }, CalendarLocale$e),
timePickerLocale: Object.assign({}, locale$s),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$e = {
// Options.jsx
items_per_page: '/ page',
jump_to: 'Aller à',
jump_to_confirm: 'confirmer',
page: '',
// Pagination.jsx
prev_page: 'Page précédente',
next_page: 'Page suivante',
prev_5: '5 Pages précédentes',
next_5: '5 Pages suivantes',
prev_3: '3 Pages précédentes',
next_3: '3 Pages suivantes',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var fr_BE = {
locale: 'fr',
Pagination: Pagination$e,
DatePicker: locale$t,
TimePicker: locale$s,
Calendar: CalendarLocale$e,
Table: {
filterTitle: 'Filtrer',
filterConfirm: 'OK',
filterReset: 'Réinitialiser',
},
Modal: {
okText: 'OK',
cancelText: 'Annuler',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuler',
},
Transfer: {
searchPlaceholder: 'Recherche',
itemUnit: 'élément',
itemsUnit: 'éléments',
},
Empty: {
description: 'Aucune donnée',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$f = {
today: 'Aujourd\'hui',
now: 'Maintenant',
backToToday: 'Aujourd\'hui',
ok: 'Ok',
clear: 'Rétablir',
month: 'Mois',
year: 'Année',
timeSelect: 'Sélectionner l\'heure',
dateSelect: 'Sélectionner l\'heure',
monthSelect: 'Choisissez un mois',
yearSelect: 'Choisissez une année',
decadeSelect: 'Choisissez une décennie',
yearFormat: 'YYYY',
dateFormat: 'DD/MM/YYYY',
dayFormat: 'DD',
dateTimeFormat: 'DD/MM/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Mois précédent (PageUp)',
nextMonth: 'Mois suivant (PageDown)',
previousYear: 'Année précédente (Ctrl + gauche)',
nextYear: 'Année prochaine (Ctrl + droite)',
previousDecade: 'Décennie précédente',
nextDecade: 'Décennie suivante',
previousCentury: 'Siècle précédent',
nextCentury: 'Siècle suivant',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$u = {
placeholder: 'Sélectionner l\'heure',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$v = {
lang: Object.assign({ placeholder: 'Sélectionner une date', rangePlaceholder: ['Date de début', 'Date de fin'] }, CalendarLocale$f),
timePickerLocale: Object.assign({}, locale$u),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$f = {
// Options.jsx
items_per_page: '/ page',
jump_to: 'Aller à',
jump_to_confirm: 'confirmer',
page: '',
// Pagination.jsx
prev_page: 'Page précédente',
next_page: 'Page suivante',
prev_5: '5 Pages précédentes',
next_5: '5 Pages suivantes',
prev_3: '3 Pages précédentes',
next_3: '3 Pages suivantes',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var fr_FR = {
locale: 'fr',
Pagination: Pagination$f,
DatePicker: locale$v,
TimePicker: locale$u,
Calendar: CalendarLocale$f,
Table: {
filterTitle: 'Filtrer',
filterConfirm: 'OK',
filterReset: 'Réinitialiser',
selectAll: 'Tout sélectionner',
selectInvert: 'Inverser la sélection',
},
Modal: {
okText: 'OK',
cancelText: 'Annuler',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuler',
},
Transfer: {
searchPlaceholder: 'Recherche',
itemUnit: 'élément',
itemsUnit: 'éléments',
},
Upload: {
uploading: 'Téléversement en cours...',
removeFile: 'Supprimer',
uploadError: 'Erreur de téléversement',
previewFile: 'Afficher l\'aperçu du fichier',
},
Empty: {
description: 'Aucune donnée',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$g = {
today: 'Í dag',
now: 'Núna',
backToToday: 'Til baka til dagsins í dag',
ok: 'Í lagi',
clear: 'Hreinsa',
month: 'Mánuður',
year: 'Ár',
timeSelect: 'Velja tíma',
dateSelect: 'Velja dag',
monthSelect: 'Velja mánuð',
yearSelect: 'Velja ár',
decadeSelect: 'Velja áratug',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Fyrri mánuður (PageUp)',
nextMonth: 'Næsti mánuður (PageDown)',
previousYear: 'Fyrra ár (Control + left)',
nextYear: 'Næsta ár (Control + right)',
previousDecade: 'Fyrri áratugur',
nextDecade: 'Næsti áratugur',
previousCentury: 'Fyrri öld',
nextCentury: 'Næsta öld',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$w = {
placeholder: 'Velja tíma',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$x = {
lang: Object.assign({ placeholder: 'Veldu dag', rangePlaceholder: ['Upphafsdagur', 'Lokadagur'] }, CalendarLocale$g),
timePickerLocale: Object.assign({}, locale$w),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$g = {
// Options.jsx
items_per_page: '/ síðu',
jump_to: 'Síða',
jump_to_confirm: 'staðfest',
page: '',
// Pagination.jsx
prev_page: 'Fyrri síða',
next_page: 'Næsta síða',
prev_5: 'Til baka 5 síður',
next_5: 'Áfram 5 síður',
prev_3: 'Til baka 3 síður',
next_3: 'Áfram 3 síður',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var is_IS = {
locale: 'is',
Pagination: Pagination$g,
DatePicker: locale$x,
TimePicker: locale$w,
Calendar: CalendarLocale$g,
Table: {
filterTitle: 'Afmarkanir',
filterConfirm: 'Staðfesta',
filterReset: 'Núllstilla',
selectAll: 'Velja allt',
selectInvert: 'Viðsnúa vali',
},
Modal: {
okText: 'Áfram',
cancelText: 'Hætta við',
justOkText: 'Í lagi',
},
Popconfirm: {
okText: 'Áfram',
cancelText: 'Hætta við',
},
Transfer: {
searchPlaceholder: 'Leita hér',
itemUnit: 'færsla',
itemsUnit: 'færslur',
},
Upload: {
uploading: 'Hleð upp...',
removeFile: 'Fjarlægja skrá',
uploadError: 'Villa við að hlaða upp',
previewFile: 'Forskoða skrá',
},
Empty: {
description: 'Engin gögn',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$h = {
today: 'Oggi',
now: 'adesso',
backToToday: 'Torna ad oggi',
ok: 'Ok',
clear: 'Chiaro',
month: 'Mese',
year: 'Anno',
timeSelect: 'Seleziona il tempo',
dateSelect: 'Select date',
monthSelect: 'Seleziona la data',
yearSelect: 'Scegli un anno',
decadeSelect: 'Scegli un decennio',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Il mese scorso (PageUp)',
nextMonth: 'Il prossimo mese (PageDown)',
previousYear: 'L\'anno scorso (Control + sinistra)',
nextYear: 'L\'anno prossimo (Control + destra)',
previousDecade: 'Ultimo decennio',
nextDecade: 'Prossimo decennio',
previousCentury: 'Secolo precedente',
nextCentury: 'Prossimo secolo',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$y = {
placeholder: 'Selezionare il tempo',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$z = {
lang: Object.assign({ placeholder: 'Selezionare la data', rangePlaceholder: ['Data d\'inizio', 'Data di fine'] }, CalendarLocale$h),
timePickerLocale: Object.assign({}, locale$y),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$h = {
// Options.jsx
items_per_page: '/ pagina',
jump_to: 'vai a',
jump_to_confirm: 'Conferma',
page: '',
// Pagination.jsx
prev_page: 'Pagina precedente',
next_page: 'Pagina successiva',
prev_5: 'Precedente 5 pagine',
next_5: 'Prossime 5 pagine',
prev_3: 'Precedente 3 pagine',
next_3: 'Prossime 3 pagine',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var it_IT = {
locale: 'it',
Pagination: Pagination$h,
DatePicker: locale$z,
TimePicker: locale$y,
Calendar: CalendarLocale$h,
Table: {
filterTitle: 'Menù Filtro',
filterConfirm: 'OK',
filterReset: 'Reset',
selectAll: 'Seleziona pagina corrente',
selectInvert: 'Inverti selezione nella pagina corrente',
sortTitle: 'Ordina',
},
Modal: {
okText: 'OK',
cancelText: 'Annulla',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annulla',
},
Transfer: {
searchPlaceholder: 'Cerca qui',
itemUnit: 'articolo',
itemsUnit: 'elementi',
},
Upload: {
uploading: 'Caricamento...',
removeFile: 'Rimuovi il file',
uploadError: 'Errore di caricamento',
previewFile: 'Anteprima file',
},
Empty: {
description: 'Nessun dato',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$i = {
today: '今日',
now: '現在時刻',
backToToday: '今日に戻る',
ok: '決定',
timeSelect: '時間を選択',
dateSelect: '日時を選択',
clear: 'クリア',
month: '月',
year: '年',
previousMonth: '前月 (ページアップキー)',
nextMonth: '翌月 (ページダウンキー)',
monthSelect: '月を選択',
yearSelect: '年を選択',
decadeSelect: '年代を選択',
yearFormat: 'YYYY年',
dayFormat: 'D日',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH時mm分ss秒',
previousYear: '前年 (Controlを押しながら左キー)',
nextYear: '翌年 (Controlを押しながら右キー)',
previousDecade: '前の年代',
nextDecade: '次の年代',
previousCentury: '前の世紀',
nextCentury: '次の世紀',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$A = {
placeholder: '時刻を選択',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$B = {
lang: Object.assign({ placeholder: '日付を選択', rangePlaceholder: ['開始日付', '終了日付'] }, CalendarLocale$i),
timePickerLocale: Object.assign({}, locale$A),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$i = {
// Options.jsx
items_per_page: '/ ページ',
jump_to: '移動',
jump_to_confirm: '確認する',
page: 'ページ',
// Pagination.jsx
prev_page: '前のページ',
next_page: '次のページ',
prev_5: '前 5ページ',
next_5: '次 5ページ',
prev_3: '前 3ページ',
next_3: '次 3ページ',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ja_JP = {
locale: 'ja',
Pagination: Pagination$i,
DatePicker: locale$B,
TimePicker: locale$A,
Calendar: CalendarLocale$i,
Table: {
filterTitle: 'メニューをフィルター',
filterConfirm: 'OK',
filterReset: 'リセット',
selectAll: 'すべてを選択',
selectInvert: '選択を反転',
},
Modal: {
okText: 'OK',
cancelText: 'キャンセル',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'キャンセル',
},
Transfer: {
searchPlaceholder: 'ここを検索',
itemUnit: 'アイテム',
itemsUnit: 'アイテム',
},
Upload: {
uploading: 'アップロード中...',
removeFile: 'ファイルを削除',
uploadError: 'アップロードエラー',
previewFile: 'ファイルをプレビュー',
},
Empty: {
description: 'データがありません',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$j = {
today: '오늘',
now: '현재 시각',
backToToday: '오늘로 돌아가기',
ok: '확인',
clear: '지우기',
month: '월',
year: '년',
timeSelect: '시간 선택',
dateSelect: '날짜 선택',
monthSelect: '달 선택',
yearSelect: '연 선택',
decadeSelect: '연대 선택',
yearFormat: 'YYYY년',
dateFormat: 'YYYY-MM-DD',
dayFormat: 'Do',
dateTimeFormat: 'YYYY-MM-DD HH:mm:ss',
monthBeforeYear: false,
previousMonth: '이전 달 (PageUp)',
nextMonth: '다음 달 (PageDown)',
previousYear: '이전 해 (Control + left)',
nextYear: '다음 해 (Control + right)',
previousDecade: '이전 연대',
nextDecade: '다음 연대',
previousCentury: '이전 세기',
nextCentury: '다음 세기',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$C = {
placeholder: '날짜 선택',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$D = {
lang: Object.assign({ placeholder: '날짜 선택', rangePlaceholder: ['시작일', '종료일'] }, CalendarLocale$j),
timePickerLocale: Object.assign({}, locale$C),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$j = {
// Options.jsx
items_per_page: '/ 쪽',
jump_to: '이동하기',
jump_to_confirm: '확인하다',
page: '',
// Pagination.jsx
prev_page: '이전 페이지',
next_page: '다음 페이지',
prev_5: '이전 5 페이지',
next_5: '다음 5 페이지',
prev_3: '이전 3 페이지',
next_3: '다음 3 페이지',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ko_KR = {
locale: 'ko',
Pagination: Pagination$j,
DatePicker: locale$D,
TimePicker: locale$C,
Calendar: CalendarLocale$j,
Table: {
filterTitle: '필터 메뉴',
filterConfirm: '확인',
filterReset: '초기화',
selectAll: '모두 선택',
selectInvert: '선택 반전',
},
Modal: {
okText: '확인',
cancelText: '취소',
justOkText: '확인',
},
Popconfirm: {
okText: '확인',
cancelText: '취소',
},
Transfer: {
searchPlaceholder: '여기에 검색하세요',
itemUnit: '개',
itemsUnit: '개',
},
Upload: {
uploading: '업로드 중...',
removeFile: '파일 삭제',
uploadError: '업로드 실패',
previewFile: '파일 미리보기',
},
Empty: {
description: '데이터 없음',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$k = {
today: 'I dag',
now: 'Nå',
backToToday: 'Gå til i dag',
ok: 'Ok',
clear: 'Annuller',
month: 'Måned',
year: 'År',
timeSelect: 'Velg tidspunkt',
dateSelect: 'Velg dato',
monthSelect: 'Velg måned',
yearSelect: 'Velg år',
decadeSelect: 'Velg årti',
yearFormat: 'YYYY',
dateFormat: 'DD.MM.YYYY',
dayFormat: 'DD',
dateTimeFormat: 'DD.MM.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Forrige måned(PageUp)',
nextMonth: 'Neste måned (PageDown)',
previousYear: 'Forrige år (Control + left)',
nextYear: 'Neste år (Control + right)',
previousDecade: 'Forrige tiår',
nextDecade: 'Neste tiår',
previousCentury: 'Forrige århundre',
nextCentury: 'Neste århundre',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$E = {
placeholder: 'Velg tid',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$F = {
lang: Object.assign({ placeholder: 'Velg dato', rangePlaceholder: ['Startdato', 'Sluttdato'] }, CalendarLocale$k),
timePickerLocale: Object.assign({}, locale$E),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$k = {
// Options.jsx
items_per_page: '/ side',
jump_to: 'Gå til side',
page: '',
// Pagination.jsx
prev_page: 'Forrige side',
next_page: 'Neste side',
prev_5: '5 forrige',
next_5: '5 neste',
prev_3: '3 forrige',
next_3: '3 neste',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var nb_NO = {
locale: 'nb',
DatePicker: locale$F,
TimePicker: locale$E,
Calendar: CalendarLocale$k,
Pagination: Pagination$k,
Table: {
filterTitle: 'Filtermeny',
filterConfirm: 'OK',
filterReset: 'Nullstill',
selectAll: 'Velg alle',
selectInvert: 'Inverter valg',
},
Modal: {
okText: 'OK',
cancelText: 'Avbryt',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Avbryt',
},
Transfer: {
searchPlaceholder: 'Søk her',
itemUnit: 'element',
itemsUnit: 'elementer',
},
Upload: {
uploading: 'Laster opp...',
removeFile: 'Fjern fil',
uploadError: 'Feil ved opplastning',
previewFile: 'Forhåndsvisning',
},
Empty: {
description: 'Ingen data',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$l = {
today: 'Vandaag',
now: 'Nu',
backToToday: 'Terug naar vandaag',
ok: 'Ok',
clear: 'Reset',
month: 'Maand',
year: 'Jaar',
timeSelect: 'Selecteer tijd',
dateSelect: 'Selecteer datum',
monthSelect: 'Kies een maand',
yearSelect: 'Kies een jaar',
decadeSelect: 'Kies een decennium',
yearFormat: 'YYYY',
dateFormat: 'D-M-YYYY',
dayFormat: 'D',
dateTimeFormat: 'D-M-YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Vorige maand (PageUp)',
nextMonth: 'Volgende maand (PageDown)',
previousYear: 'Vorig jaar (Control + left)',
nextYear: 'Volgend jaar (Control + right)',
previousDecade: 'Vorig decennium',
nextDecade: 'Volgend decennium',
previousCentury: 'Vorige eeuw',
nextCentury: 'Volgende eeuw',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$G = {
placeholder: 'Selecteer tijd',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$H = {
lang: Object.assign({ placeholder: 'Selecteer datum', rangePlaceholder: ['Begin datum', 'Eind datum'] }, CalendarLocale$l),
timePickerLocale: Object.assign({}, locale$G),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$l = {
// Options.jsx
items_per_page: '/ pagina',
jump_to: 'Ga naar',
jump_to_confirm: 'bevestigen',
page: '',
// Pagination.jsx
prev_page: 'Vorige pagina',
next_page: 'Volgende pagina',
prev_5: 'Vorige 5 pagina\'s',
next_5: 'Volgende 5 pagina\'s',
prev_3: 'Vorige 3 pagina\'s',
next_3: 'Volgende 3 pagina\'s',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var nl_BE = {
locale: 'nl-be',
Pagination: Pagination$l,
DatePicker: locale$H,
TimePicker: locale$G,
Calendar: CalendarLocale$l,
Table: {
filterTitle: 'FilterMenu',
filterConfirm: 'OK',
filterReset: 'Reset',
selectAll: 'Selecteer huidige pagina',
selectInvert: 'Selecteer huidige pagina',
},
Modal: {
okText: 'OK',
cancelText: 'Annuleer',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuleer',
},
Transfer: {
searchPlaceholder: 'Zoek hier',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Uploaden...',
removeFile: 'Bestand verwijderen',
uploadError: 'Upload fout',
previewFile: 'Preview bestand',
},
Empty: {
description: 'Geen gegevens',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$m = {
today: 'Vandaag',
now: 'Nu',
backToToday: 'Terug naar vandaag',
ok: 'Ok',
clear: 'Reset',
month: 'Maand',
year: 'Jaar',
timeSelect: 'Selecteer tijd',
dateSelect: 'Selecteer datum',
monthSelect: 'Kies een maand',
yearSelect: 'Kies een jaar',
decadeSelect: 'Kies een decennium',
yearFormat: 'YYYY',
dateFormat: 'D-M-YYYY',
dayFormat: 'D',
dateTimeFormat: 'D-M-YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Vorige maand (PageUp)',
nextMonth: 'Volgende maand (PageDown)',
previousYear: 'Vorig jaar (Control + left)',
nextYear: 'Volgend jaar (Control + right)',
previousDecade: 'Vorig decennium',
nextDecade: 'Volgend decennium',
previousCentury: 'Vorige eeuw',
nextCentury: 'Volgende eeuw',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$I = {
placeholder: 'Selecteer tijd',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$J = {
lang: Object.assign({ placeholder: 'Selecteer datum', rangePlaceholder: ['Begin datum', 'Eind datum'] }, CalendarLocale$m),
timePickerLocale: Object.assign({}, locale$I),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$m = {
// Options.jsx
items_per_page: '/ pagina',
jump_to: 'Ga naar',
jump_to_confirm: 'bevestigen',
page: '',
// Pagination.jsx
prev_page: 'Vorige pagina',
next_page: 'Volgende pagina',
prev_5: 'Vorige 5 pagina\'s',
next_5: 'Volgende 5 pagina\'s',
prev_3: 'Vorige 3 pagina\'s',
next_3: 'Volgende 3 pagina\'s',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var nl_NL = {
locale: 'nl',
Pagination: Pagination$m,
DatePicker: locale$J,
TimePicker: locale$I,
Calendar: CalendarLocale$m,
Table: {
filterTitle: 'Filteren',
filterConfirm: 'OK',
filterReset: 'Reset',
selectAll: 'Selecteer huidige pagina',
selectInvert: 'Deselecteer huidige pagina',
},
Modal: {
okText: 'OK',
cancelText: 'Annuleren',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuleren',
},
Transfer: {
searchPlaceholder: 'Zoeken',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Uploaden...',
removeFile: 'Verwijder bestand',
uploadError: 'Fout tijdens uploaden',
previewFile: 'Bekijk bestand',
},
Empty: {
description: 'Geen gegevens',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$n = {
today: 'Dzisiaj',
now: 'Teraz',
backToToday: 'Ustaw dzisiaj',
ok: 'Ok',
clear: 'Wyczyść',
month: 'Miesiąc',
year: 'Rok',
timeSelect: 'Ustaw czas',
dateSelect: 'Ustaw datę',
monthSelect: 'Wybierz miesiąc',
yearSelect: 'Wybierz rok',
decadeSelect: 'Wybierz dekadę',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Poprzedni miesiąc (PageUp)',
nextMonth: 'Następny miesiąc (PageDown)',
previousYear: 'Ostatni rok (Ctrl + left)',
nextYear: 'Następny rok (Ctrl + right)',
previousDecade: 'Ostatnia dekada',
nextDecade: 'Następna dekada',
previousCentury: 'Ostatni wiek',
nextCentury: 'Następny wiek',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$K = {
placeholder: 'Wybierz godzinę',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$L = {
lang: Object.assign({ placeholder: 'Wybierz datę', rangePlaceholder: ['Data początkowa', 'Data końcowa'] }, CalendarLocale$n),
timePickerLocale: Object.assign({}, locale$K),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$n = {
// Options.jsx
items_per_page: '/ stronę',
jump_to: 'Idź do',
jump_to_confirm: 'potwierdzać',
page: '',
// Pagination.jsx
prev_page: 'Poprzednia strona',
next_page: 'Następna strona',
prev_5: 'Poprzednie 5 stron',
next_5: 'Następne 5 stron',
prev_3: 'Poprzednie 3 strony',
next_3: 'Następne 3 strony',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var pl_PL = {
locale: 'pl',
Pagination: Pagination$n,
DatePicker: locale$L,
TimePicker: locale$K,
Calendar: CalendarLocale$n,
Table: {
filterTitle: 'Menu filtra',
filterConfirm: 'OK',
filterReset: 'Wyczyść',
selectAll: 'Zaznacz bieżącą stronę',
selectInvert: 'Odwróć zaznaczenie',
},
Modal: {
okText: 'OK',
cancelText: 'Anuluj',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Anuluj',
},
Transfer: {
searchPlaceholder: 'Szukaj',
itemUnit: 'obiekt',
itemsUnit: 'obiekty',
},
Upload: {
uploading: 'Wysyłanie...',
removeFile: 'Usuń plik',
uploadError: 'Błąd wysyłania',
previewFile: 'Podejrzyj plik',
},
Empty: {
description: 'Brak danych',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$o = {
today: 'Hoje',
now: 'Agora',
backToToday: 'Voltar para hoje',
ok: 'Ok',
clear: 'Limpar',
month: 'Mês',
year: 'Ano',
timeSelect: 'Selecionar tempo',
dateSelect: 'Selecionar data',
monthSelect: 'Escolher mês',
yearSelect: 'Escolher ano',
decadeSelect: 'Escolher década',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: false,
previousMonth: 'Mês anterior (PageUp)',
nextMonth: 'Próximo mês (PageDown)',
previousYear: 'Ano anterior (Control + esquerda)',
nextYear: 'Próximo ano (Control + direita)',
previousDecade: 'Década anterior',
nextDecade: 'Próxima década',
previousCentury: 'Século anterior',
nextCentury: 'Próximo século',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$M = {
placeholder: 'Hora',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$N = {
lang: Object.assign({ placeholder: 'Selecionar data', rangePlaceholder: ['Data de início', 'Data de fim'] }, CalendarLocale$o),
timePickerLocale: Object.assign({}, locale$M),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$o = {
// Options.jsx
items_per_page: '/ páginas',
jump_to: 'Vá até',
jump_to_confirm: 'confirme',
page: '',
// Pagination.jsx
prev_page: 'Página anterior',
next_page: 'Próxima página',
prev_5: '5 páginas anteriores',
next_5: '5 próximas páginas',
prev_3: '3 páginas anteriores',
next_3: '3 próximas páginas',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var pt_BR = {
locale: 'pt-br',
Pagination: Pagination$o,
DatePicker: locale$N,
TimePicker: locale$M,
Calendar: CalendarLocale$o,
Table: {
filterTitle: 'Filtro',
filterConfirm: 'OK',
filterReset: 'Resetar',
selectAll: 'Selecionar página atual',
selectInvert: 'Inverter seleção',
},
Modal: {
okText: 'OK',
cancelText: 'Cancelar',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancelar',
},
Transfer: {
searchPlaceholder: 'Procurar',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Enviando...',
removeFile: 'Remover arquivo',
uploadError: 'Erro no envio',
previewFile: 'Visualizar arquivo',
},
Empty: {
description: 'Não há dados',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$p = {
today: 'Hoje',
now: 'Agora',
backToToday: 'Hoje',
ok: 'Ok',
clear: 'Limpar',
month: 'Mês',
year: 'Ano',
timeSelect: 'Selecionar hora',
dateSelect: 'Selecionar data',
monthSelect: 'Selecionar mês',
yearSelect: 'Selecionar ano',
decadeSelect: 'Selecionar década',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Mês anterior (PageUp)',
nextMonth: 'Mês seguinte (PageDown)',
previousYear: 'Ano anterior (Control + left)',
nextYear: 'Ano seguinte (Control + right)',
previousDecade: 'Década anterior',
nextDecade: 'Década seguinte',
previousCentury: 'Século anterior',
nextCentury: 'Século seguinte',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$O = {
placeholder: 'Hora',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$P = {
lang: Object.assign({}, CalendarLocale$p, { placeholder: 'Data', rangePlaceholder: ['Data inicial', 'Data final'], today: 'Hoje', now: 'Agora', backToToday: 'Hoje', ok: 'Ok', clear: 'Limpar', month: 'Mês', year: 'Ano', timeSelect: 'Hora', dateSelect: 'Selecionar data', monthSelect: 'Selecionar mês', yearSelect: 'Selecionar ano', decadeSelect: 'Selecionar década', yearFormat: 'YYYY', dateFormat: 'D/M/YYYY', dayFormat: 'D', dateTimeFormat: 'D/M/YYYY HH:mm:ss', monthFormat: 'MMMM', monthBeforeYear: false, previousMonth: 'Mês anterior (PageUp)', nextMonth: 'Mês seguinte (PageDown)', previousYear: 'Ano anterior (Control + left)', nextYear: 'Ano seguinte (Control + right)', previousDecade: 'Última década', nextDecade: 'Próxima década', previousCentury: 'Último século', nextCentury: 'Próximo século' }),
timePickerLocale: Object.assign({}, locale$O, { placeholder: 'Hora' }),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$p = {
// Options.jsx
items_per_page: '/ página',
jump_to: 'Saltar',
jump_to_confirm: 'confirmar',
page: '',
// Pagination.jsx
prev_page: 'Página Anterior',
next_page: 'Página Seguinte',
prev_5: 'Recuar 5 Páginas',
next_5: 'Avançar 5 Páginas',
prev_3: 'Recuar 3 Páginas',
next_3: 'Avançar 3 Páginas',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var pt_PT = {
locale: 'pt',
Pagination: Pagination$p,
DatePicker: locale$P,
TimePicker: locale$O,
Calendar: CalendarLocale$p,
Table: {
filterTitle: 'Filtro',
filterConfirm: 'Aplicar',
filterReset: 'Reiniciar',
selectAll: 'Selecionar página atual',
selectInvert: 'Inverter seleção',
},
Modal: {
okText: 'OK',
cancelText: 'Cancelar',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancelar',
},
Transfer: {
searchPlaceholder: 'Procurar...',
itemUnit: 'item',
itemsUnit: 'itens',
},
Upload: {
uploading: 'A carregar...',
removeFile: 'Remover',
uploadError: 'Erro ao carregar',
previewFile: 'Pré-visualizar',
},
Empty: {
description: 'Sem resultados',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$q = {
today: 'Сегодня',
now: 'Сейчас',
backToToday: 'Текущая дата',
ok: 'Ok',
clear: 'Очистить',
month: 'Месяц',
year: 'Год',
timeSelect: 'Выбрать время',
dateSelect: 'Выбрать дату',
monthSelect: 'Выбрать месяц',
yearSelect: 'Выбрать год',
decadeSelect: 'Выбрать десятилетие',
yearFormat: 'YYYY',
dateFormat: 'D-M-YYYY',
dayFormat: 'D',
dateTimeFormat: 'D-M-YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Предыдущий месяц (PageUp)',
nextMonth: 'Следующий месяц (PageDown)',
previousYear: 'Предыдущий год (Control + left)',
nextYear: 'Следующий год (Control + right)',
previousDecade: 'Предыдущее десятилетие',
nextDecade: 'Следущее десятилетие',
previousCentury: 'Предыдущий век',
nextCentury: 'Следующий век',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Created by Andrey Gayvoronsky on 13/04/16.
* @type {?}
*/
const locale$Q = {
placeholder: 'Выберите время',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$R = {
lang: Object.assign({ placeholder: 'Выберите дату', rangePlaceholder: ['Начальная дата', 'Конечная дата'] }, CalendarLocale$q),
timePickerLocale: Object.assign({}, locale$Q),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$q = {
// Options.jsx
items_per_page: '/странице',
jump_to: 'Перейти',
jump_to_confirm: 'подтвердить',
page: '',
// Pagination.jsx
prev_page: 'Назад',
next_page: 'Вперед',
prev_5: 'Предыдущие 5',
next_5: 'Следующие 5',
prev_3: 'Предыдущие 3',
next_3: 'Следующие 3',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ru_RU = {
locale: 'ru',
Pagination: Pagination$q,
DatePicker: locale$R,
TimePicker: locale$Q,
Calendar: CalendarLocale$q,
Table: {
filterTitle: 'Фильтр',
filterConfirm: 'OK',
filterReset: 'Сбросить',
selectAll: 'Выбрать всё',
selectInvert: 'Инвертировать выбор',
},
Modal: {
okText: 'OK',
cancelText: 'Отмена',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Отмена',
},
Transfer: {
searchPlaceholder: 'Поиск',
itemUnit: 'элем.',
itemsUnit: 'элем.',
},
Upload: {
uploading: 'Загрузка...',
removeFile: 'Удалить файл',
uploadError: 'При загрузке произошла ошибка',
previewFile: 'Предпросмотр файла',
},
Empty: {
description: 'Нет данных',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$r = {
today: 'Dnes',
now: 'Teraz',
backToToday: 'Späť na dnes',
ok: 'Ok',
clear: 'Vymazať',
month: 'Mesiac',
year: 'Rok',
timeSelect: 'Vybrať čas',
dateSelect: 'Vybrať dátum',
monthSelect: 'Vybrať mesiac',
yearSelect: 'Vybrať rok',
decadeSelect: 'Vybrať dekádu',
yearFormat: 'YYYY',
dateFormat: 'D.M.YYYY',
dayFormat: 'D',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Predchádzajúci mesiac (PageUp)',
nextMonth: 'Nasledujúci mesiac (PageDown)',
previousYear: 'Predchádzajúci rok (Control + left)',
nextYear: 'Nasledujúci rok (Control + right)',
previousDecade: 'Predchádzajúca dekáda',
nextDecade: 'Nasledujúca dekáda',
previousCentury: 'Predchádzajúce storočie',
nextCentury: 'Nasledujúce storočie',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$S = {
placeholder: 'Vybrať čas',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// 统一合并为完整的 Locale
/** @type {?} */
const locale$T = {
lang: Object.assign({ placeholder: 'Vybrať dátum', rangePlaceholder: ['Od', 'Do'] }, CalendarLocale$r),
timePickerLocale: Object.assign({}, locale$S),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$r = {
// Options.jsx
items_per_page: '/ strana',
jump_to: 'Choď na',
jump_to_confirm: 'potvrdit',
page: '',
// Pagination.jsx
prev_page: 'Predchádzajúca strana',
next_page: 'Nasledujúca strana',
prev_5: 'Predchádzajúcich 5 strán',
next_5: 'Nasledujúcich 5 strán',
prev_3: 'Predchádzajúce 3 strany',
next_3: 'Nasledujúce 3 strany',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var sk_SK = {
locale: 'sk',
Pagination: Pagination$r,
DatePicker: locale$T,
TimePicker: locale$S,
Calendar: CalendarLocale$r,
Table: {
filterTitle: 'Filter',
filterConfirm: 'OK',
filterReset: 'Obnoviť',
selectAll: 'Vybrať všetko',
selectInvert: 'Vybrať opačné',
},
Modal: {
okText: 'OK',
cancelText: 'Zrušiť',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Zrušiť',
},
Transfer: {
searchPlaceholder: 'Vyhľadávanie',
itemUnit: 'položka',
itemsUnit: 'položiek',
},
Upload: {
uploading: 'Nahrávanie...',
removeFile: 'Odstrániť súbor',
uploadError: 'Chyba pri nahrávaní',
previewFile: 'Zobraziť súbor',
},
Empty: {
description: 'Žiadne dáta',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$s = {
today: 'Danes',
now: 'Zdaj',
backToToday: 'Nazaj na danes',
ok: 'V redu',
clear: 'Počisti',
month: 'Mesec',
year: 'Leto',
timeSelect: 'Izberi čas',
dateSelect: 'Izberi datum',
monthSelect: 'Izberi mesec',
yearSelect: 'Izberi leto',
decadeSelect: 'Izberi desetletje',
yearFormat: 'YYYY',
dateFormat: 'DD.MM.YYYY',
dayFormat: 'D',
dateTimeFormat: 'DD.MM.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Predhodnji mesec (PageUp)',
nextMonth: 'Naslednji mesec (PageDown)',
previousYear: 'Prejšnje leto (Control + left)',
nextYear: 'Naslednje leto (Control + right)',
previousDecade: 'Prejšnje desetletje',
nextDecade: 'Naslednje desetletje',
previousCentury: 'Prejšnje stoletje',
nextCentury: 'Naslednje stoletje',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$U = {
placeholder: 'Izberite čas',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$V = {
lang: Object.assign({ placeholder: 'Izberite datum', rangePlaceholder: ['Začetni datum', 'Končni datum'] }, CalendarLocale$s),
timePickerLocale: Object.assign({}, locale$U),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$s = {
// Options.jsx
items_per_page: '/ stran',
jump_to: 'Pojdi na',
jump_to_confirm: 'potrdi',
page: '',
// Pagination.jsx
prev_page: 'Prejšnja stran',
next_page: 'Naslednja stran',
prev_5: 'Prejšnjih 5 Strani',
next_5: 'Naslednjih 5 Strani',
prev_3: 'Prejšnje 3 Strani',
next_3: 'Naslednje 3 Strani',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var sl_SI = {
locale: 'sl',
Pagination: Pagination$s,
DatePicker: locale$V,
TimePicker: locale$U,
Calendar: CalendarLocale$s,
Table: {
filterTitle: 'Filter',
filterConfirm: 'Filtriraj',
filterReset: 'Pobriši filter',
selectAll: 'Izberi vse na trenutni strani',
selectInvert: 'Obrni izbor na trenutni strani',
},
Modal: {
okText: 'V redu',
cancelText: 'Prekliči',
justOkText: 'V redu',
},
Popconfirm: {
okText: 'v redu',
cancelText: 'Prekliči',
},
Transfer: {
searchPlaceholder: 'Išči tukaj',
itemUnit: 'Objekt',
itemsUnit: 'Objektov',
},
Upload: {
uploading: 'Nalaganje...',
removeFile: 'Odstrani datoteko',
uploadError: 'Napaka pri nalaganju',
previewFile: 'Predogled datoteke',
},
Empty: {
description: 'Ni podatkov',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$t = {
today: 'Danas',
now: 'Sada',
backToToday: 'Vrati se na danas',
ok: 'U redu',
clear: 'Obriši',
month: 'Mesec',
year: 'Godina',
timeSelect: 'Izaberi vreme',
dateSelect: 'Izaberi datum',
monthSelect: 'Izaberi mesec',
yearSelect: 'Izaberi godinu',
decadeSelect: 'Izaberi deceniju',
yearFormat: 'YYYY',
dateFormat: 'DD.MM.YYYY',
dayFormat: 'D',
dateTimeFormat: 'DD.MM.YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Prethodni mesec (PageUp)',
nextMonth: 'Sledeći mesec (PageDown)',
previousYear: 'Prethodna godina (Control + left)',
nextYear: 'Sledeća godina (Control + right)',
previousDecade: 'Prethodna decenija',
nextDecade: 'Sledeća decenija',
previousCentury: 'Prethodni vek',
nextCentury: 'Sledeći vek',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$W = {
placeholder: 'Izaberite vreme',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$X = {
lang: Object.assign({ placeholder: 'Izaberite datum', rangePlaceholder: ['Početni datum', 'Krajnji datum'] }, CalendarLocale$t),
timePickerLocale: Object.assign({}, locale$W),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$t = {
// Options.jsx
items_per_page: '/ strani',
jump_to: 'Idi na',
page: '',
// Pagination.jsx
prev_page: 'Prethodna strana',
next_page: 'Sledeća strana',
prev_5: 'Prethodnih 5 Strana',
next_5: 'Sledećih 5 Strana',
prev_3: 'Prethodnih 3 Strane',
next_3: 'Sledećih 3 Strane',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var sr_RS = {
locale: 'sr',
Pagination: Pagination$t,
DatePicker: locale$X,
TimePicker: locale$W,
Calendar: CalendarLocale$t,
Table: {
filterTitle: 'Filter',
filterConfirm: 'Primeni filter',
filterReset: 'Resetuj filter',
selectAll: 'Obeleži sve na trenutnoj strani',
selectInvert: 'Obrni selekciju na trenutnoj stranici',
},
Modal: {
okText: 'U redu',
cancelText: 'Otkaži',
justOkText: 'U redu',
},
Popconfirm: {
okText: 'U redu',
cancelText: 'Otkaži',
},
Transfer: {
searchPlaceholder: 'Pretražite ovde',
itemUnit: 'stavka',
itemsUnit: 'stavki',
},
Upload: {
uploading: 'Slanje...',
removeFile: 'Ukloni fajl',
uploadError: 'Greška prilikom slanja',
previewFile: 'Pogledaj fajl',
},
Empty: {
description: 'Nema podataka',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$u = {
today: 'I dag',
now: 'Nu',
backToToday: 'Till idag',
ok: 'Ok',
clear: 'Avbryt',
month: 'Månad',
year: 'År',
timeSelect: 'Välj tidpunkt',
dateSelect: 'Välj datum',
monthSelect: 'Välj månad',
yearSelect: 'Välj år',
decadeSelect: 'Välj årtionde',
yearFormat: 'YYYY',
dateFormat: 'YYYY-MM-DD',
dayFormat: 'D',
dateTimeFormat: 'YYYY-MM-DD H:mm:ss',
monthBeforeYear: true,
previousMonth: 'Förra månaden (PageUp)',
nextMonth: 'Nästa månad (PageDown)',
previousYear: 'Föreg år (Control + left)',
nextYear: 'Nästa år (Control + right)',
previousDecade: 'Föreg årtionde',
nextDecade: 'Nästa årtionde',
previousCentury: 'Föreg århundrade',
nextCentury: 'Nästa århundrade',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$Y = {
placeholder: 'Välj tid',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$Z = {
lang: Object.assign({ placeholder: 'Välj datum', rangePlaceholder: ['Startdatum', 'Slutdatum'] }, CalendarLocale$u),
timePickerLocale: Object.assign({}, locale$Y),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$u = {
// Options.jsx
items_per_page: '/ sida',
jump_to: 'Gå till',
jump_to_confirm: 'bekräfta',
page: '',
// Pagination.jsx
prev_page: 'Föreg sida',
next_page: 'Nästa sida',
prev_5: 'Föreg 5 sidor',
next_5: 'Nästa 5 sidor',
prev_3: 'Föreg 3 sidor',
next_3: 'Nästa 3 sidor',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var sv_SE = {
locale: 'sv',
Pagination: Pagination$u,
DatePicker: locale$Z,
TimePicker: locale$Y,
Calendar: CalendarLocale$u,
Table: {
filterTitle: 'Filtermeny',
filterConfirm: 'OK',
filterReset: 'Rensa',
},
Modal: {
okText: 'OK',
cancelText: 'Avbryt',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Avbryt',
},
Transfer: {
searchPlaceholder: 'Sök',
itemUnit: 'element',
itemsUnit: 'element',
},
Empty: {
description: 'Ingen information',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$v = {
today: 'วันนี้',
now: 'ตอนนี้',
backToToday: 'กลับไปยังวันนี้',
ok: 'ตกลง',
clear: 'ลบล้าง',
month: 'เดือน',
year: 'ปี',
timeSelect: 'เลือกเวลา',
dateSelect: 'เลือกวัน',
monthSelect: 'เลือกเดือน',
yearSelect: 'เลือกปี',
decadeSelect: 'เลือกทศวรรษ',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'เดือนก่อนหน้า (PageUp)',
nextMonth: 'เดือนถัดไป (PageDown)',
previousYear: 'ปีก่อนหน้า (Control + left)',
nextYear: 'ปีถัดไป (Control + right)',
previousDecade: 'ทศวรรษก่อนหน้า',
nextDecade: 'ทศวรรษถัดไป',
previousCentury: 'ศตวรรษก่อนหน้า',
nextCentury: 'ศตวรรษถัดไป',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$_ = {
placeholder: 'เลือกเวลา',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$10 = {
lang: Object.assign({ placeholder: 'เลือกวันที่', rangePlaceholder: ['วันเริ่มต้น', 'วันสิ้นสุด'] }, CalendarLocale$v),
timePickerLocale: Object.assign({}, locale$_)
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$v = {
// Options.jsx
items_per_page: '/ หน้า',
jump_to: 'ไปยัง',
jump_to_confirm: 'ยืนยัน',
page: '',
// Pagination.jsx
prev_page: 'หน้าก่อนหน้า',
next_page: 'หน้าถัดไป',
prev_5: 'ย้อนกลับ 5 หน้า',
next_5: 'ถัดไป 5 หน้า',
prev_3: 'ย้อนกลับ 3 หน้า',
next_3: 'ถัดไป 3 หน้า',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var th_TH = {
locale: 'th',
Pagination: Pagination$v,
DatePicker: locale$10,
TimePicker: locale$_,
Calendar: CalendarLocale$v,
Table: {
filterTitle: 'ตัวกรอง',
filterConfirm: 'ยืนยัน',
filterReset: 'รีเซ็ต',
selectAll: 'เลือกทั้งหมดในหน้านี้',
selectInvert: 'เลือกสถานะตรงกันข้าม',
},
Modal: {
okText: 'ตกลง',
cancelText: 'ยกเลิก',
justOkText: 'ตกลง',
},
Popconfirm: {
okText: 'ตกลง',
cancelText: 'ยกเลิก',
},
Transfer: {
searchPlaceholder: 'ค้นหา',
itemUnit: 'ชิ้น',
itemsUnit: 'ชิ้น',
},
Upload: {
uploading: 'กำลังอัปโหลด...',
removeFile: 'ลบไฟล์',
uploadError: 'เกิดข้อผิดพลาดในการอัปโหลด',
previewFile: 'ดูตัวอย่างไฟล์',
},
Empty: {
description: 'ไม่มีข้อมูล',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$11 = {
placeholder: 'Zaman Seç',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$12 = {
lang: Object.assign({ placeholder: 'Tarih Seç', rangePlaceholder: ['Başlangıç Tarihi', 'Bitiş Tarihi'] }, CalendarLocale$9),
timePickerLocale: Object.assign({}, locale$11),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var tr_TR = {
locale: 'tr',
Pagination: Pagination$9,
DatePicker: locale$12,
TimePicker: locale$11,
Calendar: CalendarLocale$9,
Table: {
filterTitle: 'Menü Filtrele',
filterConfirm: 'Tamam',
filterReset: 'Sıfırla',
selectAll: 'Hepsini Seç',
selectInvert: 'Tersini Seç',
},
Modal: {
okText: 'Tamam',
cancelText: 'İptal',
justOkText: 'Tamam',
},
Popconfirm: {
okText: 'Tamam',
cancelText: 'İptal',
},
Transfer: {
searchPlaceholder: 'Arama',
itemUnit: 'Öğe',
itemsUnit: 'Öğeler',
},
Upload: {
uploading: 'Yükleniyor...',
removeFile: `Dosyayı kaldır`,
uploadError: 'Yükleme Hatası',
previewFile: `Dosyayı Önizle`,
},
Empty: {
description: 'Veri Yok',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$w = {
today: 'Сьогодні',
now: 'Зараз',
backToToday: 'Поточна дата',
ok: 'Ok',
clear: 'Очистити',
month: 'Місяць',
year: 'Рік',
timeSelect: 'Обрати час',
dateSelect: 'Обрати дату',
monthSelect: 'Обрати місяць',
yearSelect: 'Обрати рік',
decadeSelect: 'Обрати десятиріччя',
yearFormat: 'YYYY',
dateFormat: 'D-M-YYYY',
dayFormat: 'D',
dateTimeFormat: 'D-M-YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Попередній місяць (PageUp)',
nextMonth: 'Наступний місяць (PageDown)',
previousYear: 'Попередній рік (Control + left)',
nextYear: 'Наступний рік (Control + right)',
previousDecade: 'Попереднє десятиріччя',
nextDecade: 'Наступне десятиріччя',
previousCentury: 'Попереднє століття',
nextCentury: 'Наступне століття',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$13 = {
placeholder: 'Оберіть час',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$14 = {
lang: Object.assign({ placeholder: 'Оберіть дату', rangePlaceholder: ['Початкова дата', 'Кінцева дата'] }, CalendarLocale$w),
timePickerLocale: Object.assign({}, locale$13),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$w = {
// Options.jsx
items_per_page: '/ сторінці',
jump_to: 'Перейти',
jump_to_confirm: 'підтвердити',
page: '',
// Pagination.jsx
prev_page: 'Попередня сторінка',
next_page: 'Наступна сторінка',
prev_5: 'Попередні 5 сторінок',
next_5: 'Наступні 5 сторінок',
prev_3: 'Попередні 3 сторінки',
next_3: 'Наступні 3 сторінки',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var uk_UA = {
locale: 'uk',
Pagination: Pagination$w,
DatePicker: locale$14,
TimePicker: locale$13,
Calendar: CalendarLocale$w,
Table: {
filterTitle: 'Фільтрувати',
filterConfirm: 'OK',
filterReset: 'Скинути',
selectAll: 'Обрати всі',
selectInvert: 'Інвертувати вибір',
},
Modal: {
okText: 'Гаразд',
cancelText: 'Скасувати',
justOkText: 'Гаразд',
},
Popconfirm: {
okText: 'Гаразд',
cancelText: 'Скасувати',
},
Transfer: {
searchPlaceholder: 'Введіть текст для пошуку',
itemUnit: 'item',
itemsUnit: 'items',
},
Upload: {
uploading: 'Завантаження ...',
removeFile: 'Видалити файл',
uploadError: 'Помилка завантаження',
previewFile: 'Попередній перегляд файлу',
},
Empty: {
description: 'Даних немає',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// Merge into a locale object
/** @type {?} */
const locale$15 = {
lang: Object.assign({ placeholder: 'Chọn thời điểm', rangePlaceholder: ['Ngày bắt đầu', 'Ngày kết thúc'] }, CalendarLocale$9),
timePickerLocale: Object.assign({}, locale$i),
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$x = {
// Options.jsx
items_per_page: '/ trang',
jump_to: 'Đến',
jump_to_confirm: 'xác nhận',
page: '',
// Pagination.jsx
prev_page: 'Trang Trước',
next_page: 'Trang Kế',
prev_5: 'Về 5 Trang Trước',
next_5: 'Đến 5 Trang Kế',
prev_3: 'Về 3 Trang Trước',
next_3: 'Đến 3 Trang Kế',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$16 = {
placeholder: 'Chọn thời gian',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var vi_VN = {
locale: 'vi',
Pagination: Pagination$x,
DatePicker: locale$15,
TimePicker: locale$16,
Calendar: locale$15,
Table: {
filterTitle: 'Bộ ',
filterConfirm: 'OK',
filterReset: 'Tạo Lại',
selectAll: 'Chọn Tất Cả',
selectInvert: 'Chọn Ngược Lại',
},
Modal: {
okText: 'OK',
cancelText: 'Huỷ',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Huỷ',
},
Transfer: {
searchPlaceholder: 'Tìm ở đây',
itemUnit: 'mục',
itemsUnit: 'mục',
},
Upload: {
uploading: 'Đang tải lên...',
removeFile: 'Gỡ bỏ tập tin',
uploadError: 'Lỗi tải lên',
previewFile: 'Xem thử tập tin',
},
Empty: {
description: 'Trống',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var CalendarLocale$x = {
today: '今天',
now: '此刻',
backToToday: '返回今天',
ok: '確定',
timeSelect: '選擇時間',
dateSelect: '選擇日期',
clear: '清除',
month: '月',
year: '年',
previousMonth: '上個月 (翻頁上鍵)',
nextMonth: '下個月 (翻頁下鍵)',
monthSelect: '選擇月份',
yearSelect: '選擇年份',
decadeSelect: '選擇年代',
yearFormat: 'YYYY年',
dayFormat: 'D日',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH時mm分ss秒',
previousYear: '上一年 (Control鍵加左方向鍵)',
nextYear: '下一年 (Control鍵加右方向鍵)',
previousDecade: '上一年代',
nextDecade: '下一年代',
previousCentury: '上一世紀',
nextCentury: '下一世紀',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$17 = {
placeholder: '請選擇時間',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const locale$18 = {
lang: Object.assign({ placeholder: '請選擇日期', rangePlaceholder: ['開始日期', '結束日期'] }, CalendarLocale$x),
timePickerLocale: Object.assign({}, locale$17),
};
locale$18.lang.ok = '確 定';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var Pagination$y = {
// Options.jsx
items_per_page: '條/頁',
jump_to: '跳至',
jump_to_confirm: '確定',
page: '頁',
// Pagination.jsx
prev_page: '上一頁',
next_page: '下一頁',
prev_5: '向前 5 頁',
next_5: '向後 5 頁',
prev_3: '向前 3 頁',
next_3: '向後 3 頁',
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var zh_TW = {
locale: 'zh-tw',
Pagination: Pagination$y,
DatePicker: locale$18,
TimePicker: locale$17,
Calendar: CalendarLocale$x,
Table: {
filterTitle: '篩選器',
filterConfirm: '確 定',
filterReset: '重 置',
selectAll: '全部選取',
selectInvert: '反向選取',
},
Modal: {
okText: '確 定',
cancelText: '取 消',
justOkText: 'OK',
},
Popconfirm: {
okText: '確 定',
cancelText: '取 消',
},
Transfer: {
searchPlaceholder: '搜尋資料',
itemUnit: '項目',
itemsUnit: '項目',
},
Upload: {
uploading: '正在上傳...',
removeFile: '刪除檔案',
uploadError: '上傳失敗',
previewFile: '檔案預覽',
},
Empty: {
description: '無此資料',
},
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzI18nService$$1 {
/**
* @param {?} locale
* @param {?} dateLocale
*/
constructor(locale, dateLocale) {
this._change = new BehaviorSubject(this._locale);
this.setLocale(locale || zh_CN);
this.setDateLocale(dateLocale || null);
}
/**
* @return {?}
*/
get localeChange() {
return this._change.asObservable();
}
// [NOTE] Performance issue: this method may called by every change detections
// TODO: cache more deeply paths for performance
/* tslint:disable-next-line:no-any */
/**
* @param {?} path
* @param {?=} data
* @return {?}
*/
translate(path, data) {
// this._logger.debug(`[NzI18nService] Translating(${this._locale.locale}): ${path}`);
/** @type {?} */
let content = (/** @type {?} */ (this._getObjectPath(this._locale, path)));
if (typeof content === 'string') {
if (data) {
Object.keys(data).forEach((/**
* @param {?} key
* @return {?}
*/
(key) => content = content.replace(new RegExp(`%${key}%`, 'g'), data[key])));
}
return content;
}
return path;
}
/**
* Set/Change current locale globally throughout the WHOLE application
* [NOTE] If called at runtime, rendered interface may not change along with the locale change (because this do not trigger another render schedule)
* @param {?} locale The translating letters
* @return {?}
*/
setLocale(locale) {
if (this._locale && this._locale.locale === locale.locale) {
return;
}
this._locale = locale;
this._change.next(locale);
}
/**
* @return {?}
*/
getLocale() {
return this._locale;
}
/**
* @return {?}
*/
getLocaleId() {
return this._locale ? this._locale.locale : '';
}
/**
* @param {?} dateLocale
* @return {?}
*/
setDateLocale(dateLocale) {
this.dateLocale = dateLocale;
}
/**
* @return {?}
*/
getDateLocale() {
return this.dateLocale;
}
/**
* Get locale data
* @param {?=} path dot paths for finding exist value from locale data, eg. "a.b.c"
* @param {?=} defaultValue default value if the result is not "truthy"
* @return {?}
*/
getLocaleData(path, defaultValue) {
// tslint:disable-line:no-any
/** @type {?} */
const result = path ? this._getObjectPath(this._locale, path) : this._locale;
return result || defaultValue;
}
/**
* @private
* @param {?} obj
* @param {?} path
* @return {?}
*/
_getObjectPath(obj, path) {
// tslint:disable-line:no-any
/** @type {?} */
let res = obj;
/** @type {?} */
const paths = path.split('.');
/** @type {?} */
const depth = paths.length;
/** @type {?} */
let index = 0;
while (res && index < depth) {
res = res[paths[index++]];
}
return index === depth ? res : null;
}
}
NzI18nService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzI18nService$$1.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Inject, args: [NZ_I18N,] }] },
{ type: undefined, decorators: [{ type: Inject, args: [NZ_DATE_LOCALE,] }] }
];
/** @nocollapse */ NzI18nService$$1.ngInjectableDef = defineInjectable({ factory: function NzI18nService_Factory() { return new NzI18nService$$1(inject(NZ_I18N), inject(NZ_DATE_LOCALE)); }, token: NzI18nService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzI18nPipe {
/**
* @param {?} _locale
*/
constructor(_locale) {
this._locale = _locale;
}
/**
* @param {?} path
* @param {?=} keyValue
* @return {?}
*/
transform(path, keyValue) {
return this._locale.translate(path, keyValue);
}
}
NzI18nPipe.decorators = [
{ type: Pipe, args: [{
name: 'nzI18n'
},] }
];
/** @nocollapse */
NzI18nPipe.ctorParameters = () => [
{ type: NzI18nService$$1 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzI18nModule {
}
NzI18nModule.decorators = [
{ type: NgModule, args: [{
imports: [LoggerModule],
declarations: [NzI18nPipe],
exports: [NzI18nPipe],
providers: [
DatePipe,
{ provide: NZ_I18N, useValue: null },
{ provide: NZ_DATE_LOCALE, useValue: null }
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRadioComponent {
/* tslint:disable-next-line:no-any */
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} cdr
* @param {?} focusMonitor
*/
constructor(elementRef, renderer, cdr, focusMonitor) {
this.elementRef = elementRef;
this.renderer = renderer;
this.cdr = cdr;
this.focusMonitor = focusMonitor;
this.select$ = new Subject();
this.touched$ = new Subject();
this.checked = false;
this.isNgModel = false;
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
this.nzDisabled = false;
this.nzAutoFocus = false;
this.renderer.addClass(elementRef.nativeElement, 'ant-radio-wrapper');
}
/**
* @return {?}
*/
updateAutoFocus() {
if (this.inputElement) {
if (this.nzAutoFocus) {
this.renderer.setAttribute(this.inputElement.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.inputElement.nativeElement, 'autofocus');
}
}
}
/**
* @param {?} event
* @return {?}
*/
onClick(event) {
// Prevent label click triggered twice.
event.stopPropagation();
event.preventDefault();
if (!this.nzDisabled && !this.checked) {
this.select$.next(this);
if (this.isNgModel) {
this.checked = true;
this.onChange(true);
}
}
}
/**
* @return {?}
*/
focus() {
this.focusMonitor.focusVia(this.inputElement, 'keyboard');
}
/**
* @return {?}
*/
blur() {
this.inputElement.nativeElement.blur();
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.checked = value;
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.isNgModel = true;
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.focusMonitor.monitor(this.elementRef, true).subscribe((/**
* @param {?} focusOrigin
* @return {?}
*/
focusOrigin => {
if (!focusOrigin) {
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
this.touched$.next();
}
}));
this.updateAutoFocus();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzAutoFocus) {
this.updateAutoFocus();
}
}
}
NzRadioComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-radio]',
preserveWhitespaces: false,
template: "<span class=\"ant-radio\" [class.ant-radio-checked]=\"checked\" [class.ant-radio-disabled]=\"nzDisabled\">\n <input #inputElement type=\"radio\" class=\"ant-radio-input\" [disabled]=\"nzDisabled\" [checked]=\"checked\" [attr.name]=\"name\">\n <span class=\"ant-radio-inner\"></span>\n</span>\n<span><ng-content></ng-content></span>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRadioComponent)),
multi: true
}
],
host: {
'[class.ant-radio-wrapper-checked]': 'checked',
'[class.ant-radio-wrapper-disabled]': 'nzDisabled'
}
}] }
];
/** @nocollapse */
NzRadioComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: FocusMonitor }
];
NzRadioComponent.propDecorators = {
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
nzValue: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
onClick: [{ type: HostListener, args: ['click', ['$event'],] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzRadioComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzRadioComponent.prototype, "nzAutoFocus", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRadioButtonComponent extends NzRadioComponent {
/* tslint:disable-next-line:no-any */
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} cdr
* @param {?} focusMonitor
*/
constructor(elementRef, renderer, cdr, focusMonitor) {
super(elementRef, renderer, cdr, focusMonitor);
renderer.removeClass(elementRef.nativeElement, 'ant-radio-wrapper');
renderer.addClass(elementRef.nativeElement, 'ant-radio-button-wrapper');
}
}
NzRadioButtonComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-radio-button]',
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRadioComponent)),
multi: true
},
{
provide: NzRadioComponent,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRadioButtonComponent))
}
],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
template: "<span class=\"ant-radio-button\" [class.ant-radio-button-checked]=\"checked\" [class.ant-radio-button-disabled]=\"nzDisabled\">\n <input type=\"radio\" #inputElement class=\"ant-radio-button-input\" [disabled]=\"nzDisabled\" [checked]=\"checked\" [attr.name]=\"name\">\n <span class=\"ant-radio-button-inner\"></span>\n</span>\n<span><ng-content></ng-content></span>",
host: {
'[class.ant-radio-button-wrapper-checked]': 'checked',
'[class.ant-radio-button-wrapper-disabled]': 'nzDisabled'
}
}] }
];
/** @nocollapse */
NzRadioButtonComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: FocusMonitor }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRadioGroupComponent {
/**
* @param {?} cdr
* @param {?} renderer
* @param {?} elementRef
*/
constructor(cdr, renderer, elementRef) {
this.cdr = cdr;
this.destroy$ = new Subject();
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
this.nzButtonStyle = 'outline';
this.nzSize = 'default';
renderer.addClass(elementRef.nativeElement, 'ant-radio-group');
}
/**
* @return {?}
*/
updateChildrenStatus() {
if (this.radios) {
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.radios.forEach((/**
* @param {?} radio
* @return {?}
*/
radio => {
radio.checked = radio.nzValue === this.value;
if (isNotNil(this.nzDisabled)) {
radio.nzDisabled = this.nzDisabled;
}
if (this.nzName) {
radio.name = this.nzName;
}
radio.markForCheck();
}));
}));
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.radios.changes.pipe(startWith(null), takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.updateChildrenStatus();
if (this.selectSubscription) {
this.selectSubscription.unsubscribe();
}
this.selectSubscription = merge(...this.radios.map((/**
* @param {?} radio
* @return {?}
*/
radio => radio.select$))).pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} radio
* @return {?}
*/
(radio) => {
if (this.value !== radio.nzValue) {
this.value = radio.nzValue;
this.updateChildrenStatus();
this.onChange(this.value);
}
}));
if (this.touchedSubscription) {
this.touchedSubscription.unsubscribe();
}
this.touchedSubscription = merge(...this.radios.map((/**
* @param {?} radio
* @return {?}
*/
radio => radio.touched$))).pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
}));
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzDisabled || changes.nzName) {
this.updateChildrenStatus();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
/* tslint:disable-next-line:no-any */
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.value = value;
this.updateChildrenStatus();
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
}
NzRadioGroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-radio-group',
preserveWhitespaces: false,
template: "<ng-content></ng-content>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRadioGroupComponent)),
multi: true
}
],
host: {
'[class.ant-radio-group-large]': `nzSize === 'large'`,
'[class.ant-radio-group-small]': `nzSize === 'small'`,
'[class.ant-radio-group-solid]': `nzButtonStyle === 'solid'`
}
}] }
];
/** @nocollapse */
NzRadioGroupComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: ElementRef }
];
NzRadioGroupComponent.propDecorators = {
radios: [{ type: ContentChildren, args: [forwardRef((/**
* @return {?}
*/
() => NzRadioComponent)), { descendants: true },] }],
nzDisabled: [{ type: Input }],
nzButtonStyle: [{ type: Input }],
nzSize: [{ type: Input }],
nzName: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRadioGroupComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRadioModule {
}
NzRadioModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule],
exports: [NzRadioComponent, NzRadioButtonComponent, NzRadioGroupComponent],
declarations: [NzRadioComponent, NzRadioButtonComponent, NzRadioGroupComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzConnectedOverlayDirective {
/**
* @param {?} cdkConnectedOverlay
*/
constructor(cdkConnectedOverlay) {
this.cdkConnectedOverlay = cdkConnectedOverlay;
this.cdkConnectedOverlay.backdropClass = 'nz-overlay-transparent-backdrop';
}
}
NzConnectedOverlayDirective.decorators = [
{ type: Directive, args: [{
selector: '[cdkConnectedOverlay][nzConnectedOverlay]'
},] }
];
/** @nocollapse */
NzConnectedOverlayDirective.ctorParameters = () => [
{ type: CdkConnectedOverlay }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOverlayModule {
}
NzOverlayModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzConnectedOverlayDirective],
exports: [NzConnectedOverlayDirective]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// tslint:disable-next-line:no-any
/** @type {?} */
const NZ_DEFAULT_EMPTY_CONTENT = new InjectionToken('nz-empty-content');
/** @type {?} */
const NZ_EMPTY_COMPONENT_NAME = new InjectionToken('nz-empty-component-name');
/** @type {?} */
const emptyImage = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+PGVsbGlwc2UgZmlsbC1vcGFjaXR5PSIuOCIgZmlsbD0iI0Y1RjVGNyIgY3g9IjY3Ljc5NyIgY3k9IjEwNi44OSIgcng9IjY3Ljc5NyIgcnk9IjEyLjY2OCIvPjxwYXRoIGQ9Ik0xMjIuMDM0IDY5LjY3NEw5OC4xMDkgNDAuMjI5Yy0xLjE0OC0xLjM4Ni0yLjgyNi0yLjIyNS00LjU5My0yLjIyNWgtNTEuNDRjLTEuNzY2IDAtMy40NDQuODM5LTQuNTkyIDIuMjI1TDEzLjU2IDY5LjY3NHYxNS4zODNoMTA4LjQ3NVY2OS42NzR6IiBmaWxsPSIjQUVCOEMyIi8+PHBhdGggZD0iTTEwMS41MzcgODYuMjE0TDgwLjYzIDYxLjEwMmMtMS4wMDEtMS4yMDctMi41MDctMS44NjctNC4wNDgtMS44NjdIMzEuNzI0Yy0xLjU0IDAtMy4wNDcuNjYtNC4wNDggMS44NjdMNi43NjkgODYuMjE0djEzLjc5Mmg5NC43NjhWODYuMjE0eiIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMuNTYpIi8+PHBhdGggZD0iTTMzLjgzIDBoNjcuOTMzYTQgNCAwIDAgMSA0IDR2OTMuMzQ0YTQgNCAwIDAgMS00IDRIMzMuODNhNCA0IDAgMCAxLTQtNFY0YTQgNCAwIDAgMSA0LTR6IiBmaWxsPSIjRjVGNUY3Ii8+PHBhdGggZD0iTTQyLjY3OCA5Ljk1M2g1MC4yMzdhMiAyIDAgMCAxIDIgMlYzNi45MWEyIDIgMCAwIDEtMiAySDQyLjY3OGEyIDIgMCAwIDEtMi0yVjExLjk1M2EyIDIgMCAwIDEgMi0yek00Mi45NCA0OS43NjdoNDkuNzEzYTIuMjYyIDIuMjYyIDAgMSAxIDAgNC41MjRINDIuOTRhMi4yNjIgMi4yNjIgMCAwIDEgMC00LjUyNHpNNDIuOTQgNjEuNTNoNDkuNzEzYTIuMjYyIDIuMjYyIDAgMSAxIDAgNC41MjVINDIuOTRhMi4yNjIgMi4yNjIgMCAwIDEgMC00LjUyNXpNMTIxLjgxMyAxMDUuMDMyYy0uNzc1IDMuMDcxLTMuNDk3IDUuMzYtNi43MzUgNS4zNkgyMC41MTVjLTMuMjM4IDAtNS45Ni0yLjI5LTYuNzM0LTUuMzZhNy4zMDkgNy4zMDkgMCAwIDEtLjIyMi0xLjc5VjY5LjY3NWgyNi4zMThjMi45MDcgMCA1LjI1IDIuNDQ4IDUuMjUgNS40MnYuMDRjMCAyLjk3MSAyLjM3IDUuMzcgNS4yNzcgNS4zN2gzNC43ODVjMi45MDcgMCA1LjI3Ny0yLjQyMSA1LjI3Ny01LjM5M1Y3NS4xYzAtMi45NzIgMi4zNDMtNS40MjYgNS4yNS01LjQyNmgyNi4zMTh2MzMuNTY5YzAgLjYxNy0uMDc3IDEuMjE2LS4yMjEgMS43ODl6IiBmaWxsPSIjRENFMEU2Ii8+PC9nPjxwYXRoIGQ9Ik0xNDkuMTIxIDMzLjI5MmwtNi44MyAyLjY1YTEgMSAwIDAgMS0xLjMxNy0xLjIzbDEuOTM3LTYuMjA3Yy0yLjU4OS0yLjk0NC00LjEwOS02LjUzNC00LjEwOS0xMC40MDhDMTM4LjgwMiA4LjEwMiAxNDguOTIgMCAxNjEuNDAyIDAgMTczLjg4MSAwIDE4NCA4LjEwMiAxODQgMTguMDk3YzAgOS45OTUtMTAuMTE4IDE4LjA5Ny0yMi41OTkgMTguMDk3LTQuNTI4IDAtOC43NDQtMS4wNjYtMTIuMjgtMi45MDJ6IiBmaWxsPSIjRENFMEU2Ii8+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTQ5LjY1IDE1LjM4MykiIGZpbGw9IiNGRkYiPjxlbGxpcHNlIGN4PSIyMC42NTQiIGN5PSIzLjE2NyIgcng9IjIuODQ5IiByeT0iMi44MTUiLz48cGF0aCBkPSJNNS42OTggNS42M0gwTDIuODk4LjcwNHpNOS4yNTkuNzA0aDQuOTg1VjUuNjNIOS4yNTl6Ii8+PC9nPjwvZz48L3N2Zz4=';
/** @type {?} */
const simpleEmptyImage = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI0MXB4IiB2aWV3Qm94PSIwIDAgNjQgNDEiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjUgKDY3NDY5KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDxnIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00NzIuMDAwMDAwLCAtMTMzNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgIHRyYW5zZm9ybT0idHJhbnNsYXRlKDY0LjAwMDAwMCwgMTExNC4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxnICB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MC4wMDAwMDAsIDc4LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxnICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNjguMDAwMDAwLCAxNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxnID4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxlbGxpcHNlICBmaWxsPSIjRjVGNUY1IiBjeD0iMzIiIGN5PSIzMyIgcng9IjMyIiByeT0iNyI+PC9lbGxpcHNlPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGcgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgMC4wMDAwMDApIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0iI0Q5RDlEOSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTQ2LDEyLjc2MDU2MDQgTDM1Ljg1NDMwNDcsMS4yNTczOTYzMyBDMzUuMzY3NDQxNCwwLjQ3MzgyNjYwNSAzNC42NTU4Nzg5LDAgMzMuOTA2NzYxNywwIEwxMi4wOTMyMzgzLDAgQzExLjM0NDEyMTEsMCAxMC42MzI1NTg2LDAuNDczOTUwMjU1IDEwLjE0NTY5NTMsMS4yNTczOTYzMyBMMi42MTQ3OTcyN2UtMTIsMTIuNzYwNTYwNCBMMCwyMiBMNDYsMjIgTDQ2LDEyLjc2MDU2MDQgWiIgID48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTMyLjYxMzI4MTMsMTUuOTMxNSBDMzIuNjEzMjgxMywxNC4zMjU4NTExIDMzLjYwNjk1MzEsMTMuMDAwMjM0IDM0LjgzOTY5OTIsMTMgTDQ2LDEzIEw0NiwzMS4xMzcxMjc3IEM0NiwzMy4yNTg5NTc0IDQ0LjY3OTM4NjcsMzUgNDMuMDUwNDI5NywzNSBMMi45NDk1NzAzMSwzNSBDMS4zMjA1MjM0NCwzNSAwLDMzLjI1ODg0MDQgMCwzMS4xMzcxMjc3IEwwLDEzIEwxMS4xNjAzMDA4LDEzIEMxMi4zOTMwNDY5LDEzIDEzLjM4NjcxODgsMTQuMzIyODA4NSAxMy4zODY3MTg4LDE1LjkyODQ1NzQgTDEzLjM4NjcxODgsMTUuOTQ5NjM4MyBDMTMuMzg2NzE4OCwxNy41NTUyODcyIDE0LjM5MTcxMDksMTguODUxMTgwOSAxNS42MjQ0NTcsMTguODUxMTgwOSBMMzAuMzc1NTQzLDE4Ljg1MTE4MDkgQzMxLjYwODI4OTEsMTguODUxMTgwOSAzMi42MTMyODEzLDE3LjU0MzM1MTEgMzIuNjEzMjgxMywxNS45Mzc3MDIxIEwzMi42MTMyODEzLDE1LjkzMTUgWiIgIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} content
* @return {?}
*/
function getEmptyContentTypeError(content) {
return TypeError(`[NG-ZORRO]: useDefaultContent expect 'string', 'templateRef' or 'component' but get ${content}`);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzEmptyComponent {
/**
* @param {?} sanitizer
* @param {?} i18n
* @param {?} cdr
*/
constructor(sanitizer, i18n, cdr) {
this.sanitizer = sanitizer;
this.i18n = i18n;
this.cdr = cdr;
// NOTE: It would be very hack to use `ContentChild`, because Angular could
// tell if user actually pass something to <ng-content>.
// See: https://github.com/angular/angular/issues/12530.
// I can use a directive but this would expose the name `footer`.
// @ContentChild(TemplateRef) nzNotFoundFooter: TemplateRef<void>;
this.defaultSvg = this.sanitizer.bypassSecurityTrustResourceUrl(emptyImage);
this.isContentString = false;
this.locale = {};
this.destroy$ = new Subject();
}
/**
* @return {?}
*/
get shouldRenderContent() {
/** @type {?} */
const content = this.nzNotFoundContent;
return !!(content || typeof content === 'string');
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { nzNotFoundContent } = changes;
if (nzNotFoundContent) {
this.isContentString = typeof nzNotFoundContent.currentValue === 'string';
}
}
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Empty');
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzEmptyComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-empty',
template: "<div class=\"ant-empty-image\">\n <ng-container *nzStringTemplateOutlet=\"nzNotFoundImage\">\n <img [src]=\"nzNotFoundImage || defaultSvg\" [alt]=\"isContentString ? nzNotFoundContent : 'empty'\">\n </ng-container>\n</div>\n<p class=\"ant-empty-description\">\n <ng-container *nzStringTemplateOutlet=\"nzNotFoundContent\">\n {{ shouldRenderContent ? nzNotFoundContent : locale['description'] }}\n </ng-container>\n</p>\n<div class=\"ant-empty-footer\" *ngIf=\"nzNotFoundFooter\">\n <ng-container *nzStringTemplateOutlet=\"nzNotFoundFooter\">\n {{ nzNotFoundFooter }}\n </ng-container>\n</div>\n",
host: {
'class': 'ant-empty'
},
styles: ['nz-empty { display: block; }']
}] }
];
/** @nocollapse */
NzEmptyComponent.ctorParameters = () => [
{ type: DomSanitizer },
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef }
];
NzEmptyComponent.propDecorators = {
nzNotFoundImage: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzNotFoundFooter: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @template T
*/
class NzEmptyService$$1 {
/**
* @param {?} defaultEmptyContent
*/
constructor(defaultEmptyContent) {
this.defaultEmptyContent = defaultEmptyContent;
// tslint:disable-line:no-any
this.userDefaultContent$ = new BehaviorSubject(undefined);
if (this.defaultEmptyContent) {
this.userDefaultContent$.next(this.defaultEmptyContent);
}
}
/**
* @param {?=} content
* @return {?}
*/
setDefaultContent(content) {
if (typeof content === 'string'
|| content === undefined
|| content === null
|| content instanceof TemplateRef
|| content instanceof Type) {
this.userDefaultContent$.next(content);
}
else {
throw getEmptyContentTypeError(content);
}
}
/**
* @return {?}
*/
resetDefault() {
this.userDefaultContent$.next(undefined);
}
}
NzEmptyService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzEmptyService$$1.ctorParameters = () => [
{ type: Type, decorators: [{ type: Inject, args: [NZ_DEFAULT_EMPTY_CONTENT,] }, { type: Optional }] }
];
/** @nocollapse */ NzEmptyService$$1.ngInjectableDef = defineInjectable({ factory: function NzEmptyService_Factory() { return new NzEmptyService$$1(inject(NZ_DEFAULT_EMPTY_CONTENT, 8)); }, token: NzEmptyService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzEmbedEmptyComponent {
/**
* @param {?} emptyService
* @param {?} sanitizer
* @param {?} viewContainerRef
* @param {?} cdr
* @param {?} injector
*/
constructor(emptyService, sanitizer, viewContainerRef, cdr, injector) {
this.emptyService = emptyService;
this.sanitizer = sanitizer;
this.viewContainerRef = viewContainerRef;
this.cdr = cdr;
this.injector = injector;
this.contentType = 'string';
this.defaultSvg = this.sanitizer.bypassSecurityTrustResourceUrl(simpleEmptyImage);
this.size = '';
this.subs_ = new Subscription();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzComponentName) {
this.size = this.getEmptySize(changes.nzComponentName.currentValue);
}
if (changes.specificContent && !changes.specificContent.isFirstChange()) {
this.content = changes.specificContent.currentValue;
this.renderEmpty();
}
}
/**
* @return {?}
*/
ngOnInit() {
/** @type {?} */
const userContent_ = this.emptyService.userDefaultContent$.subscribe((/**
* @param {?} content
* @return {?}
*/
content => {
this.content = this.specificContent || content;
this.renderEmpty();
}));
this.subs_.add(userContent_);
}
/**
* @return {?}
*/
ngOnDestroy() {
this.subs_.unsubscribe();
}
/**
* @private
* @param {?} componentName
* @return {?}
*/
getEmptySize(componentName) {
switch (componentName) {
case 'table':
case 'list':
return 'normal';
case 'select':
case 'tree-select':
case 'cascader':
case 'transfer':
return 'small';
default:
return '';
}
}
/**
* @private
* @return {?}
*/
renderEmpty() {
/** @type {?} */
const content = this.content;
if (typeof content === 'string') {
this.contentType = 'string';
}
else if (content instanceof TemplateRef) {
/** @type {?} */
const context = (/** @type {?} */ ({ $implicit: this.nzComponentName }));
this.contentType = 'template';
this.contentPortal = new TemplatePortal(content, this.viewContainerRef, context);
}
else if (content instanceof Type) {
/** @type {?} */
const context = new WeakMap([[NZ_EMPTY_COMPONENT_NAME, this.nzComponentName]]);
/** @type {?} */
const injector = new PortalInjector(this.injector, context);
this.contentType = 'component';
this.contentPortal = new ComponentPortal(content, this.viewContainerRef, injector);
}
else {
this.contentType = 'string';
this.contentPortal = undefined;
}
this.cdr.markForCheck();
}
}
NzEmbedEmptyComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-embed-empty',
template: "<ng-container *ngIf=\"!content && specificContent !== null\" [ngSwitch]=\"size\">\n <nz-empty *ngSwitchCase=\"'normal'\" class=\"ant-empty-normal\" [nzNotFoundImage]=\"defaultSvg\"></nz-empty>\n <nz-empty *ngSwitchCase=\"'small'\" class=\"ant-empty-small\" [nzNotFoundImage]=\"defaultSvg\"></nz-empty>\n <nz-empty *ngSwitchDefault></nz-empty>\n</ng-container>\n<ng-container *ngIf=\"content\">\n <ng-template *ngIf=\"contentType !== 'string'\" [cdkPortalOutlet]=\"contentPortal\"></ng-template>\n <ng-container *ngIf=\"contentType === 'string'\">\n {{ content }}\n </ng-container>\n</ng-container>\n"
}] }
];
/** @nocollapse */
NzEmbedEmptyComponent.ctorParameters = () => [
{ type: NzEmptyService$$1 },
{ type: DomSanitizer },
{ type: ViewContainerRef },
{ type: ChangeDetectorRef },
{ type: Injector }
];
NzEmbedEmptyComponent.propDecorators = {
nzComponentName: [{ type: Input }],
specificContent: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzEmptyModule {
}
NzEmptyModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, PortalModule, NzAddOnModule, NzI18nModule],
declarations: [NzEmptyComponent, NzEmbedEmptyComponent],
exports: [NzEmptyComponent, NzEmbedEmptyComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOptionComponent {
constructor() {
this.nzDisabled = false;
this.nzCustomContent = false;
}
}
NzOptionComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-option',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>"
}] }
];
NzOptionComponent.propDecorators = {
template: [{ type: ViewChild, args: [TemplateRef,] }],
nzLabel: [{ type: Input }],
nzValue: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzCustomContent: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzOptionComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzOptionComponent.prototype, "nzCustomContent", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFilterOptionPipe {
/**
* @param {?} options
* @param {?} searchValue
* @param {?} filterOption
* @param {?} serverSearch
* @return {?}
*/
transform(options, searchValue, filterOption, serverSearch) {
if (serverSearch || !searchValue) {
return options;
}
else {
return ((/** @type {?} */ (options))).filter((/**
* @param {?} o
* @return {?}
*/
o => filterOption(searchValue, o)));
}
}
}
NzFilterOptionPipe.decorators = [
{ type: Pipe, args: [{ name: 'nzFilterOption' },] }
];
class NzFilterGroupOptionPipe {
/**
* @param {?} groups
* @param {?} searchValue
* @param {?} filterOption
* @param {?} serverSearch
* @return {?}
*/
transform(groups, searchValue, filterOption, serverSearch) {
if (serverSearch || !searchValue) {
return groups;
}
else {
return ((/** @type {?} */ (groups))).filter((/**
* @param {?} g
* @return {?}
*/
g => {
return g.listOfNzOptionComponent.some((/**
* @param {?} o
* @return {?}
*/
o => filterOption(searchValue, o)));
}));
}
}
}
NzFilterGroupOptionPipe.decorators = [
{ type: Pipe, args: [{ name: 'nzFilterGroupOption' },] }
];
/**
* @param {?} searchValue
* @param {?} option
* @return {?}
*/
function defaultFilterOption(searchValue, option) {
if (option && option.nzLabel) {
return option.nzLabel.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
}
else {
return false;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSelectService {
constructor() {
// Input params
this.autoClearSearchValue = true;
this.serverSearch = false;
this.filterOption = defaultFilterOption;
this.mode = 'default';
this.maxMultipleCount = Infinity;
this.disabled = false;
// tslint:disable-next-line:no-any
this.compareWith = (/**
* @param {?} o1
* @param {?} o2
* @return {?}
*/
(o1, o2) => o1 === o2);
// selectedValueChanged should emit ngModelChange or not
// tslint:disable-next-line:no-any
this.listOfSelectedValueWithEmit$ = new BehaviorSubject({
value: [],
emit: false
});
// ContentChildren Change
this.mapOfTemplateOption$ = new BehaviorSubject({
listOfNzOptionComponent: [],
listOfNzOptionGroupComponent: []
});
// searchValue Change
this.searchValueRaw$ = new BehaviorSubject('');
this.listOfFilteredOption = [];
this.openRaw$ = new Subject();
this.checkRaw$ = new Subject();
this.open = false;
this.clearInput$ = new Subject();
this.searchValue = '';
this.isShowNotFound = false;
// open
this.open$ = this.openRaw$.pipe(distinctUntilChanged(), share(), tap((/**
* @return {?}
*/
() => this.clearInput())));
this.activatedOption$ = new ReplaySubject(1);
this.listOfSelectedValue$ = this.listOfSelectedValueWithEmit$.pipe(map((/**
* @param {?} data
* @return {?}
*/
data => data.value)));
this.modelChange$ = this.listOfSelectedValueWithEmit$.pipe(filter((/**
* @param {?} item
* @return {?}
*/
item => item.emit)), map((/**
* @param {?} data
* @return {?}
*/
data => {
/** @type {?} */
const selectedList = data.value;
/** @type {?} */
let modelValue = null;
if (this.isSingleMode) {
if (selectedList.length) {
modelValue = selectedList[0];
}
}
else {
modelValue = selectedList;
}
return modelValue;
})));
this.searchValue$ = this.searchValueRaw$.pipe(distinctUntilChanged(), skip(1), share(), tap((/**
* @param {?} value
* @return {?}
*/
(value) => {
this.searchValue = value;
if (value) {
this.updateActivatedOption(this.listOfFilteredOption[0]);
}
this.updateListOfFilteredOption();
})));
// tslint:disable-next-line:no-any
this.listOfSelectedValue = [];
// flat ViewChildren
this.listOfTemplateOption = [];
// tag option
this.listOfTagOption = [];
// tag option concat template option
this.listOfTagAndTemplateOption = [];
// ViewChildren
this.listOfNzOptionComponent = [];
this.listOfNzOptionGroupComponent = [];
// display in top control
this.listOfCachedSelectedOption = [];
// selected value or ViewChildren change
this.valueOrOption$ = combineLatest(this.listOfSelectedValue$, this.mapOfTemplateOption$).pipe(tap((/**
* @param {?} data
* @return {?}
*/
data => {
this.listOfSelectedValue = data[0];
this.listOfNzOptionComponent = data[1].listOfNzOptionComponent;
this.listOfNzOptionGroupComponent = data[1].listOfNzOptionGroupComponent;
this.listOfTemplateOption = this.listOfNzOptionComponent.concat(this.listOfNzOptionGroupComponent.reduce((/**
* @param {?} pre
* @param {?} cur
* @return {?}
*/
(pre, cur) => [...pre, ...cur.listOfNzOptionComponent.toArray()]), []));
this.updateListOfTagOption();
this.updateListOfFilteredOption();
this.resetActivatedOptionIfNeeded();
this.updateListOfCachedOption();
})), share());
this.check$ = merge(this.checkRaw$, this.valueOrOption$, this.searchValue$, this.activatedOption$, this.open$, this.modelChange$).pipe(share());
}
/**
* @param {?} option
* @return {?}
*/
clickOption(option) {
/** update listOfSelectedOption -> update listOfSelectedValue -> next listOfSelectedValue$ **/
if (!option.nzDisabled) {
this.updateActivatedOption(option);
/** @type {?} */
let listOfSelectedValue = [...this.listOfSelectedValue];
if (this.isMultipleOrTags) {
/** @type {?} */
const targetValue = listOfSelectedValue.find((/**
* @param {?} o
* @return {?}
*/
o => this.compareWith(o, option.nzValue)));
if (isNotNil(targetValue)) {
listOfSelectedValue.splice(listOfSelectedValue.indexOf(targetValue), 1);
this.updateListOfSelectedValue(listOfSelectedValue, true);
}
else if (listOfSelectedValue.length < this.maxMultipleCount) {
listOfSelectedValue.push(option.nzValue);
this.updateListOfSelectedValue(listOfSelectedValue, true);
}
}
else if (!this.compareWith(listOfSelectedValue[0], option.nzValue)) {
listOfSelectedValue = [option.nzValue];
this.updateListOfSelectedValue(listOfSelectedValue, true);
}
if (this.isSingleMode) {
this.setOpenState(false);
}
else if (this.autoClearSearchValue) {
this.clearInput();
}
}
}
/**
* @return {?}
*/
updateListOfCachedOption() {
if (this.isSingleMode) {
/** @type {?} */
const selectedOption = this.listOfTemplateOption.find((/**
* @param {?} o
* @return {?}
*/
o => this.compareWith(o.nzValue, this.listOfSelectedValue[0])));
if (isNotNil(selectedOption)) {
this.listOfCachedSelectedOption = [selectedOption];
}
}
else {
/** @type {?} */
const listOfCachedSelectedOption = [];
this.listOfSelectedValue.forEach((/**
* @param {?} v
* @return {?}
*/
v => {
/** @type {?} */
const listOfMixedOption = [...this.listOfTagAndTemplateOption, ...this.listOfCachedSelectedOption];
/** @type {?} */
const option = listOfMixedOption.find((/**
* @param {?} o
* @return {?}
*/
o => this.compareWith(o.nzValue, v)));
if (option) {
listOfCachedSelectedOption.push(option);
}
}));
this.listOfCachedSelectedOption = listOfCachedSelectedOption;
}
}
/**
* @return {?}
*/
updateListOfTagOption() {
if (this.isTagsMode) {
/** @type {?} */
const listOfMissValue = this.listOfSelectedValue.filter((/**
* @param {?} value
* @return {?}
*/
value => !this.listOfTemplateOption.find((/**
* @param {?} o
* @return {?}
*/
o => this.compareWith(o.nzValue, value)))));
this.listOfTagOption = listOfMissValue.map((/**
* @param {?} value
* @return {?}
*/
value => {
/** @type {?} */
const nzOptionComponent = new NzOptionComponent();
nzOptionComponent.nzValue = value;
nzOptionComponent.nzLabel = value;
return nzOptionComponent;
}));
this.listOfTagAndTemplateOption = [...this.listOfTemplateOption.concat(this.listOfTagOption)];
}
else {
this.listOfTagAndTemplateOption = [...this.listOfTemplateOption];
}
}
/**
* @return {?}
*/
updateAddTagOption() {
/** @type {?} */
const isMatch = this.listOfTagAndTemplateOption.find((/**
* @param {?} item
* @return {?}
*/
item => item.nzLabel === this.searchValue));
if (this.isTagsMode && this.searchValue && !isMatch) {
/** @type {?} */
const option = new NzOptionComponent();
option.nzValue = this.searchValue;
option.nzLabel = this.searchValue;
this.addedTagOption = option;
this.updateActivatedOption(option);
}
else {
this.addedTagOption = null;
}
}
/**
* @return {?}
*/
updateListOfFilteredOption() {
this.updateAddTagOption();
/** @type {?} */
const listOfFilteredOption = new NzFilterOptionPipe().transform(this.listOfTagAndTemplateOption, this.searchValue, this.filterOption, this.serverSearch);
this.listOfFilteredOption = this.addedTagOption ? [this.addedTagOption, ...listOfFilteredOption] : [...listOfFilteredOption];
this.isShowNotFound = !this.isTagsMode && !this.listOfFilteredOption.length;
}
/**
* @return {?}
*/
clearInput() {
this.clearInput$.next();
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @param {?} emit
* @return {?}
*/
updateListOfSelectedValue(value, emit) {
this.listOfSelectedValueWithEmit$.next({ value, emit });
}
/**
* @param {?} option
* @return {?}
*/
updateActivatedOption(option) {
this.activatedOption$.next(option);
this.activatedOption = option;
}
/**
* @param {?} inputValue
* @param {?} tokenSeparators
* @return {?}
*/
tokenSeparate(inputValue, tokenSeparators) {
// auto tokenSeparators
if (inputValue &&
inputValue.length &&
tokenSeparators.length &&
this.isMultipleOrTags &&
this.includesSeparators(inputValue, tokenSeparators)) {
/** @type {?} */
const listOfLabel = this.splitBySeparators(inputValue, tokenSeparators);
this.updateSelectedValueByLabelList(listOfLabel);
this.clearInput();
}
}
/**
* @param {?} str
* @param {?} separators
* @return {?}
*/
includesSeparators(str, separators) {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < separators.length; ++i) {
if (str.lastIndexOf(separators[i]) > 0) {
return true;
}
}
return false;
}
/**
* @param {?} str
* @param {?} separators
* @return {?}
*/
splitBySeparators(str, separators) {
/** @type {?} */
const reg = new RegExp(`[${separators.join()}]`);
/** @type {?} */
const array = ((/** @type {?} */ (str))).split(reg).filter((/**
* @param {?} token
* @return {?}
*/
token => token));
return Array.from(new Set(array));
}
/**
* @return {?}
*/
resetActivatedOptionIfNeeded() {
/** @type {?} */
const resetActivatedOption = (/**
* @return {?}
*/
() => {
/** @type {?} */
const activatedOption = this.listOfFilteredOption.find((/**
* @param {?} item
* @return {?}
*/
item => this.compareWith(item.nzValue, this.listOfSelectedValue[0])));
this.updateActivatedOption(activatedOption || null);
});
if (this.activatedOption) {
if (!this.listOfFilteredOption.find((/**
* @param {?} item
* @return {?}
*/
item => this.compareWith(item.nzValue, this.activatedOption.nzValue))) ||
!this.listOfSelectedValue.find((/**
* @param {?} item
* @return {?}
*/
item => this.compareWith(item, this.activatedOption.nzValue)))) {
resetActivatedOption();
}
}
else {
resetActivatedOption();
}
}
/**
* @param {?} listOfNzOptionComponent
* @param {?} listOfNzOptionGroupComponent
* @return {?}
*/
updateTemplateOption(listOfNzOptionComponent, listOfNzOptionGroupComponent) {
this.mapOfTemplateOption$.next({ listOfNzOptionComponent, listOfNzOptionGroupComponent });
}
/**
* @param {?} value
* @return {?}
*/
updateSearchValue(value) {
this.searchValueRaw$.next(value);
}
/**
* @param {?} listOfLabel
* @return {?}
*/
updateSelectedValueByLabelList(listOfLabel) {
/** @type {?} */
const listOfSelectedValue = [...this.listOfSelectedValue];
/** @type {?} */
const listOfMatchOptionValue = this.listOfTagAndTemplateOption
.filter((/**
* @param {?} item
* @return {?}
*/
item => listOfLabel.indexOf(item.nzLabel) !== -1))
.map((/**
* @param {?} item
* @return {?}
*/
item => item.nzValue))
.filter((/**
* @param {?} item
* @return {?}
*/
item => !isNotNil(this.listOfSelectedValue.find((/**
* @param {?} v
* @return {?}
*/
v => this.compareWith(v, item))))));
if (this.isMultipleMode) {
this.updateListOfSelectedValue([...listOfSelectedValue, ...listOfMatchOptionValue], true);
}
else {
/** @type {?} */
const listOfUnMatchOptionValue = listOfLabel
.filter((/**
* @param {?} label
* @return {?}
*/
label => this.listOfTagAndTemplateOption
.map((/**
* @param {?} item
* @return {?}
*/
item => item.nzLabel)).indexOf(label) === -1));
this.updateListOfSelectedValue([...listOfSelectedValue, ...listOfMatchOptionValue, ...listOfUnMatchOptionValue], true);
}
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
/** @type {?} */
const keyCode = e.keyCode;
/** @type {?} */
const eventTarget = (/** @type {?} */ (e.target));
/** @type {?} */
const listOfFilteredOptionWithoutDisabled = this.listOfFilteredOption.filter((/**
* @param {?} item
* @return {?}
*/
item => !item.nzDisabled));
/** @type {?} */
const activatedIndex = listOfFilteredOptionWithoutDisabled.findIndex((/**
* @param {?} item
* @return {?}
*/
item => item === this.activatedOption));
switch (keyCode) {
case UP_ARROW:
e.preventDefault();
/** @type {?} */
const preIndex = activatedIndex > 0 ? (activatedIndex - 1) : (listOfFilteredOptionWithoutDisabled.length - 1);
this.updateActivatedOption(listOfFilteredOptionWithoutDisabled[preIndex]);
break;
case DOWN_ARROW:
e.preventDefault();
/** @type {?} */
const nextIndex = activatedIndex < listOfFilteredOptionWithoutDisabled.length - 1 ? (activatedIndex + 1) : 0;
this.updateActivatedOption(listOfFilteredOptionWithoutDisabled[nextIndex]);
if (!this.disabled && !this.open) {
this.setOpenState(true);
}
break;
case ENTER:
e.preventDefault();
if (this.open) {
if (this.activatedOption && !this.activatedOption.nzDisabled) {
this.clickOption(this.activatedOption);
}
}
else {
this.setOpenState(true);
}
break;
case BACKSPACE:
if (this.isMultipleOrTags && !eventTarget.value && this.listOfCachedSelectedOption.length) {
e.preventDefault();
this.removeValueFormSelected(this.listOfCachedSelectedOption[this.listOfCachedSelectedOption.length - 1]);
}
break;
case SPACE:
if (!this.disabled && !this.open) {
this.setOpenState(true);
event.preventDefault();
}
break;
case TAB:
this.setOpenState(false);
break;
}
}
// tslint:disable-next-line:no-any
/**
* @param {?} option
* @return {?}
*/
removeValueFormSelected(option) {
if (this.disabled || option.nzDisabled) {
return;
}
/** @type {?} */
const listOfSelectedValue = this.listOfSelectedValue.filter((/**
* @param {?} item
* @return {?}
*/
item => !this.compareWith(item, option.nzValue)));
this.updateListOfSelectedValue(listOfSelectedValue, true);
this.clearInput();
}
/**
* @param {?} value
* @return {?}
*/
setOpenState(value) {
this.openRaw$.next(value);
this.open = value;
}
/**
* @return {?}
*/
check() {
this.checkRaw$.next();
}
/**
* @return {?}
*/
get isSingleMode() {
return this.mode === 'default';
}
/**
* @return {?}
*/
get isTagsMode() {
return this.mode === 'tags';
}
/**
* @return {?}
*/
get isMultipleMode() {
return this.mode === 'multiple';
}
/**
* @return {?}
*/
get isMultipleOrTags() {
return this.mode === 'tags' || this.mode === 'multiple';
}
}
NzSelectService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOptionLiComponent {
/**
* @param {?} elementRef
* @param {?} nzSelectService
* @param {?} cdr
* @param {?} renderer
*/
constructor(elementRef, nzSelectService, cdr, renderer) {
this.elementRef = elementRef;
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.el = this.elementRef.nativeElement;
this.selected = false;
this.active = false;
this.destroy$ = new Subject();
renderer.addClass(elementRef.nativeElement, 'ant-select-dropdown-menu-item');
}
/**
* @return {?}
*/
clickOption() {
this.nzSelectService.clickOption(this.nzOption);
}
/**
* @return {?}
*/
ngOnInit() {
this.nzSelectService.listOfSelectedValue$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} list
* @return {?}
*/
list => {
this.selected = isNotNil(list.find((/**
* @param {?} v
* @return {?}
*/
v => this.nzSelectService.compareWith(v, this.nzOption.nzValue))));
this.cdr.markForCheck();
}));
this.nzSelectService.activatedOption$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} option
* @return {?}
*/
option => {
if (option) {
this.active = this.nzSelectService.compareWith(option.nzValue, this.nzOption.nzValue);
}
else {
this.active = false;
}
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzOptionLiComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-option-li]',
template: "<ng-container *ngIf=\"!nzOption.nzCustomContent; else nzOption.template\">\n {{nzOption.nzLabel}}\n</ng-container>\n<ng-container *ngIf=\"nzSelectService.isMultipleOrTags\">\n <i nz-icon type=\"check\" class=\"ant-select-selected-icon\" *ngIf=\"!nzMenuItemSelectedIcon; else nzMenuItemSelectedIcon\"></i>\n</ng-container>\n",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class.ant-select-dropdown-menu-item-selected]': 'selected && !nzOption.nzDisabled',
'[class.ant-select-dropdown-menu-item-disabled]': 'nzOption.nzDisabled',
'[class.ant-select-dropdown-menu-item-active]': 'active && !nzOption.nzDisabled',
'[attr.unselectable]': '"unselectable"',
'[style.user-select]': '"none"',
'(click)': 'clickOption()',
'(mousedown)': '$event.preventDefault()'
}
}] }
];
/** @nocollapse */
NzOptionLiComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: Renderer2 }
];
NzOptionLiComponent.propDecorators = {
nzOption: [{ type: Input }],
nzMenuItemSelectedIcon: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOptionContainerComponent {
/**
* @param {?} nzSelectService
* @param {?} cdr
* @param {?} ngZone
*/
constructor(nzSelectService, cdr, ngZone) {
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.ngZone = ngZone;
this.destroy$ = new Subject();
this.nzScrollToBottom = new EventEmitter();
}
/**
* @param {?} option
* @return {?}
*/
scrollIntoViewIfNeeded(option) {
// delay after open
setTimeout((/**
* @return {?}
*/
() => {
if (this.listOfNzOptionLiComponent && this.listOfNzOptionLiComponent.length && option) {
/** @type {?} */
const targetOption = this.listOfNzOptionLiComponent.find((/**
* @param {?} o
* @return {?}
*/
o => this.nzSelectService.compareWith(o.nzOption.nzValue, option.nzValue)));
/* tslint:disable-next-line:no-string-literal */
if (targetOption && targetOption.el && targetOption.el['scrollIntoViewIfNeeded']) {
/* tslint:disable-next-line:no-string-literal */
targetOption.el['scrollIntoViewIfNeeded'](false);
}
}
}));
}
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
trackLabel(_index, option) {
return option.nzLabel;
}
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
trackValue(_index, option) {
return option.nzValue;
}
/**
* @return {?}
*/
ngOnInit() {
this.nzSelectService.activatedOption$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} option
* @return {?}
*/
(option) => {
this.scrollIntoViewIfNeeded(option);
}));
this.nzSelectService.check$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
/** @type {?} */
const ul = this.dropdownUl.nativeElement;
fromEvent(ul, 'scroll').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
e => {
e.preventDefault();
e.stopPropagation();
if (ul && (ul.scrollHeight < (ul.clientHeight + ul.scrollTop + 10))) {
this.ngZone.run((/**
* @return {?}
*/
() => {
this.nzScrollToBottom.emit();
}));
}
}));
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzOptionContainerComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-option-container]',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
template: "<ul #dropdownUl\n class=\"ant-select-dropdown-menu ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical\"\n role=\"menu\"\n tabindex=\"0\">\n <li *ngIf=\"nzSelectService.isShowNotFound\"\n nz-select-unselectable\n class=\"ant-select-dropdown-menu-item ant-select-dropdown-menu-item-disabled\">\n <nz-embed-empty [nzComponentName]=\"'select'\" [specificContent]=\"nzNotFoundContent\"></nz-embed-empty>\n </li>\n <li nz-option-li\n *ngIf=\"nzSelectService.addedTagOption\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"nzSelectService.addedTagOption\">\n </li>\n <li nz-option-li\n *ngFor=\"let option of nzSelectService.listOfNzOptionComponent | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption : nzSelectService.serverSearch; trackBy: trackValue\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n <li class=\"ant-select-dropdown-menu-item-group\"\n *ngFor=\"let group of nzSelectService.listOfNzOptionGroupComponent | nzFilterGroupOption : nzSelectService.searchValue : nzSelectService.filterOption :nzSelectService.serverSearch; trackBy: trackLabel\">\n <div class=\"ant-select-dropdown-menu-item-group-title\"\n [attr.title]=\"group.isLabelString ? group.nzLabel : ''\">\n <ng-container *nzStringTemplateOutlet=\"group.nzLabel\"> {{group.nzLabel}} </ng-container>\n </div>\n <ul class=\"ant-select-dropdown-menu-item-group-list\">\n <li nz-option-li\n *ngFor=\"let option of group.listOfNzOptionComponent | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption :nzSelectService.serverSearch; trackBy: trackValue\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n </ul>\n </li>\n <li nz-option-li\n *ngFor=\"let option of nzSelectService.listOfTagOption | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption : nzSelectService.serverSearch; trackBy: trackValue \"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n</ul>\n"
}] }
];
/** @nocollapse */
NzOptionContainerComponent.ctorParameters = () => [
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: NgZone }
];
NzOptionContainerComponent.propDecorators = {
listOfNzOptionLiComponent: [{ type: ViewChildren, args: [NzOptionLiComponent,] }],
dropdownUl: [{ type: ViewChild, args: ['dropdownUl',] }],
nzNotFoundContent: [{ type: Input }],
nzMenuItemSelectedIcon: [{ type: Input }],
nzScrollToBottom: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzOptionGroupComponent {
constructor() {
this.isLabelString = false;
}
/**
* @param {?} value
* @return {?}
*/
set nzLabel(value) {
this.label = value;
this.isLabelString = !(this.nzLabel instanceof TemplateRef);
}
/**
* @return {?}
*/
get nzLabel() {
return this.label;
}
}
NzOptionGroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-option-group',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>"
}] }
];
NzOptionGroupComponent.propDecorators = {
listOfNzOptionComponent: [{ type: ContentChildren, args: [NzOptionComponent,] }],
nzLabel: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSelectTopControlComponent {
/**
* @param {?} renderer
* @param {?} nzSelectService
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(renderer, nzSelectService, cdr, noAnimation) {
this.renderer = renderer;
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.noAnimation = noAnimation;
this.isComposing = false;
this.destroy$ = new Subject();
this.nzShowSearch = false;
this.nzOpen = false;
this.nzAllowClear = false;
this.nzShowArrow = true;
this.nzLoading = false;
this.nzTokenSeparators = [];
}
/**
* @param {?} e
* @return {?}
*/
onClearSelection(e) {
e.stopPropagation();
this.nzSelectService.updateListOfSelectedValue([], true);
}
/**
* @param {?} value
* @return {?}
*/
setInputValue(value) {
if (this.inputElement) {
this.inputElement.nativeElement.value = value;
}
this.inputValue = value;
this.updateWidth();
this.nzSelectService.updateSearchValue(value);
this.nzSelectService.tokenSeparate(this.inputValue, this.nzTokenSeparators);
}
/**
* @return {?}
*/
get placeHolderDisplay() {
return this.inputValue || this.isComposing || this.nzSelectService.listOfSelectedValue.length ? 'none' : 'block';
}
/**
* @return {?}
*/
get selectedValueStyle() {
/** @type {?} */
let showSelectedValue = false;
/** @type {?} */
let opacity = 1;
if (!this.nzShowSearch) {
showSelectedValue = true;
}
else {
if (this.nzOpen) {
showSelectedValue = !(this.inputValue || this.isComposing);
if (showSelectedValue) {
opacity = 0.4;
}
}
else {
showSelectedValue = true;
}
}
return {
display: showSelectedValue ? 'block' : 'none',
opacity: `${opacity}`
};
}
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
trackValue(_index, option) {
return option.nzValue;
}
/**
* @return {?}
*/
updateWidth() {
if (this.nzSelectService.isMultipleOrTags && this.inputElement) {
if (this.inputValue || this.isComposing) {
this.renderer.setStyle(this.inputElement.nativeElement, 'width', `${this.inputElement.nativeElement.scrollWidth}px`);
}
else {
this.renderer.removeStyle(this.inputElement.nativeElement, 'width');
}
}
}
/**
* @param {?} option
* @param {?} e
* @return {?}
*/
removeSelectedValue(option, e) {
this.nzSelectService.removeValueFormSelected(option);
e.stopPropagation();
}
/**
* @return {?}
*/
ngOnInit() {
this.nzSelectService.open$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} open
* @return {?}
*/
open => {
if (this.inputElement && open) {
this.inputElement.nativeElement.focus();
}
}));
this.nzSelectService.clearInput$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.setInputValue('');
}));
this.nzSelectService.check$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzSelectTopControlComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-select-top-control]',
preserveWhitespaces: false,
animations: [zoomMotion],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-template #inputTemplate>\n <input #inputElement\n autocomplete=\"something-new\"\n class=\"ant-select-search__field\"\n (compositionstart)=\"isComposing = true\"\n (compositionend)=\"isComposing = false\"\n (input)=\"updateWidth()\"\n [ngModel]=\"inputValue\"\n (ngModelChange)=\"setInputValue($event)\"\n [disabled]=\"nzSelectService.disabled\">\n</ng-template>\n<div class=\"ant-select-selection__rendered\">\n <div *ngIf=\"nzPlaceHolder\"\n nz-select-unselectable\n [style.display]=\"placeHolderDisplay\"\n class=\"ant-select-selection__placeholder\">{{ nzPlaceHolder }}</div>\n <!--single mode-->\n <ng-container *ngIf=\"nzSelectService.isSingleMode\">\n <!--selected label-->\n <div *ngIf=\"nzSelectService.listOfCachedSelectedOption.length && nzSelectService.listOfSelectedValue.length\"\n class=\"ant-select-selection-selected-value\"\n [attr.title]=\"nzSelectService.listOfCachedSelectedOption[0]?.nzLabel\"\n [ngStyle]=\"selectedValueStyle\">\n {{ nzSelectService.listOfCachedSelectedOption[0]?.nzLabel }}\n </div>\n <!--show search-->\n <div *ngIf=\"nzShowSearch\"\n class=\"ant-select-search ant-select-search--inline\">\n <div class=\"ant-select-search__field__wrap\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n <span class=\"ant-select-search__field__mirror\">{{inputValue}} </span>\n </div>\n </div>\n </ng-container>\n <!--multiple or tags mode-->\n <ul *ngIf=\"nzSelectService.isMultipleOrTags\">\n <ng-container *ngFor=\"let option of nzSelectService.listOfCachedSelectedOption | slice: 0 : nzMaxTagCount;trackBy:trackValue;\">\n <li [@zoomMotion]\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [attr.title]=\"option.nzLabel\"\n [class.ant-select-selection__choice__disabled]=\"option.nzDisabled\"\n class=\"ant-select-selection__choice\">\n <div class=\"ant-select-selection__choice__content\">{{ option.nzLabel }}</div>\n <span *ngIf=\"!option.nzDisabled\"\n class=\"ant-select-selection__choice__remove\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"removeSelectedValue(option, $event)\">\n <i nz-icon type=\"close\" class=\"ant-select-remove-icon\" *ngIf=\"!nzRemoveIcon; else nzRemoveIcon\"></i>\n </span>\n </li>\n </ng-container>\n <li *ngIf=\"nzSelectService.listOfCachedSelectedOption.length > nzMaxTagCount\"\n [@zoomMotion]\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n class=\"ant-select-selection__choice\">\n <div class=\"ant-select-selection__choice__content\">\n <ng-container *ngIf=\"nzMaxTagPlaceholder\">\n <ng-template\n [ngTemplateOutlet]=\"nzMaxTagPlaceholder\"\n [ngTemplateOutletContext]=\"{ $implicit: nzSelectService.listOfSelectedValue | slice: nzMaxTagCount}\">\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!nzMaxTagPlaceholder\">\n + {{ nzSelectService.listOfCachedSelectedOption.length - nzMaxTagCount }} ...\n </ng-container>\n </div>\n </li>\n <li class=\"ant-select-search ant-select-search--inline\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n </li>\n </ul>\n</div>\n<span *ngIf=\"nzAllowClear && nzSelectService.listOfSelectedValue.length\"\n class=\"ant-select-selection__clear\"\n nz-select-unselectable\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onClearSelection($event)\">\n <i nz-icon type=\"close-circle\" theme=\"fill\" *ngIf=\"!nzClearIcon; else nzClearIcon\" class=\"ant-select-close-icon\"></i>\n </span>\n<span class=\"ant-select-arrow\" nz-select-unselectable *ngIf=\"nzShowArrow\">\n <i nz-icon type=\"loading\" *ngIf=\"nzLoading; else defaultArrow\"></i>\n <ng-template #defaultArrow>\n <i nz-icon type=\"down\" class=\"ant-select-arrow-icon\" *ngIf=\"!nzSuffixIcon; else nzSuffixIcon\"></i>\n </ng-template>\n</span>"
}] }
];
/** @nocollapse */
NzSelectTopControlComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzSelectTopControlComponent.propDecorators = {
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
nzShowSearch: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzOpen: [{ type: Input }],
nzMaxTagCount: [{ type: Input }],
nzAllowClear: [{ type: Input }],
nzShowArrow: [{ type: Input }],
nzLoading: [{ type: Input }],
nzSuffixIcon: [{ type: Input }],
nzClearIcon: [{ type: Input }],
nzRemoveIcon: [{ type: Input }],
nzMaxTagPlaceholder: [{ type: Input }],
nzTokenSeparators: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSelectUnselectableDirective {
}
NzSelectUnselectableDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-select-unselectable]',
host: {
'[attr.unselectable]': '"unselectable"',
'[style.user-select]': '"none"'
}
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSelectComponent {
/**
* @param {?} renderer
* @param {?} nzSelectService
* @param {?} cdr
* @param {?} focusMonitor
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(renderer, nzSelectService, cdr, focusMonitor, elementRef, noAnimation) {
this.renderer = renderer;
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.focusMonitor = focusMonitor;
this.noAnimation = noAnimation;
this.open = false;
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
this.dropDownPosition = 'bottom';
this._disabled = false;
this._autoFocus = false;
this.destroy$ = new Subject();
this.nzOnSearch = new EventEmitter();
this.nzScrollToBottom = new EventEmitter();
this.nzOpenChange = new EventEmitter();
this.nzBlur = new EventEmitter();
this.nzFocus = new EventEmitter();
this.nzSize = 'default';
this.nzDropdownMatchSelectWidth = true;
this.nzAllowClear = false;
this.nzShowSearch = false;
this.nzLoading = false;
this.nzShowArrow = true;
this.nzTokenSeparators = [];
renderer.addClass(elementRef.nativeElement, 'ant-select');
}
/**
* @param {?} value
* @return {?}
*/
set nzAutoClearSearchValue(value) {
this.nzSelectService.autoClearSearchValue = toBoolean(value);
}
/**
* @param {?} value
* @return {?}
*/
set nzMaxMultipleCount(value) {
this.nzSelectService.maxMultipleCount = value;
}
/**
* @param {?} value
* @return {?}
*/
set nzServerSearch(value) {
this.nzSelectService.serverSearch = toBoolean(value);
}
/**
* @param {?} value
* @return {?}
*/
set nzMode(value) {
this.nzSelectService.mode = value;
this.nzSelectService.check();
}
/**
* @param {?} value
* @return {?}
*/
set nzFilterOption(value) {
this.nzSelectService.filterOption = value;
}
/**
* @param {?} value
* @return {?}
*/
set compareWith(value) {
this.nzSelectService.compareWith = value;
}
/**
* @param {?} value
* @return {?}
*/
set nzAutoFocus(value) {
this._autoFocus = toBoolean(value);
this.updateAutoFocus();
}
/**
* @return {?}
*/
get nzAutoFocus() {
return this._autoFocus;
}
/**
* @param {?} value
* @return {?}
*/
set nzOpen(value) {
this.open = value;
this.nzSelectService.setOpenState(value);
}
/**
* @param {?} value
* @return {?}
*/
set nzDisabled(value) {
this._disabled = toBoolean(value);
this.nzSelectService.disabled = this._disabled;
this.nzSelectService.check();
if (this.nzDisabled) {
this.closeDropDown();
}
}
/**
* @return {?}
*/
get nzDisabled() {
return this._disabled;
}
/**
* @return {?}
*/
updateAutoFocus() {
if (this.nzSelectTopControlComponent.inputElement) {
if (this.nzAutoFocus) {
this.renderer.setAttribute(this.nzSelectTopControlComponent.inputElement.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.nzSelectTopControlComponent.inputElement.nativeElement, 'autofocus');
}
}
}
/**
* @return {?}
*/
focus() {
if (this.nzSelectTopControlComponent.inputElement) {
this.focusMonitor.focusVia(this.nzSelectTopControlComponent.inputElement, 'keyboard');
this.nzFocus.emit();
}
}
/**
* @return {?}
*/
blur() {
if (this.nzSelectTopControlComponent.inputElement) {
this.nzSelectTopControlComponent.inputElement.nativeElement.blur();
this.nzBlur.emit();
}
}
/**
* @param {?} event
* @return {?}
*/
onKeyDown(event) {
this.nzSelectService.onKeyDown(event);
}
/**
* @return {?}
*/
toggleDropDown() {
if (!this.nzDisabled) {
this.nzSelectService.setOpenState(!this.open);
}
}
/**
* @return {?}
*/
closeDropDown() {
this.nzSelectService.setOpenState(false);
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.dropDownPosition = position.connectionPair.originY;
}
/**
* @return {?}
*/
updateCdkConnectedOverlayStatus() {
this.triggerWidth = this.cdkOverlayOrigin.elementRef.nativeElement.getBoundingClientRect().width;
}
/**
* @return {?}
*/
updateCdkConnectedOverlayPositions() {
setTimeout((/**
* @return {?}
*/
() => {
if (this.cdkConnectedOverlay && this.cdkConnectedOverlay.overlayRef) {
this.cdkConnectedOverlay.overlayRef.updatePosition();
}
}));
}
/**
* update ngModel -> update listOfSelectedValue *
* @param {?} value
* @return {?}
*/
// tslint:disable-next-line:no-any
writeValue(value) {
this.value = value;
/** @type {?} */
let listValue = [];
if (isNotNil(value)) {
if (Array.isArray(value)) {
listValue = value;
}
else {
listValue = [value];
}
}
this.nzSelectService.updateListOfSelectedValue(listValue, false);
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnInit() {
this.nzSelectService.searchValue$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
this.nzOnSearch.emit(data);
this.updateCdkConnectedOverlayPositions();
}));
this.nzSelectService.modelChange$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} modelValue
* @return {?}
*/
modelValue => {
if (this.value !== modelValue) {
this.value = modelValue;
this.onChange(this.value);
this.updateCdkConnectedOverlayPositions();
}
}));
this.nzSelectService.open$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} value
* @return {?}
*/
(value) => {
if (this.open !== value) {
this.nzOpenChange.emit(value);
}
if (value) {
this.focus();
this.updateCdkConnectedOverlayStatus();
}
else {
this.blur();
this.onTouched();
}
this.open = value;
}));
this.nzSelectService.check$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.updateCdkConnectedOverlayStatus();
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.listOfNzOptionGroupComponent.changes.pipe(startWith(true), flatMap((/**
* @return {?}
*/
() => merge(this.listOfNzOptionGroupComponent.changes, this.listOfNzOptionComponent.changes, ...this.listOfNzOptionGroupComponent.map((/**
* @param {?} group
* @return {?}
*/
group => group.listOfNzOptionComponent ? group.listOfNzOptionComponent.changes : EMPTY))).pipe(startWith(true))))).subscribe((/**
* @return {?}
*/
() => {
this.nzSelectService.updateTemplateOption(this.listOfNzOptionComponent.toArray(), this.listOfNzOptionGroupComponent.toArray());
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzSelectComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-select',
preserveWhitespaces: false,
providers: [
NzSelectService,
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzSelectComponent)),
multi: true
}
],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
animations: [slideMotion],
template: "<div cdkOverlayOrigin\n nz-select-top-control\n tabindex=\"0\"\n class=\"ant-select-selection\"\n [nzOpen]=\"open\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [nzMaxTagPlaceholder]=\"nzMaxTagPlaceholder\"\n [nzPlaceHolder]=\"nzPlaceHolder\"\n [nzAllowClear]=\"nzAllowClear\"\n [nzMaxTagCount]=\"nzMaxTagCount\"\n [nzShowArrow]=\"nzShowArrow\"\n [nzLoading]=\"nzLoading\"\n [nzSuffixIcon]=\"nzSuffixIcon\"\n [nzClearIcon]=\"nzClearIcon\"\n [nzRemoveIcon]=\"nzRemoveIcon\"\n [nzShowSearch]=\"nzShowSearch\"\n [nzTokenSeparators]=\"nzTokenSeparators\"\n [class.ant-select-selection--single]=\"nzSelectService.isSingleMode\"\n [class.ant-select-selection--multiple]=\"nzSelectService.isMultipleOrTags\"\n (keydown)=\"onKeyDown($event)\">\n</div>\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayMinWidth]=\"nzDropdownMatchSelectWidth? null : triggerWidth\"\n [cdkConnectedOverlayWidth]=\"nzDropdownMatchSelectWidth? triggerWidth : null\"\n [cdkConnectedOverlayOrigin]=\"cdkOverlayOrigin\"\n (backdropClick)=\"closeDropDown()\"\n (detach)=\"closeDropDown();\"\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayOpen]=\"open\">\n <div\n class=\"ant-select-dropdown\"\n [class.ant-select-dropdown--single]=\"nzSelectService.isSingleMode\"\n [class.ant-select-dropdown--multiple]=\"nzSelectService.isMultipleOrTags\"\n [class.ant-select-dropdown-placement-bottomLeft]=\"dropDownPosition === 'bottom'\"\n [class.ant-select-dropdown-placement-topLeft]=\"dropDownPosition === 'top'\"\n [nzClassListAdd]=\"[nzDropdownClassName]\"\n [@slideMotion]=\"dropDownPosition\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [ngStyle]=\"nzDropdownStyle\">\n <div nz-option-container\n style=\"overflow: auto;transform: translateZ(0px);\"\n (keydown)=\"onKeyDown($event)\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzNotFoundContent]=\"nzNotFoundContent\"\n (nzScrollToBottom)=\"nzScrollToBottom.emit()\">\n </div>\n <ng-template [ngTemplateOutlet]=\"nzDropdownRender\"></ng-template>\n </div>\n</ng-template>\n<!--can not use ViewChild since it will match sub options in option group -->\n<ng-template>\n <ng-content></ng-content>\n</ng-template>",
host: {
'[class.ant-select-lg]': 'nzSize==="large"',
'[class.ant-select-sm]': 'nzSize==="small"',
'[class.ant-select-enabled]': '!nzDisabled',
'[class.ant-select-no-arrow]': '!nzShowArrow',
'[class.ant-select-disabled]': 'nzDisabled',
'[class.ant-select-allow-clear]': 'nzAllowClear',
'[class.ant-select-open]': 'open',
'(click)': 'toggleDropDown()'
},
styles: [`
.ant-select-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzSelectComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: FocusMonitor },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzSelectComponent.propDecorators = {
cdkOverlayOrigin: [{ type: ViewChild, args: [CdkOverlayOrigin,] }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
nzSelectTopControlComponent: [{ type: ViewChild, args: [NzSelectTopControlComponent,] }],
listOfNzOptionComponent: [{ type: ContentChildren, args: [NzOptionComponent,] }],
listOfNzOptionGroupComponent: [{ type: ContentChildren, args: [NzOptionGroupComponent,] }],
nzOnSearch: [{ type: Output }],
nzScrollToBottom: [{ type: Output }],
nzOpenChange: [{ type: Output }],
nzBlur: [{ type: Output }],
nzFocus: [{ type: Output }],
nzSize: [{ type: Input }],
nzDropdownClassName: [{ type: Input }],
nzDropdownMatchSelectWidth: [{ type: Input }],
nzDropdownStyle: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzAllowClear: [{ type: Input }],
nzShowSearch: [{ type: Input }],
nzLoading: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzMaxTagCount: [{ type: Input }],
nzDropdownRender: [{ type: Input }],
nzSuffixIcon: [{ type: Input }],
nzClearIcon: [{ type: Input }],
nzRemoveIcon: [{ type: Input }],
nzMenuItemSelectedIcon: [{ type: Input }],
nzShowArrow: [{ type: Input }],
nzTokenSeparators: [{ type: Input }],
nzMaxTagPlaceholder: [{ type: Input }],
nzAutoClearSearchValue: [{ type: Input }],
nzMaxMultipleCount: [{ type: Input }],
nzServerSearch: [{ type: Input }],
nzMode: [{ type: Input }],
nzFilterOption: [{ type: Input }],
compareWith: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzOpen: [{ type: Input }],
nzDisabled: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSelectComponent.prototype, "nzAllowClear", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSelectComponent.prototype, "nzShowSearch", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSelectComponent.prototype, "nzLoading", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSelectModule {
}
NzSelectModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
NzI18nModule,
FormsModule,
OverlayModule,
NzIconModule,
NzAddOnModule,
NzEmptyModule,
NzOverlayModule,
NzNoAnimationModule
],
declarations: [
NzFilterGroupOptionPipe,
NzFilterOptionPipe,
NzOptionComponent,
NzSelectComponent,
NzOptionContainerComponent,
NzOptionGroupComponent,
NzOptionLiComponent,
NzSelectTopControlComponent,
NzSelectUnselectableDirective
],
exports: [
NzOptionComponent,
NzSelectComponent,
NzOptionContainerComponent,
NzOptionGroupComponent,
NzSelectTopControlComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDateCellDirective {
}
NzDateCellDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzDateCell]'
},] }
];
class NzMonthCellDirective {
}
NzMonthCellDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzMonthCell]'
},] }
];
class NzDateFullCellDirective {
}
NzDateFullCellDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzDateFullCell]'
},] }
];
class NzMonthFullCellDirective {
}
NzMonthFullCellDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzMonthFullCell]'
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCalendarHeaderComponent {
/**
* @param {?} i18n
* @param {?} dateHelper
*/
constructor(i18n, dateHelper) {
this.i18n = i18n;
this.dateHelper = dateHelper;
this.mode = 'month';
this.modeChange = new EventEmitter();
this.fullscreen = true;
this.yearChange = new EventEmitter();
this.monthChange = new EventEmitter();
this._activeDate = new Date();
this.yearOffset = 10;
this.yearTotal = 20;
}
/**
* @param {?} value
* @return {?}
*/
set activeDate(value) {
this._activeDate = value;
this.setUpYears();
}
/**
* @return {?}
*/
get activeDate() {
return this._activeDate;
}
/**
* @return {?}
*/
get activeYear() {
return this.activeDate.getFullYear();
}
/**
* @return {?}
*/
get activeMonth() {
return this.activeDate.getMonth();
}
/**
* @return {?}
*/
get size() {
return this.fullscreen ? 'default' : 'small';
}
/**
* @return {?}
*/
get yearTypeText() {
return this.i18n.getLocale().Calendar.year;
}
/**
* @return {?}
*/
get monthTypeText() {
return this.i18n.getLocale().Calendar.month;
}
/**
* @return {?}
*/
ngOnInit() {
this.setUpYears();
this.setUpMonths();
}
/**
* @param {?} year
* @return {?}
*/
updateYear(year) {
this.yearChange.emit(year);
this.setUpYears(year);
}
/**
* @private
* @param {?=} year
* @return {?}
*/
setUpYears(year) {
/** @type {?} */
const start = (year || this.activeYear) - this.yearOffset;
/** @type {?} */
const end = start + this.yearTotal;
this.years = [];
for (let i = start; i < end; i++) {
this.years.push({ label: `${i}`, value: i });
}
}
/**
* @private
* @return {?}
*/
setUpMonths() {
this.months = [];
for (let i = 0; i < 12; i++) {
/** @type {?} */
const dateInMonth = setMonth(this.activeDate, i);
/** @type {?} */
const monthText = this.dateHelper.format(dateInMonth, 'MMM');
this.months.push({ label: monthText, value: i });
}
}
}
NzCalendarHeaderComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-calendar-header',
template: "<nz-select class=\"ant-fullcalendar-year-select\" [nzSize]=\"size\" [nzDropdownMatchSelectWidth]=\"false\"\n [ngModel]=\"activeYear\" (ngModelChange)=\"updateYear($event)\">\n <nz-option *ngFor=\"let year of years\" [nzLabel]=\"year.label\" [nzValue]=\"year.value\"></nz-option>\n</nz-select>\n\n<nz-select *ngIf=\"mode === 'month'\" class=\"ant-fullcalendar-month-select\" [nzSize]=\"size\" [nzDropdownMatchSelectWidth]=\"false\"\n [ngModel]=\"activeMonth\" (ngModelChange)=\"monthChange.emit($event)\">\n <nz-option *ngFor=\"let month of months\" [nzLabel]=\"month.label\" [nzValue]=\"month.value\"></nz-option>\n</nz-select>\n\n<nz-radio-group [(ngModel)]=\"mode\" (ngModelChange)=\"modeChange.emit($event)\" [nzSize]=\"size\">\n <label nz-radio-button nzValue=\"month\">{{ monthTypeText }}</label>\n <label nz-radio-button nzValue=\"year\">{{ yearTypeText }}</label>\n</nz-radio-group>\n",
host: {
'[style.display]': `'block'`,
'[class.ant-fullcalendar-header]': `true`
}
}] }
];
/** @nocollapse */
NzCalendarHeaderComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: DateHelperService$$1 }
];
NzCalendarHeaderComponent.propDecorators = {
mode: [{ type: Input }],
modeChange: [{ type: Output }],
fullscreen: [{ type: Input }],
activeDate: [{ type: Input }],
yearChange: [{ type: Output }],
monthChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCalendarComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
*/
constructor(i18n, cdr, dateHelper) {
this.i18n = i18n;
this.cdr = cdr;
this.dateHelper = dateHelper;
this.nzMode = 'month';
this.nzModeChange = new EventEmitter();
this.nzPanelChange = new EventEmitter();
this.nzSelectChange = new EventEmitter();
this.nzValueChange = new EventEmitter();
this.fullscreen = true;
this.daysInWeek = [];
this.monthsInYear = [];
this.dateMatrix = [];
this.activeDate = new Date();
this.currentDateRow = -1;
this.currentDateCol = -1;
this.activeDateRow = -1;
this.activeDateCol = -1;
this.currentMonthRow = -1;
this.currentMonthCol = -1;
this.activeMonthRow = -1;
this.activeMonthCol = -1;
this.dateCell = null;
this.dateFullCell = null;
this.monthCell = null;
this.monthFullCell = null;
this.currentDate = new Date();
this.onChangeFn = (/**
* @return {?}
*/
() => { });
this.onTouchFn = (/**
* @return {?}
*/
() => { });
}
/**
* @param {?} value
* @return {?}
*/
set nzValue(value) { this.updateDate(value, false); }
/**
* @param {?} value
* @return {?}
*/
set nzDateCell(value) { this.dateCell = value; }
/**
* @param {?} value
* @return {?}
*/
set nzDateFullCell(value) { this.dateFullCell = value; }
/**
* @param {?} value
* @return {?}
*/
set nzMonthCell(value) { this.monthCell = value; }
/**
* @param {?} value
* @return {?}
*/
set nzMonthFullCell(value) { this.monthFullCell = value; }
/**
* @param {?} value
* @return {?}
*/
set nzFullscreen(value) { this.fullscreen = coerceBooleanProperty(value); }
/**
* @return {?}
*/
get nzFullscreen() { return this.fullscreen; }
/**
* @param {?} value
* @return {?}
*/
set nzCard(value) { this.fullscreen = !coerceBooleanProperty(value); }
/**
* @return {?}
*/
get nzCard() { return !this.fullscreen; }
/**
* @param {?} value
* @return {?}
*/
set dateCellChild(value) { if (value) {
this.dateCell = value;
} }
/**
* @param {?} value
* @return {?}
*/
set dateFullCellChild(value) { if (value) {
this.dateFullCell = value;
} }
/**
* @param {?} value
* @return {?}
*/
set monthCellChild(value) { if (value) {
this.monthCell = value;
} }
/**
* @param {?} value
* @return {?}
*/
set monthFullCellChild(value) { if (value) {
this.monthFullCell = value;
} }
/**
* @private
* @return {?}
*/
get calendarStart() {
return startOfWeek(startOfMonth(this.activeDate), { weekStartsOn: this.dateHelper.getFirstDayOfWeek() });
}
/**
* @return {?}
*/
ngOnInit() {
this.setUpDaysInWeek();
this.setUpMonthsInYear();
this.setUpDateMatrix();
this.calculateCurrentDate();
this.calculateActiveDate();
this.calculateCurrentMonth();
this.calculateActiveMonth();
}
/**
* @param {?} mode
* @return {?}
*/
onModeChange(mode) {
this.nzModeChange.emit(mode);
this.nzPanelChange.emit({ 'date': this.activeDate, 'mode': mode });
}
/**
* @param {?} date
* @return {?}
*/
onDateSelect(date) {
this.updateDate(date);
this.nzSelectChange.emit(date);
}
/**
* @param {?} year
* @return {?}
*/
onYearSelect(year) {
/** @type {?} */
const date = setYear(this.activeDate, year);
this.updateDate(date);
this.nzSelectChange.emit(date);
}
/**
* @param {?} month
* @return {?}
*/
onMonthSelect(month) {
/** @type {?} */
const date = setMonth(this.activeDate, month);
this.updateDate(date);
this.nzSelectChange.emit(date);
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.updateDate(value || new Date(), false);
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChangeFn = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouchFn = fn;
}
/**
* @private
* @param {?} date
* @param {?=} touched
* @return {?}
*/
updateDate(date, touched = true) {
/** @type {?} */
const dayChanged = !isSameDay(date, this.activeDate);
/** @type {?} */
const monthChanged = !isSameMonth(date, this.activeDate);
/** @type {?} */
const yearChanged = !isSameYear(date, this.activeDate);
this.activeDate = date;
if (dayChanged) {
this.calculateActiveDate();
}
if (monthChanged) {
this.setUpDateMatrix();
this.calculateCurrentDate();
this.calculateActiveMonth();
}
if (yearChanged) {
this.calculateCurrentMonth();
}
if (touched) {
this.onChangeFn(date);
this.onTouchFn();
this.nzValueChange.emit(date);
}
}
/**
* @private
* @return {?}
*/
setUpDaysInWeek() {
this.daysInWeek = [];
/** @type {?} */
const weekStart = startOfWeek(this.activeDate, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() });
for (let i = 0; i < 7; i++) {
/** @type {?} */
const date = addDays(weekStart, i);
/** @type {?} */
const title = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'E' : 'ddd');
/** @type {?} */
const label = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'EEEEEE' : 'dd');
this.daysInWeek.push({ title, label });
}
}
/**
* @private
* @return {?}
*/
setUpMonthsInYear() {
this.monthsInYear = [];
for (let i = 0; i < 12; i++) {
/** @type {?} */
const date = setMonth(this.activeDate, i);
/** @type {?} */
const title = this.dateHelper.format(date, 'MMM');
/** @type {?} */
const label = this.dateHelper.format(date, 'MMM');
/** @type {?} */
const start = startOfMonth(date);
this.monthsInYear.push({ title, label, start });
}
}
/**
* @private
* @return {?}
*/
setUpDateMatrix() {
this.dateMatrix = [];
/** @type {?} */
const monthStart = startOfMonth(this.activeDate);
/** @type {?} */
const monthEnd = endOfMonth(this.activeDate);
/** @type {?} */
const weekDiff = differenceInCalendarWeeks(monthEnd, monthStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }) + 2;
for (let week = 0; week < weekDiff; week++) {
/** @type {?} */
const row = [];
/** @type {?} */
const weekStart = addDays(this.calendarStart, week * 7);
for (let day = 0; day < 7; day++) {
/** @type {?} */
const date = addDays(weekStart, day);
/** @type {?} */
const monthDiff = differenceInCalendarMonths(date, this.activeDate);
/** @type {?} */
const dateFormat = this.dateHelper.relyOnDatePipe ? 'longDate' : this.i18n.getLocaleData('DatePicker.lang.dateFormat', 'YYYY-MM-DD');
/** @type {?} */
const title = this.dateHelper.format(date, dateFormat);
/** @type {?} */
const label = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'dd' : 'DD');
/** @type {?} */
const rel = monthDiff === 0 ? 'current' : monthDiff < 0 ? 'last' : 'next';
row.push({ title, label, rel, value: date });
}
this.dateMatrix.push(row);
}
}
/**
* @private
* @return {?}
*/
calculateCurrentDate() {
if (isThisMonth(this.activeDate)) {
this.currentDateRow = differenceInCalendarWeeks(this.currentDate, this.calendarStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() });
this.currentDateCol = differenceInCalendarDays(this.currentDate, addDays(this.calendarStart, this.currentDateRow * 7));
}
else {
this.currentDateRow = -1;
this.currentDateCol = -1;
}
}
/**
* @private
* @return {?}
*/
calculateActiveDate() {
this.activeDateRow = differenceInCalendarWeeks(this.activeDate, this.calendarStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() });
this.activeDateCol = differenceInCalendarDays(this.activeDate, addDays(this.calendarStart, this.activeDateRow * 7));
}
/**
* @private
* @return {?}
*/
calculateCurrentMonth() {
if (isThisYear(this.activeDate)) {
/** @type {?} */
const yearStart = startOfYear(this.currentDate);
/** @type {?} */
const monthDiff = differenceInCalendarMonths(this.currentDate, yearStart);
this.currentMonthRow = Math.floor(monthDiff / 3);
this.currentMonthCol = monthDiff % 3;
}
else {
this.currentMonthRow = -1;
this.currentMonthCol = -1;
}
}
/**
* @private
* @return {?}
*/
calculateActiveMonth() {
this.activeMonthRow = Math.floor(this.activeDate.getMonth() / 3);
this.activeMonthCol = this.activeDate.getMonth() % 3;
}
}
NzCalendarComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-calendar',
template: "<nz-calendar-header [fullscreen]=\"fullscreen\" [activeDate]=\"activeDate\"\n [(mode)]=\"nzMode\" (modeChange)=\"onModeChange($event)\"\n (yearChange)=\"onYearSelect($event)\" (monthChange)=\"onMonthSelect($event)\">\n</nz-calendar-header>\n\n<div class=\"ant-fullcalendar ant-fullcalendar-full\" [ngClass]=\"fullscreen ? 'ant-fullcalendar-fullscreen' : ''\">\n <div class=\"ant-fullcalendar-calendar-body\">\n <ng-container *ngIf=\"nzMode === 'month' then monthModeTable else yearModeTable\"></ng-container>\n </div>\n</div>\n\n<ng-template #monthModeTable>\n <table class=\"ant-fullcalendar-table\" cellspacing=\"0\" role=\"grid\">\n <thead>\n <tr role=\"row\">\n <th *ngFor=\"let day of daysInWeek\" class=\"ant-fullcalendar-column-header\" role=\"columnheader\" [title]=\"day.title\">\n <span class=\"ant-fullcalendar-column-header-inner\">{{ day.label }}</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"ant-fullcalendar-tbody\">\n <tr *ngFor=\"let week of dateMatrix; index as row\"\n [class.ant-fullcalendar-current-week]=\"row === currentDateRow\"\n [class.ant-fullcalendar-active-week]=\"row === activeDateRow\">\n <td *ngFor=\"let day of week; index as col\" role=\"gridcell\" class=\"ant-fullcalendar-cell\" [title]=\"day.title\"\n [class.ant-fullcalendar-today]=\"row === currentDateRow && col === currentDateCol\"\n [class.ant-fullcalendar-selected-day]=\"row === activeDateRow && col === activeDateCol\"\n [class.ant-fullcalendar-last-month-cell]=\"day.rel === 'last'\"\n [class.ant-fullcalendar-next-month-btn-day]=\"day.rel === 'next'\"\n (click)=\"onDateSelect(day.value)\">\n <div class=\"ant-fullcalendar-date\">\n <ng-container *ngIf=\"dateFullCell else defaultCell\">\n <ng-container *ngTemplateOutlet=\"dateFullCell; context: {$implicit: day.value}\"></ng-container>\n </ng-container>\n <ng-template #defaultCell>\n <div class=\"ant-fullcalendar-value\">{{ day.label }}</div>\n <div *ngIf=\"dateCell\" class=\"ant-fullcalendar-content\">\n <ng-container *ngTemplateOutlet=\"dateCell; context: {$implicit: day.value}\"></ng-container>\n </div>\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</ng-template>\n\n<ng-template #yearModeTable>\n <table class=\"ant-fullcalendar-month-panel-table\" cellspacing=\"0\" role=\"grid\">\n <tbody class=\"ant-fullcalendar-month-panel-tbody\">\n <tr *ngFor=\"let row of [0, 1, 2, 3]\" role=\"row\">\n <td *ngFor=\"let col of [0, 1, 2]\" role=\"gridcell\" [title]=\"monthsInYear[row * 3 + col].title\"\n class=\"ant-fullcalendar-month-panel-cell\"\n [class.ant-fullcalendar-month-panel-current-cell]=\"row === currentMonthRow && col === currentMonthCol\"\n [class.ant-fullcalendar-month-panel-selected-cell]=\"row === activeMonthRow && col === activeMonthCol\"\n (click)=\"onMonthSelect(row * 3 + col)\">\n <div class=\"ant-fullcalendar-month\">\n <ng-container *ngIf=\"monthFullCell else defaultCell\">\n <ng-container *ngTemplateOutlet=\"monthFullCell; context: {$implicit: monthsInYear[row * 3 + col].start}\"></ng-container>\n </ng-container>\n <ng-template #defaultCell>\n <div class=\"ant-fullcalendar-value\">{{ monthsInYear[row * 3 + col].label }}</div>\n <div *ngIf=\"monthCell\" class=\"ant-fullcalendar-content\">\n <ng-container *ngTemplateOutlet=\"monthCell; context: {$implicit: monthsInYear[row * 3 + col].start}\"></ng-container>\n </div>\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</ng-template>\n",
providers: [
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((/**
* @return {?}
*/
() => NzCalendarComponent)), multi: true }
]
}] }
];
/** @nocollapse */
NzCalendarComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 }
];
NzCalendarComponent.propDecorators = {
nzMode: [{ type: Input }],
nzModeChange: [{ type: Output }],
nzPanelChange: [{ type: Output }],
nzSelectChange: [{ type: Output }],
nzValue: [{ type: Input }],
nzValueChange: [{ type: Output }],
nzDateCell: [{ type: Input }],
nzDateFullCell: [{ type: Input }],
nzMonthCell: [{ type: Input }],
nzMonthFullCell: [{ type: Input }],
nzFullscreen: [{ type: Input }],
nzCard: [{ type: Input }],
dateCellChild: [{ type: ContentChild, args: [NzDateCellDirective, { read: TemplateRef },] }],
dateFullCellChild: [{ type: ContentChild, args: [NzDateFullCellDirective, { read: TemplateRef },] }],
monthCellChild: [{ type: ContentChild, args: [NzMonthCellDirective, { read: TemplateRef },] }],
monthFullCellChild: [{ type: ContentChild, args: [NzMonthFullCellDirective, { read: TemplateRef },] }],
fullscreen: [{ type: HostBinding, args: ['class.ant-fullcalendar--fullscreen',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCalendarModule {
}
NzCalendarModule.decorators = [
{ type: NgModule, args: [{
declarations: [
NzCalendarHeaderComponent,
NzCalendarComponent,
NzDateCellDirective,
NzDateFullCellDirective,
NzMonthCellDirective,
NzMonthFullCellDirective
],
exports: [
NzCalendarComponent,
NzDateCellDirective,
NzDateFullCellDirective,
NzMonthCellDirective,
NzMonthFullCellDirective
],
imports: [CommonModule, FormsModule, NzI18nModule, NzRadioModule, NzSelectModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardGridDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
renderer.addClass(elementRef.nativeElement, 'ant-card-grid');
}
}
NzCardGridDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-card-grid]'
},] }
];
/** @nocollapse */
NzCardGridDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardLoadingComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
renderer.addClass(elementRef.nativeElement, 'ant-card-loading-content');
}
}
NzCardLoadingComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-card-loading',
template: "<div class=\"ant-card-loading-content\">\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-22\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-8\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-15\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-6\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-18\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-13\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-9\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-4\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-3\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-16\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n <div class=\"ant-row\" style=\"margin-left: -4px; margin-right: -4px;\">\n <div class=\"ant-col-8\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-6\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n <div class=\"ant-col-8\" style=\"padding-left: 4px; padding-right: 4px;\">\n <div class=\"ant-card-loading-block\"></div>\n </div>\n </div>\n</div>",
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styles: [`
nz-card-loading {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzCardLoadingComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardMetaComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
renderer.addClass(elementRef.nativeElement, 'ant-card-meta');
}
}
NzCardMetaComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-card-meta',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div class=\"ant-card-meta-avatar\" *ngIf=\"nzAvatar\">\n <ng-template [ngTemplateOutlet]=\"nzAvatar\"></ng-template>\n</div>\n<div class=\"ant-card-meta-detail\" *ngIf=\"nzTitle || nzDescription\">\n <div class=\"ant-card-meta-title\" *ngIf=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-card-meta-description\" *ngIf=\"nzDescription\">\n <ng-container *nzStringTemplateOutlet=\"nzDescription\">{{ nzDescription }}</ng-container>\n </div>\n</div>",
styles: [`
nz-card-meta {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzCardMetaComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzCardMetaComponent.propDecorators = {
nzTitle: [{ type: Input }],
nzDescription: [{ type: Input }],
nzAvatar: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardTabComponent {
}
NzCardTabComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-card-tab',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>"
}] }
];
NzCardTabComponent.propDecorators = {
template: [{ type: ViewChild, args: [TemplateRef,] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardComponent {
/**
* @param {?} renderer
* @param {?} elementRef
*/
constructor(renderer, elementRef) {
this.nzBordered = true;
this.nzLoading = false;
this.nzHoverable = false;
this.nzActions = [];
renderer.addClass(elementRef.nativeElement, 'ant-card');
}
}
NzCardComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-card',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div class=\"ant-card-head\" *ngIf=\"nzTitle || nzExtra || tab\">\n <div class=\"ant-card-head-wrapper\">\n <div class=\"ant-card-head-title\" *ngIf=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-card-extra\" *ngIf=\"nzExtra\">\n <ng-container *nzStringTemplateOutlet=\"nzExtra\">{{ nzExtra }}</ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"tab\">\n <ng-template [ngTemplateOutlet]=\"tab.template\"></ng-template>\n </ng-container>\n</div>\n<div class=\"ant-card-cover\" *ngIf=\"nzCover\">\n <ng-template [ngTemplateOutlet]=\"nzCover\"></ng-template>\n</div>\n<div class=\"ant-card-body\" [ngStyle]=\"nzBodyStyle\">\n <ng-container *ngIf=\"!nzLoading\">\n <ng-content></ng-content>\n </ng-container>\n <nz-card-loading *ngIf=\"nzLoading\"></nz-card-loading>\n</div>\n<ul class=\"ant-card-actions\" *ngIf=\"nzActions.length\">\n <li *ngFor=\"let action of nzActions\" [style.width.%]=\"100 / nzActions.length\">\n <span><ng-template [ngTemplateOutlet]=\"action\"></ng-template></span>\n </li>\n</ul>",
host: {
'[class.ant-card-loading]': 'nzLoading',
'[class.ant-card-bordered]': 'nzBordered',
'[class.ant-card-hoverable]': 'nzHoverable',
'[class.ant-card-type-inner]': `nzType === 'inner'`,
'[class.ant-card-contain-tabs]': '!!tab'
},
styles: [`
nz-card {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzCardComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ElementRef }
];
NzCardComponent.propDecorators = {
nzBordered: [{ type: Input }],
nzLoading: [{ type: Input }],
nzHoverable: [{ type: Input }],
nzBodyStyle: [{ type: Input }],
nzCover: [{ type: Input }],
nzActions: [{ type: Input }],
nzType: [{ type: Input }],
nzTitle: [{ type: Input }],
nzExtra: [{ type: Input }],
tab: [{ type: ContentChild, args: [NzCardTabComponent,] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCardComponent.prototype, "nzBordered", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCardComponent.prototype, "nzLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCardComponent.prototype, "nzHoverable", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCardModule {
}
NzCardModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzAddOnModule],
declarations: [NzCardComponent, NzCardGridDirective, NzCardMetaComponent, NzCardLoadingComponent, NzCardTabComponent],
exports: [NzCardComponent, NzCardGridDirective, NzCardMetaComponent, NzCardLoadingComponent, NzCardTabComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCarouselContentDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this._active = false;
this._width = 0;
this._fadeMode = false;
this.el = this.elementRef.nativeElement;
renderer.addClass(elementRef.nativeElement, 'slick-slide');
}
/**
* @param {?} value
* @return {?}
*/
set width(value) {
this._width = value;
this.renderer.setStyle(this.el, 'width', `${this.width}px`);
}
/**
* @return {?}
*/
get width() {
return this._width;
}
/**
* @param {?} value
* @return {?}
*/
set left(value) {
this._left = value;
if (isNotNil(this.left)) {
this.renderer.setStyle(this.el, 'left', `${this.left}px`);
}
else {
this.renderer.removeStyle(this.el, 'left');
}
}
/**
* @return {?}
*/
get left() {
return this._left;
}
/**
* @param {?} value
* @return {?}
*/
set top(value) {
this._top = value;
if (isNotNil(this.top)) {
this.renderer.setStyle(this.el, 'top', `${this.top}px`);
}
else {
this.renderer.removeStyle(this.el, 'top');
}
}
/**
* @return {?}
*/
get top() {
return this._top;
}
/**
* @param {?} value
* @return {?}
*/
set isActive(value) {
this._active = value;
this.updateOpacity();
if (this.isActive) {
this.renderer.addClass(this.el, 'slick-active');
}
else {
this.renderer.removeClass(this.el, 'slick-active');
}
}
/**
* @return {?}
*/
get isActive() {
return this._active;
}
/**
* @param {?} value
* @return {?}
*/
set fadeMode(value) {
this._fadeMode = value;
if (this.fadeMode) {
this.renderer.setStyle(this.el, 'position', 'relative');
}
else {
this.renderer.removeStyle(this.el, 'position');
}
this.updateOpacity();
}
/**
* @return {?}
*/
get fadeMode() {
return this._fadeMode;
}
/**
* @return {?}
*/
ngOnInit() {
this.renderer.setStyle(this.el, 'transition', 'opacity 500ms ease');
}
/**
* @private
* @return {?}
*/
updateOpacity() {
if (this.fadeMode) {
this.renderer.setStyle(this.el, 'opacity', this.isActive ? 1 : 0);
}
}
}
NzCarouselContentDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-carousel-content]'
},] }
];
/** @nocollapse */
NzCarouselContentDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCarouselComponent {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} cdr
* @param {?} ngZone
*/
constructor(elementRef, renderer, cdr, ngZone) {
this.elementRef = elementRef;
this.renderer = renderer;
this.cdr = cdr;
this.ngZone = ngZone;
this.nzTransitionSpeed = 500; // Not exposed.
this.nzEffect = 'scrollx';
this.nzEnableSwipe = true;
this.nzDots = true;
this.nzVertical = false;
this.nzAutoPlay = false;
this.nzAutoPlaySpeed = 3000; // Should be nzAutoPlayDuration, but changing this is breaking.
// Should be nzAutoPlayDuration, but changing this is breaking.
this.nzAfterChange = new EventEmitter();
this.nzBeforeChange = new EventEmitter();
this.activeIndex = 0;
this.transform = 'translate3d(0px, 0px, 0px)';
this.el = this.elementRef.nativeElement;
this.subs_ = new Subscription();
renderer.addClass(elementRef.nativeElement, 'ant-carousel');
}
/**
* @return {?}
*/
get nextIndex() {
return this.activeIndex < this.slideContents.length - 1 ? (this.activeIndex + 1) : 0;
}
/**
* @return {?}
*/
get prevIndex() {
return this.activeIndex > 0 ? (this.activeIndex - 1) : (this.slideContents.length - 1);
}
/**
* @return {?}
*/
ngAfterContentInit() {
if (this.slideContents && this.slideContents.length) {
this.slideContents.first.isActive = true;
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
// Re-render when content changes.
this.subs_.add(this.slideContents.changes.subscribe((/**
* @return {?}
*/
() => {
this.renderContent();
})));
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
this.subs_.add(fromEvent(window, 'resize').pipe(debounceTime(50)).subscribe((/**
* @return {?}
*/
() => {
this.renderContent();
this.setTransition();
})));
}));
// When used in modals (drawers maybe too), it should render itself asynchronously.
// Refer to https://github.com/NG-ZORRO/ng-zorro-antd/issues/2387
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.renderContent();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzAutoPlay || changes.nzAutoPlaySpeed) {
this.setUpNextScroll();
}
if (changes.nzEffect) {
this.updateMode();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.subs_.unsubscribe();
this.clearTimeout();
}
/**
* @param {?} index
* @return {?}
*/
setContentActive(index) {
if (this.slideContents && this.slideContents.length) {
this.nzBeforeChange.emit({ from: this.slideContents.toArray().findIndex((/**
* @param {?} slide
* @return {?}
*/
slide => slide.isActive)), to: index });
this.activeIndex = index;
this.setTransition();
this.slideContents.forEach((/**
* @param {?} slide
* @param {?} i
* @return {?}
*/
(slide, i) => slide.isActive = index === i));
this.setUpNextScroll();
this.cdr.markForCheck();
// Should trigger the following when animation is done. The transition takes 0.5 seconds according to the CSS.
setTimeout((/**
* @return {?}
*/
() => this.nzAfterChange.emit(index)), this.nzTransitionSpeed);
}
}
/**
* @private
* @return {?}
*/
setTransition() {
this.transform = this.nzEffect === 'fade'
? 'translate3d(0px, 0px, 0px)'
: this.nzVertical
// `Scrollx` mode.
? `translate3d(0px, ${-this.activeIndex * this.el.offsetHeight}px, 0px)`
: `translate3d(${-this.activeIndex * this.el.offsetWidth}px, 0px, 0px)`;
if (this.slickTrack) {
this.renderer.setStyle(this.slickTrack.nativeElement, 'transform', this.transform);
}
}
/**
* @return {?}
*/
next() {
this.setContentActive(this.nextIndex);
}
/**
* @return {?}
*/
pre() {
this.setContentActive(this.prevIndex);
}
/**
* @param {?} index
* @return {?}
*/
goTo(index) {
if (index >= 0 && index <= this.slideContents.length - 1) {
this.setContentActive(index);
}
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
if (e.keyCode === LEFT_ARROW) { // Left
this.pre();
e.preventDefault();
}
else if (e.keyCode === RIGHT_ARROW) { // Right
this.next();
e.preventDefault();
}
}
/**
* @param {?=} action
* @return {?}
*/
swipe(action = 'swipeleft') {
if (!this.nzEnableSwipe) {
return;
}
if (action === 'swipeleft') {
this.next();
}
if (action === 'swiperight') {
this.pre();
}
}
/* tslint:disable-next-line:no-any */
/**
* @param {?} e
* @return {?}
*/
swipeInProgress(e) {
if (this.nzEffect === 'scrollx') {
/** @type {?} */
const final = e.isFinal;
/** @type {?} */
const scrollWidth = final ? 0 : e.deltaX * 1.2;
/** @type {?} */
const totalWidth = this.el.offsetWidth;
if (this.nzVertical) {
/** @type {?} */
const totalHeight = this.el.offsetHeight;
/** @type {?} */
const scrollPercent = scrollWidth / totalWidth;
/** @type {?} */
const scrollHeight = scrollPercent * totalHeight;
this.transform = `translate3d(0px, ${-this.activeIndex * totalHeight + scrollHeight}px, 0px)`;
}
else {
this.transform = `translate3d(${-this.activeIndex * totalWidth + scrollWidth}px, 0px, 0px)`;
}
if (this.slickTrack) {
this.renderer.setStyle(this.slickTrack.nativeElement, 'transform', this.transform);
}
}
if (e.isFinal) {
this.setUpNextScroll();
}
else {
this.clearTimeout();
}
}
/**
* @return {?}
*/
clearTimeout() {
if (this.transitionAction) {
clearTimeout(this.transitionAction);
this.transitionAction = null;
}
}
/**
* Make a carousel scroll to `this.nextIndex` after `this.nzAutoPlaySpeed` milliseconds.
* @private
* @return {?}
*/
setUpNextScroll() {
this.clearTimeout();
if (this.nzAutoPlay && this.nzAutoPlaySpeed > 0) {
this.transitionAction = setTimeout((/**
* @return {?}
*/
() => {
this.setContentActive(this.nextIndex);
}), this.nzAutoPlaySpeed);
}
}
/**
* @private
* @return {?}
*/
updateMode() {
if (this.slideContents && this.slideContents.length) {
this.renderContent();
this.setContentActive(0);
}
}
/**
* @private
* @return {?}
*/
renderContent() {
/** @type {?} */
const slickTrackElement = this.slickTrack.nativeElement;
/** @type {?} */
const slickListElement = this.slickList.nativeElement;
if (this.slideContents && this.slideContents.length) {
this.slideContents.forEach((/**
* @param {?} content
* @param {?} i
* @return {?}
*/
(content, i) => {
content.width = this.el.offsetWidth;
if (this.nzEffect === 'fade') {
content.fadeMode = true;
if (this.nzVertical) {
content.top = -i * this.el.offsetHeight;
}
else {
content.left = -i * content.width;
}
}
else {
content.fadeMode = false;
content.left = null;
content.top = null;
}
}));
if (this.nzVertical) {
this.renderer.removeStyle(slickTrackElement, 'width');
this.renderer.removeStyle(slickListElement, 'width');
this.renderer.setStyle(slickListElement, 'height', `${this.slideContents.first.el.offsetHeight}px`);
this.renderer.setStyle(slickTrackElement, 'height', `${this.slideContents.length * this.el.offsetHeight}px`);
}
else {
this.renderer.removeStyle(slickTrackElement, 'height');
this.renderer.removeStyle(slickListElement, 'height');
this.renderer.removeStyle(slickTrackElement, 'width'); // This is necessary to prevent carousel items to overflow.
this.renderer.setStyle(slickTrackElement, 'width', `${this.slideContents.length * this.el.offsetWidth}px`);
}
this.setUpNextScroll();
this.cdr.markForCheck();
}
}
}
NzCarouselComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-carousel',
preserveWhitespaces: false,
template: "<div class=\"slick-initialized slick-slider\" [class.slick-vertical]=\"nzVertical\">\n <div\n class=\"slick-list\"\n #slickList\n tabindex=\"-1\"\n (keydown)=\"onKeyDown($event)\"\n (swipeleft)=\"swipe('swipeleft')\"\n (swiperight)=\"swipe('swiperight')\"\n (pan)=\"swipeInProgress($event);\">\n <div class=\"slick-track\" #slickTrack>\n <ng-content></ng-content>\n </div>\n </div>\n <ul class=\"slick-dots\" *ngIf=\"nzDots\">\n <li *ngFor=\"let content of slideContents; let i = index\" [class.slick-active]=\"content.isActive\" (click)=\"goTo(i)\">\n <ng-template [ngTemplateOutlet]=\"nzDotRender || renderDotTemplate\" [ngTemplateOutletContext]=\"{ $implicit: i }\"></ng-template>\n </li>\n </ul>\n</div>\n\n<ng-template #renderDotTemplate let-index>\n <button>{{index + 1}}</button>\n</ng-template>\n",
host: {
'[class.ant-carousel-vertical]': 'nzVertical'
},
styles: [`
nz-carousel {
display: block;
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
}
.slick-dots {
display: block;
}
.slick-track {
opacity: 1;
transition: all 0.5s ease;
}
.slick-slide {
transition: opacity 500ms ease;
}
`]
}] }
];
/** @nocollapse */
NzCarouselComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: NgZone }
];
NzCarouselComponent.propDecorators = {
slideContents: [{ type: ContentChildren, args: [NzCarouselContentDirective,] }],
slickList: [{ type: ViewChild, args: ['slickList',] }],
slickTrack: [{ type: ViewChild, args: ['slickTrack',] }],
nzTransitionSpeed: [{ type: Input }],
nzDotRender: [{ type: Input }],
nzEffect: [{ type: Input }],
nzEnableSwipe: [{ type: Input }],
nzDots: [{ type: Input }],
nzVertical: [{ type: Input }],
nzAutoPlay: [{ type: Input }],
nzAutoPlaySpeed: [{ type: Input }],
nzAfterChange: [{ type: Output }],
nzBeforeChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCarouselComponent.prototype, "nzEnableSwipe", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzCarouselComponent.prototype, "nzDots", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzCarouselComponent.prototype, "nzVertical", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCarouselComponent.prototype, "nzAutoPlay", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzCarouselComponent.prototype, "nzAutoPlaySpeed", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCarouselModule {
}
NzCarouselModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzCarouselComponent, NzCarouselContentDirective],
exports: [NzCarouselComponent, NzCarouselContentDirective],
imports: [CommonModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzAutoResizeDirective {
/**
* @param {?} elementRef
* @param {?} ngZone
* @param {?} ngControl
* @param {?} platform
*/
constructor(elementRef, ngZone, ngControl, platform) {
this.elementRef = elementRef;
this.ngZone = ngZone;
this.ngControl = ngControl;
this.platform = platform;
this._autosize = false;
this.el = this.elementRef.nativeElement;
this.destroy$ = new Subject();
this.inputGap = 10;
}
/**
* @param {?} value
* @return {?}
*/
set nzAutosize(value) {
if (typeof value === 'string') {
this._autosize = true;
}
else if (typeof value !== 'boolean') {
this._autosize = value;
this.minRows = value.minRows;
this.maxRows = value.maxRows;
this.setMaxHeight();
this.setMinHeight();
}
}
/**
* @return {?}
*/
get nzAutosize() {
return this._autosize;
}
/**
* @param {?=} force
* @return {?}
*/
resizeToFitContent(force = false) {
this.cacheTextareaLineHeight();
// If we haven't determined the line-height yet, we know we're still hidden and there's no point
// in checking the height of the textarea.
if (!this.cachedLineHeight) {
return;
}
/** @type {?} */
const textarea = (/** @type {?} */ (this.el));
/** @type {?} */
const value = textarea.value;
// Only resize if the value or minRows have changed since these calculations can be expensive.
if (!force && this.minRows === this.previousMinRows && value === this.previousValue) {
return;
}
/** @type {?} */
const placeholderText = textarea.placeholder;
// Reset the textarea height to auto in order to shrink back to its default size.
// Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.
// Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight
// value. To ensure that the scrollHeight is not bigger than the content, the placeholders
// need to be removed temporarily.
textarea.classList.add('cdk-textarea-autosize-measuring');
textarea.placeholder = '';
/** @type {?} */
const height = Math.round((textarea.scrollHeight - this.inputGap) / this.cachedLineHeight) * this.cachedLineHeight + this.inputGap;
// Use the scrollHeight to know how large the textarea *would* be if fit its entire value.
textarea.style.height = `${height}px`;
textarea.classList.remove('cdk-textarea-autosize-measuring');
textarea.placeholder = placeholderText;
// On Firefox resizing the textarea will prevent it from scrolling to the caret position.
// We need to re-set the selection in order for it to scroll to the proper position.
if (typeof requestAnimationFrame !== 'undefined') {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => requestAnimationFrame((/**
* @return {?}
*/
() => {
const { selectionStart, selectionEnd } = textarea;
// IE will throw an "Unspecified error" if we try to set the selection range after the
// element has been removed from the DOM. Assert that the directive hasn't been destroyed
// between the time we requested the animation frame and when it was executed.
// Also note that we have to assert that the textarea is focused before we set the
// selection range. Setting the selection range on a non-focused textarea will cause
// it to receive focus on IE and Edge.
if (!this.destroy$.isStopped && document.activeElement === textarea) {
textarea.setSelectionRange(selectionStart, selectionEnd);
}
}))));
}
this.previousValue = value;
this.previousMinRows = this.minRows;
}
/**
* @private
* @return {?}
*/
cacheTextareaLineHeight() {
if (this.cachedLineHeight) {
return;
}
// Use a clone element because we have to override some styles.
/** @type {?} */
const textareaClone = (/** @type {?} */ (this.el.cloneNode(false)));
textareaClone.rows = 1;
// Use `position: absolute` so that this doesn't cause a browser layout and use
// `visibility: hidden` so that nothing is rendered. Clear any other styles that
// would affect the height.
textareaClone.style.position = 'absolute';
textareaClone.style.visibility = 'hidden';
textareaClone.style.border = 'none';
textareaClone.style.padding = '0';
textareaClone.style.height = '';
textareaClone.style.minHeight = '';
textareaClone.style.maxHeight = '';
// In Firefox it happens that textarea elements are always bigger than the specified amount
// of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.
// As a workaround that removes the extra space for the scrollbar, we can just set overflow
// to hidden. This ensures that there is no invalid calculation of the line height.
// See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654
textareaClone.style.overflow = 'hidden';
this.el.parentNode.appendChild(textareaClone);
this.cachedLineHeight = textareaClone.clientHeight - this.inputGap - 1;
this.el.parentNode.removeChild(textareaClone);
// Min and max heights have to be re-calculated if the cached line height changes
this.setMinHeight();
this.setMaxHeight();
}
/**
* @return {?}
*/
setMinHeight() {
/** @type {?} */
const minHeight = this.minRows && this.cachedLineHeight ?
`${this.minRows * this.cachedLineHeight + this.inputGap}px` : null;
if (minHeight) {
this.el.style.minHeight = minHeight;
}
}
/**
* @return {?}
*/
setMaxHeight() {
/** @type {?} */
const maxHeight = this.maxRows && this.cachedLineHeight ?
`${this.maxRows * this.cachedLineHeight + this.inputGap}px` : null;
if (maxHeight) {
this.el.style.maxHeight = maxHeight;
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.nzAutosize && this.platform.isBrowser) {
if (this.ngControl) {
this.resizeToFitContent();
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
fromEvent(window, 'resize')
.pipe(auditTime(16), takeUntil(this.destroy$))
.subscribe((/**
* @return {?}
*/
() => this.resizeToFitContent(true)));
}));
this.ngControl.control.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => this.resizeToFitContent()));
}
else {
console.warn('nzAutosize must work with ngModel or ReactiveForm');
}
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzAutoResizeDirective.decorators = [
{ type: Directive, args: [{
selector: 'textarea[nzAutosize]',
host: {
// Textarea elements that have the directive applied should have a single row by default.
// Browsers normally show two rows by default and therefore this limits the minRows binding.
rows: '1'
}
},] }
];
/** @nocollapse */
NzAutoResizeDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: NgZone },
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }] },
{ type: Platform }
];
NzAutoResizeDirective.propDecorators = {
nzAutosize: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzInputDirective {
/**
* @param {?} ngControl
* @param {?} renderer
* @param {?} elementRef
*/
constructor(ngControl, renderer, elementRef) {
this.ngControl = ngControl;
this._disabled = false;
this.nzSize = 'default';
renderer.addClass(elementRef.nativeElement, 'ant-input');
}
/**
* @param {?} value
* @return {?}
*/
set disabled(value) {
this._disabled = toBoolean(value);
}
/**
* @return {?}
*/
get disabled() {
if (this.ngControl && this.ngControl.disabled !== null) {
return this.ngControl.disabled;
}
return this._disabled;
}
}
NzInputDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-input]',
host: {
'[class.ant-input-disabled]': 'disabled',
'[class.ant-input-lg]': `nzSize === 'large'`,
'[class.ant-input-sm]': `nzSize === 'small'`
}
},] }
];
/** @nocollapse */
NzInputDirective.ctorParameters = () => [
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }] },
{ type: Renderer2 },
{ type: ElementRef }
];
NzInputDirective.propDecorators = {
nzSize: [{ type: Input }],
disabled: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzInputGroupComponent {
constructor() {
this._size = 'default';
this.nzSearch = false;
this.nzCompact = false;
}
/**
* @param {?} value
* @return {?}
*/
set nzSize(value) {
this._size = value;
this.updateChildrenInputSize();
}
/**
* @return {?}
*/
get nzSize() {
return this._size;
}
/**
* @return {?}
*/
get isLarge() {
return this.nzSize === 'large';
}
/**
* @return {?}
*/
get isSmall() {
return this.nzSize === 'small';
}
/**
* @return {?}
*/
get isAffix() {
return (!!(this.nzSuffix || this.nzPrefix || this.nzPrefixIcon || this.nzSuffixIcon));
}
/**
* @return {?}
*/
get isAddOn() {
return !!(this.nzAddOnAfter || this.nzAddOnBefore || this.nzAddOnAfterIcon || this.nzAddOnBeforeIcon);
}
/**
* @return {?}
*/
get isAffixWrapper() {
return this.isAffix && !this.isAddOn;
}
/**
* @return {?}
*/
get isGroup() {
return (!this.isAffix) && (!this.isAddOn);
}
/**
* @return {?}
*/
get isLargeGroup() {
return this.isGroup && this.isLarge;
}
/**
* @return {?}
*/
get isLargeGroupWrapper() {
return this.isAddOn && this.isLarge;
}
/**
* @return {?}
*/
get isLargeAffix() {
return this.isAffixWrapper && this.isLarge;
}
/**
* @return {?}
*/
get isLargeSearch() {
return this.nzSearch && this.isLarge;
}
/**
* @return {?}
*/
get isSmallGroup() {
return this.isGroup && this.isSmall;
}
/**
* @return {?}
*/
get isSmallAffix() {
return this.isAffixWrapper && this.isSmall;
}
/**
* @return {?}
*/
get isSmallGroupWrapper() {
return this.isAddOn && this.isSmall;
}
/**
* @return {?}
*/
get isSmallSearch() {
return this.nzSearch && this.isSmall;
}
/**
* @return {?}
*/
updateChildrenInputSize() {
if (this.listOfNzInputDirective) {
this.listOfNzInputDirective.forEach((/**
* @param {?} item
* @return {?}
*/
item => item.nzSize = this.nzSize));
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.updateChildrenInputSize();
}
}
NzInputGroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-input-group',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<span class=\"ant-input-wrapper ant-input-group\" *ngIf=\"isAddOn\">\n <span class=\"ant-input-group-addon\" *ngIf=\"nzAddOnBefore || nzAddOnBeforeIcon\">\n <i nz-icon [type]=\"nzAddOnBeforeIcon\" *ngIf=\"nzAddOnBeforeIcon\"></i>\n <ng-container *nzStringTemplateOutlet=\"nzAddOnBefore\">{{ nzAddOnBefore }}</ng-container>\n </span>\n <ng-template [ngIf]=\"!isAffix\" *ngTemplateOutlet=\"contentTemplate\"></ng-template>\n <span class=\"ant-input-affix-wrapper\" [class.ant-input-affix-wrapper-sm]=\"isSmall\" [class.ant-input-affix-wrapper-lg]=\"isLarge\" *ngIf=\"isAffix\">\n <ng-template *ngTemplateOutlet=\"affixTemplate\"></ng-template>\n </span>\n <span class=\"ant-input-group-addon\" *ngIf=\"nzAddOnAfter || nzAddOnAfterIcon\">\n <i nz-icon [type]=\"nzAddOnAfterIcon\" *ngIf=\"nzAddOnAfterIcon\"></i>\n <ng-container *nzStringTemplateOutlet=\"nzAddOnAfter\">{{ nzAddOnAfter }}</ng-container>\n </span>\n</span>\n<ng-container *ngIf=\"isAffix && !isAddOn\">\n <ng-template *ngTemplateOutlet=\"affixTemplate\"></ng-template>\n</ng-container>\n<ng-template #affixTemplate>\n <span class=\"ant-input-prefix\" *ngIf=\"nzPrefix || nzPrefixIcon\">\n <!-- TODO: should have a class to set its color, cc: antd-->\n <i nz-icon [type]=\"nzPrefixIcon\" *ngIf=\"nzPrefixIcon\" style=\"color: rgba(0, 0, 0, 0.25)\"></i>\n <ng-container *nzStringTemplateOutlet=\"nzPrefix\">{{ nzPrefix }}</ng-container>\n </span>\n <ng-template *ngTemplateOutlet=\"contentTemplate\"></ng-template>\n <span class=\"ant-input-suffix\" *ngIf=\"nzSuffix || nzSuffixIcon\">\n <i nz-icon [type]=\"nzSuffixIcon\" *ngIf=\"nzSuffixIcon\"></i>\n <ng-container *nzStringTemplateOutlet=\"nzSuffix\">{{ nzSuffix }}</ng-container>\n </span>\n</ng-template>\n<ng-template [ngIf]=\"isGroup\" *ngTemplateOutlet=\"contentTemplate\"></ng-template>\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>",
host: {
'[class.ant-input-group-compact]': 'nzCompact',
'[class.ant-input-search-enter-button]': 'nzSearch',
'[class.ant-input-search]': 'nzSearch',
'[class.ant-input-search-sm]': 'isSmallSearch',
'[class.ant-input-affix-wrapper]': 'isAffixWrapper',
'[class.ant-input-group-wrapper]': 'isAddOn',
'[class.ant-input-group]': 'isGroup',
'[class.ant-input-group-lg]': 'isLargeGroup',
'[class.ant-input-group-wrapper-lg]': 'isLargeGroupWrapper',
'[class.ant-input-affix-wrapper-lg]': 'isLargeAffix',
'[class.ant-input-search-lg]': 'isLargeSearch',
'[class.ant-input-group-sm]': 'isSmallGroup',
'[class.ant-input-affix-wrapper-sm]': 'isSmallAffix',
'[class.ant-input-group-wrapper-sm]': 'isSmallGroupWrapper'
}
}] }
];
NzInputGroupComponent.propDecorators = {
listOfNzInputDirective: [{ type: ContentChildren, args: [NzInputDirective,] }],
nzAddOnBeforeIcon: [{ type: Input }],
nzAddOnAfterIcon: [{ type: Input }],
nzPrefixIcon: [{ type: Input }],
nzSuffixIcon: [{ type: Input }],
nzAddOnBefore: [{ type: Input }],
nzAddOnAfter: [{ type: Input }],
nzPrefix: [{ type: Input }],
nzSuffix: [{ type: Input }],
nzSearch: [{ type: Input }],
nzCompact: [{ type: Input }],
nzSize: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzInputGroupComponent.prototype, "nzSearch", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzInputGroupComponent.prototype, "nzCompact", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzInputModule {
}
NzInputModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzInputDirective, NzInputGroupComponent, NzAutoResizeDirective],
exports: [NzInputDirective, NzInputGroupComponent, NzAutoResizeDirective],
imports: [CommonModule, FormsModule, NzIconModule, PlatformModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCascaderOptionComponent {
/**
* @param {?} sanitizer
* @param {?} cdr
* @param {?} elementRef
* @param {?} renderer
*/
constructor(sanitizer, cdr, elementRef, renderer) {
this.sanitizer = sanitizer;
this.cdr = cdr;
this.activated = false;
this.nzLabelProperty = 'label';
renderer.addClass(elementRef.nativeElement, 'ant-cascader-menu-item');
}
/**
* @return {?}
*/
getOptionLabel() {
return this.option ? this.option[this.nzLabelProperty] : '';
}
/**
* @param {?} str
* @return {?}
*/
renderHighlightString(str) {
/** @type {?} */
const safeHtml = this.sanitizer.sanitize(SecurityContext.HTML, `<span class="ant-cascader-menu-item-keyword">${this.highlightText}</span>`);
if (!safeHtml) {
throw new Error(`[NG-ZORRO] Input value "${this.highlightText}" is not considered security.`);
}
return str.replace(new RegExp(this.highlightText, 'g'), safeHtml);
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
}
NzCascaderOptionComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: '[nz-cascader-option]',
template: "<ng-container *ngIf=\"highlightText\"><span [innerHTML]=\"renderHighlightString(getOptionLabel())\"></span></ng-container>\n<ng-container *ngIf=\"!highlightText\">{{ getOptionLabel() }}</ng-container>\n<span *ngIf=\"!option.isLeaf || option.children && option.children.length || option.loading\" class=\"ant-cascader-menu-item-expand-icon\">\n <i nz-icon [type]=\"option.loading ? 'loading' : 'right'\"></i>\n</span>",
host: {
'[attr.title]': 'option.title || getOptionLabel()',
'[class.ant-cascader-menu-item-active]': 'activated',
'[class.ant-cascader-menu-item-expand]': '!option.isLeaf',
'[class.ant-cascader-menu-item-disabled]': 'option.disabled'
}
}] }
];
/** @nocollapse */
NzCascaderOptionComponent.ctorParameters = () => [
{ type: DomSanitizer },
{ type: ChangeDetectorRef },
{ type: ElementRef },
{ type: Renderer2 }
];
NzCascaderOptionComponent.propDecorators = {
option: [{ type: Input }],
activated: [{ type: Input }],
highlightText: [{ type: Input }],
nzLabelProperty: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const POSITION_MAP = {
'top': new ConnectionPositionPair({ originX: 'center', originY: 'top' }, { overlayX: 'center', overlayY: 'bottom' }),
'topCenter': new ConnectionPositionPair({ originX: 'center', originY: 'top' }, { overlayX: 'center', overlayY: 'bottom' }),
'topLeft': new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' }),
'topRight': new ConnectionPositionPair({ originX: 'end', originY: 'top' }, { overlayX: 'end', overlayY: 'bottom' }),
'right': new ConnectionPositionPair({ originX: 'end', originY: 'center' }, { overlayX: 'start', overlayY: 'center' }),
'rightTop': new ConnectionPositionPair({ originX: 'end', originY: 'top' }, { overlayX: 'start', overlayY: 'top' }),
'rightBottom': new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'start', overlayY: 'bottom' }),
'bottom': new ConnectionPositionPair({ originX: 'center', originY: 'bottom' }, { overlayX: 'center', overlayY: 'top' }),
'bottomCenter': new ConnectionPositionPair({ originX: 'center', originY: 'bottom' }, { overlayX: 'center', overlayY: 'top' }),
'bottomLeft': new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
'bottomRight': new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }),
'left': new ConnectionPositionPair({ originX: 'start', originY: 'center' }, { overlayX: 'end', overlayY: 'center' }),
'leftTop': new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'top' }),
'leftBottom': new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'end', overlayY: 'bottom' })
};
/** @type {?} */
const DEFAULT_TOOLTIP_POSITIONS = [POSITION_MAP.top, POSITION_MAP.right, POSITION_MAP.bottom, POSITION_MAP.left];
/** @type {?} */
const DEFAULT_DROPDOWN_POSITIONS = [POSITION_MAP.bottomLeft, POSITION_MAP.topLeft];
/** @type {?} */
const DEFAULT_SUBMENU_POSITIONS = [POSITION_MAP.rightTop, POSITION_MAP.leftTop];
/** @type {?} */
const DEFAULT_CASCADER_POSITIONS = [POSITION_MAP.bottomLeft, POSITION_MAP.bottomRight, POSITION_MAP.topLeft, POSITION_MAP.topRight];
/** @type {?} */
const DEFAULT_MENTION_POSITIONS = [POSITION_MAP.bottomLeft, new ConnectionPositionPair({
originX: 'start',
originY: 'bottom'
}, { overlayX: 'start', overlayY: 'bottom' })];
/**
* @param {?} position
* @return {?}
*/
function getPlacementName(position) {
/** @type {?} */
const keyList = ['originX', 'originY', 'overlayX', 'overlayY'];
for (const placement in POSITION_MAP) {
if (keyList.every((/**
* @param {?} key
* @return {?}
*/
key => position.connectionPair[key] === POSITION_MAP[placement][key]))) {
return placement;
}
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @template T
* @param {?} value
* @return {?}
*/
function toArray(value) {
/** @type {?} */
let ret;
if (value == null) {
ret = [];
}
else if (!Array.isArray(value)) {
ret = [value];
}
else {
ret = value;
}
return ret;
}
/**
* @template T
* @param {?} array1
* @param {?} array2
* @return {?}
*/
function arraysEqual(array1, array2) {
if (!array1 || !array2 || array1.length !== array2.length) {
return false;
}
/** @type {?} */
const len = array1.length;
for (let i = 0; i < len; i++) {
if (array1[i] !== array2[i]) {
return false;
}
}
return true;
}
/**
* @template T
* @param {?} source
* @return {?}
*/
function shallowCopyArray(source) {
return source.slice();
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const defaultDisplayRender = (/**
* @param {?} label
* @return {?}
*/
label => label.join(' / '));
class NzCascaderComponent {
/**
* @param {?} elementRef
* @param {?} cdr
* @param {?} renderer
* @param {?=} noAnimation
*/
constructor(elementRef, cdr, renderer, noAnimation) {
this.elementRef = elementRef;
this.cdr = cdr;
this.noAnimation = noAnimation;
this.nzShowInput = true;
this.nzShowArrow = true;
this.nzAllowClear = true;
this.nzAutoFocus = false;
this.nzChangeOnSelect = false;
this.nzDisabled = false;
this.nzExpandTrigger = 'click';
this.nzValueProperty = 'value';
this.nzLabelProperty = 'label';
this.nzSize = 'default';
this.nzPlaceHolder = 'Please select';
this.nzMouseEnterDelay = 150; // ms
// ms
this.nzMouseLeaveDelay = 150; // ms
// ms
this.nzTriggerAction = (/** @type {?} */ (['click']));
this.nzSelectionChange = new EventEmitter();
this.nzSelect = new EventEmitter();
this.nzClear = new EventEmitter();
this.nzVisibleChange = new EventEmitter(); // Not exposed, only for test
// Not exposed, only for test
this.nzChange = new EventEmitter(); // Not exposed, only for test
// Not exposed, only for test
this.el = this.elementRef.nativeElement;
this.dropDownPosition = 'bottom';
this.menuVisible = false;
this.isLoading = false;
this.labelRenderContext = {};
this.columns = [];
this.onChange = Function.prototype;
this.onTouched = Function.prototype;
this.positions = [...DEFAULT_CASCADER_POSITIONS];
this.isSearching = false;
this.isFocused = false;
this.isOpening = false;
this.selectedOptions = [];
this.activatedOptions = [];
this._inputValue = '';
renderer.addClass(elementRef.nativeElement, 'ant-cascader');
renderer.addClass(elementRef.nativeElement, 'ant-cascader-picker');
}
/**
* @return {?}
*/
get nzOptions() {
return this.columns[0];
}
/**
* @param {?} options
* @return {?}
*/
set nzOptions(options) {
this.columnsSnapshot = this.columns = options && options.length ? [options] : [];
if (!this.isSearching) {
if (this.defaultValue && this.columns.length) {
this.initOptions(0);
}
}
else {
this.prepareSearchValue();
}
}
/**
* @param {?} inputValue
* @return {?}
*/
set inputValue(inputValue) {
this._inputValue = inputValue;
this.toggleSearchMode();
}
/**
* @return {?}
*/
get inputValue() {
return this._inputValue;
}
/**
* @return {?}
*/
get menuCls() {
return {
[`${this.nzMenuClassName}`]: !!this.nzMenuClassName
};
}
/**
* @return {?}
*/
get menuColumnCls() {
return {
[`${this.nzColumnClassName}`]: !!this.nzColumnClassName
};
}
//#region Menu
/**
* @param {?} visible
* @param {?} delay
* @param {?=} setOpening
* @return {?}
*/
delaySetMenuVisible(visible, delay$$1, setOpening = false) {
this.clearDelayMenuTimer();
if (delay$$1) {
if (visible && setOpening) {
this.isOpening = true;
}
this.delayMenuTimer = setTimeout((/**
* @return {?}
*/
() => {
this.setMenuVisible(visible);
this.cdr.detectChanges();
this.clearDelayMenuTimer();
if (visible) {
setTimeout((/**
* @return {?}
*/
() => {
this.isOpening = false;
}), 100);
}
}), delay$$1);
}
else {
this.setMenuVisible(visible);
}
}
/**
* @param {?} visible
* @return {?}
*/
setMenuVisible(visible) {
if (this.nzDisabled) {
return;
}
if (this.menuVisible !== visible) {
this.menuVisible = visible;
this.cdr.detectChanges();
if (visible) {
this.loadRootOptions();
}
this.nzVisibleChange.emit(visible);
}
}
/**
* @private
* @return {?}
*/
clearDelayMenuTimer() {
if (this.delayMenuTimer) {
clearTimeout(this.delayMenuTimer);
this.delayMenuTimer = null;
}
}
/**
* @private
* @return {?}
*/
loadRootOptions() {
if (!this.columns.length) {
/** @type {?} */
const root = {};
this.loadChildrenAsync(root, -1);
}
}
//#endregion
//#region Init
/**
* @private
* @param {?} index
* @return {?}
*/
isLoaded(index) {
return this.columns[index] && this.columns[index].length > 0;
}
/**
* @private
* @param {?} option
* @param {?} index
* @return {?}
*/
findOption(option, index) {
/** @type {?} */
const options = this.columns[index];
if (options) {
/** @type {?} */
const value = typeof option === 'object' ? this.getOptionValue(option) : option;
return options.find((/**
* @param {?} o
* @return {?}
*/
o => value === this.getOptionValue(o)));
}
return null;
}
// tslint:disable-next-line:no-any
/**
* @private
* @param {?} index
* @param {?} value
* @return {?}
*/
activateOnInit(index, value) {
/** @type {?} */
let option = this.findOption(value, index);
if (!option) {
option = typeof value === 'object' ? value : {
[`${this.nzValueProperty}`]: value,
[`${this.nzLabelProperty}`]: value
};
}
this.setOptionActivated(option, index, false, false);
}
/**
* @private
* @param {?} index
* @return {?}
*/
initOptions(index) {
/** @type {?} */
const vs = this.defaultValue;
/** @type {?} */
const lastIndex = vs.length - 1;
/** @type {?} */
const load = (/**
* @return {?}
*/
() => {
this.activateOnInit(index, vs[index]);
if (index < lastIndex) {
this.initOptions(index + 1);
}
if (index === lastIndex) {
this.afterWriteValue();
}
});
if (this.isLoaded(index) || !this.nzLoadData) {
load();
}
else {
/** @type {?} */
const node = this.activatedOptions[index - 1] || {};
this.loadChildrenAsync(node, index - 1, load, this.afterWriteValue);
}
}
//#endregion
//#region Mutating data
/**
* @private
* @param {?} option
* @param {?} columnIndex
* @param {?=} select
* @param {?=} loadChildren
* @return {?}
*/
setOptionActivated(option, columnIndex, select = false, loadChildren = true) {
if (!option || option.disabled) {
return;
}
this.activatedOptions[columnIndex] = option;
// Set parent option and all ancestor options as active.
for (let i = columnIndex - 1; i >= 0; i--) {
if (!this.activatedOptions[i]) {
this.activatedOptions[i] = this.activatedOptions[i + 1].parent;
}
}
// Set child options and all success options as inactive.
if (columnIndex < this.activatedOptions.length - 1) {
this.activatedOptions = this.activatedOptions.slice(0, columnIndex + 1);
}
// Load child options.
if (option.children && option.children.length && !option.isLeaf) {
option.children.forEach((/**
* @param {?} child
* @return {?}
*/
child => child.parent = option));
this.setColumnData(option.children, columnIndex + 1);
}
else if (!option.isLeaf && loadChildren) {
this.loadChildrenAsync(option, columnIndex);
}
if (select) {
this.setOptionSelected(option, columnIndex);
}
this.cdr.detectChanges();
this.reposition();
}
/**
* @private
* @param {?} option
* @param {?} columnIndex
* @param {?=} success
* @param {?=} failure
* @return {?}
*/
loadChildrenAsync(option, columnIndex, success, failure) {
if (this.nzLoadData) {
this.isLoading = columnIndex < 0;
option.loading = true;
this.nzLoadData(option, columnIndex).then((/**
* @return {?}
*/
() => {
if (option.children) {
option.children.forEach((/**
* @param {?} child
* @return {?}
*/
child => child.parent = columnIndex < 0 ? undefined : option));
this.setColumnData(option.children, columnIndex + 1);
}
if (success) {
success();
}
option.loading = this.isLoading = false; // Need to check children.
this.checkChildren();
// Reposition in the next tick, because we use markForCheck above.
Promise.resolve().then((/**
* @return {?}
*/
() => this.reposition()));
}), (/**
* @return {?}
*/
() => {
option.loading = this.isLoading = false;
option.isLeaf = true;
this.cdr.detectChanges();
if (failure) {
failure();
}
}));
}
}
/**
* @private
* @param {?} option
* @param {?} columnIndex
* @return {?}
*/
setOptionSelected(option, columnIndex) {
/** @type {?} */
const shouldPerformSelection = (/**
* @param {?} o
* @param {?} i
* @return {?}
*/
(o, i) => {
return typeof this.nzChangeOn === 'function' ? this.nzChangeOn(o, i) === true : false;
});
this.nzSelect.emit({ option, index: columnIndex });
if (option.isLeaf || this.nzChangeOnSelect || shouldPerformSelection(option, columnIndex)) {
this.selectedOptions = this.activatedOptions;
this.buildDisplayLabel();
this.onValueChange();
}
if (option.isLeaf) {
this.delaySetMenuVisible(false, this.nzMouseLeaveDelay);
}
}
/**
* @private
* @param {?} options
* @param {?} columnIndex
* @return {?}
*/
setColumnData(options, columnIndex) {
if (!arraysEqual(this.columns[columnIndex], options)) {
this.columns[columnIndex] = options;
if (columnIndex < this.columns.length - 1) {
this.columns = this.columns.slice(0, columnIndex + 1);
}
}
}
/**
* @param {?=} event
* @return {?}
*/
clearSelection(event) {
if (event) {
event.preventDefault();
event.stopPropagation();
}
this.labelRenderText = '';
this.labelRenderContext = {};
this.selectedOptions = [];
this.activatedOptions = [];
this.inputValue = '';
this.setMenuVisible(false);
this.onValueChange();
}
// tslint:disable-next-line:no-any
/**
* @return {?}
*/
getSubmitValue() {
/** @type {?} */
const values = [];
this.selectedOptions.forEach((/**
* @param {?} option
* @return {?}
*/
option => {
values.push(this.getOptionValue(option));
}));
return values;
}
/**
* @private
* @return {?}
*/
onValueChange() {
/** @type {?} */
const value = this.getSubmitValue();
if (!arraysEqual(this.value, value)) {
this.defaultValue = null;
this.value = value;
this.onChange(value);
if (value.length === 0) {
this.nzClear.emit();
}
this.nzSelectionChange.emit(this.selectedOptions);
this.nzChange.emit(value);
}
}
/**
* @return {?}
*/
afterWriteValue() {
this.selectedOptions = this.activatedOptions;
this.value = this.getSubmitValue();
this.buildDisplayLabel();
}
//#endregion
//#region Mouse and keyboard event handles, view children
/**
* @return {?}
*/
focus() {
if (!this.isFocused) {
(this.input ? this.input.nativeElement : this.el).focus();
this.isFocused = true;
}
}
/**
* @return {?}
*/
blur() {
if (this.isFocused) {
(this.input ? this.input.nativeElement : this.el).blur();
this.isFocused = false;
}
}
/**
* @return {?}
*/
handleInputBlur() {
this.menuVisible ? this.focus() : this.blur();
}
/**
* @return {?}
*/
handleInputFocus() {
this.focus();
}
/**
* @param {?} event
* @return {?}
*/
onKeyDown(event) {
/** @type {?} */
const keyCode = event.keyCode;
if (keyCode !== DOWN_ARROW &&
keyCode !== UP_ARROW &&
keyCode !== LEFT_ARROW &&
keyCode !== RIGHT_ARROW &&
keyCode !== ENTER &&
keyCode !== BACKSPACE &&
keyCode !== ESCAPE) {
return;
}
// Press any keys above to reopen menu.
if (!this.menuVisible && keyCode !== BACKSPACE && keyCode !== ESCAPE) {
return this.setMenuVisible(true);
}
// Make these keys work as default in searching mode.
if (this.isSearching && (keyCode === BACKSPACE || keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW)) {
return;
}
// Interact with the component.
if (this.menuVisible) {
event.preventDefault();
if (keyCode === DOWN_ARROW) {
this.moveUpOrDown(false);
}
else if (keyCode === UP_ARROW) {
this.moveUpOrDown(true);
}
else if (keyCode === LEFT_ARROW) {
this.moveLeft();
}
else if (keyCode === RIGHT_ARROW) {
this.moveRight();
}
else if (keyCode === ENTER) {
this.onEnter();
}
}
}
/**
* @return {?}
*/
onTriggerClick() {
if (this.nzDisabled) {
return;
}
if (this.nzShowSearch) {
this.focus();
}
if (this.isActionTrigger('click')) {
this.delaySetMenuVisible(!this.menuVisible, 100);
}
this.onTouched();
}
/**
* @return {?}
*/
onTriggerMouseEnter() {
if (this.nzDisabled) {
return;
}
if (this.isActionTrigger('hover')) {
this.delaySetMenuVisible(true, this.nzMouseEnterDelay, true);
}
}
/**
* @param {?} event
* @return {?}
*/
onTriggerMouseLeave(event) {
if (this.nzDisabled) {
return;
}
if (!this.menuVisible || this.isOpening) {
event.preventDefault();
return;
}
if (this.isActionTrigger('hover')) {
/** @type {?} */
const mouseTarget = (/** @type {?} */ (event.relatedTarget));
/** @type {?} */
const hostEl = this.el;
/** @type {?} */
const menuEl = this.menu && (/** @type {?} */ (this.menu.nativeElement));
if (hostEl.contains(mouseTarget) || (menuEl && menuEl.contains(mouseTarget))) {
return;
}
this.delaySetMenuVisible(false, this.nzMouseLeaveDelay);
}
}
/**
* @private
* @param {?} action
* @return {?}
*/
isActionTrigger(action) {
return typeof this.nzTriggerAction === 'string'
? this.nzTriggerAction === action
: this.nzTriggerAction.indexOf(action) !== -1;
}
/**
* @param {?} option
* @param {?} columnIndex
* @param {?} event
* @return {?}
*/
onOptionClick(option, columnIndex, event) {
if (event) {
event.preventDefault();
}
if (option && option.disabled) {
return;
}
this.el.focus();
this.isSearching
? this.setSearchOptionActivated((/** @type {?} */ (option)), event)
: this.setOptionActivated(option, columnIndex, true);
}
/**
* @private
* @return {?}
*/
onEnter() {
/** @type {?} */
const columnIndex = Math.max(this.activatedOptions.length - 1, 0);
/** @type {?} */
const option = this.activatedOptions[columnIndex];
if (option && !option.disabled) {
this.isSearching
? this.setSearchOptionActivated((/** @type {?} */ (option)), null)
: this.setOptionSelected(option, columnIndex);
}
}
/**
* @private
* @param {?} isUp
* @return {?}
*/
moveUpOrDown(isUp) {
/** @type {?} */
const columnIndex = Math.max(this.activatedOptions.length - 1, 0);
/** @type {?} */
const activeOption = this.activatedOptions[columnIndex];
/** @type {?} */
const options = this.columns[columnIndex] || [];
/** @type {?} */
const length = options.length;
/** @type {?} */
let nextIndex = -1;
if (!activeOption) { // Not selected options in this column
nextIndex = isUp ? length : -1;
}
else {
nextIndex = options.indexOf(activeOption);
}
while (true) {
nextIndex = isUp ? nextIndex - 1 : nextIndex + 1;
if (nextIndex < 0 || nextIndex >= length) {
break;
}
/** @type {?} */
const nextOption = options[nextIndex];
if (!nextOption || nextOption.disabled) {
continue;
}
this.setOptionActivated(nextOption, columnIndex);
break;
}
}
/**
* @private
* @return {?}
*/
moveLeft() {
/** @type {?} */
const options = this.activatedOptions;
if (options.length) {
options.pop(); // Remove the last one
}
}
/**
* @private
* @return {?}
*/
moveRight() {
/** @type {?} */
const length = this.activatedOptions.length;
/** @type {?} */
const options = this.columns[length];
if (options && options.length) {
/** @type {?} */
const nextOpt = options.find((/**
* @param {?} o
* @return {?}
*/
o => !o.disabled));
if (nextOpt) {
this.setOptionActivated(nextOpt, length);
}
}
}
/**
* @param {?} option
* @param {?} columnIndex
* @param {?} event
* @return {?}
*/
onOptionMouseEnter(option, columnIndex, event) {
event.preventDefault();
if (this.nzExpandTrigger === 'hover' && !option.isLeaf) {
this.delaySelectOption(option, columnIndex, true);
}
}
/**
* @param {?} option
* @param {?} columnIndex
* @param {?} event
* @return {?}
*/
onOptionMouseLeave(option, columnIndex, event) {
event.preventDefault();
if (this.nzExpandTrigger === 'hover' && !option.isLeaf) {
this.delaySelectOption(option, columnIndex, false);
}
}
/**
* @private
* @return {?}
*/
clearDelaySelectTimer() {
if (this.delaySelectTimer) {
clearTimeout(this.delaySelectTimer);
this.delaySelectTimer = null;
}
}
/**
* @private
* @param {?} option
* @param {?} index
* @param {?} doSelect
* @return {?}
*/
delaySelectOption(option, index, doSelect) {
this.clearDelaySelectTimer();
if (doSelect) {
this.delaySelectTimer = setTimeout((/**
* @return {?}
*/
() => {
this.setOptionActivated(option, index);
this.delaySelectTimer = null;
}), 150);
}
}
//#endregion
//#region Search
/**
* @private
* @return {?}
*/
toggleSearchMode() {
/** @type {?} */
const willBeInSearch = !!this._inputValue;
// Take a snapshot before entering search mode.
if (!this.isSearching && willBeInSearch) {
this.isSearching = true;
this.activatedOptionsSnapshot = this.activatedOptions;
this.activatedOptions = [];
this.labelRenderText = '';
if (this.input) {
/** @type {?} */
const width = this.input.nativeElement.offsetWidth;
this.dropdownWidthStyle = `${width}px`;
}
}
// Restore the snapshot after leaving search mode.
if (this.isSearching && !willBeInSearch) {
this.isSearching = false;
this.activatedOptions = this.activatedOptionsSnapshot;
this.columns = this.columnsSnapshot;
this.dropdownWidthStyle = '';
if (this.activatedOptions) {
this.buildDisplayLabel();
}
}
if (this.isSearching) {
this.prepareSearchValue();
}
}
/**
* @private
* @return {?}
*/
prepareSearchValue() {
/** @type {?} */
const results = [];
/** @type {?} */
const path = [];
/** @type {?} */
const defaultFilter = (/**
* @param {?} inputValue
* @param {?} p
* @return {?}
*/
(inputValue, p) => {
return p.some((/**
* @param {?} n
* @return {?}
*/
n => {
/** @type {?} */
const label = this.getOptionLabel(n);
return label && label.indexOf(inputValue) !== -1;
}));
});
/** @type {?} */
const filter$$1 = this.nzShowSearch instanceof Object && ((/** @type {?} */ (this.nzShowSearch))).filter
? ((/** @type {?} */ (this.nzShowSearch))).filter
: defaultFilter;
/** @type {?} */
const sorter = this.nzShowSearch instanceof Object && ((/** @type {?} */ (this.nzShowSearch))).sorter;
/** @type {?} */
const loopParent = (/**
* @param {?} node
* @param {?=} forceDisabled
* @return {?}
*/
(node, forceDisabled = false) => {
/** @type {?} */
const disabled = forceDisabled || node.disabled;
path.push(node);
node.children.forEach((/**
* @param {?} sNode
* @return {?}
*/
(sNode) => {
if (!sNode.parent) {
sNode.parent = node;
} // Build parent reference when doing searching
if (!sNode.isLeaf) {
loopParent(sNode, disabled);
}
if (sNode.isLeaf || !sNode.children || !sNode.children.length) {
loopChild(sNode, disabled);
}
}));
path.pop();
});
/** @type {?} */
const loopChild = (/**
* @param {?} node
* @param {?=} forceDisabled
* @return {?}
*/
(node, forceDisabled = false) => {
path.push(node);
/** @type {?} */
const cPath = Array.from(path);
if (filter$$1(this._inputValue, cPath)) {
/** @type {?} */
const disabled = forceDisabled || node.disabled;
/** @type {?} */
const option = {
disabled,
isLeaf: true,
path: cPath,
[this.nzLabelProperty]: cPath.map((/**
* @param {?} p
* @return {?}
*/
p => this.getOptionLabel(p))).join(' / ')
};
results.push(option);
}
path.pop();
});
if (!this.columnsSnapshot.length) {
this.columns = [[]];
return;
}
this.columnsSnapshot[0].forEach((/**
* @param {?} node
* @return {?}
*/
node => (node.isLeaf || !node.children || !node.children.length)
? loopChild(node)
: loopParent(node)));
if (sorter) {
results.sort((/**
* @param {?} a
* @param {?} b
* @return {?}
*/
(a, b) => sorter(a.path, b.path, this._inputValue)));
}
this.columns = [results];
}
/**
* @param {?} result
* @param {?} event
* @return {?}
*/
setSearchOptionActivated(result, event) {
this.activatedOptions = [result];
this.delaySetMenuVisible(false, 200);
setTimeout((/**
* @return {?}
*/
() => {
this.inputValue = '';
/** @type {?} */
const index = result.path.length - 1;
/** @type {?} */
const destinationNode = result.path[index];
// NOTE: optimize this.
/** @type {?} */
const mockClickParent = (/**
* @param {?} node
* @param {?} columnIndex
* @return {?}
*/
(node, columnIndex) => {
if (node && node.parent) {
mockClickParent(node.parent, columnIndex - 1);
}
this.onOptionClick(node, columnIndex, event);
});
mockClickParent(destinationNode, index);
}), 300);
}
//#endregion
//#region Helpers
/**
* @private
* @return {?}
*/
get hasInput() {
return !!this.inputValue;
}
/**
* @private
* @return {?}
*/
get hasValue() {
return !!this.value && !!this.value.length;
}
/**
* @return {?}
*/
get showPlaceholder() {
return !(this.hasInput || this.hasValue);
}
/**
* @return {?}
*/
get clearIconVisible() {
return this.nzAllowClear && !this.nzDisabled && (this.hasValue || this.hasInput);
}
/**
* @return {?}
*/
get isLabelRenderTemplate() {
return !!this.nzLabelRender;
}
// tslint:disable-next-line:no-any
/**
* @param {?} option
* @return {?}
*/
getOptionLabel(option) {
return option[this.nzLabelProperty || 'label'];
}
// tslint:disable-next-line:no-any
/**
* @param {?} option
* @return {?}
*/
getOptionValue(option) {
return option[this.nzValueProperty || 'value'];
}
/**
* @param {?} option
* @param {?} index
* @return {?}
*/
isOptionActivated(option, index) {
/** @type {?} */
const activeOpt = this.activatedOptions[index];
return activeOpt === option;
}
/**
* @private
* @return {?}
*/
buildDisplayLabel() {
/** @type {?} */
const selectedOptions = this.selectedOptions;
/** @type {?} */
const labels = selectedOptions.map((/**
* @param {?} o
* @return {?}
*/
o => this.getOptionLabel(o)));
if (this.isLabelRenderTemplate) {
this.labelRenderContext = { labels, selectedOptions };
}
else {
this.labelRenderText = defaultDisplayRender.call(this, labels, selectedOptions);
}
// When components inits with default value, this would make display label appear correctly.
this.cdr.detectChanges();
}
//#endregion
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
if (isDisabled) {
this.closeMenu();
}
this.nzDisabled = isDisabled;
}
/**
* @return {?}
*/
closeMenu() {
this.blur();
this.clearDelayMenuTimer();
this.setMenuVisible(false);
}
/**
* @return {?}
*/
ngOnDestroy() {
this.clearDelayMenuTimer();
this.clearDelaySelectTimer();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
/** @type {?} */
const vs = this.defaultValue = toArray(value);
if (vs.length) {
this.initOptions(0);
}
else {
this.value = vs;
this.activatedOptions = [];
this.afterWriteValue();
}
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
/** @type {?} */
const newValue = position.connectionPair.originY === 'bottom' ? 'bottom' : 'top';
if (this.dropDownPosition !== newValue) {
this.dropDownPosition = newValue;
this.cdr.detectChanges();
}
}
/**
* Reposition the cascader panel. When a menu opens, the cascader expands
* and may exceed the browser boundary.
* @private
* @return {?}
*/
reposition() {
if (this.overlay && this.overlay.overlayRef && this.menuVisible) {
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.overlay.overlayRef.updatePosition();
}));
}
}
/**
* @private
* @return {?}
*/
checkChildren() {
this.cascaderItems.forEach((/**
* @param {?} item
* @return {?}
*/
item => item.markForCheck()));
}
}
NzCascaderComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-cascader,[nz-cascader]',
preserveWhitespaces: false,
template: "<div\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n #trigger>\n <div *ngIf=\"nzShowInput\">\n <input\n #input\n nz-input\n class=\"ant-cascader-input\"\n [class.ant-cascader-input-disabled]=\"nzDisabled\"\n [class.ant-cascader-input-lg]=\"nzSize === 'large'\"\n [class.ant-cascader-input-sm]=\"nzSize === 'small'\"\n [attr.autoComplete]=\"'off'\"\n [attr.placeholder]=\"showPlaceholder ? nzPlaceHolder : null\"\n [attr.autofocus]=\"nzAutoFocus ? 'autofocus' : null\"\n [readonly]=\"!nzShowSearch\"\n [disabled]=\"nzDisabled\"\n [nzSize]=\"nzSize\"\n [(ngModel)]=\"inputValue\"\n (blur)=\"handleInputBlur()\"\n (focus)=\"handleInputFocus()\"\n (change)=\"$event.stopPropagation()\">\n <i *ngIf=\"clearIconVisible\"\n nz-icon\n type=\"close-circle\"\n theme=\"fill\"\n class=\"ant-cascader-picker-clear\"\n (click)=\"clearSelection($event)\"></i>\n <i *ngIf=\"nzShowArrow && !isLoading\"\n nz-icon\n type=\"down\"\n class=\"ant-cascader-picker-arrow\"\n [class.ant-cascader-picker-arrow-expand]=\"menuVisible\">\n </i>\n <i *ngIf=\"isLoading\" nz-icon type=\"loading\" class=\"ant-cascader-picker-arrow\"></i>\n <span\n class=\"ant-cascader-picker-label\"\n [class.ant-cascader-show-search]=\"!!nzShowSearch\"\n [class.ant-focusd]=\"!!nzShowSearch && isFocused && !inputValue\">\n <ng-container *ngIf=\"!isLabelRenderTemplate; else labelTemplate\">{{ labelRenderText }}</ng-container>\n <ng-template #labelTemplate>\n <ng-template [ngTemplateOutlet]=\"nzLabelRender\" [ngTemplateOutletContext]=\"labelRenderContext\"></ng-template>\n </ng-template>\n </span>\n </div>\n <ng-content></ng-content>\n</div>\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (backdropClick)=\"closeMenu()\"\n (detach)=\"closeMenu()\"\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayOpen]=\"menuVisible\">\n <div\n #menu\n class=\"ant-cascader-menus\"\n *ngIf=\"nzOptions && nzOptions.length || isSearching\"\n [class.ant-cascader-menus-hidden]=\"!menuVisible\"\n [ngClass]=\"menuCls\"\n [ngStyle]=\"nzMenuStyle\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@slideMotion]=\"dropDownPosition\"\n (mouseleave)=\"onTriggerMouseLeave($event)\">\n <ul *ngFor=\"let options of columns; let i = index;\" class=\"ant-cascader-menu\"\n [ngClass]=\"menuColumnCls\"\n [style.height]=\"isSearching && !columns[0].length ? 'auto': ''\"\n [style.width]=\"dropdownWidthStyle\">\n <li\n nz-cascader-option\n *ngFor=\"let option of options\"\n [nzLabelProperty]=\"nzLabelProperty\"\n [activated]=\"isOptionActivated(option, i)\"\n [highlightText]=\"isSearching ? inputValue : ''\"\n [option]=\"option\"\n (mouseenter)=\"onOptionMouseEnter(option, i, $event)\"\n (mouseleave)=\"onOptionMouseLeave(option, i, $event)\"\n (click)=\"onOptionClick(option, i, $event)\">\n </li>\n <li *ngIf=\"isSearching && !columns[0].length\"\n class=\"ant-cascader-menu-item ant-cascader-menu-item-expanded ant-cascader-menu-item-disabled\">\n <nz-embed-empty [nzComponentName]=\"'cascader'\" [specificContent]=\"nzNotFoundContent\"></nz-embed-empty>\n </li>\n </ul>\n </div>\n</ng-template>\n",
animations: [slideMotion],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzCascaderComponent)),
multi: true
}
],
host: {
'[attr.tabIndex]': '"0"',
'[class.ant-cascader-lg]': 'nzSize === "large"',
'[class.ant-cascader-sm]': 'nzSize === "small"',
'[class.ant-cascader-picker-disabled]': 'nzDisabled',
'[class.ant-cascader-picker-open]': 'menuVisible',
'[class.ant-cascader-picker-with-value]': '!!inputValue',
'[class.ant-cascader-focused]': 'isFocused'
},
styles: [`
.ant-cascader-menus {
margin-top: 4px;
margin-bottom: 4px;
top: 100%;
left: 0;
position: relative;
width: 100%;
}
`]
}] }
];
/** @nocollapse */
NzCascaderComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzCascaderComponent.propDecorators = {
input: [{ type: ViewChild, args: ['input',] }],
menu: [{ type: ViewChild, args: ['menu',] }],
overlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
cascaderItems: [{ type: ViewChildren, args: [NzCascaderOptionComponent,] }],
nzShowInput: [{ type: Input }],
nzShowArrow: [{ type: Input }],
nzAllowClear: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzChangeOnSelect: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzColumnClassName: [{ type: Input }],
nzExpandTrigger: [{ type: Input }],
nzValueProperty: [{ type: Input }],
nzLabelRender: [{ type: Input }],
nzLabelProperty: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzSize: [{ type: Input }],
nzShowSearch: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzMenuClassName: [{ type: Input }],
nzMenuStyle: [{ type: Input }],
nzMouseEnterDelay: [{ type: Input }],
nzMouseLeaveDelay: [{ type: Input }],
nzTriggerAction: [{ type: Input }],
nzChangeOn: [{ type: Input }],
nzLoadData: [{ type: Input }],
nzOptions: [{ type: Input }],
nzSelectionChange: [{ type: Output }],
nzSelect: [{ type: Output }],
nzClear: [{ type: Output }],
nzVisibleChange: [{ type: Output }],
nzChange: [{ type: Output }],
onKeyDown: [{ type: HostListener, args: ['keydown', ['$event'],] }],
onTriggerClick: [{ type: HostListener, args: ['click',] }],
onTriggerMouseEnter: [{ type: HostListener, args: ['mouseenter',] }],
onTriggerMouseLeave: [{ type: HostListener, args: ['mouseleave', ['$event'],] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzShowInput", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzShowArrow", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzAllowClear", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzAutoFocus", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzChangeOnSelect", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCascaderComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCascaderModule {
}
NzCascaderModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, OverlayModule, NzInputModule, NzIconModule, NzEmptyModule, NzOverlayModule, NzNoAnimationModule],
declarations: [
NzCascaderComponent,
NzCascaderOptionComponent
],
exports: [
NzCascaderComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCheckboxGroupComponent {
/**
* @param {?} elementRef
* @param {?} focusMonitor
* @param {?} cdr
* @param {?} renderer
*/
constructor(elementRef, focusMonitor, cdr, renderer) {
this.elementRef = elementRef;
this.focusMonitor = focusMonitor;
this.cdr = cdr;
// tslint:disable-next-line:no-any
this.onChange = (/**
* @return {?}
*/
() => null);
// tslint:disable-next-line:no-any
this.onTouched = (/**
* @return {?}
*/
() => null);
this.options = [];
this.nzDisabled = false;
renderer.addClass(elementRef.nativeElement, 'ant-checkbox-group');
}
/**
* @return {?}
*/
onOptionChange() {
this.onChange(this.options);
}
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
trackByOption(_index, option) {
return option.value;
}
/**
* @return {?}
*/
ngOnInit() {
this.focusMonitor.monitor(this.elementRef, true).subscribe((/**
* @param {?} focusOrigin
* @return {?}
*/
focusOrigin => {
if (!focusOrigin) {
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
}
}));
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.options = value;
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
}
NzCheckboxGroupComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-checkbox-group',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
template: "<label nz-checkbox\n *ngFor=\"let option of options; trackBy:trackByOption\"\n [nzDisabled]=\"option.disabled || nzDisabled\"\n [(nzChecked)]=\"option.checked\"\n (nzCheckedChange)=\"onOptionChange()\">\n <span>{{ option.label }}</span>\n</label>",
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzCheckboxGroupComponent)),
multi: true
}
]
}] }
];
/** @nocollapse */
NzCheckboxGroupComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: FocusMonitor },
{ type: ChangeDetectorRef },
{ type: Renderer2 }
];
NzCheckboxGroupComponent.propDecorators = {
nzDisabled: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCheckboxGroupComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCheckboxWrapperComponent {
/**
* @param {?} renderer
* @param {?} elementRef
*/
constructor(renderer, elementRef) {
this.nzOnChange = new EventEmitter();
this.checkboxList = [];
renderer.addClass(elementRef.nativeElement, 'ant-checkbox-group');
}
/**
* @param {?} value
* @return {?}
*/
addCheckbox(value) {
this.checkboxList.push(value);
}
/**
* @param {?} value
* @return {?}
*/
removeCheckbox(value) {
this.checkboxList.splice(this.checkboxList.indexOf(value), 1);
}
/**
* @return {?}
*/
outputValue() {
/** @type {?} */
const checkedList = this.checkboxList.filter((/**
* @param {?} item
* @return {?}
*/
item => item.nzChecked));
return checkedList.map((/**
* @param {?} item
* @return {?}
*/
item => item.nzValue));
}
/**
* @return {?}
*/
onChange() {
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 = () => [
{ type: Renderer2 },
{ type: ElementRef }
];
NzCheckboxWrapperComponent.propDecorators = {
nzOnChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCheckboxComponent {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} nzCheckboxWrapperComponent
* @param {?} cdr
* @param {?} focusMonitor
*/
constructor(elementRef, renderer, nzCheckboxWrapperComponent, cdr, focusMonitor) {
this.elementRef = elementRef;
this.renderer = renderer;
this.nzCheckboxWrapperComponent = nzCheckboxWrapperComponent;
this.cdr = cdr;
this.focusMonitor = focusMonitor;
// tslint:disable-next-line:no-any
this.onChange = (/**
* @return {?}
*/
() => null);
// tslint:disable-next-line:no-any
this.onTouched = (/**
* @return {?}
*/
() => null);
this.nzCheckedChange = new EventEmitter();
this.nzAutoFocus = false;
this.nzDisabled = false;
this.nzIndeterminate = false;
this.nzChecked = false;
renderer.addClass(elementRef.nativeElement, 'ant-checkbox-wrapper');
}
/**
* @param {?} e
* @return {?}
*/
hostClick(e) {
e.preventDefault();
this.focus();
this.innerCheckedChange(!this.nzChecked);
}
/**
* @param {?} checked
* @return {?}
*/
innerCheckedChange(checked) {
if (!this.nzDisabled) {
this.nzChecked = checked;
this.onChange(this.nzChecked);
this.nzCheckedChange.emit(this.nzChecked);
if (this.nzCheckboxWrapperComponent) {
this.nzCheckboxWrapperComponent.onChange();
}
}
}
/**
* @return {?}
*/
updateAutoFocus() {
if (this.inputElement && this.nzAutoFocus) {
this.renderer.setAttribute(this.inputElement.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.inputElement.nativeElement, 'autofocus');
}
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.nzChecked = value;
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
/**
* @return {?}
*/
focus() {
this.focusMonitor.focusVia(this.inputElement, 'keyboard');
}
/**
* @return {?}
*/
blur() {
this.inputElement.nativeElement.blur();
}
/**
* @return {?}
*/
checkContent() {
if (isEmpty(this.contentElement.nativeElement)) {
this.renderer.setStyle(this.contentElement.nativeElement, 'display', 'none');
}
else {
this.renderer.removeStyle(this.contentElement.nativeElement, 'display');
}
}
/**
* @return {?}
*/
ngOnInit() {
this.focusMonitor.monitor(this.elementRef, true).subscribe((/**
* @param {?} focusOrigin
* @return {?}
*/
focusOrigin => {
if (!focusOrigin) {
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
}
}));
if (this.nzCheckboxWrapperComponent) {
this.nzCheckboxWrapperComponent.addCheckbox(this);
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzAutoFocus) {
this.updateAutoFocus();
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.updateAutoFocus();
this.checkContent();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.focusMonitor.stopMonitoring(this.elementRef);
if (this.nzCheckboxWrapperComponent) {
this.nzCheckboxWrapperComponent.removeCheckbox(this);
}
}
}
NzCheckboxComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-checkbox]',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<span class=\"ant-checkbox\"\n [class.ant-checkbox-checked]=\"nzChecked && !nzIndeterminate\"\n [class.ant-checkbox-disabled]=\"nzDisabled\"\n [class.ant-checkbox-indeterminate]=\"nzIndeterminate\">\n <input #inputElement [checked]=\"nzChecked\" [ngModel]=\"nzChecked\" [disabled]=\"nzDisabled\" (ngModelChange)=\"innerCheckedChange($event)\" (click)=\"$event.stopPropagation();\" type=\"checkbox\" class=\"ant-checkbox-input\">\n <span class=\"ant-checkbox-inner\"></span>\n</span>\n<span #contentElement (cdkObserveContent)=\"checkContent()\"><ng-content></ng-content></span>",
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzCheckboxComponent)),
multi: true
}
],
host: {
'(click)': 'hostClick($event)'
}
}] }
];
/** @nocollapse */
NzCheckboxComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzCheckboxWrapperComponent, decorators: [{ type: Optional }] },
{ type: ChangeDetectorRef },
{ type: FocusMonitor }
];
NzCheckboxComponent.propDecorators = {
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
contentElement: [{ type: ViewChild, args: ['contentElement',] }],
nzCheckedChange: [{ type: Output }],
nzValue: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzIndeterminate: [{ type: Input }],
nzChecked: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCheckboxComponent.prototype, "nzAutoFocus", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCheckboxComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCheckboxComponent.prototype, "nzIndeterminate", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCheckboxComponent.prototype, "nzChecked", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCheckboxModule {
}
NzCheckboxModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, ObserversModule],
declarations: [
NzCheckboxComponent,
NzCheckboxGroupComponent,
NzCheckboxWrapperComponent
],
exports: [
NzCheckboxComponent,
NzCheckboxGroupComponent,
NzCheckboxWrapperComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const collapseMotion = trigger('collapseMotion', [
state('expanded', style({ height: '*' })),
state('collapsed', style({ height: 0, overflow: 'hidden' })),
state('hidden', style({ height: 0, display: 'none' })),
transition('expanded => collapsed', animate(`150ms ${AnimationCurves.EASE_IN_OUT}`)),
transition('expanded => hidden', animate(`150ms ${AnimationCurves.EASE_IN_OUT}`)),
transition('collapsed => expanded', animate(`150ms ${AnimationCurves.EASE_IN_OUT}`)),
transition('hidden => expanded', animate(`150ms ${AnimationCurves.EASE_IN_OUT}`))
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCollapseComponent {
constructor() {
this.listOfNzCollapsePanelComponent = [];
this.nzAccordion = false;
this.nzBordered = true;
}
/**
* @param {?} value
* @return {?}
*/
addPanel(value) {
this.listOfNzCollapsePanelComponent.push(value);
}
/**
* @param {?} value
* @return {?}
*/
removePanel(value) {
this.listOfNzCollapsePanelComponent.splice(this.listOfNzCollapsePanelComponent.indexOf(value), 1);
}
/**
* @param {?} collapse
* @return {?}
*/
click(collapse) {
if (this.nzAccordion && !collapse.nzActive) {
this.listOfNzCollapsePanelComponent.filter((/**
* @param {?} item
* @return {?}
*/
item => item !== collapse)).forEach((/**
* @param {?} item
* @return {?}
*/
item => {
if (item.nzActive) {
item.nzActive = false;
item.nzActiveChange.emit(item.nzActive);
item.markForCheck();
}
}));
}
collapse.nzActive = !collapse.nzActive;
collapse.nzActiveChange.emit(collapse.nzActive);
}
}
NzCollapseComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-collapse',
template: "<div class=\"ant-collapse\" [class.ant-collapse-borderless]=\"!nzBordered\">\n <ng-content></ng-content>\n</div>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styles: [`nz-collapse {
display: block;
}`]
}] }
];
NzCollapseComponent.propDecorators = {
nzAccordion: [{ type: Input }],
nzBordered: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCollapseComponent.prototype, "nzAccordion", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCollapseComponent.prototype, "nzBordered", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCollapsePanelComponent {
/**
* @param {?} cdr
* @param {?} nzCollapseComponent
* @param {?} elementRef
* @param {?} renderer
*/
constructor(cdr, nzCollapseComponent, elementRef, renderer) {
this.cdr = cdr;
this.nzCollapseComponent = nzCollapseComponent;
this.nzActive = false;
this.nzDisabled = false;
this.nzShowArrow = true;
this.nzActiveChange = new EventEmitter();
renderer.addClass(elementRef.nativeElement, 'ant-collapse-item');
}
/**
* @return {?}
*/
clickHeader() {
if (!this.nzDisabled) {
this.nzCollapseComponent.click(this);
}
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnInit() {
this.nzCollapseComponent.addPanel(this);
}
/**
* @return {?}
*/
ngOnDestroy() {
this.nzCollapseComponent.removePanel(this);
}
}
NzCollapsePanelComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-collapse-panel',
template: "<div role=\"tab\" [attr.aria-expanded]=\"nzActive\" class=\"ant-collapse-header\" (click)=\"clickHeader()\">\n <ng-container *ngIf=\"nzShowArrow\">\n <ng-container *nzStringTemplateOutlet=\"nzExpandedIcon\">\n <i nz-icon [type]=\"nzExpandedIcon || 'right'\" class=\"ant-collapse-arrow\" [nzRotate]=\"nzActive ? 90 : 0\"></i>\n </ng-container>\n </ng-container>\n <ng-container *nzStringTemplateOutlet=\"nzHeader\">{{ nzHeader }}</ng-container>\n</div>\n<div class=\"ant-collapse-content\"\n [class.ant-collapse-content-active]=\"nzActive\"\n [@collapseMotion]=\"nzActive ? 'expanded' : 'hidden' \">\n <div class=\"ant-collapse-content-box\">\n <ng-content></ng-content>\n </div>\n</div>\n",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
animations: [collapseMotion],
host: {
'[class.ant-collapse-no-arrow]': '!nzShowArrow'
},
styles: [` nz-collapse-panel {
display: block
}`]
}] }
];
/** @nocollapse */
NzCollapsePanelComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzCollapseComponent, decorators: [{ type: Host }] },
{ type: ElementRef },
{ type: Renderer2 }
];
NzCollapsePanelComponent.propDecorators = {
nzActive: [{ type: Input }, { type: HostBinding, args: ['class.ant-collapse-item-active',] }],
nzDisabled: [{ type: Input }, { type: HostBinding, args: ['class.ant-collapse-item-disabled',] }],
nzShowArrow: [{ type: Input }],
nzHeader: [{ type: Input }],
nzExpandedIcon: [{ type: Input }],
nzActiveChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCollapsePanelComponent.prototype, "nzActive", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCollapsePanelComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzCollapsePanelComponent.prototype, "nzShowArrow", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCollapseModule {
}
NzCollapseModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzCollapsePanelComponent, NzCollapseComponent],
exports: [NzCollapsePanelComponent, NzCollapseComponent],
imports: [CommonModule, NzIconModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCommentAvatarDirective {
}
NzCommentAvatarDirective.decorators = [
{ type: Directive, args: [{
selector: 'nz-avatar[nz-comment-avatar]'
},] }
];
class NzCommentContentDirective {
}
NzCommentContentDirective.decorators = [
{ type: Directive, args: [{
selector: 'nz-comment-content, [nz-comment-content]',
host: { 'class': 'ant-comment-content-detail' }
},] }
];
class NzCommentActionHostDirective extends CdkPortalOutlet {
/**
* @param {?} componentFactoryResolver
* @param {?} viewContainerRef
*/
constructor(componentFactoryResolver, viewContainerRef) {
super(componentFactoryResolver, viewContainerRef);
}
/**
* @return {?}
*/
ngOnInit() {
super.ngOnInit();
this.attach(this.nzCommentActionHost);
}
/**
* @return {?}
*/
ngOnDestroy() {
super.ngOnDestroy();
}
}
NzCommentActionHostDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzCommentActionHost]'
},] }
];
/** @nocollapse */
NzCommentActionHostDirective.ctorParameters = () => [
{ type: ComponentFactoryResolver },
{ type: ViewContainerRef }
];
NzCommentActionHostDirective.propDecorators = {
nzCommentActionHost: [{ type: Input }]
};
class NzCommentActionComponent {
/**
* @param {?} viewContainerRef
*/
constructor(viewContainerRef) {
this.viewContainerRef = viewContainerRef;
this.contentPortal = null;
}
/**
* @return {?}
*/
get content() {
return this.contentPortal;
}
/**
* @return {?}
*/
ngOnInit() {
this.contentPortal = new TemplatePortal(this.implicitContent, this.viewContainerRef);
}
}
NzCommentActionComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-comment-action',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-template><ng-content></ng-content></ng-template>'
}] }
];
/** @nocollapse */
NzCommentActionComponent.ctorParameters = () => [
{ type: ViewContainerRef }
];
NzCommentActionComponent.propDecorators = {
implicitContent: [{ type: ViewChild, args: [TemplateRef,] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCommentComponent {
constructor() {
}
}
NzCommentComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-comment',
template: "<div class=\"ant-comment-inner\">\n <div class=\"ant-comment-avatar\">\n <ng-content select=\"nz-avatar[nz-comment-avatar]\"></ng-content>\n </div>\n <div class=\"ant-comment-content\">\n <div class=\"ant-comment-content-author\">\n <span *ngIf=\"nzAuthor\" class=\"ant-comment-content-author-name\">\n <ng-container *nzStringTemplateOutlet=\"nzAuthor\">{{ nzAuthor }}</ng-container>\n </span>\n <span *ngIf=\"nzDatetime\" class=\"ant-comment-content-author-time\">\n <ng-container *nzStringTemplateOutlet=\"nzDatetime\">{{ nzDatetime }}</ng-container>\n </span>\n </div>\n <ng-content select=\"nz-comment-content\"></ng-content>\n <ul class=\"ant-comment-actions\" *ngIf=\"actions?.length\">\n <li *ngFor=\"let action of actions\">\n <span><ng-template [nzCommentActionHost]=\"action.content\"></ng-template></span>\n </li>\n </ul>\n </div>\n</div>\n<div class=\"ant-comment-nested\">\n <ng-content></ng-content>\n</div>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'class': 'ant-comment'
},
styles: [`
nz-comment {
display: block;
}
nz-comment-content {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzCommentComponent.ctorParameters = () => [];
NzCommentComponent.propDecorators = {
nzAuthor: [{ type: Input }],
nzDatetime: [{ type: Input }],
actions: [{ type: ContentChildren, args: [NzCommentActionComponent,] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_COMMENT_CELLS = [
NzCommentAvatarDirective,
NzCommentContentDirective,
NzCommentActionComponent,
NzCommentActionHostDirective
];
class NzCommentModule {
}
NzCommentModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
NzAddOnModule
],
exports: [NzCommentComponent, ...NZ_COMMENT_CELLS],
declarations: [NzCommentComponent, ...NZ_COMMENT_CELLS]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimeValueAccessorDirective {
/**
* @param {?} dateHelper
* @param {?} elementRef
*/
constructor(dateHelper, elementRef) {
this.dateHelper = dateHelper;
this.elementRef = elementRef;
}
/**
* @return {?}
*/
keyup() {
this.changed();
}
/**
* @return {?}
*/
blur() {
this.touched();
}
/**
* @return {?}
*/
changed() {
if (this._onChange) {
/** @type {?} */
const value = this.dateHelper.parseTime(this.elementRef.nativeElement.value);
this._onChange(value);
}
}
/**
* @return {?}
*/
touched() {
if (this._onTouch) {
this._onTouch();
}
}
/**
* @return {?}
*/
setRange() {
this.elementRef.nativeElement.focus();
this.elementRef.nativeElement.setSelectionRange(0, this.elementRef.nativeElement.value.length);
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.elementRef.nativeElement.value = this.dateHelper.format(value, this.nzTime);
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this._onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this._onTouch = fn;
}
}
NzTimeValueAccessorDirective.decorators = [
{ type: Directive, args: [{
selector: 'input[nzTime]',
providers: [
{ provide: NG_VALUE_ACCESSOR, useExisting: NzTimeValueAccessorDirective, multi: true }
]
},] }
];
/** @nocollapse */
NzTimeValueAccessorDirective.ctorParameters = () => [
{ type: DateHelperService$$1 },
{ type: ElementRef }
];
NzTimeValueAccessorDirective.propDecorators = {
nzTime: [{ type: Input }],
keyup: [{ type: HostListener, args: ['keyup',] }],
blur: [{ type: HostListener, args: ['blur',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class TimeHolder {
constructor() {
this._seconds = undefined;
this._hours = undefined;
this._minutes = undefined;
this._defaultOpenValue = new Date();
this._changes = new Subject();
}
/**
* @return {?}
*/
setDefaultValueIfNil() {
if (!isNotNil(this._value)) {
this._value = new Date(this.defaultOpenValue);
}
}
/**
* @template THIS
* @this {THIS}
* @param {?} value
* @param {?} disabled
* @return {THIS}
*/
setMinutes(value, disabled) {
if (disabled) {
return (/** @type {?} */ (this));
}
(/** @type {?} */ (this)).setDefaultValueIfNil();
(/** @type {?} */ (this)).minutes = value;
return (/** @type {?} */ (this));
}
/**
* @template THIS
* @this {THIS}
* @param {?} value
* @param {?} disabled
* @return {THIS}
*/
setHours(value, disabled) {
if (disabled) {
return (/** @type {?} */ (this));
}
(/** @type {?} */ (this)).setDefaultValueIfNil();
(/** @type {?} */ (this)).hours = value;
return (/** @type {?} */ (this));
}
/**
* @template THIS
* @this {THIS}
* @param {?} value
* @param {?} disabled
* @return {THIS}
*/
setSeconds(value, disabled) {
if (disabled) {
return (/** @type {?} */ (this));
}
(/** @type {?} */ (this)).setDefaultValueIfNil();
(/** @type {?} */ (this)).seconds = value;
return (/** @type {?} */ (this));
}
/**
* @return {?}
*/
get changes() {
return this._changes.asObservable();
}
/**
* @return {?}
*/
get value() {
return this._value;
}
/**
* @param {?} value
* @return {?}
*/
set value(value) {
if (value !== this._value) {
this._value = value;
if (isNotNil(this._value)) {
this._hours = this._value.getHours();
this._minutes = this._value.getMinutes();
this._seconds = this._value.getSeconds();
}
else {
this._clear();
}
}
}
/**
* @template THIS
* @this {THIS}
* @param {?} value
* @return {THIS}
*/
setValue(value) {
(/** @type {?} */ (this)).value = value;
return (/** @type {?} */ (this));
}
/**
* @return {?}
*/
clear() {
this._clear();
this.update();
}
/**
* @return {?}
*/
get isEmpty() {
return !(isNotNil(this._hours) || isNotNil(this._minutes) || isNotNil(this._seconds));
}
/**
* @private
* @return {?}
*/
_clear() {
this._hours = undefined;
this._minutes = undefined;
this._seconds = undefined;
}
/**
* @private
* @return {?}
*/
update() {
if (this.isEmpty) {
this._value = undefined;
}
else {
if (!isNotNil(this._hours)) {
this._hours = this.defaultHours;
}
else {
this._value.setHours(this.hours);
}
if (!isNotNil(this._minutes)) {
this._minutes = this.defaultMinutes;
}
else {
this._value.setMinutes(this.minutes);
}
if (!isNotNil(this._seconds)) {
this._seconds = this.defaultSeconds;
}
else {
this._value.setSeconds(this.seconds);
}
this._value = new Date(this._value);
}
this.changed();
}
/**
* @return {?}
*/
changed() {
this._changes.next(this._value);
}
/**
* @return {?}
*/
get hours() {
return this._hours;
}
/**
* @param {?} value
* @return {?}
*/
set hours(value) {
if (value !== this._hours) {
this._hours = value;
this.update();
}
}
/**
* @return {?}
*/
get minutes() {
return this._minutes;
}
/**
* @param {?} value
* @return {?}
*/
set minutes(value) {
if (value !== this._minutes) {
this._minutes = value;
this.update();
}
}
/**
* @return {?}
*/
get seconds() {
return this._seconds;
}
/**
* @param {?} value
* @return {?}
*/
set seconds(value) {
if (value !== this._seconds) {
this._seconds = value;
this.update();
}
}
/**
* @return {?}
*/
get defaultOpenValue() {
return this._defaultOpenValue;
}
/**
* @param {?} value
* @return {?}
*/
set defaultOpenValue(value) {
if (this._defaultOpenValue !== value) {
this._defaultOpenValue = value;
this.update();
}
}
/**
* @template THIS
* @this {THIS}
* @param {?} value
* @return {THIS}
*/
setDefaultOpenValue(value) {
(/** @type {?} */ (this)).defaultOpenValue = value;
return (/** @type {?} */ (this));
}
/**
* @return {?}
*/
get defaultHours() {
return this._defaultOpenValue.getHours();
}
/**
* @return {?}
*/
get defaultMinutes() {
return this._defaultOpenValue.getMinutes();
}
/**
* @return {?}
*/
get defaultSeconds() {
return this._defaultOpenValue.getSeconds();
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} length
* @param {?=} step
* @return {?}
*/
function makeRange(length, step = 1) {
return new Array(Math.ceil(length / step)).fill(0).map((/**
* @param {?} _
* @param {?} i
* @return {?}
*/
(_, i) => i * step));
}
class NzTimePickerPanelComponent {
/**
* @param {?} element
* @param {?} updateCls
* @param {?} cdr
*/
constructor(element, updateCls, cdr) {
this.element = element;
this.updateCls = updateCls;
this.cdr = cdr;
this._nzHourStep = 1;
this._nzMinuteStep = 1;
this._nzSecondStep = 1;
this.unsubscribe$ = new Subject();
this._format = 'HH:mm:ss';
this._defaultOpenValue = new Date();
this._opened = false;
this._allowEmpty = true;
this.prefixCls = 'ant-time-picker-panel';
this.time = new TimeHolder();
this.hourEnabled = true;
this.minuteEnabled = true;
this.secondEnabled = true;
this.enabledColumns = 3;
this.nzInDatePicker = false; // If inside a date-picker, more diff works need to be done
this.nzHideDisabledOptions = false;
}
/**
* @param {?} value
* @return {?}
*/
set nzAllowEmpty(value) {
if (isNotNil(value)) {
this._allowEmpty = value;
}
}
/**
* @return {?}
*/
get nzAllowEmpty() {
return this._allowEmpty;
}
/**
* @param {?} value
* @return {?}
*/
set opened(value) {
this._opened = value;
if (this.opened) {
this.initPosition();
this.selectInputRange();
}
}
/**
* @return {?}
*/
get opened() {
return this._opened;
}
/**
* @param {?} value
* @return {?}
*/
set nzDefaultOpenValue(value) {
if (isNotNil(value)) {
this._defaultOpenValue = value;
this.time.setDefaultOpenValue(this.nzDefaultOpenValue);
}
}
/**
* @return {?}
*/
get nzDefaultOpenValue() {
return this._defaultOpenValue;
}
/**
* @param {?} value
* @return {?}
*/
set nzDisabledHours(value) {
this._disabledHours = value;
if (this._disabledHours) {
this.buildHours();
}
}
/**
* @return {?}
*/
get nzDisabledHours() {
return this._disabledHours;
}
/**
* @param {?} value
* @return {?}
*/
set nzDisabledMinutes(value) {
if (isNotNil(value)) {
this._disabledMinutes = value;
this.buildMinutes();
}
}
/**
* @return {?}
*/
get nzDisabledMinutes() {
return this._disabledMinutes;
}
/**
* @param {?} value
* @return {?}
*/
set nzDisabledSeconds(value) {
if (isNotNil(value)) {
this._disabledSeconds = value;
this.buildSeconds();
}
}
/**
* @return {?}
*/
get nzDisabledSeconds() {
return this._disabledSeconds;
}
/**
* @param {?} value
* @return {?}
*/
set format(value) {
if (isNotNil(value)) {
this._format = value;
this.enabledColumns = 0;
/** @type {?} */
const charSet = new Set(value);
this.hourEnabled = charSet.has('H') || charSet.has('h');
this.minuteEnabled = charSet.has('m');
this.secondEnabled = charSet.has('s');
if (this.hourEnabled) {
this.enabledColumns++;
}
if (this.minuteEnabled) {
this.enabledColumns++;
}
if (this.secondEnabled) {
this.enabledColumns++;
}
}
}
/**
* @return {?}
*/
get format() {
return this._format;
}
/**
* @param {?} value
* @return {?}
*/
set nzHourStep(value) {
if (isNotNil(value)) {
this._nzHourStep = value;
this.buildHours();
}
}
/**
* @return {?}
*/
get nzHourStep() {
return this._nzHourStep;
}
/**
* @param {?} value
* @return {?}
*/
set nzMinuteStep(value) {
if (isNotNil(value)) {
this._nzMinuteStep = value;
this.buildMinutes();
}
}
/**
* @return {?}
*/
get nzMinuteStep() {
return this._nzMinuteStep;
}
/**
* @param {?} value
* @return {?}
*/
set nzSecondStep(value) {
if (isNotNil(value)) {
this._nzSecondStep = value;
this.buildSeconds();
}
}
/**
* @return {?}
*/
get nzSecondStep() {
return this._nzSecondStep;
}
/**
* @return {?}
*/
selectInputRange() {
setTimeout((/**
* @return {?}
*/
() => {
if (this.nzTimeValueAccessorDirective) {
this.nzTimeValueAccessorDirective.setRange();
}
}));
}
/**
* @return {?}
*/
buildHours() {
this.hourRange = makeRange(24, this.nzHourStep).map((/**
* @param {?} r
* @return {?}
*/
r => {
return {
index: r,
disabled: this.nzDisabledHours && (this.nzDisabledHours().indexOf(r) !== -1)
};
}));
}
/**
* @return {?}
*/
buildMinutes() {
this.minuteRange = makeRange(60, this.nzMinuteStep).map((/**
* @param {?} r
* @return {?}
*/
r => {
return {
index: r,
disabled: this.nzDisabledMinutes && (this.nzDisabledMinutes(this.time.hours).indexOf(r) !== -1)
};
}));
}
/**
* @return {?}
*/
buildSeconds() {
this.secondRange = makeRange(60, this.nzSecondStep).map((/**
* @param {?} r
* @return {?}
*/
r => {
return {
index: r,
disabled: this.nzDisabledSeconds && (this.nzDisabledSeconds(this.time.hours, this.time.minutes).indexOf(r) !== -1)
};
}));
}
/**
* @return {?}
*/
buildTimes() {
this.buildHours();
this.buildMinutes();
this.buildSeconds();
}
/**
* @param {?} hour
* @return {?}
*/
selectHour(hour) {
this.time.setHours(hour.index, hour.disabled);
this.scrollToSelected(this.hourListElement.nativeElement, hour.index, 120, 'hour');
if (this._disabledMinutes) {
this.buildMinutes();
}
if (this._disabledSeconds || this._disabledMinutes) {
this.buildSeconds();
}
}
/**
* @param {?} minute
* @return {?}
*/
selectMinute(minute) {
this.time.setMinutes(minute.index, minute.disabled);
this.scrollToSelected(this.minuteListElement.nativeElement, minute.index, 120, 'minute');
if (this._disabledSeconds) {
this.buildSeconds();
}
}
/**
* @param {?} second
* @return {?}
*/
selectSecond(second) {
this.time.setSeconds(second.index, second.disabled);
this.scrollToSelected(this.secondListElement.nativeElement, second.index, 120, 'second');
}
/**
* @param {?} instance
* @param {?} index
* @param {?=} duration
* @param {?=} unit
* @return {?}
*/
scrollToSelected(instance, index, duration = 0, unit) {
/** @type {?} */
const transIndex = this.translateIndex(index, unit);
/** @type {?} */
const currentOption = (/** @type {?} */ ((instance.children[0].children[transIndex] || instance.children[0].children[0])));
this.scrollTo(instance, currentOption.offsetTop, duration);
}
/**
* @param {?} index
* @param {?} unit
* @return {?}
*/
translateIndex(index, unit) {
if (unit === 'hour') {
/** @type {?} */
const disabledHours = this.nzDisabledHours && this.nzDisabledHours();
return this.calcIndex(disabledHours, this.hourRange.map((/**
* @param {?} item
* @return {?}
*/
item => item.index)).indexOf(index));
}
else if (unit === 'minute') {
/** @type {?} */
const disabledMinutes = this.nzDisabledMinutes && this.nzDisabledMinutes(this.time.hours);
return this.calcIndex(disabledMinutes, this.minuteRange.map((/**
* @param {?} item
* @return {?}
*/
item => item.index)).indexOf(index));
}
else if (unit === 'second') {
/** @type {?} */
const disabledSeconds = this.nzDisabledSeconds && this.nzDisabledSeconds(this.time.hours, this.time.minutes);
return this.calcIndex(disabledSeconds, this.secondRange.map((/**
* @param {?} item
* @return {?}
*/
item => item.index)).indexOf(index));
}
}
/**
* @param {?} element
* @param {?} to
* @param {?} duration
* @return {?}
*/
scrollTo(element, to, duration) {
if (duration <= 0) {
element.scrollTop = to;
return;
}
/** @type {?} */
const difference = to - element.scrollTop;
/** @type {?} */
const perTick = difference / duration * 10;
reqAnimFrame((/**
* @return {?}
*/
() => {
element.scrollTop = element.scrollTop + perTick;
if (element.scrollTop === to) {
return;
}
this.scrollTo(element, to, duration - 10);
}));
}
/**
* @param {?} array
* @param {?} index
* @return {?}
*/
calcIndex(array, index) {
if (array && array.length && this.nzHideDisabledOptions) {
return index - array.reduce((/**
* @param {?} pre
* @param {?} value
* @return {?}
*/
(pre, value) => {
return pre + (value < index ? 1 : 0);
}), 0);
}
else {
return index;
}
}
/**
* @protected
* @return {?}
*/
changed() {
if (this.onChange) {
this.onChange(this.time.value);
}
}
/**
* @protected
* @return {?}
*/
touched() {
if (this.onTouch) {
this.onTouch();
}
}
/**
* @private
* @return {?}
*/
setClassMap() {
this.updateCls.updateHostClass(this.element.nativeElement, {
[`${this.prefixCls}`]: true,
[`${this.prefixCls}-column-${this.enabledColumns}`]: this.nzInDatePicker ? false : true,
[`${this.prefixCls}-narrow`]: this.enabledColumns < 3,
[`${this.prefixCls}-placement-bottomLeft`]: this.nzInDatePicker ? false : true
});
}
/**
* @param {?} hour
* @return {?}
*/
isSelectedHour(hour) {
return (hour.index === this.time.hours) || (!isNotNil(this.time.hours) && (hour.index === this.time.defaultHours));
}
/**
* @param {?} minute
* @return {?}
*/
isSelectedMinute(minute) {
return (minute.index === this.time.minutes) || (!isNotNil(this.time.minutes) && (minute.index === this.time.defaultMinutes));
}
/**
* @param {?} second
* @return {?}
*/
isSelectedSecond(second) {
return (second.index === this.time.seconds) || (!isNotNil(this.time.seconds) && (second.index === this.time.defaultSeconds));
}
/**
* @return {?}
*/
initPosition() {
setTimeout((/**
* @return {?}
*/
() => {
if (this.hourEnabled && this.hourListElement) {
if (isNotNil(this.time.hours)) {
this.scrollToSelected(this.hourListElement.nativeElement, this.time.hours, 0, 'hour');
}
else {
this.scrollToSelected(this.hourListElement.nativeElement, this.time.defaultHours, 0, 'hour');
}
}
if (this.minuteEnabled && this.minuteListElement) {
if (isNotNil(this.time.minutes)) {
this.scrollToSelected(this.minuteListElement.nativeElement, this.time.minutes, 0, 'minute');
}
else {
this.scrollToSelected(this.minuteListElement.nativeElement, this.time.defaultMinutes, 0, 'minute');
}
}
if (this.secondEnabled && this.secondListElement) {
if (isNotNil(this.time.seconds)) {
this.scrollToSelected(this.secondListElement.nativeElement, this.time.seconds, 0, 'second');
}
else {
this.scrollToSelected(this.secondListElement.nativeElement, this.time.defaultSeconds, 0, 'second');
}
}
}));
}
/**
* @return {?}
*/
ngOnInit() {
if (this.nzInDatePicker) {
this.prefixCls = 'ant-calendar-time-picker';
}
this.time.changes.pipe(takeUntil(this.unsubscribe$)).subscribe((/**
* @return {?}
*/
() => {
this.changed();
this.touched();
}));
this.buildTimes();
this.setClassMap();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.unsubscribe$.next();
this.unsubscribe$.complete();
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.time.value = value;
this.buildTimes();
// Mark this component to be checked manually with internal properties changing (see: https://github.com/angular/angular/issues/10816)
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouch = fn;
}
}
NzTimePickerPanelComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-time-picker-panel',
template: "<div class=\"{{ nzInDatePicker ? prefixCls + '-panel' : '' }}\">\n <div\n class=\"{{ prefixCls }}-inner {{ nzInDatePicker ? prefixCls + '-column-' + enabledColumns : '' }}\"\n [style.width.px]=\"nzInDatePicker ? null : enabledColumns * 56\">\n <div class=\"{{ prefixCls }}-input-wrap\">\n <input\n type=\"text\"\n class=\"{{ prefixCls }}-input\"\n [placeholder]=\"nzPlaceHolder\"\n [nzTime]=\"format\"\n [(ngModel)]=\"time.value\"\n (blur)=\"time.changed()\">\n </div>\n <div class=\"{{ prefixCls }}-combobox\">\n <div\n *ngIf=\"hourEnabled\"\n #hourListElement\n class=\"{{ prefixCls }}-select\">\n <ul>\n <ng-container *ngFor=\"let hour of hourRange\">\n <li\n *ngIf=\"!(nzHideDisabledOptions && hour.disabled)\"\n (click)=\"selectHour(hour)\"\n class=\"\n {{ isSelectedHour(hour) ? prefixCls + '-select-option-selected' : '' }}\n {{ hour.disabled ? prefixCls + '-select-option-disabled' : '' }}\n \"\n >\n {{ hour.index | number:'2.0-0' }}\n </li>\n </ng-container>\n </ul>\n </div>\n <div\n *ngIf=\"minuteEnabled\"\n #minuteListElement\n class=\"{{ prefixCls }}-select\">\n <ul>\n <ng-container *ngFor=\"let minute of minuteRange\">\n <li\n *ngIf=\"!(nzHideDisabledOptions && minute.disabled)\"\n (click)=\"selectMinute(minute)\"\n class=\"\n {{ isSelectedMinute(minute) ? prefixCls + '-select-option-selected' : '' }}\n {{ minute.disabled ? prefixCls + '-select-option-disabled' : '' }}\n \"\n >\n {{ minute.index | number:'2.0-0' }}\n </li>\n </ng-container>\n </ul>\n </div>\n <div\n *ngIf=\"secondEnabled\"\n #secondListElement\n class=\"{{ prefixCls }}-select\">\n <ul>\n <ng-container *ngFor=\"let second of secondRange\">\n <li\n *ngIf=\"!(nzHideDisabledOptions && second.disabled)\"\n (click)=\"selectSecond(second)\"\n class=\"\n {{ isSelectedSecond(second) ? prefixCls + '-select-option-selected' : '' }}\n {{ second.disabled ? prefixCls + '-select-option-disabled' : '' }}\n \"\n >\n {{ second.index | number:'2.0-0' }}\n </li>\n </ng-container>\n </ul>\n </div>\n </div>\n <div class=\"{{ prefixCls }}-addon\" *ngIf=\"nzAddOn\">\n <ng-template [ngTemplateOutlet]=\"nzAddOn\"></ng-template>\n </div>\n </div>\n</div>",
providers: [
NzUpdateHostClassService,
{ provide: NG_VALUE_ACCESSOR, useExisting: NzTimePickerPanelComponent, multi: true }
]
}] }
];
/** @nocollapse */
NzTimePickerPanelComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzUpdateHostClassService },
{ type: ChangeDetectorRef }
];
NzTimePickerPanelComponent.propDecorators = {
nzTimeValueAccessorDirective: [{ type: ViewChild, args: [NzTimeValueAccessorDirective,] }],
hourListElement: [{ type: ViewChild, args: ['hourListElement',] }],
minuteListElement: [{ type: ViewChild, args: ['minuteListElement',] }],
secondListElement: [{ type: ViewChild, args: ['secondListElement',] }],
nzInDatePicker: [{ type: Input }],
nzAddOn: [{ type: Input }],
nzHideDisabledOptions: [{ type: Input }],
nzClearText: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzAllowEmpty: [{ type: Input }],
opened: [{ type: Input }],
nzDefaultOpenValue: [{ type: Input }],
nzDisabledHours: [{ type: Input }],
nzDisabledMinutes: [{ type: Input }],
nzDisabledSeconds: [{ type: Input }],
format: [{ type: Input }],
nzHourStep: [{ type: Input }],
nzMinuteStep: [{ type: Input }],
nzSecondStep: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimePickerComponent {
/**
* @param {?} element
* @param {?} renderer
* @param {?} updateCls
* @param {?} cdr
*/
constructor(element, renderer, updateCls, cdr) {
this.element = element;
this.renderer = renderer;
this.updateCls = updateCls;
this.cdr = cdr;
this._disabled = false;
this._value = null;
this._allowEmpty = true;
this._autoFocus = false;
this._hideDisabledOptions = false;
this.isInit = false;
this.overlayPositions = [{
originX: 'start',
originY: 'top',
overlayX: 'end',
overlayY: 'top',
offsetX: 0,
offsetY: 0
}];
this.nzSize = null;
this.nzHourStep = 1;
this.nzMinuteStep = 1;
this.nzSecondStep = 1;
this.nzClearText = 'clear';
this.nzPopupClassName = '';
this.nzPlaceHolder = '';
this.nzDefaultOpenValue = new Date();
this.nzFormat = 'HH:mm:ss';
this.nzOpen = false;
this.nzOpenChange = new EventEmitter();
}
/**
* @param {?} value
* @return {?}
*/
set nzHideDisabledOptions(value) {
this._hideDisabledOptions = toBoolean(value);
}
/**
* @return {?}
*/
get nzHideDisabledOptions() {
return this._hideDisabledOptions;
}
/**
* @param {?} value
* @return {?}
*/
set nzAllowEmpty(value) {
this._allowEmpty = toBoolean(value);
}
/**
* @return {?}
*/
get nzAllowEmpty() {
return this._allowEmpty;
}
/**
* @param {?} value
* @return {?}
*/
set nzAutoFocus(value) {
this._autoFocus = toBoolean(value);
this.updateAutoFocus();
}
/**
* @return {?}
*/
get nzAutoFocus() {
return this._autoFocus;
}
/**
* @param {?} value
* @return {?}
*/
set nzDisabled(value) {
this._disabled = toBoolean(value);
/** @type {?} */
const input = (/** @type {?} */ (this.inputRef.nativeElement));
if (this._disabled) {
this.renderer.setAttribute(input, 'disabled', '');
}
else {
this.renderer.removeAttribute(input, 'disabled');
}
}
/**
* @return {?}
*/
get nzDisabled() {
return this._disabled;
}
/**
* @param {?} value
* @return {?}
*/
set value(value) {
this._value = value;
if (this._onChange) {
this._onChange(this.value);
}
if (this._onTouched) {
this._onTouched();
}
}
/**
* @return {?}
*/
get value() {
return this._value;
}
/**
* @return {?}
*/
open() {
if (this.nzDisabled) {
return;
}
this.nzOpen = true;
this.nzOpenChange.emit(this.nzOpen);
}
/**
* @return {?}
*/
close() {
this.nzOpen = false;
this.nzOpenChange.emit(this.nzOpen);
}
/**
* @return {?}
*/
updateAutoFocus() {
if (this.isInit && !this.nzDisabled) {
if (this.nzAutoFocus) {
this.renderer.setAttribute(this.inputRef.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.inputRef.nativeElement, 'autofocus');
}
}
}
/**
* @return {?}
*/
onClickClearBtn() {
this.value = null;
}
/**
* @private
* @return {?}
*/
setClassMap() {
this.updateCls.updateHostClass(this.element.nativeElement, {
[`ant-time-picker`]: true,
[`ant-time-picker-${this.nzSize}`]: isNotNil(this.nzSize)
});
}
/**
* @return {?}
*/
focus() {
if (this.inputRef.nativeElement) {
this.inputRef.nativeElement.focus();
}
}
/**
* @return {?}
*/
blur() {
if (this.inputRef.nativeElement) {
this.inputRef.nativeElement.blur();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.origin = new CdkOverlayOrigin(this.element);
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.isInit = true;
this.updateAutoFocus();
}
/**
* @param {?} time
* @return {?}
*/
writeValue(time) {
this._value = time;
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this._onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this._onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
}
NzTimePickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-time-picker',
template: "<input\n type=\"text\"\n [nzTime]=\"nzFormat\"\n class=\"ant-time-picker-input\"\n [placeholder]=\"nzPlaceHolder || ('TimePicker.placeholder' | nzI18n)\"\n [(ngModel)]=\"value\"\n readonly=\"readonly\"\n (click)=\"open()\"\n #inputElement>\n<span class=\"ant-time-picker-icon\">\n <i nz-icon type=\"clock-circle\"></i>\n</span>\n<i\n *ngIf=\"nzAllowEmpty && value\"\n nz-icon\n type=\"close-circle\"\n theme=\"fill\"\n class=\"anticon anticon-close-circle ant-time-picker-clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"nzClearText\"\n [attr.title]=\"nzClearText\"\n (click)=\"onClickClearBtn()\"\n></i>\n\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"nzOpen\"\n [cdkConnectedOverlayOffsetY]=\"-2\"\n (detach)=\"close()\"\n (backdropClick)=\"close()\">\n <nz-time-picker-panel\n [ngClass]=\"nzPopupClassName\"\n [@slideMotion]=\"'bottom'\"\n [format]=\"nzFormat\"\n [nzHourStep]=\"nzHourStep\"\n [nzMinuteStep]=\"nzMinuteStep\"\n [nzSecondStep]=\"nzSecondStep\"\n [nzDisabledHours]=\"nzDisabledHours\"\n [nzDisabledMinutes]=\"nzDisabledMinutes\"\n [nzDisabledSeconds]=\"nzDisabledSeconds\"\n [nzPlaceHolder]=\"nzPlaceHolder || ('TimePicker.placeholder' | nzI18n)\"\n [nzHideDisabledOptions]=\"nzHideDisabledOptions\"\n [nzDefaultOpenValue]=\"nzDefaultOpenValue\"\n [nzAddOn]=\"nzAddOn\"\n [opened]=\"nzOpen\"\n [nzClearText]=\"nzClearText\"\n [nzAllowEmpty]=\"nzAllowEmpty\"\n [(ngModel)]=\"value\">\n </nz-time-picker-panel>\n</ng-template>\n\n",
animations: [slideMotion],
providers: [
NzUpdateHostClassService,
{ provide: NG_VALUE_ACCESSOR, useExisting: NzTimePickerComponent, multi: true }
]
}] }
];
/** @nocollapse */
NzTimePickerComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzUpdateHostClassService },
{ type: ChangeDetectorRef }
];
NzTimePickerComponent.propDecorators = {
inputRef: [{ type: ViewChild, args: ['inputElement',] }],
nzSize: [{ type: Input }],
nzHourStep: [{ type: Input }],
nzMinuteStep: [{ type: Input }],
nzSecondStep: [{ type: Input }],
nzClearText: [{ type: Input }],
nzPopupClassName: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzAddOn: [{ type: Input }],
nzDefaultOpenValue: [{ type: Input }],
nzDisabledHours: [{ type: Input }],
nzDisabledMinutes: [{ type: Input }],
nzDisabledSeconds: [{ type: Input }],
nzFormat: [{ type: Input }],
nzOpen: [{ type: Input }],
nzOpenChange: [{ type: Output }],
nzHideDisabledOptions: [{ type: Input }],
nzAllowEmpty: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzDisabled: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimePickerModule {
}
NzTimePickerModule.decorators = [
{ type: NgModule, args: [{
declarations: [
NzTimePickerComponent,
NzTimePickerPanelComponent,
NzTimeValueAccessorDirective
],
exports: [
NzTimePickerPanelComponent,
NzTimePickerComponent
],
imports: [CommonModule, FormsModule, NzI18nModule, OverlayModule, NzIconModule, NzOverlayModule],
entryComponents: []
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class CalendarFooterComponent {
constructor() {
this.showToday = false;
this.hasTimePicker = false;
this.isRange = false;
this.showTimePicker = false;
this.showTimePickerChange = new EventEmitter();
this.timePickerDisabled = false;
this.okDisabled = false;
this.clickOk = new EventEmitter();
this.clickToday = new EventEmitter();
this.prefixCls = 'ant-calendar';
this.isTemplateRef = isTemplateRef;
this.isNonEmptyString = isNonEmptyString;
}
}
CalendarFooterComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'calendar-footer',
template: "<div class=\"{{ prefixCls }}-footer {{ isRange ? prefixCls + '-range-bottom' : '' }} {{ hasTimePicker ? prefixCls + '-footer-show-ok' : '' }}\">\n <div *ngIf=\"rangeQuickSelector\" class=\"{{ prefixCls }}-footer-extra {{ prefixCls }}-range-quick-selector\">\n <ng-container *ngTemplateOutlet=\"rangeQuickSelector\"></ng-container>\n </div>\n <div *ngIf=\"extraFooter\" class=\"{{ prefixCls }}-footer-extra {{ isRange ? prefixCls + '-range-quick-selector' : '' }}\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(extraFooter)\">\n <ng-container *ngTemplateOutlet=\"extraFooter\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(extraFooter)\">\n <span [innerHTML]=\"extraFooter\"></span>\n </ng-container>\n </ng-container>\n </div>\n <span *ngIf=\"showToday || hasTimePicker\" class=\"{{ prefixCls }}-footer-btn\">\n <today-button\n *ngIf=\"showToday\"\n [locale]=\"locale\"\n [disabledDate]=\"disabledDate\"\n [hasTimePicker]=\"hasTimePicker\"\n (clickToday)=\"clickToday.emit($event)\"\n ></today-button>\n <time-picker-button\n *ngIf=\"hasTimePicker\"\n [locale]=\"locale\"\n [timePickerDisabled]=\"timePickerDisabled\"\n [showTimePicker]=\"showTimePicker\"\n (showTimePickerChange)=\"showTimePickerChange.emit($event)\"\n ></time-picker-button>\n <ok-button\n *ngIf=\"hasTimePicker\"\n [okDisabled]=\"okDisabled\"\n [locale]=\"locale\"\n (clickOk)=\"clickOk.emit()\"\n ></ok-button>\n </span>\n</div>"
}] }
];
CalendarFooterComponent.propDecorators = {
locale: [{ type: Input }],
showToday: [{ type: Input }],
hasTimePicker: [{ type: Input }],
isRange: [{ type: Input }],
showTimePicker: [{ type: Input }],
showTimePickerChange: [{ type: Output }],
timePickerDisabled: [{ type: Input }],
okDisabled: [{ type: Input }],
disabledDate: [{ type: Input }],
extraFooter: [{ type: Input }],
rangeQuickSelector: [{ type: Input }],
clickOk: [{ type: Output }],
clickToday: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Wrapping kind APIs for date operating and unify
* NOTE: every new API return new CandyDate object without side effects to the former Date object
* NOTE: most APIs are based on local time other than customized locale id (this needs tobe support in future)
* TODO: support format() against to angular's core API
*/
class CandyDate {
// locale: string; // Custom specified locale ID
/**
* @param {?=} date
*/
constructor(date) {
// if (!(this instanceof CandyDate)) {
// return new CandyDate(date);
// }
if (date) {
if (date instanceof Date) {
this.nativeDate = date;
}
else if (typeof date === 'string') {
this.nativeDate = new Date(date);
}
else {
throw new Error('The input date type is not supported ("Date" and "string" is now recommended)');
}
}
else {
this.nativeDate = new Date();
}
}
// getLocale(): string {
// return this.locale;
// }
// setLocale(locale: string): CandyDate {
// this.locale = locale;
// return this;
// }
// ---------------------------------------------------------------------
// | Native shortcuts
// ---------------------------------------------------------------------
/**
* @return {?}
*/
getYear() {
return this.nativeDate.getFullYear();
}
/**
* @return {?}
*/
getMonth() {
return this.nativeDate.getMonth();
}
/**
* @return {?}
*/
getDay() {
return this.nativeDate.getDay();
}
/**
* @return {?}
*/
getTime() {
return this.nativeDate.getTime();
}
/**
* @return {?}
*/
getDate() {
return this.nativeDate.getDate();
}
/**
* @return {?}
*/
getHours() {
return this.nativeDate.getHours();
}
/**
* @return {?}
*/
getMinutes() {
return this.nativeDate.getMinutes();
}
/**
* @return {?}
*/
getSeconds() {
return this.nativeDate.getSeconds();
}
/**
* @return {?}
*/
getMilliseconds() {
return this.nativeDate.getMilliseconds();
}
// ---------------------------------------------------------------------
// | New implementing APIs
// ---------------------------------------------------------------------
/**
* @return {?}
*/
clone() {
return new CandyDate(new Date(this.nativeDate));
}
/**
* @param {?} hour
* @param {?} minute
* @param {?} second
* @return {?}
*/
setHms(hour, minute, second) {
/** @type {?} */
const date = new Date(this.nativeDate);
date.setHours(hour, minute, second);
return new CandyDate(date);
}
/**
* @param {?} year
* @return {?}
*/
setYear(year) {
// return new CandyDate(setYear(this.date, year));
/** @type {?} */
const date = new Date(this.nativeDate);
date.setFullYear(year);
return new CandyDate(date);
}
/**
* @param {?} amount
* @return {?}
*/
addYears(amount) {
return new CandyDate(addYears(this.nativeDate, amount));
}
// NOTE: month starts from 0
// NOTE: Don't use the native API for month manipulation as it not restrict the date when it overflows, eg. (new Date('2018-7-31')).setMonth(1) will be date of 2018-3-03 instead of 2018-2-28
/**
* @param {?} month
* @return {?}
*/
setMonth(month) {
// const date = new Date(this.nativeDate);
// date.setMonth(month);
// return new CandyDate(date);
return new CandyDate(setMonth(this.nativeDate, month));
}
/**
* @param {?} amount
* @return {?}
*/
addMonths(amount) {
return new CandyDate(addMonths(this.nativeDate, amount));
}
/**
* @param {?} day
* @param {?=} options
* @return {?}
*/
setDay(day, options) {
return new CandyDate(setDay(this.nativeDate, day, options));
}
/**
* @param {?} amount
* @return {?}
*/
setDate(amount) {
/** @type {?} */
const date = new Date(this.nativeDate);
date.setDate(amount);
return new CandyDate(date);
}
/**
* @param {?} amount
* @return {?}
*/
addDays(amount) {
return this.setDate(this.getDate() + amount);
}
/**
* @param {?} grain
* @return {?}
*/
endOf(grain) {
switch (grain) {
case 'month': return new CandyDate(endOfMonth(this.nativeDate));
}
return null;
}
/**
* @param {?} date
* @param {?} grain
* @return {?}
*/
isSame(date, grain) {
if (date) {
/** @type {?} */
const left = this.toNativeDate();
/** @type {?} */
const right = this.toNativeDate(date);
switch (grain) {
case 'year':
return left.getFullYear() === right.getFullYear();
case 'month':
return left.getFullYear() === right.getFullYear()
&& left.getMonth() === right.getMonth();
case 'day':
return left.getFullYear() === right.getFullYear()
&& left.getMonth() === right.getMonth()
&& left.getDate() === right.getDate();
case 'hour':
return left.getFullYear() === right.getFullYear()
&& left.getMonth() === right.getMonth()
&& left.getDate() === right.getDate()
&& left.getHours() === right.getHours();
case 'minute':
return left.getFullYear() === right.getFullYear()
&& left.getMonth() === right.getMonth()
&& left.getDate() === right.getDate()
&& left.getHours() === right.getHours()
&& left.getMinutes() === right.getMinutes();
case 'second':
return left.getFullYear() === right.getFullYear()
&& left.getMonth() === right.getMonth()
&& left.getDate() === right.getDate()
&& left.getHours() === right.getHours()
&& left.getMinutes() === right.getMinutes()
&& left.getSeconds() === right.getSeconds();
}
}
return false;
}
/**
* @param {?} date
* @param {?} grain
* @return {?}
*/
isAfter(date, grain) {
if (date) {
/** @type {?} */
const left = this.toNativeDate();
/** @type {?} */
const right = this.toNativeDate(date);
switch (grain) {
case 'year':
return left.getFullYear() > right.getFullYear();
case 'month':
return (left.getFullYear() > right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() > right.getMonth());
case 'day':
return (left.getFullYear() > right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() > right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() > right.getDate());
case 'hour':
return (left.getFullYear() > right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() > right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() > right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() > right.getHours());
case 'minute':
return (left.getFullYear() > right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() > right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() > right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() > right.getHours())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() > right.getMinutes());
case 'second':
return (left.getFullYear() > right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() > right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() > right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() > right.getHours())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() > right.getMinutes())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() === right.getMinutes() && left.getSeconds() > right.getSeconds());
}
}
return false;
}
/**
* @param {?} date
* @param {?} grain
* @return {?}
*/
isBefore(date, grain) {
if (date) {
/** @type {?} */
const left = this.toNativeDate();
/** @type {?} */
const right = this.toNativeDate(date);
switch (grain) {
case 'year':
return left.getFullYear() < right.getFullYear();
case 'month':
return (left.getFullYear() < right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() < right.getMonth());
case 'day':
return (left.getFullYear() < right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() < right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() < right.getDate());
case 'hour':
return (left.getFullYear() < right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() < right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() < right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() < right.getHours());
case 'minute':
return (left.getFullYear() < right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() < right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() < right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() < right.getHours())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() < right.getMinutes());
case 'second':
return (left.getFullYear() < right.getFullYear())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() < right.getMonth())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() < right.getDate())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() < right.getHours())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() < right.getMinutes())
|| (left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate() && left.getHours() === right.getHours() && left.getMinutes() === right.getMinutes() && left.getSeconds() < right.getSeconds());
}
}
return false;
}
// Equal to today accurate to "day"
/**
* @return {?}
*/
isToday() {
return this.isSame(new Date(), 'day');
}
/**
* @return {?}
*/
isInvalid() {
return isNaN(this.nativeDate.valueOf());
}
/**
* @private
* @param {?=} date
* @return {?}
*/
toNativeDate(date = this) {
return date instanceof CandyDate ? date.nativeDate : date;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class CalendarHeaderComponent {
// Indicate whether should change to month panel when current is year panel (if referer=month, it should show month panel when choosed a year)
/**
* @param {?} dateHelper
*/
constructor(dateHelper) {
this.dateHelper = dateHelper;
this.enablePrev = true;
this.enableNext = true;
this.showTimePicker = false;
this.valueChange = new EventEmitter();
this.panelModeChange = new EventEmitter();
this.chooseDecade = new EventEmitter();
this.chooseYear = new EventEmitter();
this.chooseMonth = new EventEmitter();
this.prefixCls = 'ant-calendar';
this.yearToMonth = false; // Indicate whether should change to month panel when current is year panel (if referer=month, it should show month panel when choosed a year)
}
/**
* @return {?}
*/
ngOnInit() {
if (!this.value) {
this.value = new CandyDate(); // Show today by default
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.value || changes.showTimePicker || changes.panelMode) {
this.render();
}
}
/**
* @return {?}
*/
previousYear() {
this.gotoYear(-1);
}
/**
* @return {?}
*/
nextYear() {
this.gotoYear(1);
}
/**
* @return {?}
*/
previousMonth() {
this.gotoMonth(-1);
}
/**
* @return {?}
*/
nextMonth() {
this.gotoMonth(1);
}
/**
* @param {?} mode
* @param {?=} value
* @return {?}
*/
changePanel(mode, value) {
this.panelModeChange.emit(mode);
if (value) {
this.changeValueFromInside(value);
}
}
/**
* @param {?} value
* @return {?}
*/
onChooseDecade(value) {
this.changePanel('year', value);
this.chooseDecade.emit(value);
}
/**
* @param {?} value
* @return {?}
*/
onChooseYear(value) {
this.changePanel(this.yearToMonth ? 'month' : 'date', value);
this.yearToMonth = false; // Clear
this.chooseYear.emit(value);
}
/**
* @param {?} value
* @return {?}
*/
onChooseMonth(value) {
this.changePanel('date', value);
this.yearToMonth = false; // Clear
this.chooseMonth.emit(value);
}
/**
* @return {?}
*/
changeToMonthPanel() {
this.changePanel('month');
this.yearToMonth = true;
}
/**
* @private
* @return {?}
*/
render() {
if (this.value) {
this.yearMonthDaySelectors = this.createYearMonthDaySelectors();
}
}
/**
* @private
* @param {?} amount
* @return {?}
*/
gotoMonth(amount) {
this.changeValueFromInside(this.value.addMonths(amount));
}
/**
* @private
* @param {?} amount
* @return {?}
*/
gotoYear(amount) {
this.changeValueFromInside(this.value.addYears(amount));
}
/**
* @private
* @param {?} value
* @return {?}
*/
changeValueFromInside(value) {
if (this.value !== value) {
this.value = value;
this.valueChange.emit(this.value);
this.render();
}
}
/**
* @private
* @param {?} localeFormat
* @return {?}
*/
formatDateTime(localeFormat) {
return this.dateHelper.format(this.value.nativeDate, localeFormat);
}
/**
* @private
* @return {?}
*/
createYearMonthDaySelectors() {
/** @type {?} */
let year;
/** @type {?} */
let month;
/** @type {?} */
let day;
// NOTE: Compat for DatePipe formatting rules
/** @type {?} */
let yearFormat = this.locale.yearFormat;
if (this.dateHelper.relyOnDatePipe) {
yearFormat = ((/** @type {?} */ (this.dateHelper))).transCompatFormat(yearFormat);
}
year = {
className: `${this.prefixCls}-year-select`,
title: this.locale.yearSelect,
onClick: (/**
* @return {?}
*/
() => this.showTimePicker ? null : this.changePanel('year')),
label: this.formatDateTime(yearFormat)
};
month = {
className: `${this.prefixCls}-month-select`,
title: this.locale.monthSelect,
onClick: (/**
* @return {?}
*/
() => this.showTimePicker ? null : this.changeToMonthPanel()),
label: this.formatDateTime(this.locale.monthFormat || 'MMM')
};
// NOTE: Compat for DatePipe formatting rules
/** @type {?} */
let dayFormat = this.locale.dayFormat;
if (this.dateHelper.relyOnDatePipe) {
dayFormat = ((/** @type {?} */ (this.dateHelper))).transCompatFormat(dayFormat);
}
if (this.showTimePicker) {
day = {
className: `${this.prefixCls}-day-select`,
label: this.formatDateTime(dayFormat)
};
}
/** @type {?} */
let result;
if (this.locale.monthBeforeYear) {
result = [month, day, year];
}
else {
result = [year, month, day];
}
return result.filter((/**
* @param {?} selector
* @return {?}
*/
selector => !!selector));
}
}
CalendarHeaderComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'calendar-header',
template: "<div class=\"{{ prefixCls }}-header\">\n <div style=\"position: relative;\">\n <a *ngIf=\"enablePrev && !showTimePicker\"\n class=\"{{ prefixCls }}-prev-year-btn\"\n role=\"button\"\n (click)=\"previousYear()\"\n title=\"{{ locale.previousYear }}\"\n ></a>\n <a *ngIf=\"enablePrev && !showTimePicker\"\n class=\"{{ prefixCls }}-prev-month-btn\"\n role=\"button\"\n (click)=\"previousMonth()\"\n title=\"{{ locale.previousMonth }}\"\n ></a>\n\n <span class=\"{{ prefixCls }}-{{ locale.monthBeforeYear ? 'my-select' : 'ym-select' }}\">\n <ng-container *ngFor=\"let selector of yearMonthDaySelectors\">\n <a class=\"{{ selector.className }}\"\n role=\"button\"\n (click)=\"selector.onClick ? selector.onClick() : null\"\n title=\"{{ selector.title || null }}\"\n >\n {{ selector.label }}\n </a>\n </ng-container>\n </span>\n\n <a *ngIf=\"enableNext && !showTimePicker\"\n class=\"{{ prefixCls }}-next-month-btn\"\n role=\"button\"\n (click)=\"nextMonth()\"\n title=\"{{ locale.nextMonth }}\"\n ></a>\n <a *ngIf=\"enableNext && !showTimePicker\"\n class=\"{{ prefixCls }}-next-year-btn\"\n role=\"button\"\n (click)=\"nextYear()\"\n title=\"{{ locale.nextYear }}\"\n ></a>\n </div>\n\n <ng-container [ngSwitch]=\"panelMode\">\n <ng-container *ngSwitchCase=\"'decade'\">\n <decade-panel\n [locale]=\"locale\"\n [value]=\"value\"\n (valueChange)=\"onChooseDecade($event)\"\n ></decade-panel>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <year-panel\n [locale]=\"locale\"\n [value]=\"value\"\n [disabledDate]=\"disabledYear\"\n (valueChange)=\"onChooseYear($event)\"\n (decadePanelShow)=\"changePanel('decade')\"\n ></year-panel>\n </ng-container>\n <ng-container *ngSwitchCase=\"'month'\">\n <month-panel\n [locale]=\"locale\"\n [value]=\"value\"\n [disabledDate]=\"disabledMonth\"\n (valueChange)=\"onChooseMonth($event)\"\n (yearPanelShow)=\"changePanel('year')\"\n ></month-panel>\n </ng-container>\n </ng-container>\n</div>"
}] }
];
/** @nocollapse */
CalendarHeaderComponent.ctorParameters = () => [
{ type: DateHelperService$$1 }
];
CalendarHeaderComponent.propDecorators = {
locale: [{ type: Input }],
enablePrev: [{ type: Input }],
enableNext: [{ type: Input }],
disabledMonth: [{ type: Input }],
disabledYear: [{ type: Input }],
showTimePicker: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
panelMode: [{ type: Input }],
panelModeChange: [{ type: Output }],
chooseDecade: [{ type: Output }],
chooseYear: [{ type: Output }],
chooseMonth: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class CalendarInputComponent {
/**
* @param {?} dateHelper
*/
constructor(dateHelper) {
this.dateHelper = dateHelper;
this.valueChange = new EventEmitter();
this.prefixCls = 'ant-calendar';
this.invalidInputClass = '';
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @param {?} event
* @return {?}
*/
onInputKeyup(event) {
/** @type {?} */
const date = this.checkValidInputDate(event);
if (!date || (this.disabledDate && this.disabledDate(date.nativeDate))) {
return;
}
if (!date.isSame(this.value, 'second')) { // Not same with original value
this.value = date;
this.valueChange.emit(this.value);
}
}
/**
* @param {?} value
* @return {?}
*/
toReadableInput(value) {
return value ? this.dateHelper.format(value.nativeDate, this.format) : '';
}
/**
* @private
* @param {?} event
* @return {?}
*/
checkValidInputDate(event) {
/** @type {?} */
const input = ((/** @type {?} */ (event.target))).value;
/** @type {?} */
const date = new CandyDate(input);
this.invalidInputClass = '';
if (date.isInvalid() || input !== this.toReadableInput(date)) { // Should also match the input format exactly
this.invalidInputClass = `${this.prefixCls}-input-invalid`;
return null;
}
return date;
}
}
CalendarInputComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'calendar-input',
template: "<div class=\"{{ prefixCls }}-input-wrap\">\n <div class=\"{{ prefixCls }}-date-input-wrap\">\n <input\n class=\"{{ prefixCls }}-input {{ invalidInputClass }}\"\n placeholder=\"{{ placeholder || locale.dateSelect }}\"\n value=\"{{ toReadableInput(value) }}\"\n (keyup)=\"onInputKeyup($event)\"\n />\n </div>\n <a class=\"{{ prefixCls }}-clear-btn\" role=\"button\" title=\"{{ locale.clear }}\">\n <!--<i nz-icon type=\"close\"></i>-->\n </a>\n</div>"
}] }
];
/** @nocollapse */
CalendarInputComponent.ctorParameters = () => [
{ type: DateHelperService$$1 }
];
CalendarInputComponent.propDecorators = {
locale: [{ type: Input }],
format: [{ type: Input }],
placeholder: [{ type: Input }],
disabledDate: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class OkButtonComponent {
constructor() {
this.okDisabled = false;
this.clickOk = new EventEmitter();
this.prefixCls = 'ant-calendar';
}
}
OkButtonComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'ok-button',
template: "<a\n class=\"{{ prefixCls }}-ok-btn {{ okDisabled ? prefixCls + '-ok-btn-disabled' : '' }}\"\n role=\"button\"\n (click)=\"okDisabled ? null : clickOk.emit()\"\n >\n {{ locale.ok }}\n </a>"
}] }
];
OkButtonComponent.propDecorators = {
locale: [{ type: Input }],
okDisabled: [{ type: Input }],
clickOk: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class TimePickerButtonComponent {
constructor() {
this.timePickerDisabled = false;
this.showTimePicker = false;
this.showTimePickerChange = new EventEmitter();
this.prefixCls = 'ant-calendar';
}
/**
* @return {?}
*/
onClick() {
this.showTimePicker = !this.showTimePicker;
this.showTimePickerChange.emit(this.showTimePicker);
}
}
TimePickerButtonComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'time-picker-button',
template: "<a\n class=\"{{ prefixCls }}-time-picker-btn {{ timePickerDisabled ? prefixCls + '-time-picker-btn-disabled' : '' }}\"\n role=\"button\"\n (click)=\"timePickerDisabled ? null : onClick()\"\n>\n {{ showTimePicker ? locale.dateSelect : locale.timeSelect }}\n</a>"
}] }
];
TimePickerButtonComponent.propDecorators = {
locale: [{ type: Input }],
timePickerDisabled: [{ type: Input }],
showTimePicker: [{ type: Input }],
showTimePickerChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class TodayButtonComponent {
/**
* @param {?} dateHelper
*/
constructor(dateHelper) {
this.dateHelper = dateHelper;
this.hasTimePicker = false;
this.clickToday = new EventEmitter();
this.prefixCls = 'ant-calendar';
this.isDisabled = false;
this.now = new CandyDate();
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.disabledDate) {
this.isDisabled = this.disabledDate && this.disabledDate(this.now.nativeDate);
}
if (changes.locale) {
// NOTE: Compat for DatePipe formatting rules
/** @type {?} */
let dateFormat = this.locale.dateFormat;
if (this.dateHelper.relyOnDatePipe) {
dateFormat = ((/** @type {?} */ (this.dateHelper))).transCompatFormat(dateFormat);
}
this.title = this.dateHelper.format(this.now.nativeDate, dateFormat);
}
}
/**
* @return {?}
*/
onClickToday() {
this.clickToday.emit(this.now.clone()); // To prevent the "now" being modified from outside, we use clone
}
}
TodayButtonComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'today-button',
template: "<a\n class=\"{{ prefixCls }}-today-btn {{ isDisabled ? prefixCls + '-today-btn-disabled' : '' }}\"\n role=\"button\"\n (click)=\"isDisabled ? null : onClickToday()\"\n title=\"{{ title }}\"\n>\n {{ hasTimePicker ? locale.now : locale.today }}\n</a>"
}] }
];
/** @nocollapse */
TodayButtonComponent.ctorParameters = () => [
{ type: DateHelperService$$1 }
];
TodayButtonComponent.propDecorators = {
locale: [{ type: Input }],
hasTimePicker: [{ type: Input }],
disabledDate: [{ type: Input }],
clickToday: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const DATE_ROW_NUM = 6;
/** @type {?} */
const DATE_COL_NUM = 7;
class DateTableComponent {
/**
* @param {?} i18n
* @param {?} dateHelper
*/
constructor(i18n, dateHelper) {
this.i18n = i18n;
this.dateHelper = dateHelper;
this.valueChange = new EventEmitter();
// Customize date content while rendering
this.dayHover = new EventEmitter(); // Emitted when hover on a day by mouse enter
// Emitted when hover on a day by mouse enter
this.prefixCls = 'ant-calendar';
this.isTemplateRef = isTemplateRef;
this.isNonEmptyString = isNonEmptyString;
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (this.isDateRealChange(changes.value) ||
this.isDateRealChange(changes.selectedValue) ||
this.isDateRealChange(changes.hoverValue)) {
this.render();
}
}
/**
* @private
* @param {?} change
* @return {?}
*/
isDateRealChange(change) {
if (change) {
/** @type {?} */
const previousValue = change.previousValue;
/** @type {?} */
const currentValue = change.currentValue;
if (Array.isArray(currentValue)) {
return !Array.isArray(previousValue) ||
currentValue.length !== previousValue.length ||
currentValue.some((/**
* @param {?} value
* @param {?} index
* @return {?}
*/
(value, index) => !this.isSameDate(previousValue[index], value)));
}
else {
return !this.isSameDate((/** @type {?} */ (previousValue)), currentValue);
}
}
return false;
}
/**
* @private
* @param {?} left
* @param {?} right
* @return {?}
*/
isSameDate(left, right) {
return (!left && !right) || (left && right && right.isSame(left, 'day'));
}
/**
* @private
* @return {?}
*/
render() {
if (this.value) {
this.headWeekDays = this.makeHeadWeekDays();
this.weekRows = this.makeWeekRows();
}
}
/**
* @private
* @param {?} value
* @return {?}
*/
changeValueFromInside(value) {
if (this.value !== value) {
this.valueChange.emit(value);
}
}
/**
* @private
* @return {?}
*/
makeHeadWeekDays() {
/** @type {?} */
const weekDays = [];
/** @type {?} */
const firstDayOfWeek = this.dateHelper.getFirstDayOfWeek();
for (let colIndex = 0; colIndex < DATE_COL_NUM; colIndex++) {
/** @type {?} */
const day = (firstDayOfWeek + colIndex) % DATE_COL_NUM;
/** @type {?} */
const tempDate = this.value.setDay(day);
weekDays[colIndex] = {
short: this.dateHelper.format(tempDate.nativeDate, this.dateHelper.relyOnDatePipe ? 'E' : 'ddd'),
// eg. Tue
veryShort: this.dateHelper.format(tempDate.nativeDate, this.getVeryShortWeekFormat()) // eg. Tu
};
}
return weekDays;
}
/**
* @private
* @return {?}
*/
getVeryShortWeekFormat() {
if (this.dateHelper.relyOnDatePipe) {
return this.i18n.getLocaleId().toLowerCase().indexOf('zh') === 0 ? 'EEEEE' : 'EEEEEE'; // Use extreme short for chinese
}
return 'dd';
}
/**
* @private
* @return {?}
*/
makeWeekRows() {
/** @type {?} */
const weekRows = [];
/** @type {?} */
const firstDayOfWeek = this.dateHelper.getFirstDayOfWeek();
/** @type {?} */
const firstDateOfMonth = this.value.setDate(1);
/** @type {?} */
const firstDateOffset = (firstDateOfMonth.getDay() + 7 - firstDayOfWeek) % 7;
/** @type {?} */
const firstDateToShow = firstDateOfMonth.addDays(0 - firstDateOffset);
/** @type {?} */
let increased = 0;
for (let rowIndex = 0; rowIndex < DATE_ROW_NUM; rowIndex++) {
/** @type {?} */
const week = weekRows[rowIndex] = {
isActive: false,
isCurrent: false,
dateCells: []
};
for (let colIndex = 0; colIndex < DATE_COL_NUM; colIndex++) {
/** @type {?} */
const current = firstDateToShow.addDays(increased++);
/** @type {?} */
const isBeforeMonthYear = this.isBeforeMonthYear(current, this.value);
/** @type {?} */
const isAfterMonthYear = this.isAfterMonthYear(current, this.value);
/** @type {?} */
const cell = {
value: current,
isSelected: false,
isDisabled: false,
isToday: false,
title: this.getDateTitle(current),
customContent: valueFunctionProp(this.dateRender, current),
// Customized content
content: `${current.getDate()}`,
onClick: (/**
* @return {?}
*/
() => this.changeValueFromInside(current)),
onMouseEnter: (/**
* @return {?}
*/
() => this.dayHover.emit(cell.value))
};
if (this.showWeek && !week.weekNum) {
week.weekNum = this.getWeekNum(current);
}
if (current.isToday()) {
cell.isToday = true;
week.isCurrent = true;
}
if (Array.isArray(this.selectedValue) && !isBeforeMonthYear && !isAfterMonthYear) { // Range selections
// Range selections
/** @type {?} */
const rangeValue = this.hoverValue && this.hoverValue.length ? this.hoverValue : this.selectedValue;
/** @type {?} */
const start = rangeValue[0];
/** @type {?} */
const end = rangeValue[1];
if (start) {
if (current.isSame(start, 'day')) {
cell.isSelectedStartDate = true;
cell.isSelected = true;
week.isActive = true;
}
if (end) {
if (current.isSame(end, 'day')) {
cell.isSelectedEndDate = true;
cell.isSelected = true;
week.isActive = true;
}
else if (current.isAfter(start, 'day') && current.isBefore(end, 'day')) {
cell.isInRange = true;
}
}
}
}
else if (current.isSame(this.value, 'day')) {
cell.isSelected = true;
week.isActive = true;
}
if (this.disabledDate && this.disabledDate(current.nativeDate)) {
cell.isDisabled = true;
}
cell.classMap = {
[`${this.prefixCls}-cell`]: true,
// [`${this.prefixCls}-selected-date`]: false,
[`${this.prefixCls}-today`]: cell.isToday,
[`${this.prefixCls}-last-month-cell`]: isBeforeMonthYear,
[`${this.prefixCls}-next-month-btn-day`]: isAfterMonthYear,
[`${this.prefixCls}-selected-day`]: cell.isSelected,
[`${this.prefixCls}-disabled-cell`]: cell.isDisabled,
[`${this.prefixCls}-selected-start-date`]: !!cell.isSelectedStartDate,
[`${this.prefixCls}-selected-end-date`]: !!cell.isSelectedEndDate,
[`${this.prefixCls}-in-range-cell`]: !!cell.isInRange
};
week.dateCells.push(cell);
}
week.classMap = {
[`${this.prefixCls}-current-week`]: week.isCurrent,
[`${this.prefixCls}-active-week`]: week.isActive
};
}
return weekRows;
}
/**
* @private
* @param {?} date
* @return {?}
*/
getDateTitle(date) {
// NOTE: Compat for DatePipe formatting rules
/** @type {?} */
let dateFormat = (this.locale && this.locale.dateFormat) || 'YYYY-MM-DD';
if (this.dateHelper.relyOnDatePipe) {
dateFormat = ((/** @type {?} */ (this.dateHelper))).transCompatFormat(dateFormat);
}
return this.dateHelper.format(date.nativeDate, dateFormat);
}
/**
* @private
* @param {?} date
* @return {?}
*/
getWeekNum(date) {
return this.dateHelper.getISOWeek(date.nativeDate);
}
/**
* @private
* @param {?} current
* @param {?} target
* @return {?}
*/
isBeforeMonthYear(current, target) {
if (current.getYear() < target.getYear()) {
return true;
}
return current.getYear() === target.getYear() && current.getMonth() < target.getMonth();
}
/**
* @private
* @param {?} current
* @param {?} target
* @return {?}
*/
isAfterMonthYear(current, target) {
if (current.getYear() > target.getYear()) {
return true;
}
return current.getYear() === target.getYear() && current.getMonth() > target.getMonth();
}
}
DateTableComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'date-table',
template: "<table class=\"{{ prefixCls }}-table\" cellSpacing=\"0\" role=\"grid\">\n <thead>\n <tr role=\"row\">\n <th *ngIf=\"showWeek\" role=\"columnheader\" class=\"{{ prefixCls }}-column-header {{ prefixCls }}-week-number-header\">\n <span class=\"{{ prefixCls }}-column-header-inner\">x</span>\n </th>\n <th *ngFor=\"let cell of headWeekDays\"\n role=\"columnheader\"\n title=\"{{ cell.short }}\"\n class=\"{{ prefixCls }}-column-header\"\n >\n <span class=\"{{ prefixCls }}-column-header-inner\">{{ cell.veryShort }}</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"{{ prefixCls }}-tbody\">\n <tr *ngFor=\"let row of weekRows\" [ngClass]=\"row.classMap\" role=\"row\">\n <td *ngIf=\"row.weekNum\" role=\"gridcell\" class=\"{{ prefixCls }}-week-number-cell\">\n {{ row.weekNum }}\n </td>\n <td\n *ngFor=\"let cell of row.dateCells\"\n (click)=\"cell.isDisabled ? null : cell.onClick()\"\n (mouseenter)=\"cell.isDisabled ? null : cell.onMouseEnter()\"\n title=\"{{ cell.title }}\"\n [ngClass]=\"cell.classMap\"\n role=\"gridcell\"\n >\n\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(cell.customContent)\">\n <ng-container *ngTemplateOutlet=\"cell.customContent; context: { $implicit: cell.value }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(cell.customContent)\">\n <span [innerHTML]=\"cell.customContent\"></span>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <div\n class=\"{{ prefixCls }}-date\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-disabled]=\"cell.isDisabled\"\n >\n {{ cell.content }}\n </div>\n </ng-container>\n </ng-container>\n\n </td>\n </tr>\n </tbody>\n</table>"
}] }
];
/** @nocollapse */
DateTableComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: DateHelperService$$1 }
];
DateTableComponent.propDecorators = {
locale: [{ type: Input }],
selectedValue: [{ type: Input }],
hoverValue: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
showWeek: [{ type: Input }],
disabledDate: [{ type: Input }],
dateRender: [{ type: Input }],
dayHover: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const MAX_ROW = 4;
/** @type {?} */
const MAX_COL = 3;
class DecadePanelComponent {
constructor() {
this.valueChange = new EventEmitter();
this.prefixCls = 'ant-calendar-decade-panel';
}
/**
* @return {?}
*/
get startYear() {
return parseInt(`${this.value.getYear() / 100}`, 10) * 100;
}
/**
* @return {?}
*/
get endYear() {
return this.startYear + 99;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.value) {
this.render();
}
}
/**
* @return {?}
*/
previousCentury() {
this.gotoYear(-100);
}
/**
* @return {?}
*/
nextCentury() {
this.gotoYear(100);
}
/**
* @param {?} _index
* @param {?} decadeData
* @return {?}
*/
trackPanelDecade(_index, decadeData) {
return decadeData.content;
}
/**
* @private
* @return {?}
*/
render() {
if (this.value) {
this.panelDecades = this.makePanelDecades();
}
}
// Re-render panel content by the header's buttons (NOTE: Do not try to trigger final value change)
/**
* @private
* @param {?} amount
* @return {?}
*/
gotoYear(amount) {
this.value = this.value.addYears(amount);
// this.valueChange.emit(this.value); // Do not try to trigger final value change
this.render();
}
/**
* @private
* @param {?} startYear
* @return {?}
*/
chooseDecade(startYear) {
this.value = this.value.setYear(startYear);
this.valueChange.emit(this.value);
}
/**
* @private
* @return {?}
*/
makePanelDecades() {
/** @type {?} */
const decades = [];
/** @type {?} */
const currentYear = this.value.getYear();
/** @type {?} */
const startYear = this.startYear;
/** @type {?} */
const endYear = this.endYear;
/** @type {?} */
const previousYear = startYear - 10;
/** @type {?} */
let index = 0;
for (let rowIndex = 0; rowIndex < MAX_ROW; rowIndex++) {
decades[rowIndex] = [];
for (let colIndex = 0; colIndex < MAX_COL; colIndex++) {
/** @type {?} */
const start = previousYear + index * 10;
/** @type {?} */
const end = previousYear + index * 10 + 9;
/** @type {?} */
const content = `${start}-${end}`;
/** @type {?} */
const cell = decades[rowIndex][colIndex] = {
content,
title: content,
isCurrent: currentYear >= start && currentYear <= end,
isLowerThanStart: end < startYear,
isBiggerThanEnd: start > endYear,
classMap: null,
onClick: null
};
cell.classMap = {
[`${this.prefixCls}-cell`]: true,
[`${this.prefixCls}-selected-cell`]: cell.isCurrent,
[`${this.prefixCls}-last-century-cell`]: cell.isLowerThanStart,
[`${this.prefixCls}-next-century-cell`]: cell.isBiggerThanEnd
};
if (cell.isLowerThanStart) {
cell.onClick = (/**
* @return {?}
*/
() => this.previousCentury());
}
else if (cell.isBiggerThanEnd) {
cell.onClick = (/**
* @return {?}
*/
() => this.nextCentury());
}
else {
cell.onClick = (/**
* @return {?}
*/
() => this.chooseDecade(start));
}
index++;
}
}
return decades;
}
}
DecadePanelComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'decade-panel',
template: "<div class=\"{{ prefixCls }}\">\n <div class=\"{{ prefixCls }}-header\">\n <a\n class=\"{{ prefixCls }}-prev-century-btn\"\n role=\"button\"\n (click)=\"previousCentury()\"\n title=\"{{ locale.previousCentury }}\"\n ></a>\n\n <div class=\"{{ prefixCls }}-century\">\n {{ startYear }}-{{ endYear }}\n </div>\n <a\n class=\"{{ prefixCls }}-next-century-btn\"\n role=\"button\"\n (click)=\"nextCentury()\"\n title=\"{{ locale.nextCentury }}\"\n ></a>\n </div>\n <div class=\"{{ prefixCls }}-body\">\n <table class=\"{{ prefixCls }}-table\" cellSpacing=\"0\" role=\"grid\">\n <tbody class=\"{{ prefixCls }}-tbody\">\n <tr *ngFor=\"let row of panelDecades\" role=\"row\">\n <td *ngFor=\"let cell of row; trackBy: trackPanelDecade\"\n role=\"gridcell\"\n title=\"{{ cell.title }}\"\n (click)=\"cell.onClick()\"\n [ngClass]=\"cell.classMap\"\n >\n <a class=\"{{ prefixCls }}-decade\">{{ cell.content }}</a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>"
}] }
];
/** @nocollapse */
DecadePanelComponent.ctorParameters = () => [];
DecadePanelComponent.propDecorators = {
locale: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MonthPanelComponent {
constructor() {
this.valueChange = new EventEmitter();
this.yearPanelShow = new EventEmitter();
this.prefixCls = 'ant-calendar-month-panel';
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @return {?}
*/
previousYear() {
this.gotoYear(-1);
}
/**
* @return {?}
*/
nextYear() {
this.gotoYear(1);
}
// Re-render panel content by the header's buttons (NOTE: Do not try to trigger final value change)
/**
* @private
* @param {?} amount
* @return {?}
*/
gotoYear(amount) {
this.value = this.value.addYears(amount);
// this.valueChange.emit(this.value); // Do not try to trigger final value change
}
}
MonthPanelComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'month-panel',
template: "<div class=\"{{ prefixCls }}\">\n <div>\n <div class=\"{{ prefixCls }}-header\">\n <a\n class=\"{{ prefixCls }}-prev-year-btn\"\n role=\"button\"\n (click)=\"previousYear()\"\n title=\"{{ locale.previousYear }}\"\n ></a>\n\n <a\n class=\"{{ prefixCls }}-year-select\"\n role=\"button\"\n (click)=\"yearPanelShow.emit()\"\n title=\"{{ locale.yearSelect }}\"\n >\n <span class=\"{{ prefixCls }}-year-select-content\">{{ value.getYear() }}</span>\n <span class=\"{{ prefixCls }}-year-select-arrow\">x</span>\n </a>\n\n <a\n class=\"{{ prefixCls }}-next-year-btn\"\n role=\"button\"\n (click)=\"nextYear()\"\n title=\"{{ locale.nextYear }}\"\n ></a>\n </div>\n <div class=\"{{ prefixCls }}-body\">\n <month-table [disabledDate]=\"disabledDate\" [value]=\"value\" (valueChange)=\"valueChange.emit($event)\"></month-table>\n </div>\n </div>\n</div>"
}] }
];
/** @nocollapse */
MonthPanelComponent.ctorParameters = () => [];
MonthPanelComponent.propDecorators = {
locale: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
disabledDate: [{ type: Input }],
yearPanelShow: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const MAX_ROW$1 = 4;
/** @type {?} */
const MAX_COL$1 = 3;
class MonthTableComponent {
/**
* @param {?} dateHelper
*/
constructor(dateHelper) {
this.dateHelper = dateHelper;
this.valueChange = new EventEmitter();
this.prefixCls = 'ant-calendar-month-panel';
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.value || changes.disabledDate) {
this.render();
}
}
/**
* @param {?} _index
* @param {?} monthData
* @return {?}
*/
trackPanelMonth(_index, monthData) {
return monthData.month;
}
/**
* @private
* @return {?}
*/
render() {
if (this.value) {
this.panelMonths = this.makePanelMonths();
}
}
/**
* @private
* @return {?}
*/
makePanelMonths() {
/** @type {?} */
const months = [];
/** @type {?} */
const currentMonth = this.value.getMonth();
/** @type {?} */
const today = new CandyDate();
/** @type {?} */
let monthValue = 0;
for (let rowIndex = 0; rowIndex < MAX_ROW$1; rowIndex++) {
months[rowIndex] = [];
for (let colIndex = 0; colIndex < MAX_COL$1; colIndex++) {
/** @type {?} */
const month = this.value.setMonth(monthValue);
/** @type {?} */
const disabled = this.disabledDate ? this.disabledDate(this.value.setMonth(monthValue).nativeDate) : false;
/** @type {?} */
const content = this.dateHelper.format(month.nativeDate, 'MMM');
/** @type {?} */
const cell = months[rowIndex][colIndex] = {
disabled,
content,
month: monthValue,
title: content,
classMap: null,
onClick: (/**
* @return {?}
*/
() => this.chooseMonth(cell.month))
};
cell.classMap = {
[`${this.prefixCls}-cell`]: true,
[`${this.prefixCls}-cell-disabled`]: disabled,
[`${this.prefixCls}-selected-cell`]: cell.month === currentMonth,
[`${this.prefixCls}-current-cell`]: today.getYear() === this.value.getYear() && cell.month === today.getMonth()
};
monthValue++;
}
}
return months;
}
/**
* @private
* @param {?} month
* @return {?}
*/
chooseMonth(month) {
this.value = this.value.setMonth(month);
this.valueChange.emit(this.value);
this.render();
}
}
MonthTableComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'month-table',
template: "<table class=\"{{ prefixCls }}-table\" cellSpacing=\"0\" role=\"grid\">\n <tbody class=\"{{ prefixCls }}-tbody\">\n <tr *ngFor=\"let row of panelMonths\" role=\"row\">\n <td *ngFor=\"let monthCell of row; trackBy: trackPanelMonth\"\n role=\"gridcell\"\n title=\"{{ monthCell.title }}\"\n (click)=\"monthCell.disabled ? null : monthCell.onClick()\"\n [ngClass]=\"monthCell.classMap\"\n >\n <a class=\"{{ prefixCls }}-month\">{{ monthCell.content }}</a>\n </td>\n </tr>\n </tbody>\n</table>"
}] }
];
/** @nocollapse */
MonthTableComponent.ctorParameters = () => [
{ type: DateHelperService$$1 }
];
MonthTableComponent.propDecorators = {
value: [{ type: Input }],
valueChange: [{ type: Output }],
disabledDate: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const defaultDisabledTime = {
/**
* @return {?}
*/
nzDisabledHours() {
return [];
},
/**
* @return {?}
*/
nzDisabledMinutes() {
return [];
},
/**
* @return {?}
*/
nzDisabledSeconds() {
return [];
}
};
/**
* @param {?} value
* @param {?} disabledTime
* @return {?}
*/
function getTimeConfig(value, disabledTime) {
/** @type {?} */
let disabledTimeConfig = disabledTime ? disabledTime(value && value.nativeDate) : (/** @type {?} */ ({}));
disabledTimeConfig = Object.assign({}, defaultDisabledTime, disabledTimeConfig);
return disabledTimeConfig;
}
/**
* @param {?} value
* @param {?} disabledTimeConfig
* @return {?}
*/
function isTimeValidByConfig(value, disabledTimeConfig) {
/** @type {?} */
let invalidTime = false;
if (value) {
/** @type {?} */
const hour = value.getHours();
/** @type {?} */
const minutes = value.getMinutes();
/** @type {?} */
const seconds = value.getSeconds();
/** @type {?} */
const disabledHours = disabledTimeConfig.nzDisabledHours();
if (disabledHours.indexOf(hour) === -1) {
/** @type {?} */
const disabledMinutes = disabledTimeConfig.nzDisabledMinutes(hour);
if (disabledMinutes.indexOf(minutes) === -1) {
/** @type {?} */
const disabledSeconds = disabledTimeConfig.nzDisabledSeconds(hour, minutes);
invalidTime = disabledSeconds.indexOf(seconds) !== -1;
}
else {
invalidTime = true;
}
}
else {
invalidTime = true;
}
}
return !invalidTime;
}
/**
* @param {?} value
* @param {?} disabledTime
* @return {?}
*/
function isTimeValid(value, disabledTime) {
/** @type {?} */
const disabledTimeConfig = getTimeConfig(value, disabledTime);
return isTimeValidByConfig(value, disabledTimeConfig);
}
/**
* @param {?} value
* @param {?=} disabledDate
* @param {?=} disabledTime
* @return {?}
*/
function isAllowedDate(value, disabledDate, disabledTime) {
if (disabledDate) {
if (disabledDate(value.nativeDate)) {
return false;
}
}
if (disabledTime) {
if (!isTimeValid(value, disabledTime)) {
return false;
}
}
return true;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class DateRangePopupComponent {
constructor() {
this.panelModeChange = new EventEmitter();
this.valueChange = new EventEmitter();
this.resultOk = new EventEmitter(); // Emitted when done with date selecting
// Emitted when done with date selecting
this.closePicker = new EventEmitter(); // Notify outside to close the picker panel
// Notify outside to close the picker panel
this.prefixCls = 'ant-calendar';
this.showTimePicker = false;
this.partTypeMap = { 'left': 0, 'right': 1 };
this.disabledStartTime = (/**
* @param {?} value
* @return {?}
*/
(value) => {
return this.disabledTime && this.disabledTime(value, 'start');
});
this.disabledEndTime = (/**
* @param {?} value
* @return {?}
*/
(value) => {
return this.disabledTime && this.disabledTime(value, 'end');
});
}
// Range ONLY
/**
* @return {?}
*/
get hasTimePicker() {
return !!this.showTime;
}
/**
* @return {?}
*/
get hasFooter() {
return this.showToday || this.hasTimePicker || !!this.extraFooter || !!this.ranges;
}
/**
* @return {?}
*/
ngOnInit() {
// Initialization for range properties to prevent errors while later assignment
if (this.isRange) {
['placeholder', 'panelMode', 'selectedValue', 'hoverValue'].forEach((/**
* @param {?} prop
* @return {?}
*/
(prop) => this.initialArray(prop)));
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (this.isRange) {
if (changes.value) { // Re-initialize all related values
this.clearHoverValue();
this.selectedValue = (/** @type {?} */ (this.value));
this.valueForRangeShow = this.normalizeRangeValue((/** @type {?} */ (this.value)));
}
}
// Parse showTime options
if (changes.showTime || changes.disabledTime) {
if (this.showTime) {
this.buildTimeOptions();
}
}
// Show time picker when assigned panel mode as "time"
if (changes.panelMode && this.hasTimePicker) {
this.showTimePicker = this.panelMode === 'time';
}
}
/**
* @param {?} show
* @return {?}
*/
onShowTimePickerChange(show) {
// this.panelMode = show ? 'time' : 'date';
// this.panelModeChange.emit(this.panelMode);
this.panelModeChange.emit(show ? 'time' : 'date');
}
/**
* @param {?} value
* @return {?}
*/
onClickToday(value) {
// if (this.isRange) { // Show today is not support by range
// throw new Error('"nzShowToday" is not support for "RangePicker"!');
// } else {
if (!this.isRange) {
this.value = null; // Clear current value to not sync time by next step
this.changeValue(value);
}
this.closePickerPanel();
}
/**
* @param {?} value
* @return {?}
*/
onDayHover(value) {
if (this.isRange && this.selectedValue[0] && !this.selectedValue[1]) { // When right value is selected, don't do hover
// When right value is selected, don't do hover
/** @type {?} */
const base = this.selectedValue[0];
if (base.isBefore(value, 'day')) {
this.hoverValue = [base, value];
}
else {
this.hoverValue = [value, base];
}
}
}
/**
* @param {?} mode
* @param {?=} partType
* @return {?}
*/
onPanelModeChange(mode, partType) {
if (this.isRange) {
((/** @type {?} */ (this.panelMode)))[this.getPartTypeIndex(partType)] = mode;
}
else {
this.panelMode = mode;
}
this.panelModeChange.emit(this.panelMode);
}
/**
* @param {?} value
* @param {?=} partType
* @return {?}
*/
onHeaderChange(value, partType) {
if (this.isRange) {
this.valueForRangeShow[this.getPartTypeIndex(partType)] = value;
this.valueForRangeShow = this.normalizeRangeValue(this.valueForRangeShow); // Should always take care of start/end
}
}
/**
* @param {?} value
* @param {?=} partType
* @return {?}
*/
onSelectTime(value, partType) {
if (this.isRange) {
/** @type {?} */
const newValue = this.cloneRangeDate((/** @type {?} */ (this.value)));
/** @type {?} */
const index = this.getPartTypeIndex(partType);
newValue[index] = this.overrideHms(value, newValue[index]);
this.setValue(newValue);
}
else {
this.setValue(this.overrideHms(value, ((/** @type {?} */ (this.value))) || new CandyDate())); // If not select a date currently, use today
}
}
/**
* @param {?} value
* @param {?=} partType
* @return {?}
*/
changeValue(value, partType) {
if (this.isRange) {
/** @type {?} */
const index = this.getPartTypeIndex(partType);
this.selectedValue[index] = value;
if (this.isValidRange(this.selectedValue)) {
this.valueForRangeShow = this.normalizeRangeValue(this.selectedValue);
this.setValue(this.cloneRangeDate(this.selectedValue));
}
}
else {
this.setValue(value);
}
}
/**
* @param {?} value
* @return {?}
*/
changeValueFromSelect(value) {
if (this.isRange) {
const [left, right] = (/** @type {?} */ (this.selectedValue));
if ((!left && !right) || (left && right)) { // If totally full or empty, clean up && re-assign left first
this.hoverValue = this.selectedValue = [value];
}
else if (left && !right) { // If one of them is empty, assign the other one and sort, then set the final values
this.clearHoverValue(); // Clean up
this.setRangeValue('selectedValue', 'right', value);
this.sortRangeValue('selectedValue'); // Sort
this.valueForRangeShow = this.normalizeRangeValue(this.selectedValue);
this.setValue(this.cloneRangeDate(this.selectedValue));
}
}
else {
this.setValue(value);
}
// this.selectDate.emit(value);
}
/**
* @param {?} direction
* @param {?=} partType
* @return {?}
*/
enablePrevNext(direction, partType) {
if (this.isRange) {
const [start, end] = this.valueForRangeShow;
/** @type {?} */
const showMiddle = !start.addMonths(1).isSame(end, 'month');
if ((partType === 'left' && direction === 'next') || (partType === 'right' && direction === 'prev')) {
return showMiddle;
}
return true;
}
else {
return true;
}
}
/**
* @param {?=} partType
* @return {?}
*/
getPanelMode(partType) {
if (this.isRange) {
return (/** @type {?} */ (this.panelMode[this.getPartTypeIndex(partType)]));
}
else {
return (/** @type {?} */ (this.panelMode));
}
}
// Get single value or part value of a range
/**
* @param {?=} partType
* @return {?}
*/
getValue(partType) {
if (this.isRange) {
return this.value[this.getPartTypeIndex(partType)];
}
else {
return (/** @type {?} */ (this.value));
}
}
/**
* @param {?=} partType
* @return {?}
*/
getValueBySelector(partType) {
if (this.isRange) {
/** @type {?} */
const valueShow = this.showTimePicker ? this.value : this.valueForRangeShow;
return valueShow[this.getPartTypeIndex(partType)];
}
else {
return (/** @type {?} */ (this.value));
}
}
/**
* @param {?} partType
* @return {?}
*/
getPartTypeIndex(partType) {
return this.partTypeMap[partType];
}
/**
* @param {?=} partType
* @return {?}
*/
getPlaceholder(partType) {
return this.isRange ? this.placeholder[this.getPartTypeIndex(partType)] : (/** @type {?} */ (this.placeholder));
}
/**
* @return {?}
*/
hasSelectedValue() {
return this.selectedValue && !!this.selectedValue[1] && !!this.selectedValue[0];
}
/**
* @return {?}
*/
isAllowedSelectedValue() {
/** @type {?} */
const selectedValue = this.selectedValue;
if (selectedValue && selectedValue[0] && selectedValue[1]) {
return isAllowedDate(selectedValue[0], this.disabledDate, this.disabledStartTime) &&
isAllowedDate(selectedValue[1], this.disabledDate, this.disabledEndTime);
}
return false;
}
/**
* @return {?}
*/
timePickerDisabled() {
if (!this.hasTimePicker) {
return true;
}
if (this.isRange) {
return !this.hasSelectedValue() || !!this.hoverValue.length;
}
else {
return false;
}
}
/**
* @return {?}
*/
okDisabled() {
if (!this.hasTimePicker) {
return true;
}
if (this.isRange) {
return !this.isAllowedSelectedValue() || !this.hasSelectedValue() || !!this.hoverValue.length;
}
else {
return this.value ? !isAllowedDate((/** @type {?} */ (this.value)), this.disabledDate, this.disabledTime) : false;
}
}
/**
* @param {?=} partType
* @return {?}
*/
getTimeOptions(partType) {
if (this.showTime && this.timeOptions) {
return this.isRange ? this.timeOptions[this.getPartTypeIndex(partType)] : this.timeOptions;
}
return null;
}
/**
* @param {?} val
* @return {?}
*/
onClickPresetRange(val) {
/** @type {?} */
const value = val;
this.setValue([new CandyDate(value[0]), new CandyDate(value[1])]);
this.resultOk.emit();
}
/**
* @return {?}
*/
onPresetRangeMouseLeave() {
this.clearHoverValue();
}
/**
* @param {?} val
* @return {?}
*/
onHoverPresetRange(val) {
this.hoverValue = ([new CandyDate(val[0]), new CandyDate(val[1])]);
}
/**
* @param {?} obj
* @return {?}
*/
getObjectKeys(obj) {
return obj ? Object.keys(obj) : [];
}
/**
* @private
* @return {?}
*/
closePickerPanel() {
this.closePicker.emit();
}
/**
* @private
* @return {?}
*/
clearHoverValue() {
this.hoverValue = [];
}
/**
* @private
* @return {?}
*/
buildTimeOptions() {
if (this.showTime) {
/** @type {?} */
const showTime = typeof this.showTime === 'object' ? this.showTime : {};
if (this.isRange) {
this.timeOptions = [this.overrideTimeOptions(showTime, this.value[0], 'start'), this.overrideTimeOptions(showTime, this.value[1], 'end')];
}
else {
this.timeOptions = this.overrideTimeOptions(showTime, (/** @type {?} */ (this.value)));
}
}
else {
this.timeOptions = null;
}
}
/**
* @private
* @param {?} origin
* @param {?} value
* @param {?=} partial
* @return {?}
*/
overrideTimeOptions(origin, value, partial) {
/** @type {?} */
let disabledTimeFn;
if (partial) {
disabledTimeFn = partial === 'start' ? this.disabledStartTime : this.disabledEndTime;
}
else {
disabledTimeFn = this.disabledTime;
}
return Object.assign({}, origin, getTimeConfig(value, disabledTimeFn));
}
// Set value and trigger change event
/**
* @private
* @param {?} value
* @return {?}
*/
setValue(value) {
/** @type {?} */
const newValue = value;
// TODO: Sync original time (NOTE: this should take more care of beacuse it may depend on many change sources)
// if (this.isRange) {
// // TODO: Sync time
// } else {
// if (this.value) { // Sync time from the original one if it's available
// newValue = this.overrideHms(this.value as CandyDate, newValue as CandyDate);
// }
// }
this.value = newValue;
this.valueChange.emit(this.value);
this.buildTimeOptions();
}
/**
* @private
* @param {?} from
* @param {?} to
* @return {?}
*/
overrideHms(from, to) {
if (!from || !to) {
return null;
}
return to.setHms(from.getHours(), from.getMinutes(), from.getSeconds());
}
// Check if it's a valid range value
/**
* @private
* @param {?} value
* @return {?}
*/
isValidRange(value) {
if (Array.isArray(value)) {
const [start, end] = value;
/** @type {?} */
const grain = this.hasTimePicker ? 'second' : 'day';
return start && end && (start.isBefore(end, grain) || start.isSame(end, grain));
}
return false;
}
/**
* @private
* @param {?} value
* @return {?}
*/
normalizeRangeValue(value) {
const [start, end] = value;
/** @type {?} */
const newStart = start || new CandyDate();
/** @type {?} */
const newEnd = end && end.isSame(newStart, 'month') ? end.addMonths(1) : end || newStart.addMonths(1);
return [newStart, newEnd];
}
// private isEmptyRangeValue(value: CandyDate[]): boolean {
// return !value || !Array.isArray(value) || value.every((val) => !val);
// }
// Sort a range value (accurate to second)
/**
* @private
* @param {?} key
* @return {?}
*/
sortRangeValue(key) {
if (Array.isArray(this[key])) {
const [start, end] = this[key];
if (start && end && start.isAfter(end, 'day')) {
this[key] = [end, start];
}
}
}
// Renew and set a range value to trigger sub-component's change detection
/**
* @private
* @param {?} key
* @param {?} partType
* @param {?} value
* @return {?}
*/
setRangeValue(key, partType, value) {
/** @type {?} */
const ref = this[key] = this.cloneRangeDate((/** @type {?} */ (this[key])));
ref[this.getPartTypeIndex(partType)] = value;
}
/**
* @private
* @param {?} value
* @return {?}
*/
cloneRangeDate(value) {
return (/** @type {?} */ ([value[0] && value[0].clone(), value[1] && value[1].clone()]));
}
/**
* @private
* @param {?} key
* @return {?}
*/
initialArray(key) {
if (!this[key] || !Array.isArray(this[key])) {
this[key] = [];
}
}
}
DateRangePopupComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'date-range-popup',
template: "<div\n class=\"{{ prefixCls }}-picker-container {{ dropdownClassName }} {{ prefixCls }}-picker-container-placement-bottomLeft\"\n [ngStyle]=\"popupStyle\">\n\n <div class=\"{{ prefixCls }} {{ showWeek ? prefixCls + '-week-number': '' }} {{ hasTimePicker ? prefixCls + '-time' : '' }} {{ isRange ? prefixCls + '-range' : '' }}\" tabindex=\"0\">\n <div class=\"{{ prefixCls }}-panel\">\n <ng-container *ngIf=\"!isRange\"> <!-- Single ONLY -->\n <ng-container *ngTemplateOutlet=\"tplCalendarInput\"></ng-container>\n </ng-container>\n <div class=\"{{ prefixCls }}-date-panel\">\n <ng-container *ngIf=\"isRange; else tplSinglePart\">\n <!-- Range Selectors -->\n <ng-container *ngTemplateOutlet=\"tplRangePart; context: { partType: 'left' }\"></ng-container>\n <div class=\"ant-calendar-range-middle\">~</div>\n <ng-container *ngTemplateOutlet=\"tplRangePart; context: { partType: 'right' }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!isRange\"> <!-- Single ONLY -->\n <ng-container *ngTemplateOutlet=\"tplFooter\"></ng-container>\n </ng-container>\n </div>\n <ng-container *ngIf=\"isRange\"> <!-- Range ONLY -->\n <ng-container *ngTemplateOutlet=\"tplFooter\"></ng-container>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #tplCalendarInput let-partType=\"partType\">\n <calendar-input\n [value]=\"getValue(partType)\"\n (valueChange)=\"changeValue($event, partType)\"\n [locale]=\"locale\"\n [disabledDate]=\"disabledDate\"\n [format]=\"format\"\n [placeholder]=\"getPlaceholder(partType)\"\n ></calendar-input>\n</ng-template>\n\n<ng-template #tplInnerPopup let-partType=\"partType\">\n <inner-popup\n [showWeek]=\"showWeek\"\n [locale]=\"locale\"\n [showTimePicker]=\"hasTimePicker && showTimePicker\"\n [timeOptions]=\"getTimeOptions(partType)\"\n [panelMode]=\"getPanelMode(partType)\"\n (panelModeChange)=\"onPanelModeChange($event, partType)\"\n [value]=\"getValueBySelector(partType)\"\n [disabledDate]=\"disabledDate\"\n [dateRender]=\"dateRender\"\n [selectedValue]=\"selectedValue\"\n [hoverValue]=\"hoverValue\"\n [enablePrev]=\"enablePrevNext('prev', partType)\"\n [enableNext]=\"enablePrevNext('next', partType)\"\n (dayHover)=\"onDayHover($event)\"\n (selectDate)=\"changeValueFromSelect($event)\"\n (selectTime)=\"onSelectTime($event, partType)\"\n (headerChange)=\"onHeaderChange($event, partType)\"\n ></inner-popup>\n</ng-template>\n\n<ng-template #tplFooter>\n <calendar-footer\n *ngIf=\"hasFooter\"\n [locale]=\"locale\"\n [showToday]=\"showToday\"\n [hasTimePicker]=\"hasTimePicker\"\n [timePickerDisabled]=\"timePickerDisabled()\"\n [okDisabled]=\"okDisabled()\"\n [extraFooter]=\"extraFooter\"\n [rangeQuickSelector]=\"ranges ? tplRangeQuickSelector : null\"\n [(showTimePicker)]=\"showTimePicker\"\n (showTimePickerChange)=\"onShowTimePickerChange($event)\"\n (clickOk)=\"resultOk.emit()\"\n (clickToday)=\"onClickToday($event)\"\n ></calendar-footer>\n</ng-template>\n\n<!-- Single ONLY -->\n<ng-template #tplSinglePart>\n <ng-container *ngTemplateOutlet=\"tplInnerPopup\"></ng-container>\n</ng-template>\n\n<!-- Range ONLY -->\n<ng-template #tplRangePart let-partType=\"partType\">\n <div class=\"{{ prefixCls }}-range-part {{ prefixCls }}-range-{{ partType }}\">\n <ng-container *ngTemplateOutlet=\"tplCalendarInput; context: { partType: partType }\"></ng-container>\n <div style=\"outline: none;\">\n <ng-container *ngTemplateOutlet=\"tplInnerPopup; context: { partType: partType }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<!-- Range ONLY: Range Quick Selector -->\n<ng-template #tplRangeQuickSelector>\n <a *ngFor=\"let name of getObjectKeys(ranges)\"\n (click)=\"onClickPresetRange(ranges[name])\"\n (mouseenter)=\"onHoverPresetRange(ranges[name])\"\n (mouseleave)=\"onPresetRangeMouseLeave()\"\n >{{ name }}</a>\n</ng-template>"
}] }
];
DateRangePopupComponent.propDecorators = {
isRange: [{ type: Input }],
showWeek: [{ type: Input }],
locale: [{ type: Input }],
format: [{ type: Input }],
placeholder: [{ type: Input }],
disabledDate: [{ type: Input }],
disabledTime: [{ type: Input }],
showToday: [{ type: Input }],
showTime: [{ type: Input }],
extraFooter: [{ type: Input }],
ranges: [{ type: Input }],
dateRender: [{ type: Input }],
popupStyle: [{ type: Input }],
dropdownClassName: [{ type: Input }],
panelMode: [{ type: Input }],
panelModeChange: [{ type: Output }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
resultOk: [{ type: Output }],
closePicker: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class InnerPopupComponent {
constructor() {
this.panelModeChange = new EventEmitter();
this.headerChange = new EventEmitter(); // Emitted when user changed the header's value
// Emitted when user changed the header's value
this.selectDate = new EventEmitter(); // Emitted when the date is selected by click the date panel
// Emitted when the date is selected by click the date panel
this.selectTime = new EventEmitter();
this.dayHover = new EventEmitter(); // Emitted when hover on a day by mouse enter
// Emitted when hover on a day by mouse enter
this.prefixCls = 'ant-calendar';
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.value && !this.value) {
this.value = new CandyDate();
}
}
/**
* @param {?} date
* @return {?}
*/
onSelectTime(date) {
this.selectTime.emit(new CandyDate(date));
}
// The value real changed to outside
/**
* @param {?} date
* @return {?}
*/
onSelectDate(date) {
/** @type {?} */
const value = date instanceof CandyDate ? date : new CandyDate(date);
this.selectDate.emit(value);
}
}
InnerPopupComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'inner-popup',
template: "<calendar-header\n [(panelMode)]=\"panelMode\"\n (panelModeChange)=\"panelModeChange.emit($event)\"\n [(value)]=\"value\"\n (valueChange)=\"headerChange.emit($event)\"\n [locale]=\"locale\"\n [showTimePicker]=\"showTimePicker\"\n [enablePrev]=\"enablePrev\"\n [enableNext]=\"enableNext\"\n></calendar-header>\n\n<ng-container *ngIf=\"showTimePicker && timeOptions\">\n <nz-time-picker-panel\n [nzInDatePicker]=\"true\"\n [ngModel]=\"value.nativeDate\"\n (ngModelChange)=\"onSelectTime($event)\"\n [format]=\"timeOptions.nzFormat\"\n [nzHourStep]=\"timeOptions.nzHourStep\"\n [nzMinuteStep]=\"timeOptions.nzMinuteStep\"\n [nzSecondStep]=\"timeOptions.nzSecondStep\"\n [nzDisabledHours]=\"timeOptions.nzDisabledHours\"\n [nzDisabledMinutes]=\"timeOptions.nzDisabledMinutes\"\n [nzDisabledSeconds]=\"timeOptions.nzDisabledSeconds\"\n [nzHideDisabledOptions]=\"timeOptions.nzHideDisabledOptions\"\n [nzDefaultOpenValue]=\"timeOptions.nzDefaultOpenValue\"\n [nzAddOn]=\"timeOptions.nzAddOn\"\n ></nz-time-picker-panel>\n</ng-container>\n\n<div class=\"{{ prefixCls }}-body\">\n <date-table\n [locale]=\"locale\"\n [showWeek]=\"showWeek\"\n [value]=\"value\"\n (valueChange)=\"onSelectDate($event)\"\n showWeekNumber=\"false\"\n [disabledDate]=\"disabledDate\"\n [dateRender]=\"dateRender\"\n [selectedValue]=\"selectedValue\"\n [hoverValue]=\"hoverValue\"\n (dayHover)=\"dayHover.emit($event)\"\n ></date-table>\n</div>"
}] }
];
/** @nocollapse */
InnerPopupComponent.ctorParameters = () => [];
InnerPopupComponent.propDecorators = {
showWeek: [{ type: Input }],
locale: [{ type: Input }],
showTimePicker: [{ type: Input }],
timeOptions: [{ type: Input }],
enablePrev: [{ type: Input }],
enableNext: [{ type: Input }],
disabledDate: [{ type: Input }],
dateRender: [{ type: Input }],
selectedValue: [{ type: Input }],
hoverValue: [{ type: Input }],
panelMode: [{ type: Input }],
panelModeChange: [{ type: Output }],
value: [{ type: Input }],
headerChange: [{ type: Output }],
selectDate: [{ type: Output }],
selectTime: [{ type: Output }],
dayHover: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const MAX_ROW$2 = 4;
/** @type {?} */
const MAX_COL$2 = 3;
class YearPanelComponent {
constructor() {
this.valueChange = new EventEmitter();
this.decadePanelShow = new EventEmitter();
this.prefixCls = 'ant-calendar-year-panel';
}
/**
* @return {?}
*/
get currentYear() {
return this.value.getYear();
}
/**
* @return {?}
*/
get startYear() {
return parseInt(`${this.currentYear / 10}`, 10) * 10;
}
/**
* @return {?}
*/
get endYear() {
return this.startYear + 9;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.value || changes.disabledDate) {
this.render();
}
}
/**
* @return {?}
*/
previousDecade() {
this.gotoYear(-10);
}
/**
* @return {?}
*/
nextDecade() {
this.gotoYear(10);
}
/**
* @param {?} _index
* @param {?} yearData
* @return {?}
*/
trackPanelYear(_index, yearData) {
return yearData.content;
}
/**
* @private
* @return {?}
*/
render() {
if (this.value) {
this.panelYears = this.makePanelYears();
}
}
// Re-render panel content by the header's buttons (NOTE: Do not try to trigger final value change)
/**
* @private
* @param {?} amount
* @return {?}
*/
gotoYear(amount) {
this.value = this.value.addYears(amount);
// this.valueChange.emit(this.value); // Do not trigger final value change
this.render();
}
/**
* @private
* @param {?} year
* @return {?}
*/
chooseYear(year) {
this.value = this.value.setYear(year);
this.valueChange.emit(this.value);
this.render();
}
/**
* @private
* @return {?}
*/
makePanelYears() {
/** @type {?} */
const years = [];
/** @type {?} */
const currentYear = this.currentYear;
/** @type {?} */
const startYear = this.startYear;
/** @type {?} */
const endYear = this.endYear;
/** @type {?} */
const previousYear = startYear - 1;
/** @type {?} */
let index = 0;
for (let rowIndex = 0; rowIndex < MAX_ROW$2; rowIndex++) {
years[rowIndex] = [];
for (let colIndex = 0; colIndex < MAX_COL$2; colIndex++) {
/** @type {?} */
const year = previousYear + index;
/** @type {?} */
const content = String(year);
/** @type {?} */
const disabled = this.disabledDate ? this.disabledDate(this.value.setYear(year).nativeDate) : false;
/** @type {?} */
const cell = years[rowIndex][colIndex] = {
disabled,
content,
year,
title: content,
isCurrent: year === currentYear,
isLowerThanStart: year < startYear,
isBiggerThanEnd: year > endYear,
classMap: null,
onClick: null
};
cell.classMap = {
[`${this.prefixCls}-cell`]: true,
[`${this.prefixCls}-selected-cell`]: cell.isCurrent,
[`${this.prefixCls}-cell-disabled`]: disabled,
[`${this.prefixCls}-last-decade-cell`]: cell.isLowerThanStart,
[`${this.prefixCls}-next-decade-cell`]: cell.isBiggerThanEnd
};
if (cell.isLowerThanStart) {
cell.onClick = (/**
* @return {?}
*/
() => this.previousDecade());
}
else if (cell.isBiggerThanEnd) {
cell.onClick = (/**
* @return {?}
*/
() => this.nextDecade());
}
else {
cell.onClick = (/**
* @return {?}
*/
() => this.chooseYear(cell.year));
}
index++;
}
}
return years;
}
}
YearPanelComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
// tslint:disable-next-line:component-selector
selector: 'year-panel',
template: "<div class=\"{{ prefixCls }}\">\n <div>\n <div class=\"{{ prefixCls }}-header\">\n <a\n class=\"{{ prefixCls }}-prev-decade-btn\"\n role=\"button\"\n (click)=\"previousDecade()\"\n title=\"{{ locale.previousDecade }}\"\n ></a>\n <a\n class=\"{{ prefixCls }}-decade-select\"\n role=\"button\"\n (click)=\"decadePanelShow.emit()\"\n title=\"{{ locale.decadeSelect }}\"\n >\n <span class=\"{{ prefixCls }}-decade-select-content\">\n {{ startYear }}-{{ endYear }}\n </span>\n <span class=\"{{ prefixCls }}-decade-select-arrow\">x</span>\n </a>\n\n <a class=\"{{ prefixCls }}-next-decade-btn\" (click)=\"nextDecade()\" title=\"{{ locale.nextDecade }}\" role=\"button\"></a>\n </div>\n <div class=\"{{ prefixCls }}-body\">\n <table class=\"{{ prefixCls }}-table\" cellSpacing=\"0\" role=\"grid\">\n <tbody class=\"{{ prefixCls }}-tbody\">\n <tr *ngFor=\"let row of panelYears\" role=\"row\">\n <td *ngFor=\"let yearCell of row; trackBy: trackPanelYear\"\n role=\"gridcell\"\n title=\"{{ yearCell.title }}\"\n (click)=\"yearCell.disabled ? null : yearCell.onClick()\"\n [ngClass]=\"yearCell.classMap\"\n >\n <a class=\"{{ prefixCls }}-year\">{{ yearCell.content }}</a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</div>",
styles: [
// Support disabledDate
`
.ant-calendar-year-panel-cell-disabled .ant-calendar-year-panel-year, .ant-calendar-year-panel-cell-disabled .ant-calendar-year-panel-year:hover {
color: rgba(0,0,0,0.25);
background: #f5f5f5;
cursor: not-allowed;
}
`]
}] }
];
/** @nocollapse */
YearPanelComponent.ctorParameters = () => [];
YearPanelComponent.propDecorators = {
locale: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
disabledDate: [{ type: Input }],
decadePanelShow: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class LibPackerModule {
}
LibPackerModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
FormsModule,
NzI18nModule,
NzTimePickerModule
],
exports: [
CalendarHeaderComponent,
CalendarInputComponent,
CalendarFooterComponent,
OkButtonComponent,
TimePickerButtonComponent,
TodayButtonComponent,
DateTableComponent,
YearPanelComponent,
MonthPanelComponent,
MonthTableComponent,
DecadePanelComponent,
InnerPopupComponent,
DateRangePopupComponent
],
declarations: [
CalendarHeaderComponent,
CalendarInputComponent,
CalendarFooterComponent,
OkButtonComponent,
TimePickerButtonComponent,
TodayButtonComponent,
DateTableComponent,
YearPanelComponent,
MonthPanelComponent,
MonthTableComponent,
DecadePanelComponent,
InnerPopupComponent,
DateRangePopupComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPickerComponent {
/**
* @param {?} dateHelper
* @param {?} changeDetector
*/
constructor(dateHelper, changeDetector) {
this.dateHelper = dateHelper;
this.changeDetector = changeDetector;
this.noAnimation = false;
this.isRange = false;
this.open = undefined; // "undefined" = this value will be not used
this.valueChange = new EventEmitter();
this.openChange = new EventEmitter(); // Emitted when overlay's open state change
this.prefixCls = 'ant-calendar';
this.animationOpenState = false;
this.overlayOpen = false; // Available when "open"=undefined
// Available when "open"=undefined
this.overlayOffsetY = 0;
this.overlayOffsetX = -2;
this.overlayPositions = (/** @type {?} */ ([
{
// offsetX: -10, // TODO: What a pity, cdk/overlay current not support offset configs even though it already provide these properties
// offsetY: -10,
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'top'
},
{
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'bottom'
},
{
originX: 'end',
originY: 'top',
overlayX: 'end',
overlayY: 'top'
},
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'bottom'
}
]));
this.dropdownAnimation = 'bottom';
this.currentPositionX = 'start';
this.currentPositionY = 'top';
}
/**
* @return {?}
*/
get realOpenState() {
return this.isOpenHandledByUser() ? this.open : this.overlayOpen;
}
/**
* @return {?}
*/
ngOnInit() {
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.autoFocus) {
if (this.isRange) {
/** @type {?} */
const firstInput = (/** @type {?} */ (((/** @type {?} */ (this.pickerInput.nativeElement))).querySelector('input:first-child')));
firstInput.focus(); // Focus on the first input
}
else {
this.pickerInput.nativeElement.focus();
}
}
}
// Show overlay content
/**
* @return {?}
*/
showOverlay() {
if (!this.realOpenState) {
this.overlayOpen = true;
this.openChange.emit(this.overlayOpen);
setTimeout((/**
* @return {?}
*/
() => {
if (this.cdkConnectedOverlay && this.cdkConnectedOverlay.overlayRef) {
this.cdkConnectedOverlay.overlayRef.updatePosition();
}
}));
}
}
/**
* @return {?}
*/
hideOverlay() {
if (this.realOpenState) {
this.overlayOpen = false;
this.openChange.emit(this.overlayOpen);
}
}
/**
* @return {?}
*/
onClickInputBox() {
if (!this.disabled && !this.isOpenHandledByUser()) {
this.showOverlay();
}
}
/**
* @return {?}
*/
onClickBackdrop() {
this.hideOverlay();
}
/**
* @return {?}
*/
onOverlayDetach() {
this.hideOverlay();
}
// NOTE: A issue here, the first time position change, the animation will not be triggered.
// Because the overlay's "positionChange" event is emitted after the content's full shown up.
// All other components like "nz-dropdown" which depends on overlay also has the same issue.
// See: https://github.com/NG-ZORRO/ng-zorro-antd/issues/1429
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.dropdownAnimation = position.connectionPair.originY === 'top' ? 'bottom' : 'top';
this.currentPositionX = (/** @type {?} */ (position.connectionPair.originX));
this.currentPositionY = (/** @type {?} */ (position.connectionPair.originY));
this.changeDetector.detectChanges(); // Take side-effects to position styles
}
/**
* @param {?} event
* @return {?}
*/
onClickClear(event) {
event.preventDefault();
event.stopPropagation();
this.value = this.isRange ? [] : null;
this.valueChange.emit(this.value);
}
/**
* @param {?=} partType
* @return {?}
*/
getReadableValue(partType) {
/** @type {?} */
let value;
if (this.isRange) {
value = this.value[this.getPartTypeIndex(partType)];
}
else {
value = (/** @type {?} */ (this.value));
}
return value ? this.dateHelper.format(value.nativeDate, this.format) : null;
}
/**
* @param {?} partType
* @return {?}
*/
getPartTypeIndex(partType) {
return { 'left': 0, 'right': 1 }[partType];
}
/**
* @param {?=} partType
* @return {?}
*/
getPlaceholder(partType) {
return this.isRange ? this.placeholder[this.getPartTypeIndex(partType)] : (/** @type {?} */ (this.placeholder));
}
/**
* @param {?} value
* @return {?}
*/
isEmptyValue(value) {
if (this.isRange) {
return !value || !Array.isArray(value) || value.every((/**
* @param {?} val
* @return {?}
*/
(val) => !val));
}
else {
return !value;
}
}
// Whether open state is permanently controlled by user himself
/**
* @return {?}
*/
isOpenHandledByUser() {
return this.open !== undefined;
}
/**
* @return {?}
*/
animationStart() {
if (this.realOpenState) {
this.animationOpenState = true;
}
}
/**
* @return {?}
*/
animationDone() {
this.animationOpenState = this.realOpenState;
}
}
NzPickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
selector: 'nz-picker',
template: "<span\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n class=\"{{ prefixCls }}-picker {{ size ? prefixCls + '-picker-' + size : '' }} {{ className }}\"\n [ngStyle]=\"style\"\n tabindex=\"0\"\n (click)=\"onClickInputBox()\"\n>\n <!-- Content of single picker -->\n <ng-container *ngIf=\"!isRange\">\n <input\n #pickerInput\n class=\"{{ prefixCls }}-picker-input ant-input\"\n [class.ant-input-lg]=\"size === 'large'\"\n [class.ant-input-sm]=\"size === 'small'\"\n [class.ant-input-disabled]=\"disabled\"\n\n [disabled]=\"disabled\"\n readonly\n value=\"{{ getReadableValue() }}\"\n placeholder=\"{{ getPlaceholder() }}\"\n />\n <ng-container *ngTemplateOutlet=\"tplRightRest\"></ng-container>\n </ng-container>\n\n <!-- Content of range picker -->\n <ng-container *ngIf=\"isRange\">\n <span\n #pickerInput\n class=\"{{ prefixCls }}-picker-input ant-input\"\n [class.ant-input-lg]=\"size === 'large'\"\n [class.ant-input-sm]=\"size === 'small'\"\n [class.ant-input-disabled]=\"disabled\"\n >\n <ng-container *ngTemplateOutlet=\"tplRangeInput; context: { partType: 'left' }\"></ng-container>\n <span class=\"{{ prefixCls }}-range-picker-separator\"> ~ </span>\n <ng-container *ngTemplateOutlet=\"tplRangeInput; context: { partType: 'right' }\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tplRightRest\"></ng-container>\n </span>\n </ng-container>\n</span>\n\n<!-- Input for Range ONLY -->\n<ng-template #tplRangeInput let-partType=\"partType\">\n <input\n class=\"{{ prefixCls }}-range-picker-input\"\n [disabled]=\"disabled\"\n readonly\n value=\"{{ getReadableValue(partType) }}\"\n placeholder=\"{{ getPlaceholder(partType) }}\"\n />\n</ng-template>\n\n<!-- Right operator icons -->\n<ng-template #tplRightRest>\n <i\n nz-icon\n type=\"close-circle\"\n theme=\"fill\"\n *ngIf=\"!disabled && !isEmptyValue(value) && allowClear\"\n class=\"{{ prefixCls }}-picker-clear\"\n (click)=\"onClickClear($event)\"\n ></i>\n <span class=\"{{ prefixCls }}-picker-icon\">\n <i nz-icon type=\"calendar\"></i>\n </span>\n</ng-template>\n\n<!-- Overlay -->\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"realOpenState\"\n [cdkConnectedOverlayHasBackdrop]=\"!isOpenHandledByUser()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n (positionChange)=\"onPositionChange($event)\"\n (backdropClick)=\"onClickBackdrop()\"\n (detach)=\"onOverlayDetach()\"\n>\n <div\n [nzNoAnimation]=\"noAnimation\"\n [@slideMotion]=\"dropdownAnimation\"\n (@slideMotion.start)=\"animationStart()\"\n (@slideMotion.done)=\"animationDone()\"\n style=\"position: relative;\"\n [style.left]=\"currentPositionX === 'start' ? '-2px' : '2px'\"\n [style.top]=\"currentPositionY === 'top' ? '-2px' : '2px'\"\n > <!-- Compatible for overlay that not support offset dynamically and immediately -->\n <ng-content></ng-content>\n </div>\n</ng-template>",
animations: [
slideMotion
],
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzPickerComponent.ctorParameters = () => [
{ type: DateHelperService$$1 },
{ type: ChangeDetectorRef }
];
NzPickerComponent.propDecorators = {
noAnimation: [{ type: Input }],
isRange: [{ type: Input }],
open: [{ type: Input }],
disabled: [{ type: Input }],
placeholder: [{ type: Input }],
allowClear: [{ type: Input }],
autoFocus: [{ type: Input }],
className: [{ type: Input }],
format: [{ type: Input }],
size: [{ type: Input }],
style: [{ type: Input }],
value: [{ type: Input }],
valueChange: [{ type: Output }],
openChange: [{ type: Output }],
origin: [{ type: ViewChild, args: ['origin',] }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
pickerInput: [{ type: ViewChild, args: ['pickerInput',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const POPUP_STYLE_PATCH = { 'position': 'relative' };
// Aim to override antd's style to support overlay's position strategy (position:absolute will cause it not working beacuse the overlay can't get the height/width of it's content)
/**
* The base picker for all common APIs
* @abstract
*/
class AbstractPickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, noAnimation) {
this.i18n = i18n;
this.cdr = cdr;
this.dateHelper = dateHelper;
this.noAnimation = noAnimation;
// --- Common API
this.nzAllowClear = true;
this.nzAutoFocus = false;
this.nzDisabled = false;
this.nzPopupStyle = POPUP_STYLE_PATCH;
this.nzOnOpenChange = new EventEmitter();
this.isRange = false; // Indicate whether the value is a range value
this.destroyed$ = new Subject();
this.isCustomPlaceHolder = false;
// ------------------------------------------------------------------------
// | Control value accessor implements
// ------------------------------------------------------------------------
// NOTE: onChangeFn/onTouchedFn will not be assigned if user not use as ngModel
this.onChangeFn = (/**
* @return {?}
*/
() => void 0);
this.onTouchedFn = (/**
* @return {?}
*/
() => void 0);
}
// Indicate whether the value is a range value
/**
* @return {?}
*/
get realOpenState() {
return this.picker.animationOpenState;
} // Use picker's real open state to let re-render the picker's content when shown up
// Use picker's real open state to let re-render the picker's content when shown up
/**
* @return {?}
*/
initValue() {
this.nzValue = this.isRange ? [] : null;
}
/**
* @return {?}
*/
ngOnInit() {
// Subscribe the every locale change if the nzLocale is not handled by user
if (!this.nzLocale) {
this.i18n.localeChange
.pipe(takeUntil(this.destroyed$))
.subscribe((/**
* @return {?}
*/
() => this.setLocale()));
}
// Default value
this.initValue();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzPopupStyle) { // Always assign the popup style patch
this.nzPopupStyle = this.nzPopupStyle ? Object.assign({}, this.nzPopupStyle, POPUP_STYLE_PATCH) : POPUP_STYLE_PATCH;
}
// Mark as customized placeholder by user once nzPlaceHolder assigned at the first time
if (changes.nzPlaceHolder && changes.nzPlaceHolder.firstChange && typeof this.nzPlaceHolder !== 'undefined') {
this.isCustomPlaceHolder = true;
}
if (changes.nzLocale) { // The nzLocale is currently handled by user
this.setDefaultPlaceHolder();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroyed$.next();
this.destroyed$.complete();
}
/**
* @return {?}
*/
closeOverlay() {
this.picker.hideOverlay();
}
/**
* Common handle for value changes
* @param {?} value changed value
* @return {?}
*/
onValueChange(value) {
this.nzValue = value;
if (this.isRange) {
if (((/** @type {?} */ (this.nzValue))).length) {
this.onChangeFn([this.nzValue[0].nativeDate, this.nzValue[1].nativeDate]);
}
else {
this.onChangeFn([]);
}
}
else {
if (this.nzValue) {
this.onChangeFn(((/** @type {?} */ (this.nzValue))).nativeDate);
}
else {
this.onChangeFn(null);
}
}
this.onTouchedFn();
}
/**
* Triggered when overlayOpen changes (different with realOpenState)
* @param {?} open The overlayOpen in picker component
* @return {?}
*/
onOpenChange(open) {
this.nzOnOpenChange.emit(open);
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.setValue(value);
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChangeFn = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouchedFn = fn;
}
/**
* @param {?} disabled
* @return {?}
*/
setDisabledState(disabled) {
this.nzDisabled = disabled;
this.cdr.markForCheck();
}
// ------------------------------------------------------------------------
// | Internal methods
// ------------------------------------------------------------------------
// Reload locale from i18n with side effects
/**
* @private
* @return {?}
*/
setLocale() {
this.nzLocale = this.i18n.getLocaleData('DatePicker', {});
this.setDefaultPlaceHolder();
this.cdr.markForCheck();
}
/**
* @private
* @return {?}
*/
setDefaultPlaceHolder() {
if (!this.isCustomPlaceHolder && this.nzLocale) {
this.nzPlaceHolder = this.isRange ? this.nzLocale.lang.rangePlaceholder : this.nzLocale.lang.placeholder;
}
}
// Safe way of setting value with default
/**
* @private
* @param {?} value
* @return {?}
*/
setValue(value) {
if (this.isRange) {
this.nzValue = value ? ((/** @type {?} */ (value))).map((/**
* @param {?} val
* @return {?}
*/
val => new CandyDate(val))) : [];
}
else {
this.nzValue = value ? new CandyDate((/** @type {?} */ (value))) : null;
}
}
}
AbstractPickerComponent.propDecorators = {
nzAllowClear: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzOpen: [{ type: Input }],
nzClassName: [{ type: Input }],
nzDisabledDate: [{ type: Input }],
nzLocale: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzPopupStyle: [{ type: Input }],
nzDropdownClassName: [{ type: Input }],
nzSize: [{ type: Input }],
nzStyle: [{ type: Input }],
nzOnOpenChange: [{ type: Output }],
nzFormat: [{ type: Input }],
nzValue: [{ type: Input }],
picker: [{ type: ViewChild, args: [NzPickerComponent,] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzAllowClear", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzAutoFocus", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzOpen", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class DateRangePickerComponent extends AbstractPickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.showWeek = false; // Should show as week picker
this.nzShowToday = true;
this.nzOnPanelChange = new EventEmitter();
this.nzOnOk = new EventEmitter();
}
/**
* @return {?}
*/
get nzShowTime() { return this._showTime; }
/**
* @param {?} value
* @return {?}
*/
set nzShowTime(value) {
this._showTime = typeof value === 'object' ? value : toBoolean(value);
}
/**
* @return {?}
*/
get realShowToday() {
return !this.isRange && this.nzShowToday;
}
/**
* @return {?}
*/
ngOnInit() {
super.ngOnInit();
// Default format when it's empty
if (!this.nzFormat) {
if (this.showWeek) {
this.nzFormat = this.dateHelper.relyOnDatePipe ? 'yyyy-ww' : 'YYYY-WW'; // Format for week
}
else {
if (this.dateHelper.relyOnDatePipe) {
this.nzFormat = this.nzShowTime ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd';
}
else {
this.nzFormat = this.nzShowTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
}
}
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
super.ngOnChanges(changes);
if (changes.nzRenderExtraFooter) {
this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
}
if (changes.nzShowTime || changes.nzStyle) {
this.setFixedPickerStyle();
}
}
// If has no timepicker and the user select a date by date panel, then close picker
/**
* @param {?} value
* @return {?}
*/
onValueChange(value) {
super.onValueChange(value);
if (!this.nzShowTime) {
this.closeOverlay();
}
}
// Emitted when done with date selecting
/**
* @return {?}
*/
onResultOk() {
if (this.isRange) {
if (((/** @type {?} */ (this.nzValue))).length) {
this.nzOnOk.emit([this.nzValue[0].nativeDate, this.nzValue[1].nativeDate]);
}
else {
this.nzOnOk.emit([]);
}
}
else {
if (this.nzValue) {
this.nzOnOk.emit(((/** @type {?} */ (this.nzValue))).nativeDate);
}
else {
this.nzOnOk.emit(null);
}
}
this.closeOverlay();
}
/**
* @param {?} open
* @return {?}
*/
onOpenChange(open) {
this.nzOnOpenChange.emit(open);
}
// Setup fixed style for picker
/**
* @private
* @return {?}
*/
setFixedPickerStyle() {
/** @type {?} */
const showTimeFixes = {};
if (this.nzShowTime) {
showTimeFixes.width = this.isRange ? '350px' : '195px';
}
this.pickerStyle = Object.assign({}, showTimeFixes, this.nzStyle);
}
}
DateRangePickerComponent.decorators = [
{ type: Component, args: [{
template: `` // Just for rollup
}] }
];
/** @nocollapse */
DateRangePickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: NzNoAnimationDirective }
];
DateRangePickerComponent.propDecorators = {
nzDateRender: [{ type: Input }],
nzDisabledTime: [{ type: Input }],
nzRenderExtraFooter: [{ type: Input }],
nzShowToday: [{ type: Input }],
nzMode: [{ type: Input }],
nzRanges: [{ type: Input }],
nzOnPanelChange: [{ type: Output }],
nzShowTime: [{ type: Input }],
nzOnOk: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], DateRangePickerComponent.prototype, "nzShowToday", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDatePickerComponent extends DateRangePickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?} renderer
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.noAnimation = noAnimation;
this.isRange = false;
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
}
}
NzDatePickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-date-picker',
template: "<nz-picker\n [isRange]=\"isRange\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"pickerStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <date-range-popup *ngIf=\"realOpenState\"\n [isRange]=\"isRange\"\n [showWeek]=\"showWeek\"\n [panelMode]=\"nzMode\"\n (panelModeChange)=\"nzOnPanelChange.emit($event)\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [locale]=\"nzLocale?.lang\"\n [showToday]=\"realShowToday\"\n [showTime]=\"nzShowTime\"\n [format]=\"nzFormat\"\n [dateRender]=\"nzDateRender\"\n [disabledDate]=\"nzDisabledDate\"\n [disabledTime]=\"nzDisabledTime\"\n [placeholder]=\"nzPlaceHolder\"\n [dropdownClassName]=\"nzDropdownClassName\"\n [popupStyle]=\"nzPopupStyle\"\n [extraFooter]=\"extraFooter\"\n [ranges]=\"nzRanges\"\n (resultOk)=\"onResultOk()\"\n (closePicker)=\"closeOverlay()\"\n ></date-range-popup>\n</nz-picker>",
providers: [{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzDatePickerComponent))
}]
}] }
];
/** @nocollapse */
NzDatePickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* The base picker for header panels, current support: Year/Month
*/
class HeaderPickerComponent extends AbstractPickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
}
/**
* @return {?}
*/
ngOnInit() {
super.ngOnInit();
this.panelMode = this.endPanelMode;
/** @type {?} */
const allHeaderPanels = ['decade', 'year', 'month'];
this.supportPanels = allHeaderPanels.slice(0, allHeaderPanels.indexOf(this.endPanelMode) + 1);
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
super.ngOnChanges(changes);
if (changes.nzRenderExtraFooter) {
this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
}
}
/**
* @param {?} mode
* @return {?}
*/
onPanelModeChange(mode) {
if (this.supportPanels.indexOf(mode) > -1) {
this.panelMode = mode;
}
else { // Since the default "click year" logic can be "year panel" -> "date panel", we need force to the end panel otherwise
this.panelMode = this.endPanelMode;
}
}
/**
* @param {?} mode
* @param {?} value
* @return {?}
*/
onChooseValue(mode, value) {
if (this.endPanelMode === mode) {
super.onValueChange(value);
this.closeOverlay();
}
}
/**
* @param {?} open
* @return {?}
*/
onOpenChange(open) {
if (!open) {
this.cleanUp();
}
this.nzOnOpenChange.emit(open);
}
// Restore some initial props to let open as new in next time
/**
* @private
* @return {?}
*/
cleanUp() {
this.panelMode = this.endPanelMode;
}
}
HeaderPickerComponent.decorators = [
{ type: Component, args: [{
template: ``
}] }
];
/** @nocollapse */
HeaderPickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: NzNoAnimationDirective }
];
HeaderPickerComponent.propDecorators = {
nzPlaceHolder: [{ type: Input }],
nzRenderExtraFooter: [{ type: Input }],
nzDefaultValue: [{ type: Input }],
nzFormat: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMonthPickerComponent extends HeaderPickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?} renderer
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.noAnimation = noAnimation;
this.nzFormat = 'yyyy-MM';
this.endPanelMode = 'month';
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
}
}
NzMonthPickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-month-picker',
template: "<nz-picker\n [isRange]=\"false\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"nzStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <div *ngIf=\"realOpenState\">\n <div class=\"ant-calendar-picker-container {{ nzDropdownClassName }} ant-calendar-picker-container-placement-bottomLeft\" [ngStyle]=\"nzPopupStyle\">\n <div class=\"ant-calendar ant-calendar-month ant-calendar-month-calendar\" tabindex=\"0\">\n <div class=\"ant-calendar-month-calendar-content\">\n <div class=\"ant-calendar-month-header-wrap\">\n <calendar-header\n [disabledMonth]=\"nzDisabledDate\"\n [disabledYear]=\"nzDisabledDate\"\n [panelMode]=\"panelMode\"\n (panelModeChange)=\"onPanelModeChange($event)\"\n [value]=\"nzValue\"\n (chooseYear)=\"onChooseValue('year', $event)\"\n (chooseMonth)=\"onChooseValue('month', $event)\"\n [locale]=\"nzLocale.lang\"\n [enablePrev]=\"true\"\n [enableNext]=\"true\"\n ></calendar-header>\n </div>\n <calendar-footer *ngIf=\"extraFooter\" [extraFooter]=\"extraFooter\"></calendar-footer>\n </div>\n </div>\n </div>\n </div>\n</nz-picker>",
providers: [{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzMonthPickerComponent))
}]
}] }
];
/** @nocollapse */
NzMonthPickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzMonthPickerComponent.propDecorators = {
nzFormat: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRangePickerComponent extends DateRangePickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?} renderer
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.noAnimation = noAnimation;
this.isRange = true;
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
}
}
NzRangePickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-range-picker',
template: "<nz-picker\n [isRange]=\"isRange\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"pickerStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <date-range-popup *ngIf=\"realOpenState\"\n [isRange]=\"isRange\"\n [showWeek]=\"showWeek\"\n [panelMode]=\"nzMode\"\n (panelModeChange)=\"nzOnPanelChange.emit($event)\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [locale]=\"nzLocale?.lang\"\n [showToday]=\"realShowToday\"\n [showTime]=\"nzShowTime\"\n [format]=\"nzFormat\"\n [dateRender]=\"nzDateRender\"\n [disabledDate]=\"nzDisabledDate\"\n [disabledTime]=\"nzDisabledTime\"\n [placeholder]=\"nzPlaceHolder\"\n [dropdownClassName]=\"nzDropdownClassName\"\n [popupStyle]=\"nzPopupStyle\"\n [extraFooter]=\"extraFooter\"\n [ranges]=\"nzRanges\"\n (resultOk)=\"onResultOk()\"\n (closePicker)=\"closeOverlay()\"\n ></date-range-popup>\n</nz-picker>",
providers: [{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRangePickerComponent))
}]
}] }
];
/** @nocollapse */
NzRangePickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzWeekPickerComponent extends DateRangePickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?} renderer
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.noAnimation = noAnimation;
this.showWeek = true;
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
}
}
NzWeekPickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-week-picker',
template: "<nz-picker\n [isRange]=\"isRange\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"pickerStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <date-range-popup *ngIf=\"realOpenState\"\n [isRange]=\"isRange\"\n [showWeek]=\"showWeek\"\n [panelMode]=\"nzMode\"\n (panelModeChange)=\"nzOnPanelChange.emit($event)\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [locale]=\"nzLocale?.lang\"\n [showToday]=\"realShowToday\"\n [showTime]=\"nzShowTime\"\n [format]=\"nzFormat\"\n [dateRender]=\"nzDateRender\"\n [disabledDate]=\"nzDisabledDate\"\n [disabledTime]=\"nzDisabledTime\"\n [placeholder]=\"nzPlaceHolder\"\n [dropdownClassName]=\"nzDropdownClassName\"\n [popupStyle]=\"nzPopupStyle\"\n [extraFooter]=\"extraFooter\"\n [ranges]=\"nzRanges\"\n (resultOk)=\"onResultOk()\"\n (closePicker)=\"closeOverlay()\"\n ></date-range-popup>\n</nz-picker>",
providers: [{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzWeekPickerComponent))
}]
}] }
];
/** @nocollapse */
NzWeekPickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzYearPickerComponent extends HeaderPickerComponent {
/**
* @param {?} i18n
* @param {?} cdr
* @param {?} dateHelper
* @param {?} renderer
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
super(i18n, cdr, dateHelper, noAnimation);
this.noAnimation = noAnimation;
this.nzFormat = 'yyyy';
this.endPanelMode = 'year';
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
}
}
NzYearPickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-year-picker',
template: "<nz-picker\n [isRange]=\"false\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"nzStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <div *ngIf=\"realOpenState\">\n <div class=\"ant-calendar-picker-container {{ nzDropdownClassName }} ant-calendar-picker-container-placement-bottomLeft\" [ngStyle]=\"nzPopupStyle\">\n <div class=\"ant-calendar ant-calendar-month ant-calendar-month-calendar\" tabindex=\"0\">\n <div class=\"ant-calendar-month-calendar-content\">\n <div class=\"ant-calendar-month-header-wrap\">\n <calendar-header\n [disabledMonth]=\"nzDisabledDate\"\n [disabledYear]=\"nzDisabledDate\"\n [panelMode]=\"panelMode\"\n (panelModeChange)=\"onPanelModeChange($event)\"\n [value]=\"nzValue\"\n (chooseYear)=\"onChooseValue('year', $event)\"\n (chooseMonth)=\"onChooseValue('month', $event)\"\n [locale]=\"nzLocale.lang\"\n [enablePrev]=\"true\"\n [enableNext]=\"true\"\n ></calendar-header>\n </div>\n <calendar-footer *ngIf=\"extraFooter\" [extraFooter]=\"extraFooter\"></calendar-footer>\n </div>\n </div>\n </div>\n </div>\n</nz-picker>",
providers: [{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzYearPickerComponent))
}]
}] }
];
/** @nocollapse */
NzYearPickerComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef },
{ type: DateHelperService$$1 },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzYearPickerComponent.propDecorators = {
nzFormat: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDatePickerModule {
}
NzDatePickerModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
OverlayModule,
LibPackerModule,
NzIconModule,
NzOverlayModule,
NzNoAnimationModule
],
exports: [
NzDatePickerComponent,
NzRangePickerComponent,
NzMonthPickerComponent,
NzYearPickerComponent,
NzWeekPickerComponent
],
declarations: [
HeaderPickerComponent,
DateRangePickerComponent,
NzPickerComponent,
NzDatePickerComponent,
NzMonthPickerComponent,
NzYearPickerComponent,
NzWeekPickerComponent,
NzRangePickerComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDividerComponent {
/**
* @param {?} elementRef
* @param {?} nzUpdateHostClassService
*/
constructor(elementRef, nzUpdateHostClassService) {
this.elementRef = elementRef;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.nzType = 'horizontal';
this.nzOrientation = '';
this.nzDashed = false;
}
/**
* @private
* @return {?}
*/
setClass() {
/** @type {?} */
const orientationPrefix = (this.nzOrientation.length > 0) ? '-' + this.nzOrientation : this.nzOrientation;
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
['ant-divider']: true,
[`ant-divider-${this.nzType}`]: true,
[`ant-divider-with-text${orientationPrefix}`]: this.nzText,
[`ant-divider-dashed`]: this.nzDashed
});
}
/**
* @return {?}
*/
ngOnChanges() {
this.setClass();
}
/**
* @return {?}
*/
ngOnInit() {
this.setClass();
}
}
NzDividerComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-divider',
template: "<span *ngIf=\"nzText\" class=\"ant-divider-inner-text\">\n <ng-container *nzStringTemplateOutlet=\"nzText\">{{ nzText }}</ng-container>\n</span>",
preserveWhitespaces: false,
providers: [NzUpdateHostClassService],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzDividerComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzUpdateHostClassService }
];
NzDividerComponent.propDecorators = {
nzText: [{ type: Input }],
nzType: [{ type: Input }],
nzOrientation: [{ type: Input }],
nzDashed: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDividerComponent.prototype, "nzDashed", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDividerModule {
}
NzDividerModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzAddOnModule],
declarations: [NzDividerComponent],
exports: [NzDividerComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// tslint:disable-next-line:no-any
/**
* @abstract
* @template R
*/
class NzDrawerRef {
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const DRAWER_ANIMATE_DURATION = 300;
/**
* @template T, R, D
*/
// tslint:disable-next-line:no-any
class NzDrawerComponent extends NzDrawerRef {
/**
* @param {?} document
* @param {?} renderer
* @param {?} overlay
* @param {?} injector
* @param {?} changeDetectorRef
* @param {?} focusTrapFactory
* @param {?} viewContainerRef
*/
constructor(document, renderer, overlay, injector, changeDetectorRef, focusTrapFactory, viewContainerRef) {
super();
this.document = document;
this.renderer = renderer;
this.overlay = overlay;
this.injector = injector;
this.changeDetectorRef = changeDetectorRef;
this.focusTrapFactory = focusTrapFactory;
this.viewContainerRef = viewContainerRef;
this.nzClosable = true;
this.nzMaskClosable = true;
this.nzMask = true;
this.nzNoAnimation = false;
this.nzPlacement = 'right';
this.nzMaskStyle = {};
this.nzBodyStyle = {};
this.nzWidth = 256;
this.nzHeight = 256;
this.nzZIndex = 1000;
this.nzOffsetX = 0;
this.nzOffsetY = 0;
this.nzOnViewInit = new EventEmitter();
this.nzOnClose = new EventEmitter();
this.isOpen = false;
this.templateContext = {
$implicit: undefined,
drawerRef: (/** @type {?} */ (this))
};
this.nzAfterOpen = new Subject();
this.nzAfterClose = new Subject();
}
/**
* @param {?} value
* @return {?}
*/
set nzVisible(value) {
this.isOpen = value;
}
/**
* @return {?}
*/
get nzVisible() {
return this.isOpen;
}
/**
* @return {?}
*/
get offsetTransform() {
if (!this.isOpen || (this.nzOffsetX + this.nzOffsetY) === 0) {
return null;
}
switch (this.nzPlacement) {
case 'left':
return `translateX(${this.nzOffsetX}px)`;
case 'right':
return `translateX(-${this.nzOffsetX}px)`;
case 'top':
return `translateY(${this.nzOffsetY}px)`;
case 'bottom':
return `translateY(-${this.nzOffsetY}px)`;
}
}
/**
* @return {?}
*/
get transform() {
if (this.isOpen) {
return null;
}
switch (this.nzPlacement) {
case 'left':
return `translateX(-100%)`;
case 'right':
return `translateX(100%)`;
case 'top':
return `translateY(-100%)`;
case 'bottom':
return `translateY(100%)`;
}
}
/**
* @return {?}
*/
get width() {
return this.isLeftOrRight ? toCssPixel(this.nzWidth) : null;
}
/**
* @return {?}
*/
get height() {
return !this.isLeftOrRight ? toCssPixel(this.nzHeight) : null;
}
/**
* @return {?}
*/
get isLeftOrRight() {
return this.nzPlacement === 'left' || this.nzPlacement === 'right';
}
/**
* @return {?}
*/
get afterOpen() {
return this.nzAfterOpen.asObservable();
}
/**
* @return {?}
*/
get afterClose() {
return this.nzAfterClose.asObservable();
}
/**
* @param {?} value
* @return {?}
*/
isTemplateRef(value) {
return value instanceof TemplateRef;
}
/**
* @return {?}
*/
ngOnInit() {
this.attachOverlay();
this.updateOverlayStyle();
this.updateBodyOverflow();
this.templateContext = { $implicit: this.nzContentParams, drawerRef: (/** @type {?} */ (this)) };
this.changeDetectorRef.detectChanges();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.attachBodyContent();
setTimeout((/**
* @return {?}
*/
() => {
this.nzOnViewInit.emit();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.hasOwnProperty('nzVisible')) {
/** @type {?} */
const value = changes.nzVisible.currentValue;
this.updateOverlayStyle();
if (value) {
this.updateBodyOverflow();
this.savePreviouslyFocusedElement();
this.trapFocus();
}
else {
setTimeout((/**
* @return {?}
*/
() => {
this.updateBodyOverflow();
this.restoreFocus();
}), this.getAnimationDuration());
}
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.disposeOverlay();
}
/**
* @private
* @return {?}
*/
getAnimationDuration() {
return this.nzNoAnimation ? 0 : DRAWER_ANIMATE_DURATION;
}
/**
* @param {?=} result
* @return {?}
*/
close(result) {
this.isOpen = false;
this.updateOverlayStyle();
this.changeDetectorRef.detectChanges();
setTimeout((/**
* @return {?}
*/
() => {
this.updateBodyOverflow();
this.restoreFocus();
this.nzAfterClose.next(result);
this.nzAfterClose.complete();
}), this.getAnimationDuration());
}
/**
* @return {?}
*/
open() {
this.isOpen = true;
this.updateOverlayStyle();
this.updateBodyOverflow();
this.savePreviouslyFocusedElement();
this.trapFocus();
this.changeDetectorRef.detectChanges();
setTimeout((/**
* @return {?}
*/
() => {
this.nzAfterOpen.next();
}), this.getAnimationDuration());
}
/**
* @return {?}
*/
closeClick() {
this.nzOnClose.emit();
}
/**
* @return {?}
*/
maskClick() {
if (this.nzMaskClosable && this.nzMask) {
this.nzOnClose.emit();
}
}
/**
* @private
* @return {?}
*/
attachBodyContent() {
this.bodyPortalOutlet.dispose();
if (this.nzContent instanceof Type) {
/** @type {?} */
const childInjector = new PortalInjector(this.injector, new WeakMap([[NzDrawerRef, this]]));
/** @type {?} */
const componentPortal = new ComponentPortal(this.nzContent, null, childInjector);
/** @type {?} */
const componentRef = this.bodyPortalOutlet.attachComponentPortal(componentPortal);
Object.assign(componentRef.instance, this.nzContentParams);
componentRef.changeDetectorRef.detectChanges();
}
}
/**
* @private
* @return {?}
*/
attachOverlay() {
if (!this.overlayRef) {
this.portal = new TemplatePortal(this.drawerTemplate, this.viewContainerRef);
this.overlayRef = this.overlay.create(this.getOverlayConfig());
}
if (this.overlayRef && !this.overlayRef.hasAttached()) {
this.overlayRef.attach(this.portal);
}
}
/**
* @private
* @return {?}
*/
disposeOverlay() {
if (this.overlayRef) {
this.overlayRef.dispose();
}
this.overlayRef = null;
}
/**
* @private
* @return {?}
*/
getOverlayConfig() {
return new OverlayConfig({
positionStrategy: this.overlay.position().global(),
scrollStrategy: this.overlay.scrollStrategies.block()
});
}
/**
* @private
* @return {?}
*/
updateOverlayStyle() {
if (this.overlayRef && this.overlayRef.overlayElement) {
this.renderer.setStyle(this.overlayRef.overlayElement, 'pointer-events', this.isOpen ? 'auto' : 'none');
}
}
/**
* @private
* @return {?}
*/
updateBodyOverflow() {
if (this.overlayRef) {
if (this.isOpen) {
this.overlayRef.getConfig().scrollStrategy.enable();
}
else {
this.overlayRef.getConfig().scrollStrategy.disable();
}
}
}
/**
* @return {?}
*/
savePreviouslyFocusedElement() {
if (this.document && !this.previouslyFocusedElement) {
this.previouslyFocusedElement = (/** @type {?} */ (this.document.activeElement));
// We need the extra check, because IE's svg element has no blur method.
if (this.previouslyFocusedElement && typeof this.previouslyFocusedElement.blur === 'function') {
this.previouslyFocusedElement.blur();
}
}
}
/**
* @private
* @return {?}
*/
trapFocus() {
if (!this.focusTrap) {
this.focusTrap = this.focusTrapFactory.create(this.overlayRef.overlayElement);
}
this.focusTrap.focusInitialElement();
}
/**
* @private
* @return {?}
*/
restoreFocus() {
// We need the extra check, because IE can set the `activeElement` to null in some cases.
if (this.previouslyFocusedElement && typeof this.previouslyFocusedElement.focus === 'function') {
this.previouslyFocusedElement.focus();
}
if (this.focusTrap) {
this.focusTrap.destroy();
}
}
}
NzDrawerComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-drawer',
template: "<ng-template #drawerTemplate>\n <div\n class=\"ant-drawer\"\n [nzNoAnimation]=\"nzNoAnimation\"\n [class.ant-drawer-open]=\"isOpen\"\n [class.ant-drawer-top]=\"nzPlacement === 'top'\"\n [class.ant-drawer-bottom]=\"nzPlacement === 'bottom'\"\n [class.ant-drawer-right]=\"nzPlacement === 'right'\"\n [class.ant-drawer-left]=\"nzPlacement === 'left'\"\n [style.transform]=\"offsetTransform\">\n <div class=\"ant-drawer-mask\" (click)=\"maskClick()\" *ngIf=\"nzMask\" [style.zIndex]=\"nzZIndex\" [ngStyle]=\"nzMaskStyle\"></div>\n <div class=\"ant-drawer-content-wrapper {{ nzWrapClassName }}\"\n [style.zIndex]=\"nzZIndex\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.transform]=\"transform\">\n <div class=\"ant-drawer-content\">\n <div class=\"ant-drawer-wrapper-body\"\n [style.overflow]=\"isLeftOrRight ? 'auto' : null\"\n [style.height]=\"isLeftOrRight ? '100%' : null\">\n <div *ngIf=\"nzTitle\" class=\"ant-drawer-header\">\n <div class=\"ant-drawer-title\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\"><div [innerHTML]=\"nzTitle\"></div></ng-container>\n </div>\n </div>\n <button *ngIf=\"nzClosable\" (click)=\"closeClick()\" aria-label=\"Close\" class=\"ant-drawer-close\">\n <span class=\"ant-drawer-close-x\"><i nz-icon type=\"close\"></i></span>\n </button>\n <div class=\"ant-drawer-body\" [ngStyle]=\"nzBodyStyle\">\n <ng-template cdkPortalOutlet></ng-template>\n <ng-container *ngIf=\"isTemplateRef(nzContent)\">\n <ng-container *ngTemplateOutlet=\"nzContent; context: templateContext\"></ng-container>\n </ng-container>\n <ng-content *ngIf=\"!nzContent\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>",
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzDrawerComponent.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
{ type: Renderer2 },
{ type: Overlay },
{ type: Injector },
{ type: ChangeDetectorRef },
{ type: FocusTrapFactory },
{ type: ViewContainerRef }
];
NzDrawerComponent.propDecorators = {
nzContent: [{ type: Input }],
nzClosable: [{ type: Input }],
nzMaskClosable: [{ type: Input }],
nzMask: [{ type: Input }],
nzNoAnimation: [{ type: Input }],
nzTitle: [{ type: Input }],
nzPlacement: [{ type: Input }],
nzMaskStyle: [{ type: Input }],
nzBodyStyle: [{ type: Input }],
nzWrapClassName: [{ type: Input }],
nzWidth: [{ type: Input }],
nzHeight: [{ type: Input }],
nzZIndex: [{ type: Input }],
nzOffsetX: [{ type: Input }],
nzOffsetY: [{ type: Input }],
nzVisible: [{ type: Input }],
nzOnViewInit: [{ type: Output }],
nzOnClose: [{ type: Output }],
drawerTemplate: [{ type: ViewChild, args: ['drawerTemplate',] }],
contentTemplate: [{ type: ViewChild, args: ['contentTemplate',] }],
bodyPortalOutlet: [{ type: ViewChild, args: [CdkPortalOutlet,] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDrawerComponent.prototype, "nzClosable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDrawerComponent.prototype, "nzMaskClosable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDrawerComponent.prototype, "nzMask", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDrawerComponent.prototype, "nzNoAnimation", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @template R
*/
class DrawerBuilderForService$$1 {
/**
* @param {?} overlay
* @param {?} options
*/
constructor(overlay, options) {
this.overlay = overlay;
this.options = options;
this.unsubscribe$ = new Subject();
this.createDrawer();
this.updateOptions(this.options);
// Prevent repeatedly open drawer when tap focus element.
this.drawerRef.instance.savePreviouslyFocusedElement();
this.drawerRef.instance.nzOnViewInit
.pipe(takeUntil(this.unsubscribe$))
.subscribe((/**
* @return {?}
*/
() => {
this.drawerRef.instance.open();
}));
this.drawerRef.instance.nzOnClose
.subscribe((/**
* @return {?}
*/
() => {
this.drawerRef.instance.close();
}));
this.drawerRef.instance.afterClose
.pipe(takeUntil(this.unsubscribe$))
.subscribe((/**
* @return {?}
*/
() => {
this.overlayRef.dispose();
this.drawerRef = null;
this.unsubscribe$.next();
this.unsubscribe$.complete();
}));
}
/**
* @return {?}
*/
getInstance() {
return this.drawerRef && this.drawerRef.instance;
}
/**
* @return {?}
*/
createDrawer() {
this.overlayRef = this.overlay.create();
this.drawerRef = this.overlayRef.attach(new ComponentPortal(NzDrawerComponent));
}
/**
* @param {?} options
* @return {?}
*/
updateOptions(options) {
Object.assign(this.drawerRef.instance, options);
}
}
class NzDrawerService$$1 {
/**
* @param {?} overlay
*/
constructor(overlay) {
this.overlay = overlay;
}
// tslint:disable-next-line:no-any
/**
* @template T, D, R
* @param {?} options
* @return {?}
*/
create(options) {
return new DrawerBuilderForService$$1(this.overlay, options).getInstance();
}
}
NzDrawerService$$1.decorators = [
{ type: Injectable, args: [{ providedIn: 'root' },] }
];
/** @nocollapse */
NzDrawerService$$1.ctorParameters = () => [
{ type: Overlay }
];
/** @nocollapse */ NzDrawerService$$1.ngInjectableDef = defineInjectable({ factory: function NzDrawerService_Factory() { return new NzDrawerService$$1(inject(Overlay)); }, token: NzDrawerService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDrawerModule {
}
NzDrawerModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, PortalModule, NzIconModule, NzAddOnModule, NzNoAnimationModule],
exports: [NzDrawerComponent],
declarations: [NzDrawerComponent],
entryComponents: [NzDrawerComponent],
providers: [NzDrawerService$$1]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuDividerDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(elementRef.nativeElement, 'ant-dropdown-menu-item-divider');
}
}
NzMenuDividerDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu-divider]'
},] }
];
/** @nocollapse */
NzMenuDividerDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuGroupComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(elementRef.nativeElement, 'ant-menu-item-group');
}
}
NzMenuGroupComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-menu-group]',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div class=\"ant-menu-item-group-title\">\n <ng-content select=\"[title]\"></ng-content>\n</div>\n<ul class=\"ant-menu-item-group-list\">\n <ng-content></ng-content>\n</ul>",
preserveWhitespaces: false
}] }
];
/** @nocollapse */
NzMenuGroupComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuService {
constructor() {
this.menuItemClick$ = new Subject();
this.theme$ = new Subject();
this.mode$ = new BehaviorSubject('vertical');
this.inlineIndent$ = new BehaviorSubject(24);
this.check$ = merge(this.theme$, this.mode$, this.inlineIndent$);
this.theme = 'light';
this.mode = 'vertical';
this.inlineIndent = 24;
this.menuOpen$ = new BehaviorSubject(false);
}
/**
* @param {?} menu
* @return {?}
*/
onMenuItemClick(menu) {
this.menuItemClick$.next(menu);
}
/**
* @param {?} mode
* @return {?}
*/
setMode(mode) {
this.mode = mode;
this.mode$.next(mode);
}
/**
* @param {?} theme
* @return {?}
*/
setTheme(theme) {
this.theme = theme;
this.theme$.next(theme);
}
/**
* @param {?} indent
* @return {?}
*/
setInlineIndent(indent) {
this.inlineIndent = indent;
this.inlineIndent$.next(indent);
}
}
NzMenuService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSubmenuService {
/**
* @param {?} nzHostSubmenuService
* @param {?} nzMenuService
*/
constructor(nzHostSubmenuService, nzMenuService) {
this.nzHostSubmenuService = nzHostSubmenuService;
this.nzMenuService = nzMenuService;
this.disabled = false;
this.mode = 'vertical';
this.mode$ = this.nzMenuService.mode$.pipe(map((/**
* @param {?} mode
* @return {?}
*/
mode => {
if (mode === 'inline') {
return 'inline';
}
else if (mode === 'vertical' || this.nzHostSubmenuService) {
return 'vertical';
}
else {
return 'horizontal';
}
})), tap((/**
* @param {?} mode
* @return {?}
*/
mode => this.mode = (/** @type {?} */ (mode)))));
this.level = 1;
this.level$ = new BehaviorSubject(1);
this.subMenuOpen$ = new BehaviorSubject(false);
this.open$ = new BehaviorSubject(false);
this.mouseEnterLeave$ = new Subject();
this.menuOpen$ = combineLatest(this.subMenuOpen$, this.mouseEnterLeave$).pipe(map((/**
* @param {?} value
* @return {?}
*/
value => value[0] || value[1])), auditTime(150), distinctUntilChanged(), tap((/**
* @param {?} data
* @return {?}
*/
data => {
this.setOpenState(data);
if (this.nzHostSubmenuService) {
this.nzHostSubmenuService.subMenuOpen$.next(data);
}
})));
if (this.nzHostSubmenuService) {
this.setLevel(this.nzHostSubmenuService.level + 1);
}
}
/**
* @param {?} value
* @return {?}
*/
setOpenState(value) {
this.open$.next(value);
}
/**
* @return {?}
*/
onMenuItemClick() {
this.setMouseEnterState(false);
}
/**
* @param {?} value
* @return {?}
*/
setLevel(value) {
this.level$.next(value);
this.level = value;
}
/**
* @param {?} value
* @return {?}
*/
setMouseEnterState(value) {
if ((this.mode === 'horizontal' || this.mode === 'vertical' || this.nzMenuService.isInDropDown) && !this.disabled) {
this.mouseEnterLeave$.next(value);
}
}
}
NzSubmenuService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzSubmenuService.ctorParameters = () => [
{ type: NzSubmenuService, decorators: [{ type: SkipSelf }, { type: Optional }] },
{ type: NzMenuService }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuItemDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} nzMenuService
* @param {?} nzSubmenuService
* @param {?} renderer
* @param {?} elementRef
*/
constructor(nzUpdateHostClassService, nzMenuService, nzSubmenuService, renderer, elementRef) {
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.nzMenuService = nzMenuService;
this.nzSubmenuService = nzSubmenuService;
this.renderer = renderer;
this.elementRef = elementRef;
this.el = this.elementRef.nativeElement;
this.destroy$ = new Subject();
this.originalPadding = null;
this.selected$ = new Subject();
this.nzDisabled = false;
this.nzSelected = false;
}
/**
* clear all item selected status except this
* @param {?} e
* @return {?}
*/
clickMenuItem(e) {
if (this.nzDisabled) {
e.preventDefault();
e.stopPropagation();
return;
}
this.nzMenuService.onMenuItemClick(this);
if (this.nzSubmenuService) {
this.nzSubmenuService.onMenuItemClick();
}
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu-item' : 'ant-menu-item';
this.nzUpdateHostClassService.updateHostClass(this.el, {
[`${prefixName}`]: true,
[`${prefixName}-selected`]: this.nzSelected,
[`${prefixName}-disabled`]: this.nzDisabled
});
}
/**
* @param {?} value
* @return {?}
*/
setSelectedState(value) {
this.nzSelected = value;
this.selected$.next(value);
this.setClassMap();
}
/**
* @return {?}
*/
ngOnInit() {
/** store origin padding in padding */
if (this.el.style['padding-left']) {
this.originalPadding = parseInt(this.el.style['padding-left'], 10);
}
merge(this.nzMenuService.mode$, this.nzMenuService.inlineIndent$, this.nzSubmenuService ? this.nzSubmenuService.level$ : EMPTY).pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
/** @type {?} */
let padding = null;
if (this.nzMenuService.mode === 'inline') {
if (isNotNil(this.nzPaddingLeft)) {
padding = this.nzPaddingLeft;
}
else {
/** @type {?} */
const level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;
padding = level * this.nzMenuService.inlineIndent;
}
}
else {
padding = this.originalPadding;
}
if (padding) {
this.renderer.setStyle(this.el, 'padding-left', `${padding}px`);
}
else {
this.renderer.removeStyle(this.el, 'padding-left');
}
}));
this.setClassMap();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzSelected) {
this.setSelectedState(this.nzSelected);
}
if (changes.nzDisabled) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzMenuItemDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu-item]',
providers: [NzUpdateHostClassService],
host: {
'(click)': 'clickMenuItem($event)'
}
},] }
];
/** @nocollapse */
NzMenuItemDirective.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: NzMenuService },
{ type: NzSubmenuService, decorators: [{ type: Optional }] },
{ type: Renderer2 },
{ type: ElementRef }
];
NzMenuItemDirective.propDecorators = {
nzPaddingLeft: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzSelected: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuItemDirective.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuItemDirective.prototype, "nzSelected", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuDropdownService extends NzMenuService {
constructor() {
super(...arguments);
this.isInDropDown = true;
}
}
NzMenuDropdownService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuMenuService extends NzMenuService {
constructor() {
super(...arguments);
this.isInDropDown = false;
}
}
NzMenuMenuService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSubMenuComponent {
/**
* @param {?} elementRef
* @param {?} nzMenuService
* @param {?} cdr
* @param {?} nzSubmenuService
* @param {?} nzUpdateHostClassService
* @param {?=} noAnimation
*/
constructor(elementRef, nzMenuService, cdr, nzSubmenuService, nzUpdateHostClassService, noAnimation) {
this.elementRef = elementRef;
this.nzMenuService = nzMenuService;
this.cdr = cdr;
this.nzSubmenuService = nzSubmenuService;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.noAnimation = noAnimation;
this.placement = 'rightTop';
this.expandState = 'collapsed';
this.overlayPositions = [...DEFAULT_SUBMENU_POSITIONS];
this.destroy$ = new Subject();
this.isChildMenuSelected = false;
this.nzOpen = false;
this.nzDisabled = false;
this.nzOpenChange = new EventEmitter();
}
/**
* @param {?} open
* @return {?}
*/
setOpenState(open) {
this.nzSubmenuService.setOpenState(open);
}
/**
* @return {?}
*/
clickSubMenuTitle() {
if (this.nzSubmenuService.mode === 'inline' && !this.nzMenuService.isInDropDown && !this.nzDisabled) {
this.setOpenState(!this.nzOpen);
}
}
/**
* @param {?} value
* @return {?}
*/
setMouseEnterState(value) {
this.nzSubmenuService.setMouseEnterState(value);
}
/**
* @return {?}
*/
setTriggerWidth() {
if (this.nzSubmenuService.mode === 'horizontal') {
this.triggerWidth = this.cdkOverlayOrigin.nativeElement.getBoundingClientRect().width;
}
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.placement = getPlacementName(position);
this.cdr.markForCheck();
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu-submenu' : 'ant-menu-submenu';
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`${prefixName}`]: true,
[`${prefixName}-disabled`]: this.nzDisabled,
[`${prefixName}-open`]: this.nzOpen,
[`${prefixName}-selected`]: this.isChildMenuSelected,
[`${prefixName}-${this.nzSubmenuService.mode}`]: true
});
}
/**
* @return {?}
*/
ngOnInit() {
combineLatest(this.nzSubmenuService.mode$, this.nzSubmenuService.open$).pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
/** @type {?} */
const mode = data[0];
/** @type {?} */
const open = data[1];
if (open && mode === 'inline') {
this.expandState = 'expanded';
}
else if (open && mode === 'horizontal') {
this.expandState = 'bottom';
}
else if (open && mode === 'vertical') {
this.expandState = 'active';
}
else {
this.expandState = 'collapsed';
}
this.overlayPositions = mode === 'horizontal' ? [POSITION_MAP.bottomLeft] : [POSITION_MAP.rightTop, POSITION_MAP.leftTop];
if (open !== this.nzOpen) {
this.nzOpen = open;
this.nzOpenChange.emit(this.nzOpen);
}
this.setClassMap();
this.setTriggerWidth();
}));
this.nzSubmenuService.menuOpen$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
(data) => {
this.nzMenuService.menuOpen$.next(data);
}));
merge(this.nzMenuService.mode$, this.nzMenuService.inlineIndent$, this.nzSubmenuService.level$, this.nzSubmenuService.open$, this.nzSubmenuService.mode$).pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.setTriggerWidth();
this.listOfNzMenuItemDirective.changes.pipe(startWith(true), flatMap((/**
* @return {?}
*/
() => merge(this.listOfNzMenuItemDirective.changes, ...this.listOfNzMenuItemDirective.map((/**
* @param {?} menu
* @return {?}
*/
menu => menu.selected$))))), map((/**
* @return {?}
*/
() => this.listOfNzMenuItemDirective.some((/**
* @param {?} e
* @return {?}
*/
e => e.nzSelected)))), takeUntil(this.destroy$)).subscribe((/**
* @param {?} selected
* @return {?}
*/
(selected) => {
this.isChildMenuSelected = selected;
this.setClassMap();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzOpen) {
this.nzSubmenuService.setOpenState(this.nzOpen);
}
if (changes.nzDisabled) {
this.nzSubmenuService.disabled = this.nzDisabled;
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzSubMenuComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-submenu]',
providers: [NzSubmenuService, NzUpdateHostClassService],
animations: [collapseMotion, zoomBigMotion, slideMotion],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
template: "<div cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n [class.ant-dropdown-menu-submenu-title]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-submenu-title]=\"!nzMenuService.isInDropDown\"\n [style.paddingLeft.px]=\"nzMenuService.mode === 'inline'? (nzPaddingLeft ? nzPaddingLeft : nzSubmenuService.level * nzMenuService.inlineIndent) : null\"\n (mouseenter)=\"setMouseEnterState(true)\"\n (mouseleave)=\"setMouseEnterState(false)\"\n (click)=\"clickSubMenuTitle()\">\n <ng-content select=\"[title]\"></ng-content>\n <span *ngIf=\"nzMenuService.isInDropDown; else notDropdownTpl\" class=\"ant-dropdown-menu-submenu-arrow\">\n <i nz-icon type=\"right\" class=\"anticon-right ant-dropdown-menu-submenu-arrow-icon\"></i>\n </span>\n <ng-template #notDropdownTpl><i class=\"ant-menu-submenu-arrow\"></i></ng-template>\n</div>\n<ul *ngIf=\"nzMenuService.mode === 'inline'\" [@collapseMotion]=\"expandState\" [nzNoAnimation]=\"noAnimation?.nzNoAnimation\" class=\"ant-menu ant-menu-inline ant-menu-sub\">\n <ng-template [ngTemplateOutlet]=\"subMenuTemplate\"></ng-template>\n</ul>\n<ng-template cdkConnectedOverlay\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayWidth]=\"triggerWidth\"\n [cdkConnectedOverlayOpen]=\"nzOpen && nzMenuService.mode !== 'inline'\">\n <div class=\"ant-menu-submenu ant-menu-submenu-popup\"\n [@slideMotion]=\"expandState\"\n [@zoomBigMotion]=\"expandState\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [class.ant-menu-light]=\"nzMenuService.theme === 'light'\"\n [class.ant-menu-dark]=\"nzMenuService.theme === 'dark'\"\n [class.ant-menu-submenu-placement-bottomLeft]=\"nzSubmenuService.mode === 'horizontal'\"\n [class.ant-menu-submenu-placement-rightTop]=\"nzSubmenuService.mode === 'vertical' && placement === 'rightTop'\"\n [class.ant-menu-submenu-placement-leftTop]=\"nzSubmenuService.mode === 'vertical' && placement === 'leftTop'\"\n (mouseleave)=\"setMouseEnterState(false)\"\n (mouseenter)=\"setMouseEnterState(true)\">\n <ul [class.ant-dropdown-menu]=\"nzMenuService.isInDropDown\"\n [class.ant-menu]=\"!nzMenuService.isInDropDown\"\n [class.ant-dropdown-menu-vertical]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-vertical]=\"!nzMenuService.isInDropDown\"\n [class.ant-dropdown-menu-sub]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-sub]=\"!nzMenuService.isInDropDown\">\n <ng-template [ngTemplateOutlet]=\"subMenuTemplate\"></ng-template>\n </ul>\n </div>\n</ng-template>\n\n<ng-template #subMenuTemplate>\n <ng-content></ng-content>\n</ng-template>",
styles: [`
.ant-menu-submenu-placement-bottomLeft {
top: 6px;
position: relative;
}
.ant-menu-submenu-placement-rightTop {
left: 4px;
position: relative;
}
.ant-menu-submenu-placement-leftTop {
right: 4px;
position: relative;
}
`]
}] }
];
/** @nocollapse */
NzSubMenuComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzMenuService },
{ type: ChangeDetectorRef },
{ type: NzSubmenuService },
{ type: NzUpdateHostClassService },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzSubMenuComponent.propDecorators = {
listOfNzSubMenuComponent: [{ type: ContentChildren, args: [NzSubMenuComponent, { descendants: true },] }],
listOfNzMenuItemDirective: [{ type: ContentChildren, args: [NzMenuItemDirective, { descendants: true },] }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
cdkOverlayOrigin: [{ type: ViewChild, args: [CdkOverlayOrigin, { read: ElementRef },] }],
nzPaddingLeft: [{ type: Input }],
nzOpen: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzOpenChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSubMenuComponent.prototype, "nzOpen", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSubMenuComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} dropService
* @param {?} menuService
* @return {?}
*/
function NzMenuFactory(dropService, menuService) {
return dropService ? dropService : menuService;
}
class NzMenuDirective {
/**
* @param {?} elementRef
* @param {?} nzMenuService
* @param {?} nzUpdateHostClassService
*/
constructor(elementRef, nzMenuService, nzUpdateHostClassService) {
this.elementRef = elementRef;
this.nzMenuService = nzMenuService;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.destroy$ = new Subject();
this.listOfOpenedNzSubMenuComponent = [];
this.nzInlineIndent = 24;
this.nzTheme = 'light';
this.nzMode = 'vertical';
this.nzInDropDown = false;
this.nzInlineCollapsed = false;
this.nzSelectable = !this.nzMenuService.isInDropDown;
this.nzClick = new EventEmitter();
}
/**
* @return {?}
*/
updateInlineCollapse() {
if (this.listOfNzMenuItemDirective) {
if (this.nzInlineCollapsed) {
this.listOfOpenedNzSubMenuComponent = this.listOfNzSubMenuComponent.filter((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.nzOpen));
this.listOfNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(false)));
this.nzMode = 'vertical';
}
else {
this.listOfOpenedNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(true)));
this.listOfOpenedNzSubMenuComponent = [];
this.nzMode = this.cacheMode;
}
this.nzMenuService.setMode(this.nzMode);
}
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu' : 'ant-menu';
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`${prefixName}`]: true,
[`${prefixName}-root`]: true,
[`${prefixName}-${this.nzTheme}`]: true,
[`${prefixName}-${this.nzMode}`]: true,
[`${prefixName}-inline-collapsed`]: this.nzInlineCollapsed
});
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.nzMenuService.menuItemClick$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} menu
* @return {?}
*/
menu => {
this.nzClick.emit(menu);
if (this.nzSelectable) {
this.listOfNzMenuItemDirective.forEach((/**
* @param {?} item
* @return {?}
*/
item => item.setSelectedState(item === menu)));
}
}));
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.cacheMode = this.nzMode;
this.updateInlineCollapse();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzInlineCollapsed) {
this.updateInlineCollapse();
}
if (changes.nzInlineIndent) {
this.nzMenuService.setInlineIndent(this.nzInlineIndent);
}
if (changes.nzInDropDown) {
this.nzMenuService.isInDropDown = this.nzInDropDown;
}
if (changes.nzTheme) {
this.nzMenuService.setTheme(this.nzTheme);
}
if (changes.nzMode) {
this.nzMenuService.setMode(this.nzMode);
if (!changes.nzMode.isFirstChange() && this.listOfNzSubMenuComponent) {
this.listOfNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(false)));
}
}
if (changes.nzTheme || changes.nzMode || changes.nzInlineCollapsed) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzMenuDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu]',
providers: [
NzUpdateHostClassService,
NzMenuMenuService,
{
provide: NzMenuService,
useFactory: NzMenuFactory,
deps: [
[
new SkipSelf(),
new Optional(),
NzMenuDropdownService
],
NzMenuMenuService
]
}
]
},] }
];
/** @nocollapse */
NzMenuDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: NzMenuService },
{ type: NzUpdateHostClassService }
];
NzMenuDirective.propDecorators = {
listOfNzMenuItemDirective: [{ type: ContentChildren, args: [NzMenuItemDirective, { descendants: true },] }],
listOfNzSubMenuComponent: [{ type: ContentChildren, args: [NzSubMenuComponent, { descendants: true },] }],
nzInlineIndent: [{ type: Input }],
nzTheme: [{ type: Input }],
nzMode: [{ type: Input }],
nzInDropDown: [{ type: Input }],
nzInlineCollapsed: [{ type: Input }],
nzSelectable: [{ type: Input }],
nzClick: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzInDropDown", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzInlineCollapsed", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzSelectable", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuModule {
}
NzMenuModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzButtonModule, OverlayModule, NzIconModule, NzNoAnimationModule],
declarations: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent],
exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropDownADirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-dropdown-link');
}
}
NzDropDownADirective.decorators = [
{ type: Directive, args: [{
selector: 'a[nz-dropdown]'
},] }
];
/** @nocollapse */
NzDropDownADirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropDownDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.el = this.elementRef.nativeElement;
this.hover$ = merge(fromEvent(this.el, 'mouseenter').pipe(mapTo(true)), fromEvent(this.el, 'mouseleave').pipe(mapTo(false)));
this.$click = fromEvent(this.el, 'click').pipe(tap((/**
* @param {?} e
* @return {?}
*/
e => e.stopPropagation())), mapTo(true));
renderer.addClass(elementRef.nativeElement, 'ant-dropdown-trigger');
}
/**
* @param {?} disabled
* @return {?}
*/
setDisabled(disabled) {
if (disabled) {
this.renderer.setAttribute(this.el, 'disabled', '');
}
else {
this.renderer.removeAttribute(this.el, 'disabled');
}
}
}
NzDropDownDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-dropdown]'
},] }
];
/** @nocollapse */
NzDropDownDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropDownComponent {
/**
* @param {?} cdr
* @param {?} nzMenuDropdownService
* @param {?=} noAnimation
*/
constructor(cdr, nzMenuDropdownService, noAnimation) {
this.cdr = cdr;
this.nzMenuDropdownService = nzMenuDropdownService;
this.noAnimation = noAnimation;
this.triggerWidth = 0;
this.dropDownPosition = 'bottom';
this.positions = [...DEFAULT_DROPDOWN_POSITIONS];
this.visible$ = new Subject();
this.destroy$ = new Subject();
this.nzTrigger = 'hover';
this.nzOverlayClassName = '';
this.nzOverlayStyle = {};
this.nzPlacement = 'bottomLeft';
this.nzClickHide = true;
this.nzDisabled = false;
this.nzVisible = false;
this.nzTableFilter = false;
this.nzVisibleChange = new EventEmitter();
}
/**
* @param {?} visible
* @param {?=} trigger
* @return {?}
*/
setVisibleStateWhen(visible, trigger$$1 = 'all') {
if (this.nzTrigger === trigger$$1 || trigger$$1 === 'all') {
this.visible$.next(visible);
}
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.dropDownPosition = position.connectionPair.originY;
this.cdr.markForCheck();
}
/**
* @param {?} observable$
* @return {?}
*/
startSubscribe(observable$) {
/** @type {?} */
const click$ = this.nzClickHide ? this.nzMenuDropdownService.menuItemClick$.pipe(mapTo(false)) : EMPTY;
combineLatest(merge(observable$, click$), this.nzMenuDropdownService.menuOpen$).pipe(map((/**
* @param {?} value
* @return {?}
*/
value => value[0] || value[1])), debounceTime(50), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe((/**
* @param {?} visible
* @return {?}
*/
(visible) => {
if (!this.nzDisabled && this.nzVisible !== visible) {
this.nzVisible = visible;
this.nzVisibleChange.emit(this.nzVisible);
this.triggerWidth = this.nzDropDownDirective.elementRef.nativeElement.getBoundingClientRect().width;
this.cdr.markForCheck();
}
}));
}
/**
* @return {?}
*/
updateDisabledState() {
if (this.nzDropDownDirective) {
this.nzDropDownDirective.setDisabled(this.nzDisabled);
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.startSubscribe(merge(this.visible$, this.nzTrigger === 'hover' ? this.nzDropDownDirective.hover$ : this.nzDropDownDirective.$click));
this.updateDisabledState();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzVisible) {
this.visible$.next(this.nzVisible);
}
if (changes.nzDisabled) {
this.updateDisabledState();
}
if (changes.nzPlacement) {
this.dropDownPosition = this.nzPlacement.indexOf('top') !== -1 ? 'top' : 'bottom';
this.positions = [POSITION_MAP[this.nzPlacement], ...this.positions];
}
}
}
NzDropDownComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-dropdown',
preserveWhitespaces: false,
providers: [NzMenuDropdownService],
animations: [slideMotion],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content select=\"[nz-dropdown]\"></ng-content>\n<ng-template cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"nzTrigger === 'click'\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayOrigin]=\"nzDropDownDirective\"\n [cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n [cdkConnectedOverlayOpen]=\"nzVisible\"\n (backdropClick)=\"setVisibleStateWhen(false)\"\n (detach)=\"setVisibleStateWhen(false)\"\n (positionChange)=\"onPositionChange($event)\">\n <div class=\"{{'ant-dropdown ant-dropdown-placement-'+nzPlacement}}\"\n [ngClass]=\"nzOverlayClassName\"\n [ngStyle]=\"nzOverlayStyle\"\n [@slideMotion]=\"dropDownPosition\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [style.minWidth.px]=\"triggerWidth\"\n (mouseenter)=\"setVisibleStateWhen(true,'hover')\"\n (mouseleave)=\"setVisibleStateWhen(false,'hover')\">\n <div [class.ant-table-filter-dropdown]=\"nzTableFilter\">\n <ng-content select=\"[nz-menu]\"></ng-content>\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>",
styles: [`
.ant-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzDropDownComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzMenuDropdownService },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzDropDownComponent.propDecorators = {
nzDropDownDirective: [{ type: ContentChild, args: [NzDropDownDirective,] }],
nzMenuDirective: [{ type: ContentChild, args: [NzMenuDirective,] }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
nzTrigger: [{ type: Input }],
nzOverlayClassName: [{ type: Input }],
nzOverlayStyle: [{ type: Input }],
nzPlacement: [{ type: Input }],
nzClickHide: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzVisible: [{ type: Input }],
nzTableFilter: [{ type: Input }],
nzVisibleChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDropDownComponent.prototype, "nzClickHide", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDropDownComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDropDownComponent.prototype, "nzVisible", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDropDownComponent.prototype, "nzTableFilter", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropDownButtonComponent extends NzDropDownComponent {
/**
* @param {?} cdr
* @param {?} nzMenuDropdownService
* @param {?=} noAnimation
*/
constructor(cdr, nzMenuDropdownService, noAnimation) {
super(cdr, nzMenuDropdownService, noAnimation);
this.noAnimation = noAnimation;
this.nzSize = 'default';
this.nzType = 'default';
this.nzClick = new EventEmitter();
}
/**
* rewrite afterViewInit hook
* @return {?}
*/
ngAfterContentInit() {
this.startSubscribe(this.visible$);
}
}
NzDropDownButtonComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-dropdown-button',
preserveWhitespaces: false,
animations: [slideMotion],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [NzMenuDropdownService],
template: "<div class=\"ant-btn-group ant-dropdown-button\" nz-dropdown>\n <button nz-button\n type=\"button\"\n [disabled]=\"nzDisabled\"\n [nzType]=\"nzType\"\n [nzSize]=\"nzSize\"\n (click)=\"nzClick.emit($event)\">\n <span><ng-content></ng-content></span>\n </button>\n <button nz-button\n type=\"button\"\n class=\"ant-dropdown-trigger\"\n [nzType]=\"nzType\"\n [nzSize]=\"nzSize\"\n [disabled]=\"nzDisabled\"\n (click)=\"setVisibleStateWhen(true,'click')\"\n (mouseenter)=\"setVisibleStateWhen(true,'hover')\"\n (mouseleave)=\"setVisibleStateWhen(false,'hover')\">\n <i nz-icon type=\"ellipsis\"></i>\n </button>\n</div>\n<ng-template cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"nzTrigger === 'click'\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayOrigin]=\"nzDropDownDirective\"\n (backdropClick)=\"setVisibleStateWhen(false)\"\n (detach)=\"setVisibleStateWhen(false)\"\n [cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayOpen]=\"nzVisible\">\n <div class=\"{{'ant-dropdown ant-dropdown-placement-'+nzPlacement}}\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@slideMotion]=\"dropDownPosition\"\n (mouseenter)=\"setVisibleStateWhen(true,'hover')\"\n (mouseleave)=\"setVisibleStateWhen(false,'hover')\"\n [style.minWidth.px]=\"triggerWidth\">\n <ng-content select=\"[nz-menu]\"></ng-content>\n </div>\n</ng-template>",
styles: [`
nz-dropdown-button {
position: relative;
display: inline-block;
}
.ant-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzDropDownButtonComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzMenuDropdownService },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzDropDownButtonComponent.propDecorators = {
nzSize: [{ type: Input }],
nzType: [{ type: Input }],
nzClick: [{ type: Output }],
nzDropDownDirective: [{ type: ViewChild, args: [NzDropDownDirective,] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropdownContextComponent {
/**
* @param {?} cdr
*/
constructor(cdr) {
this.cdr = cdr;
this.open = true;
this.dropDownPosition = 'bottom';
this.destroy$ = new Subject();
}
/**
* @param {?} open
* @param {?} templateRef
* @param {?} positionChanges
* @param {?} control
* @return {?}
*/
init(open, templateRef, positionChanges, control) {
this.open = open;
this.templateRef = templateRef;
this.control = control;
positionChanges.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
this.dropDownPosition = data.connectionPair.overlayY === 'bottom' ? 'top' : 'bottom';
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
close() {
this.open = false;
this.cdr.markForCheck();
}
/**
* @return {?}
*/
afterAnimation() {
if (!this.open) {
this.control.dispose();
}
}
// TODO auto set dropdown class after the bug resolved
/**
* https://github.com/angular/angular/issues/14842 *
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzDropdownContextComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-dropdown-context',
animations: [slideMotion],
preserveWhitespaces: false,
template: "<div *ngIf=\"open\"\n class=\"ant-dropdown ant-dropdown-placement-bottomLeft\"\n [@slideMotion]=\"dropDownPosition\"\n (@slideMotion.done)=\"afterAnimation()\">\n <ng-template [ngTemplateOutlet]=\"templateRef\"></ng-template>\n</div>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [NzMenuDropdownService],
styles: [`
nz-dropdown-context {
display: block;
}
.ant-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzDropdownContextComponent.ctorParameters = () => [
{ type: ChangeDetectorRef }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropDownModule {
}
NzDropDownModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, FormsModule, NzButtonModule, NzMenuModule, NzIconModule, NzNoAnimationModule],
entryComponents: [NzDropdownContextComponent],
declarations: [NzDropDownComponent, NzDropDownButtonComponent, NzDropDownDirective, NzDropDownADirective, NzDropdownContextComponent],
exports: [NzDropDownComponent, NzDropDownButtonComponent, NzDropDownDirective, NzDropDownADirective]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @enum {number} */
const Breakpoint = {
'xxl': 0,
'xl': 1,
'lg': 2,
'md': 3,
'sm': 4,
'xs': 5,
};
Breakpoint[Breakpoint['xxl']] = 'xxl';
Breakpoint[Breakpoint['xl']] = 'xl';
Breakpoint[Breakpoint['lg']] = 'lg';
Breakpoint[Breakpoint['md']] = 'md';
Breakpoint[Breakpoint['sm']] = 'sm';
Breakpoint[Breakpoint['xs']] = 'xs';
/** @type {?} */
const responsiveMap = {
xs: '(max-width: 575px)',
sm: '(min-width: 576px)',
md: '(min-width: 768px)',
lg: '(min-width: 992px)',
xl: '(min-width: 1200px)',
xxl: '(min-width: 1600px)'
};
class NzRowDirective {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} nzUpdateHostClassService
* @param {?} mediaMatcher
* @param {?} ngZone
* @param {?} platform
*/
constructor(elementRef, renderer, nzUpdateHostClassService, mediaMatcher, ngZone, platform) {
this.elementRef = elementRef;
this.renderer = renderer;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.mediaMatcher = mediaMatcher;
this.ngZone = ngZone;
this.platform = platform;
this.nzAlign = 'top';
this.nzJustify = 'start';
this.el = this.elementRef.nativeElement;
this.prefixCls = 'ant-row';
this.actualGutter$ = new Subject();
this.destroy$ = new Subject();
}
/**
* @return {?}
*/
calculateGutter() {
if (typeof this.nzGutter !== 'object') {
return this.nzGutter;
}
else if (this.breakPoint && this.nzGutter[this.breakPoint]) {
return this.nzGutter[this.breakPoint];
}
else {
return;
}
}
/**
* @return {?}
*/
updateGutter() {
/** @type {?} */
const actualGutter = this.calculateGutter();
if (this.actualGutter !== actualGutter) {
this.actualGutter = actualGutter;
this.actualGutter$.next(this.actualGutter);
this.renderer.setStyle(this.el, 'margin-left', `-${this.actualGutter / 2}px`);
this.renderer.setStyle(this.el, 'margin-right', `-${this.actualGutter / 2}px`);
}
}
/**
* @return {?}
*/
watchMedia() {
// @ts-ignore
Object.keys(responsiveMap).map((/**
* @param {?} screen
* @return {?}
*/
(screen) => {
/** @type {?} */
const matchBelow = this.mediaMatcher.matchMedia(responsiveMap[screen]).matches;
if (matchBelow) {
this.breakPoint = screen;
}
}));
this.updateGutter();
}
/**
* temp solution since no method add classMap to host https://github.com/angular/angular/issues/7289
* @return {?}
*/
setClassMap() {
/** @type {?} */
const classMap = {
[`${this.prefixCls}`]: !this.nzType,
[`${this.prefixCls}-${this.nzType}`]: this.nzType,
[`${this.prefixCls}-${this.nzType}-${this.nzAlign}`]: this.nzType && this.nzAlign,
[`${this.prefixCls}-${this.nzType}-${this.nzJustify}`]: this.nzType && this.nzJustify
};
this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.watchMedia();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzType || changes.nzAlign || changes.nzJustify) {
this.setClassMap();
}
if (changes.nzGutter) {
this.updateGutter();
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.platform.isBrowser) {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
fromEvent(window, 'resize')
.pipe(auditTime(16), takeUntil(this.destroy$))
.subscribe((/**
* @return {?}
*/
() => this.watchMedia()));
}));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzRowDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-row],nz-row',
providers: [NzUpdateHostClassService]
},] }
];
/** @nocollapse */
NzRowDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzUpdateHostClassService },
{ type: MediaMatcher },
{ type: NgZone },
{ type: Platform }
];
NzRowDirective.propDecorators = {
nzType: [{ type: Input }],
nzAlign: [{ type: Input }],
nzJustify: [{ type: Input }],
nzGutter: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzColDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
* @param {?} nzRowDirective
* @param {?} renderer
*/
constructor(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
* @return {?}
*/
setClassMap() {
/** @type {?} */
const classMap = Object.assign({ [`${this.prefixCls}-${this.nzSpan}`]: isNotNil(this.nzSpan), [`${this.prefixCls}-order-${this.nzOrder}`]: isNotNil(this.nzOrder), [`${this.prefixCls}-offset-${this.nzOffset}`]: isNotNil(this.nzOffset), [`${this.prefixCls}-pull-${this.nzPull}`]: isNotNil(this.nzPull), [`${this.prefixCls}-push-${this.nzPush}`]: isNotNil(this.nzPush) }, this.generateClass());
this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
}
/**
* @return {?}
*/
generateClass() {
/** @type {?} */
const listOfSizeInputName = ['nzXs', 'nzSm', 'nzMd', 'nzLg', 'nzXl', 'nzXXl'];
/** @type {?} */
const listClassMap = {};
listOfSizeInputName.forEach((/**
* @param {?} name
* @return {?}
*/
name => {
/** @type {?} */
const 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 {?}
*/
ngOnChanges() {
this.setClassMap();
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.nzRowDirective) {
this.nzRowDirective.actualGutter$.pipe(startWith(this.nzRowDirective.actualGutter), takeUntil(this.destroy$)).subscribe((/**
* @param {?} actualGutter
* @return {?}
*/
(actualGutter) => {
this.renderer.setStyle(this.el, 'padding-left', `${actualGutter / 2}px`);
this.renderer.setStyle(this.el, 'padding-right', `${actualGutter / 2}px`);
}));
}
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzColDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-col],nz-col',
providers: [NzUpdateHostClassService]
},] }
];
/** @nocollapse */
NzColDirective.ctorParameters = () => [
{ 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 }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzGridModule {
}
NzGridModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzColDirective, NzRowDirective],
exports: [NzColDirective, NzRowDirective],
imports: [CommonModule, LayoutModule, PlatformModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const helpMotion = trigger('helpMotion', [
transition(':enter', [
style({
opacity: 0,
transform: 'translateY(-5px)'
}),
animate(`${AnimationDuration.SLOW} ${AnimationCurves.EASE_IN_OUT}`, style({
opacity: 1,
transform: 'translateY(0)'
}))
]),
transition(':leave', [
style({
opacity: 1,
transform: 'translateY(0)'
}),
animate(`${AnimationDuration.SLOW} ${AnimationCurves.EASE_IN_OUT}`, style({
opacity: 0,
transform: 'translateY(-5px)'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormExplainComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-form-explain');
}
}
NzFormExplainComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-explain',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [helpMotion],
template: "<div [@helpMotion]>\n <ng-content></ng-content>\n</div>",
styles: [`nz-form-explain {
display: block;
}`]
}] }
];
/** @nocollapse */
NzFormExplainComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* should add nz-row directive to host, track https://github.com/angular/angular/issues/8785 *
*/
class NzFormItemComponent extends NzRowDirective {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} nzUpdateHostClassService
* @param {?} mediaMatcher
* @param {?} ngZone
* @param {?} platform
* @param {?} cdr
*/
constructor(elementRef, renderer, nzUpdateHostClassService, mediaMatcher, ngZone, platform, cdr) {
super(elementRef, renderer, nzUpdateHostClassService, mediaMatcher, ngZone, platform);
this.cdr = cdr;
this._flex = false;
renderer.addClass(elementRef.nativeElement, 'ant-form-item');
}
/**
* @param {?} value
* @return {?}
*/
set nzFlex(value) {
this._flex = toBoolean(value);
if (this._flex) {
this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'flex');
}
else {
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
if (this.listOfNzFormExplainComponent) {
this.listOfNzFormExplainComponent.changes.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
}
}
NzFormItemComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-item',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [NzUpdateHostClassService],
template: "<ng-content></ng-content>",
host: {
'[class.ant-form-item-with-help]': 'listOfNzFormExplainComponent && (listOfNzFormExplainComponent.length>0)'
},
styles: [`
nz-form-item {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzFormItemComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzUpdateHostClassService },
{ type: MediaMatcher },
{ type: NgZone },
{ type: Platform },
{ type: ChangeDetectorRef }
];
NzFormItemComponent.propDecorators = {
listOfNzFormExplainComponent: [{ type: ContentChildren, args: [NzFormExplainComponent, { descendants: true },] }],
nzFlex: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormControlComponent extends NzColDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
* @param {?} nzFormItemComponent
* @param {?} nzRowDirective
* @param {?} cdr
* @param {?} renderer
*/
constructor(nzUpdateHostClassService, elementRef, nzFormItemComponent, nzRowDirective, cdr, renderer) {
super(nzUpdateHostClassService, elementRef, nzFormItemComponent || nzRowDirective, renderer);
this.cdr = cdr;
this._hasFeedback = false;
this.controlClassMap = {};
renderer.addClass(elementRef.nativeElement, 'ant-form-item-control-wrapper');
}
/**
* @param {?} value
* @return {?}
*/
set nzHasFeedback(value) {
this._hasFeedback = toBoolean(value);
this.setControlClassMap();
}
/**
* @return {?}
*/
get nzHasFeedback() {
return this._hasFeedback;
}
/**
* @param {?} value
* @return {?}
*/
set nzValidateStatus(value) {
if (value instanceof FormControl) {
this.validateControl = value;
this.validateString = null;
this.watchControl();
}
else if (value instanceof FormControlName) {
this.validateControl = value.control;
this.validateString = null;
this.watchControl();
}
else {
this.validateString = value;
this.validateControl = null;
this.setControlClassMap();
}
}
/**
* @return {?}
*/
removeSubscribe() {
if (this.validateChanges) {
this.validateChanges.unsubscribe();
this.validateChanges = null;
}
}
/**
* @return {?}
*/
watchControl() {
this.removeSubscribe();
/** miss detect https://github.com/angular/angular/issues/10887 **/
if (this.validateControl && this.validateControl.statusChanges) {
this.validateChanges = this.validateControl.statusChanges.pipe(startWith(null)).subscribe((/**
* @return {?}
*/
() => {
this.setControlClassMap();
this.cdr.markForCheck();
}));
}
}
/**
* @param {?} status
* @return {?}
*/
validateControlStatus(status) {
return this.validateControl && (this.validateControl.dirty || this.validateControl.touched) && (this.validateControl.status === status);
}
/**
* @return {?}
*/
setControlClassMap() {
this.controlClassMap = {
[`has-warning`]: this.validateString === 'warning',
[`is-validating`]: this.validateString === 'validating' || this.validateString === 'pending' || this.validateControlStatus('PENDING'),
[`has-error`]: this.validateString === 'error' || this.validateControlStatus('INVALID'),
[`has-success`]: this.validateString === 'success' || this.validateControlStatus('VALID'),
[`has-feedback`]: this.nzHasFeedback
};
if (this.controlClassMap['has-warning']) {
this.iconType = 'exclamation-circle-fill';
}
else if (this.controlClassMap['is-validating']) {
this.iconType = 'loading';
}
else if (this.controlClassMap['has-error']) {
this.iconType = 'close-circle-fill';
}
else if (this.controlClassMap['has-success']) {
this.iconType = 'check-circle-fill';
}
else {
this.iconType = '';
}
}
/**
* @return {?}
*/
ngOnInit() {
super.ngOnInit();
this.setControlClassMap();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.removeSubscribe();
super.ngOnDestroy();
}
/**
* @return {?}
*/
ngAfterContentInit() {
if (this.defaultValidateControl && (!this.validateControl) && (!this.validateString)) {
this.nzValidateStatus = this.defaultValidateControl;
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
super.ngAfterViewInit();
}
}
NzFormControlComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-control',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [NzUpdateHostClassService],
template: "<div class=\"ant-form-item-control\" [ngClass]=\"controlClassMap\">\n <span class=\"ant-form-item-children\">\n <ng-content></ng-content>\n <span class=\"ant-form-item-children-icon\">\n <i *ngIf=\"nzHasFeedback && iconType\" nz-icon [type]=\"iconType\"></i>\n </span>\n </span>\n <ng-content select=\"nz-form-explain\"></ng-content>\n</div>",
styles: [`
nz-form-control {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzFormControlComponent.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: ElementRef },
{ type: NzFormItemComponent, decorators: [{ type: Optional }, { type: Host }] },
{ type: NzRowDirective, decorators: [{ type: Optional }, { type: Host }] },
{ type: ChangeDetectorRef },
{ type: Renderer2 }
];
NzFormControlComponent.propDecorators = {
defaultValidateControl: [{ type: ContentChild, args: [NgControl,] }],
nzHasFeedback: [{ type: Input }],
nzValidateStatus: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormExtraComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-form-extra');
}
}
NzFormExtraComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-extra',
template: "<ng-content></ng-content>",
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [`
nz-form-extra {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzFormExtraComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormLabelComponent extends NzColDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
* @param {?} nzFormItemComponent
* @param {?} nzRowDirective
* @param {?} renderer
*/
constructor(nzUpdateHostClassService, elementRef, nzFormItemComponent, nzRowDirective, renderer) {
super(nzUpdateHostClassService, elementRef, nzFormItemComponent || nzRowDirective, renderer);
this.nzRequired = false;
renderer.addClass(elementRef.nativeElement, 'ant-form-item-label');
}
/**
* @return {?}
*/
ngOnDestroy() {
super.ngOnDestroy();
}
/**
* @return {?}
*/
ngAfterViewInit() {
super.ngAfterViewInit();
}
}
NzFormLabelComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-label',
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<label [attr.for]=\"nzFor\" [class.ant-form-item-required]=\"nzRequired\">\n <ng-content></ng-content>\n</label>"
}] }
];
/** @nocollapse */
NzFormLabelComponent.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: ElementRef },
{ type: NzFormItemComponent, decorators: [{ type: Optional }, { type: Host }] },
{ type: NzRowDirective, decorators: [{ type: Optional }, { type: Host }] },
{ type: Renderer2 }
];
NzFormLabelComponent.propDecorators = {
nzFor: [{ type: Input }],
nzRequired: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzFormLabelComponent.prototype, "nzRequired", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormSplitComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-form-split');
}
}
NzFormSplitComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-split',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>"
}] }
];
/** @nocollapse */
NzFormSplitComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormTextComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-form-text');
}
}
NzFormTextComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-text',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-content></ng-content>"
}] }
];
/** @nocollapse */
NzFormTextComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormDirective {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} nzUpdateHostClassService
*/
constructor(elementRef, renderer, nzUpdateHostClassService) {
this.elementRef = elementRef;
this.renderer = renderer;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.nzLayout = 'horizontal';
this.renderer.addClass(elementRef.nativeElement, 'ant-form');
}
/**
* @return {?}
*/
setClassMap() {
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`ant-form-${this.nzLayout}`]: this.nzLayout
});
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
}
/**
* @return {?}
*/
ngOnChanges() {
this.setClassMap();
}
}
NzFormDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-form]',
providers: [NzUpdateHostClassService]
},] }
];
/** @nocollapse */
NzFormDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzUpdateHostClassService }
];
NzFormDirective.propDecorators = {
nzLayout: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFormModule {
}
NzFormModule.decorators = [
{ type: NgModule, args: [{
declarations: [
NzFormExtraComponent,
NzFormLabelComponent,
NzFormDirective,
NzFormItemComponent,
NzFormControlComponent,
NzFormExplainComponent,
NzFormTextComponent,
NzFormSplitComponent
],
exports: [
NzFormExtraComponent,
NzFormLabelComponent,
NzFormDirective,
NzFormItemComponent,
NzFormControlComponent,
NzFormExplainComponent,
NzFormTextComponent,
NzFormSplitComponent
],
imports: [CommonModule, NzGridModule, NzIconModule, LayoutModule, PlatformModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzInputNumberComponent {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} cdr
* @param {?} focusMonitor
*/
constructor(elementRef, renderer, cdr, focusMonitor) {
this.elementRef = elementRef;
this.renderer = renderer;
this.cdr = cdr;
this.focusMonitor = focusMonitor;
this.isFocused = false;
this.disabledUp = false;
this.disabledDown = false;
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
this.nzBlur = new EventEmitter();
this.nzFocus = new EventEmitter();
this.nzSize = 'default';
this.nzMin = -Infinity;
this.nzMax = Infinity;
this.nzParser = (/**
* @param {?} value
* @return {?}
*/
(value) => value);
this.nzPlaceHolder = '';
this.nzStep = 1;
this.nzDisabled = false;
this.nzAutoFocus = false;
this.nzFormatter = (/**
* @param {?} value
* @return {?}
*/
(value) => value);
renderer.addClass(elementRef.nativeElement, 'ant-input-number');
}
/**
* @return {?}
*/
updateAutoFocus() {
if (this.nzAutoFocus) {
this.renderer.setAttribute(this.inputElement.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.inputElement.nativeElement, 'autofocus');
}
}
/**
* @param {?} value
* @return {?}
*/
onModelChange(value) {
this.actualValue = this.nzParser(value.trim().replace(/。/g, '.').replace(/[^\w\.-]+/g, ''));
this.inputElement.nativeElement.value = this.actualValue;
}
/**
* @param {?} value
* @return {?}
*/
getCurrentValidValue(value) {
/** @type {?} */
let val = value;
if (val === '') {
val = '';
}
else if (!this.isNotCompleteNumber(val)) {
val = (/** @type {?} */ (this.getValidValue(val)));
}
else {
val = this.value;
}
return this.toNumber(val);
}
// '1.' '1x' 'xx' '' => are not complete numbers
/**
* @param {?} num
* @return {?}
*/
isNotCompleteNumber(num) {
return (isNaN((/** @type {?} */ (num))) ||
num === '' ||
num === null ||
(num && num.toString().indexOf('.') === num.toString().length - 1));
}
/**
* @param {?} value
* @return {?}
*/
getValidValue(value) {
/** @type {?} */
let val = parseFloat((/** @type {?} */ (value)));
// https://github.com/ant-design/ant-design/issues/7358
if (isNaN(val)) {
return value;
}
if (val < this.nzMin) {
val = this.nzMin;
}
if (val > this.nzMax) {
val = this.nzMax;
}
return val;
}
/**
* @param {?} num
* @return {?}
*/
toNumber(num) {
if (this.isNotCompleteNumber(num)) {
return (/** @type {?} */ (num));
}
if (isNotNil(this.nzPrecision)) {
return Number(Number(num).toFixed(this.nzPrecision));
}
return Number(num);
}
/**
* @return {?}
*/
setValidateValue() {
/** @type {?} */
const value = this.getCurrentValidValue(this.actualValue);
this.setValue(value, `${this.value}` !== `${value}`);
}
/**
* @return {?}
*/
onBlur() {
this.isFocused = false;
this.setValidateValue();
}
/**
* @return {?}
*/
onFocus() {
this.isFocused = true;
}
/**
* @param {?} e
* @return {?}
*/
getRatio(e) {
/** @type {?} */
let ratio = 1;
if (e.metaKey || e.ctrlKey) {
ratio = 0.1;
}
else if (e.shiftKey) {
ratio = 10;
}
return ratio;
}
/**
* @param {?} e
* @param {?=} ratio
* @return {?}
*/
down(e, ratio) {
if (!this.isFocused) {
this.focus();
}
this.step('down', e, ratio);
}
/**
* @param {?} e
* @param {?=} ratio
* @return {?}
*/
up(e, ratio) {
if (!this.isFocused) {
this.focus();
}
this.step('up', e, ratio);
}
/**
* @param {?} value
* @return {?}
*/
getPrecision(value) {
/** @type {?} */
const valueString = value.toString();
if (valueString.indexOf('e-') >= 0) {
return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);
}
/** @type {?} */
let precision = 0;
if (valueString.indexOf('.') >= 0) {
precision = valueString.length - valueString.indexOf('.') - 1;
}
return precision;
}
// step={1.0} value={1.51}
// press +
// then value should be 2.51, rather than 2.5
// if this.props.precision is undefined
// https://github.com/react-component/input-number/issues/39
/**
* @param {?} currentValue
* @param {?} ratio
* @return {?}
*/
getMaxPrecision(currentValue, ratio) {
if (isNotNil(this.nzPrecision)) {
return this.nzPrecision;
}
/** @type {?} */
const ratioPrecision = this.getPrecision(ratio);
/** @type {?} */
const stepPrecision = this.getPrecision(this.nzStep);
/** @type {?} */
const currentValuePrecision = this.getPrecision((/** @type {?} */ (currentValue)));
if (!currentValue) {
return ratioPrecision + stepPrecision;
}
return Math.max(currentValuePrecision, ratioPrecision + stepPrecision);
}
/**
* @param {?} currentValue
* @param {?} ratio
* @return {?}
*/
getPrecisionFactor(currentValue, ratio) {
/** @type {?} */
const precision = this.getMaxPrecision(currentValue, ratio);
return Math.pow(10, precision);
}
/**
* @param {?} val
* @param {?} rat
* @return {?}
*/
upStep(val, rat) {
/** @type {?} */
const precisionFactor = this.getPrecisionFactor(val, rat);
/** @type {?} */
const precision = Math.abs(this.getMaxPrecision(val, rat));
/** @type {?} */
let result;
if (typeof val === 'number') {
result =
((precisionFactor * val + precisionFactor * this.nzStep * rat) /
precisionFactor).toFixed(precision);
}
else {
result = this.nzMin === -Infinity ? this.nzStep : this.nzMin;
}
return this.toNumber(result);
}
/**
* @param {?} val
* @param {?} rat
* @return {?}
*/
downStep(val, rat) {
/** @type {?} */
const precisionFactor = this.getPrecisionFactor(val, rat);
/** @type {?} */
const precision = Math.abs(this.getMaxPrecision(val, rat));
/** @type {?} */
let result;
if (typeof val === 'number') {
result =
((precisionFactor * val - precisionFactor * this.nzStep * rat) /
precisionFactor).toFixed(precision);
}
else {
result = this.nzMin === -Infinity ? -this.nzStep : this.nzMin;
}
return this.toNumber(result);
}
/**
* @param {?} type
* @param {?} e
* @param {?=} ratio
* @return {?}
*/
step(type, e, ratio = 1) {
this.stop();
e.preventDefault();
if (this.nzDisabled) {
return;
}
/** @type {?} */
const value = this.getCurrentValidValue(this.actualValue) || 0;
/** @type {?} */
let val;
if (type === 'up') {
val = this.upStep(value, ratio);
}
else if (type === 'down') {
val = this.downStep(value, ratio);
}
/** @type {?} */
const outOfRange = val > this.nzMax || val < this.nzMin;
if (val > this.nzMax) {
val = this.nzMax;
}
else if (val < this.nzMin) {
val = this.nzMin;
}
this.setValue(val, true);
this.isFocused = true;
if (outOfRange) {
return;
}
this.autoStepTimer = setTimeout((/**
* @return {?}
*/
() => {
this[type](e, ratio, true);
}), 600);
}
/**
* @return {?}
*/
stop() {
if (this.autoStepTimer) {
clearTimeout(this.autoStepTimer);
}
}
/**
* @param {?} value
* @param {?} emit
* @return {?}
*/
setValue(value, emit) {
if (emit && (`${this.value}` !== `${value}`)) {
this.onChange(value);
}
this.value = value;
this.actualValue = value;
/** @type {?} */
const displayValue = isNotNil(this.nzFormatter(this.value)) ? this.nzFormatter(this.value) : '';
this.displayValue = displayValue;
this.inputElement.nativeElement.value = displayValue;
this.disabledUp = this.disabledDown = false;
if (value || value === 0) {
/** @type {?} */
const val = Number(value);
if (val >= this.nzMax) {
this.disabledUp = true;
}
if (val <= this.nzMin) {
this.disabledDown = true;
}
}
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
if (e.code === 'ArrowUp' || e.keyCode === UP_ARROW) {
/** @type {?} */
const ratio = this.getRatio(e);
this.up(e, ratio);
this.stop();
}
else if (e.code === 'ArrowDown' || e.keyCode === DOWN_ARROW) {
/** @type {?} */
const ratio = this.getRatio(e);
this.down(e, ratio);
this.stop();
}
else if (e.keyCode === ENTER) {
this.setValidateValue();
}
}
/**
* @return {?}
*/
onKeyUp() {
this.stop();
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.setValue(value, false);
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
/**
* @return {?}
*/
focus() {
this.focusMonitor.focusVia(this.inputElement, 'keyboard');
}
/**
* @return {?}
*/
blur() {
this.inputElement.nativeElement.blur();
}
/**
* @return {?}
*/
ngOnInit() {
this.focusMonitor.monitor(this.elementRef, true).subscribe((/**
* @param {?} focusOrigin
* @return {?}
*/
focusOrigin => {
if (!focusOrigin) {
this.nzBlur.emit();
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
}
else {
this.nzFocus.emit();
}
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzAutoFocus) {
this.updateAutoFocus();
}
if (changes.nzFormatter) {
/** @type {?} */
const value = this.getCurrentValidValue(this.actualValue);
this.setValue(value, true);
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.nzAutoFocus) {
this.focus();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.focusMonitor.stopMonitoring(this.elementRef);
}
}
NzInputNumberComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-input-number',
template: "<div class=\"ant-input-number-handler-wrap\">\n <span unselectable=\"unselectable\"\n class=\"ant-input-number-handler ant-input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.ant-input-number-handler-up-disabled]=\"disabledUp\">\n <i nz-icon type=\"up\" class=\"ant-input-number-handler-up-inner\"></i>\n </span>\n <span unselectable=\"unselectable\"\n class=\"ant-input-number-handler ant-input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.ant-input-number-handler-down-disabled]=\"disabledDown\">\n <i nz-icon type=\"down\" class=\"ant-input-number-handler-down-inner\"></i>\n </span>\n</div>\n<div class=\"ant-input-number-input-wrap\">\n <input #inputElement\n autocomplete=\"off\"\n class=\"ant-input-number-input\"\n [disabled]=\"nzDisabled\"\n [attr.min]=\"nzMin\"\n [attr.max]=\"nzMax\"\n [placeholder]=\"nzPlaceHolder\"\n [attr.step]=\"nzStep\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"onKeyUp()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n [ngModel]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\">\n</div>",
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzInputNumberComponent)),
multi: true
}
],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class.ant-input-number-focused]': 'isFocused',
'[class.ant-input-number-lg]': `nzSize === 'large'`,
'[class.ant-input-number-sm]': `nzSize === 'small'`,
'[class.ant-input-number-disabled]': 'nzDisabled'
}
}] }
];
/** @nocollapse */
NzInputNumberComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: FocusMonitor }
];
NzInputNumberComponent.propDecorators = {
nzBlur: [{ type: Output }],
nzFocus: [{ type: Output }],
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
nzSize: [{ type: Input }],
nzMin: [{ type: Input }],
nzMax: [{ type: Input }],
nzParser: [{ type: Input }],
nzPrecision: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzStep: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzFormatter: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzInputNumberComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzInputNumberComponent.prototype, "nzAutoFocus", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzInputNumberModule {
}
NzInputNumberModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzIconModule],
declarations: [NzInputNumberComponent],
exports: [NzInputNumberComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzContentComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-layout-content');
}
}
NzContentComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-content',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-content></ng-content>",
styles: [`nz-content {
display: block;
}`]
}] }
];
/** @nocollapse */
NzContentComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzFooterComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-layout-footer');
}
}
NzFooterComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-footer',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
styles: [`nz-footer {
display: block;
}`]
}] }
];
/** @nocollapse */
NzFooterComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzHeaderComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(this.elementRef.nativeElement, 'ant-layout-header');
}
}
NzHeaderComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-header',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
template: "<ng-content></ng-content>",
styles: [`nz-header {
display: block;
}`]
}] }
];
/** @nocollapse */
NzHeaderComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzLayoutComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
renderer.addClass(elementRef.nativeElement, 'ant-layout');
}
/**
* @return {?}
*/
destroySider() {
this.renderer.removeClass(this.elementRef.nativeElement, 'ant-layout-has-sider');
}
/**
* @return {?}
*/
initSider() {
this.renderer.addClass(this.elementRef.nativeElement, 'ant-layout-has-sider');
}
}
NzLayoutComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-layout',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
template: "<ng-content></ng-content>"
}] }
];
/** @nocollapse */
NzLayoutComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSiderComponent {
/**
* @param {?} nzLayoutComponent
* @param {?} mediaMatcher
* @param {?} ngZone
* @param {?} platform
* @param {?} cdr
* @param {?} renderer
* @param {?} elementRef
*/
constructor(nzLayoutComponent, mediaMatcher, ngZone, platform, cdr, renderer, elementRef) {
this.nzLayoutComponent = nzLayoutComponent;
this.mediaMatcher = mediaMatcher;
this.ngZone = ngZone;
this.platform = platform;
this.cdr = cdr;
this.below = false;
this.destroy$ = new Subject();
this.dimensionMap = {
xs: '480px',
sm: '576px',
md: '768px',
lg: '992px',
xl: '1200px',
xxl: '1600px'
};
this.nzWidth = 200;
this.nzTheme = 'dark';
this.nzCollapsedWidth = 80;
this.nzReverseArrow = false;
this.nzCollapsible = false;
this.nzCollapsed = false;
this.nzCollapsedChange = new EventEmitter();
renderer.addClass(elementRef.nativeElement, 'ant-layout-sider');
}
/**
* @return {?}
*/
get flexSetting() {
if (this.nzCollapsed) {
return `0 0 ${this.nzCollapsedWidth}px`;
}
else {
return `0 0 ${this.nzWidth}px`;
}
}
/**
* @return {?}
*/
get widthSetting() {
if (this.nzCollapsed) {
return this.nzCollapsedWidth;
}
else {
return this.nzWidth;
}
}
/**
* @return {?}
*/
watchMatchMedia() {
if (this.nzBreakpoint) {
/** @type {?} */
const matchBelow = this.mediaMatcher.matchMedia(`(max-width: ${this.dimensionMap[this.nzBreakpoint]})`).matches;
this.below = matchBelow;
this.nzCollapsed = matchBelow;
this.nzCollapsedChange.emit(matchBelow);
this.ngZone.run((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
}
/**
* @return {?}
*/
toggleCollapse() {
this.nzCollapsed = !this.nzCollapsed;
this.nzCollapsedChange.emit(this.nzCollapsed);
}
/**
* @return {?}
*/
get isZeroTrigger() {
return this.nzCollapsible && this.nzTrigger && this.nzCollapsedWidth === 0 && ((this.nzBreakpoint && this.below) || (!this.nzBreakpoint));
}
/**
* @return {?}
*/
get isSiderTrigger() {
return this.nzCollapsible && this.nzTrigger && this.nzCollapsedWidth !== 0;
}
/**
* @return {?}
*/
ngOnInit() {
if (this.nzLayoutComponent) {
this.nzLayoutComponent.initSider();
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.platform.isBrowser) {
Promise.resolve().then((/**
* @return {?}
*/
() => this.watchMatchMedia()));
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
fromEvent(window, 'resize')
.pipe(auditTime(16), takeUntil(this.destroy$))
.subscribe((/**
* @return {?}
*/
() => this.watchMatchMedia()));
}));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
if (this.nzLayoutComponent) {
this.nzLayoutComponent.destroySider();
}
}
}
NzSiderComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-sider',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<div class=\"ant-layout-sider-children\">\n <ng-content></ng-content>\n</div>\n<span class=\"ant-layout-sider-zero-width-trigger\" *ngIf=\"isZeroTrigger\" (click)=\"toggleCollapse()\">\n <ng-template [ngTemplateOutlet]=\"nzZeroTrigger || zeroTrigger\"></ng-template>\n</span>\n<div class=\"ant-layout-sider-trigger\"\n *ngIf=\"isSiderTrigger\"\n (click)=\"toggleCollapse()\"\n [style.width.px]=\"nzCollapsed ? nzCollapsedWidth : nzWidth\">\n <ng-template [ngTemplateOutlet]=\"nzTrigger\"></ng-template>\n</div>\n<ng-template #defaultTrigger>\n <i nz-icon [type]=\"nzCollapsed ? 'right' : 'left'\" *ngIf=\"!nzReverseArrow\"></i>\n <i nz-icon [type]=\"nzCollapsed ? 'left' : 'right'\" *ngIf=\"nzReverseArrow\"></i>\n</ng-template>\n<ng-template #zeroTrigger>\n <i nz-icon type=\"bars\"></i>\n</ng-template>",
host: {
'[class.ant-layout-sider-zero-width]': 'nzCollapsed && nzCollapsedWidth === 0',
'[class.ant-layout-sider-light]': `nzTheme === 'light'`,
'[class.ant-layout-sider-collapsed]': 'nzCollapsed',
'[style.flex]': 'flexSetting',
'[style.max-width.px]': 'widthSetting',
'[style.min-width.px]': 'widthSetting',
'[style.width.px]': 'widthSetting'
}
}] }
];
/** @nocollapse */
NzSiderComponent.ctorParameters = () => [
{ type: NzLayoutComponent, decorators: [{ type: Optional }, { type: Host }] },
{ type: MediaMatcher },
{ type: NgZone },
{ type: Platform },
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: ElementRef }
];
NzSiderComponent.propDecorators = {
nzWidth: [{ type: Input }],
nzTheme: [{ type: Input }],
nzCollapsedWidth: [{ type: Input }],
nzBreakpoint: [{ type: Input }],
nzZeroTrigger: [{ type: Input }],
nzTrigger: [{ type: Input }, { type: ViewChild, args: ['defaultTrigger',] }],
nzReverseArrow: [{ type: Input }],
nzCollapsible: [{ type: Input }],
nzCollapsed: [{ type: Input }],
nzCollapsedChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSiderComponent.prototype, "nzReverseArrow", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSiderComponent.prototype, "nzCollapsible", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSiderComponent.prototype, "nzCollapsed", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzLayoutModule {
}
NzLayoutModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzLayoutComponent, NzHeaderComponent, NzContentComponent, NzFooterComponent, NzSiderComponent],
exports: [NzLayoutComponent, NzHeaderComponent, NzContentComponent, NzFooterComponent, NzSiderComponent],
imports: [CommonModule, NzIconModule, LayoutModule, PlatformModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSpinComponent {
/**
* @param {?} cdr
*/
constructor(cdr) {
this.cdr = cdr;
this.nzSize = 'default';
this.nzDelay = 0;
this.nzSimple = false;
this.nzSpinning = true;
this.spinning$ = new BehaviorSubject(this.nzSpinning);
this.loading$ = this.spinning$.pipe(debounceTime(this.nzDelay));
this.loading = true;
}
/**
* @return {?}
*/
subscribeLoading() {
this.unsubscribeLoading();
this.loading_ = this.loading$.subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
this.loading = data;
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
unsubscribeLoading() {
if (this.loading_) {
this.loading_.unsubscribe();
this.loading_ = null;
}
}
/**
* @return {?}
*/
ngOnInit() {
this.subscribeLoading();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzSpinning) {
if (changes.nzSpinning.isFirstChange()) {
this.loading = this.nzSpinning;
}
this.spinning$.next(this.nzSpinning);
}
if (changes.nzDelay) {
this.loading$ = this.spinning$.pipe(debounceTime(this.nzDelay));
this.subscribeLoading();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.unsubscribeLoading();
}
}
NzSpinComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-spin',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template #defaultIndicatorTemplate>\n <span class=\"ant-spin-dot\" [class.ant-spin-dot-spin]=\"loading\">\n <i></i><i></i><i></i><i></i>\n </span>\n</ng-template>\n<div *ngIf=\"loading\">\n <div class=\"ant-spin\"\n [class.ant-spin-spinning]=\"loading\"\n [class.ant-spin-lg]=\"nzSize === 'large'\"\n [class.ant-spin-sm]=\"nzSize === 'small'\"\n [class.ant-spin-show-text]=\"nzTip\">\n <ng-template [ngTemplateOutlet]=\"nzIndicator || defaultIndicatorTemplate\"></ng-template>\n <div class=\"ant-spin-text\" *ngIf=\"nzTip\">{{ nzTip }}</div>\n </div>\n</div>\n<div *ngIf=\"!nzSimple\"\n class=\"ant-spin-container\"\n [class.ant-spin-blur]=\"loading\">\n <ng-content></ng-content>\n</div>\n",
host: {
'[class.ant-spin-nested-loading]': '!nzSimple'
},
styles: [`
nz-spin {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzSpinComponent.ctorParameters = () => [
{ type: ChangeDetectorRef }
];
NzSpinComponent.propDecorators = {
nzIndicator: [{ type: Input }],
nzSize: [{ type: Input }],
nzTip: [{ type: Input }],
nzDelay: [{ type: Input }],
nzSimple: [{ type: Input }],
nzSpinning: [{ type: Input }]
};
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzSpinComponent.prototype, "nzDelay", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSpinComponent.prototype, "nzSimple", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSpinComponent.prototype, "nzSpinning", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSpinModule {
}
NzSpinModule.decorators = [
{ type: NgModule, args: [{
exports: [NzSpinComponent],
declarations: [NzSpinComponent],
imports: [CommonModule, ObserversModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzListItemMetaComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.avatarStr = '';
this.renderer.addClass(elementRef.nativeElement, 'ant-list-item-meta');
}
/**
* @param {?} value
* @return {?}
*/
set nzAvatar(value) {
if (value instanceof TemplateRef) {
this.avatarStr = null;
this.avatarTpl = value;
}
else {
this.avatarStr = value;
}
}
}
NzListItemMetaComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-list-item-meta',
template: "<div *ngIf=\"avatarStr || avatarTpl\" class=\"ant-list-item-meta-avatar\">\n <ng-container *ngIf=\"avatarStr; else avatarTpl\">\n <nz-avatar [nzSrc]=\"avatarStr\"></nz-avatar>\n </ng-container>\n</div>\n<div *ngIf=\"nzTitle || nzDescription\" class=\"ant-list-item-meta-content\">\n <h4 *ngIf=\"nzTitle\" class=\"ant-list-item-meta-title\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </h4>\n <div *ngIf=\"nzDescription\" class=\"ant-list-item-meta-description\">\n <ng-container *nzStringTemplateOutlet=\"nzDescription\">{{ nzDescription }}</ng-container>\n </div>\n</div>",
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
}] }
];
/** @nocollapse */
NzListItemMetaComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzListItemMetaComponent.propDecorators = {
nzAvatar: [{ type: Input }],
nzTitle: [{ type: Input }],
nzDescription: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzListItemComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.nzActions = [];
this.renderer.addClass(this.elementRef.nativeElement, 'ant-list-item');
}
}
NzListItemComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-list-item',
template: "<ng-template #contentTpl>\n <div *ngIf=\"nzContent\" class=\"ant-list-item-content\" [ngClass]=\"{'ant-list-item-content-single': metas.length < 1}\">\n <ng-container *nzStringTemplateOutlet=\"nzContent\">{{ nzContent }}</ng-container>\n </div>\n</ng-template>\n<ng-template #actionsTpl>\n <ul *ngIf=\"nzActions?.length > 0\" class=\"ant-list-item-action\">\n <li *ngFor=\"let i of nzActions; let last=last;\">\n <ng-template [ngTemplateOutlet]=\"i\"></ng-template>\n <em *ngIf=\"!last\" class=\"ant-list-item-action-split\"></em>\n </li>\n </ul>\n</ng-template>\n<ng-template #mainTpl>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTpl\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"actionsTpl\"></ng-template>\n</ng-template>\n<div *ngIf=\"nzExtra; else mainTpl\" class=\"ant-list-item-extra-wrap\">\n <div class=\"ant-list-item-main\">\n <ng-template [ngTemplateOutlet]=\"mainTpl\"></ng-template>\n </div>\n <div class=\"ant-list-item-extra\">\n <ng-template [ngTemplateOutlet]=\"nzExtra\"></ng-template>\n </div>\n</div>",
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzListItemComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzListItemComponent.propDecorators = {
metas: [{ type: ContentChildren, args: [NzListItemMetaComponent,] }],
nzActions: [{ type: Input }],
nzContent: [{ type: Input }],
nzExtra: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzListComponent {
// #endregion
/**
* @param {?} el
* @param {?} updateHostClassService
*/
constructor(el, updateHostClassService) {
this.el = el;
this.updateHostClassService = updateHostClassService;
this.nzBordered = false;
this.nzItemLayout = 'horizontal';
this.nzLoading = false;
this.nzSize = 'default';
this.nzSplit = true;
// #endregion
// #region styles
this.prefixCls = 'ant-list';
}
/**
* @private
* @return {?}
*/
_setClassMap() {
/** @type {?} */
const classMap = {
[this.prefixCls]: true,
[`${this.prefixCls}-vertical`]: this.nzItemLayout === 'vertical',
[`${this.prefixCls}-lg`]: this.nzSize === 'large',
[`${this.prefixCls}-sm`]: this.nzSize === 'small',
[`${this.prefixCls}-split`]: this.nzSplit,
[`${this.prefixCls}-bordered`]: this.nzBordered,
[`${this.prefixCls}-loading`]: this.nzLoading,
[`${this.prefixCls}-grid`]: this.nzGrid,
[`${this.prefixCls}-something-after-last-item`]: !!(this.nzLoadMore || this.nzPagination || this.nzFooter)
};
this.updateHostClassService.updateHostClass(this.el.nativeElement, classMap);
}
/**
* @return {?}
*/
ngOnInit() {
this._setClassMap();
}
/**
* @return {?}
*/
ngOnChanges() {
this._setClassMap();
}
}
NzListComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-list',
template: "<ng-template #itemsTpl>\n <ng-container *ngFor=\"let item of nzDataSource; let index = index\">\n <ng-template [ngTemplateOutlet]=\"nzRenderItem\" [ngTemplateOutletContext]=\"{ $implicit: item, index: index }\"></ng-template>\n </ng-container>\n</ng-template>\n<div *ngIf=\"nzHeader\" class=\"ant-list-header\">\n <ng-container *nzStringTemplateOutlet=\"nzHeader\">{{ nzHeader }}</ng-container>\n</div>\n<nz-spin [nzSpinning]=\"nzLoading\">\n <ng-container *ngIf=\"nzDataSource\">\n <div *ngIf=\"nzLoading && nzDataSource.length === 0\" [style.min-height.px]=\"53\"></div>\n <div *ngIf=\"nzGrid; else itemsTpl\" nz-row [nzGutter]=\"nzGrid.gutter\">\n <div nz-col [nzSpan]=\"nzGrid.span\" [nzXs]=\"nzGrid.xs\" [nzSm]=\"nzGrid.sm\" [nzMd]=\"nzGrid.md\" [nzLg]=\"nzGrid.lg\" [nzXl]=\"nzGrid.xl\"\n [nzXXl]=\"nzGrid.xxl\" *ngFor=\"let item of nzDataSource; let index = index\">\n <ng-template [ngTemplateOutlet]=\"nzRenderItem\" [ngTemplateOutletContext]=\"{ $implicit: item, index: index }\"></ng-template>\n </div>\n </div>\n <div *ngIf=\"!nzLoading && nzDataSource.length === 0\" class=\"ant-list-empty-text\">\n <nz-embed-empty [nzComponentName]=\"'list'\" [specificContent]=\"nzNoResult\"></nz-embed-empty>\n </div>\n </ng-container>\n <ng-content></ng-content>\n</nz-spin>\n<div *ngIf=\"nzFooter\" class=\"ant-list-footer\">\n <ng-container *nzStringTemplateOutlet=\"nzFooter\">{{ nzFooter }}</ng-container>\n</div>\n<ng-template [ngTemplateOutlet]=\"nzLoadMore\"></ng-template>\n<div *ngIf=\"nzPagination\" class=\"ant-list-pagination\">\n <ng-template [ngTemplateOutlet]=\"nzPagination\"></ng-template>\n</div>",
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [`
nz-list, nz-list nz-spin {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzListComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzUpdateHostClassService }
];
NzListComponent.propDecorators = {
nzDataSource: [{ type: Input }],
nzBordered: [{ type: Input }],
nzGrid: [{ type: Input }],
nzHeader: [{ type: Input }],
nzFooter: [{ type: Input }],
nzItemLayout: [{ type: Input }],
nzRenderItem: [{ type: Input }],
nzLoading: [{ type: Input }],
nzLoadMore: [{ type: Input }],
nzPagination: [{ type: Input }],
nzSize: [{ type: Input }],
nzSplit: [{ type: Input }],
nzNoResult: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzListComponent.prototype, "nzBordered", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzListComponent.prototype, "nzLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzListComponent.prototype, "nzSplit", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzListModule {
}
NzListModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
NzSpinModule,
NzGridModule,
NzAvatarModule,
NzAddOnModule,
NzEmptyModule
],
declarations: [
NzListComponent,
NzListItemComponent,
NzListItemMetaComponent
],
exports: [
NzListComponent,
NzListItemComponent,
NzListItemMetaComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMentionSuggestionDirective {
}
NzMentionSuggestionDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzMentionSuggestion]'
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_MENTION_TRIGGER_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzMentionTriggerDirective)),
multi: true
};
class NzMentionTriggerDirective {
/**
* @param {?} el
*/
constructor(el) {
this.el = el;
this.onFocusin = new EventEmitter();
this.onBlur = new EventEmitter();
this.onInput = new EventEmitter();
this.onKeydown = new EventEmitter();
this.onClick = new EventEmitter();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.completeEvents();
}
/**
* @return {?}
*/
completeEvents() {
this.onFocusin.complete();
this.onBlur.complete();
this.onInput.complete();
this.onKeydown.complete();
this.onClick.complete();
}
/**
* @param {?=} caretPos
* @return {?}
*/
focus(caretPos) {
this.el.nativeElement.focus();
this.el.nativeElement.setSelectionRange(caretPos, caretPos);
}
/**
* @param {?} mention
* @return {?}
*/
insertMention(mention) {
/** @type {?} */
const value = this.el.nativeElement.value;
/** @type {?} */
const insertValue = mention.mention.trim() + ' ';
/** @type {?} */
const newValue = [
value.slice(0, mention.startPos + 1),
insertValue,
value.slice(mention.endPos, value.length)
].join('');
this.el.nativeElement.value = newValue;
this.focus(mention.startPos + insertValue.length + 1);
this.onChange(newValue);
this.value = newValue;
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.value = value;
if (typeof value === 'string') {
this.el.nativeElement.value = value;
}
else {
this.el.nativeElement.value = '';
}
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
}
NzMentionTriggerDirective.decorators = [
{ type: Directive, args: [{
selector: 'input[nzMentionTrigger], textarea[nzMentionTrigger]',
providers: [NZ_MENTION_TRIGGER_ACCESSOR],
host: {
'autocomplete': 'off',
'(focusin)': 'onFocusin.emit()',
'(blur)': 'onBlur.emit()',
'(input)': 'onInput.emit($event)',
'(keydown)': 'onKeydown.emit($event)',
'(click)': 'onClick.emit($event)'
}
},] }
];
/** @nocollapse */
NzMentionTriggerDirective.ctorParameters = () => [
{ type: ElementRef }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMentionComponent {
/**
* @param {?} ngDocument
* @param {?} changeDetectorRef
* @param {?} overlay
* @param {?} viewContainerRef
*/
constructor(ngDocument, // tslint:disable-line:no-any
changeDetectorRef, overlay, viewContainerRef) {
this.ngDocument = ngDocument;
this.changeDetectorRef = changeDetectorRef;
this.overlay = overlay;
this.viewContainerRef = viewContainerRef;
this.nzValueWith = (/**
* @param {?} value
* @return {?}
*/
value => value); // tslint:disable-line:no-any
// tslint:disable-line:no-any
this.nzPrefix = '@';
this.nzLoading = false;
this.nzNotFoundContent = '无匹配结果,轻敲空格完成输入';
this.nzPlacement = 'bottom';
this.nzSuggestions = [];
this.nzOnSelect = new EventEmitter();
this.nzOnSearchChange = new EventEmitter();
this.isOpen = false;
this.filteredSuggestions = [];
this.suggestionTemplate = null; // tslint:disable-line:no-any
// tslint:disable-line:no-any
this.activeIndex = -1;
}
/**
* @param {?} value
* @return {?}
*/
set suggestionChild(value) {
if (value) {
this.suggestionTemplate = value;
}
}
/**
* @private
* @return {?}
*/
get triggerNativeElement() {
return this.trigger.el.nativeElement;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.hasOwnProperty('nzSuggestions')) {
if (this.isOpen) {
this.previousValue = null;
this.activeIndex = -1;
this.resetDropdown(false);
}
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.bindTriggerEvents();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.closeDropdown();
}
/**
* @return {?}
*/
closeDropdown() {
if (this.overlayRef && this.overlayRef.hasAttached()) {
this.overlayRef.detach();
this.overlayBackdropClickSubscription.unsubscribe();
this.isOpen = false;
this.changeDetectorRef.markForCheck();
}
}
/**
* @return {?}
*/
openDropdown() {
this.attachOverlay();
this.isOpen = true;
this.changeDetectorRef.markForCheck();
}
/**
* @return {?}
*/
getMentions() {
return getMentions(this.trigger.value, this.nzPrefix);
}
/**
* @param {?} suggestion
* @return {?}
*/
selectSuggestion(suggestion) {
/** @type {?} */
const value = this.nzValueWith(suggestion);
this.trigger.insertMention({
mention: value,
startPos: this.cursorMentionStart,
endPos: this.cursorMentionEnd
});
this.nzOnSelect.emit(suggestion);
this.closeDropdown();
this.activeIndex = -1;
}
/**
* @private
* @param {?} event
* @return {?}
*/
handleInput(event) {
/** @type {?} */
const target = (/** @type {?} */ (event.target));
this.trigger.onChange(target.value);
this.trigger.value = target.value;
this.resetDropdown();
}
/**
* @private
* @param {?} event
* @return {?}
*/
handleKeydown(event) {
/** @type {?} */
const keyCode = event.keyCode;
if (this.isOpen && keyCode === ENTER && this.activeIndex !== -1 && this.filteredSuggestions.length) {
this.selectSuggestion(this.filteredSuggestions[this.activeIndex]);
event.preventDefault();
}
else if (keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW) {
this.resetDropdown();
event.stopPropagation();
}
else {
if (this.isOpen && (keyCode === TAB || keyCode === ESCAPE)) {
this.closeDropdown();
return;
}
if (this.isOpen && (keyCode === UP_ARROW)) {
this.setPreviousItemActive();
event.preventDefault();
event.stopPropagation();
}
if (this.isOpen && (keyCode === DOWN_ARROW)) {
this.setNextItemActive();
event.preventDefault();
event.stopPropagation();
}
}
}
/**
* @private
* @return {?}
*/
handleClick() {
this.resetDropdown();
}
/**
* @private
* @return {?}
*/
bindTriggerEvents() {
this.trigger.onInput.subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleInput(e)));
this.trigger.onKeydown.subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleKeydown(e)));
this.trigger.onClick.subscribe((/**
* @return {?}
*/
() => this.handleClick()));
}
/**
* @private
* @param {?} value
* @param {?} emit
* @return {?}
*/
suggestionsFilter(value, emit) {
/** @type {?} */
const suggestions = value.substring(1);
if (this.previousValue === value) {
return;
}
this.previousValue = value;
if (emit) {
this.nzOnSearchChange.emit({
value: this.cursorMention.substring(1),
prefix: this.cursorMention[0]
});
}
/** @type {?} */
const searchValue = suggestions.toLowerCase();
this.filteredSuggestions = this.nzSuggestions
.filter((/**
* @param {?} suggestion
* @return {?}
*/
suggestion => this.nzValueWith(suggestion).toLowerCase().includes(searchValue)));
}
/**
* @private
* @param {?=} emit
* @return {?}
*/
resetDropdown(emit = true) {
this.resetCursorMention();
if (typeof this.cursorMention !== 'string' || !this.canOpen()) {
this.closeDropdown();
return;
}
this.suggestionsFilter(this.cursorMention, emit);
/** @type {?} */
const activeIndex = this.filteredSuggestions.indexOf(this.cursorMention.substring(1));
this.activeIndex = activeIndex >= 0 ? activeIndex : 0;
this.openDropdown();
}
/**
* @private
* @return {?}
*/
setNextItemActive() {
this.activeIndex = this.activeIndex + 1 <= this.filteredSuggestions.length - 1
? this.activeIndex + 1
: 0;
this.changeDetectorRef.markForCheck();
}
/**
* @private
* @return {?}
*/
setPreviousItemActive() {
this.activeIndex = this.activeIndex - 1 < 0
? this.filteredSuggestions.length - 1
: this.activeIndex - 1;
this.changeDetectorRef.markForCheck();
}
/**
* @private
* @return {?}
*/
canOpen() {
/** @type {?} */
const element = this.triggerNativeElement;
return !element.readOnly && !element.disabled;
}
/**
* @private
* @return {?}
*/
resetCursorMention() {
/** @type {?} */
const value = this.triggerNativeElement.value.replace(/[\r\n]/g, ' ') || '';
/** @type {?} */
const selectionStart = this.triggerNativeElement.selectionStart;
/** @type {?} */
const prefix = typeof this.nzPrefix === 'string' ? [this.nzPrefix] : this.nzPrefix;
/** @type {?} */
let i = prefix.length;
while (i >= 0) {
/** @type {?} */
const startPos = value.lastIndexOf(prefix[i], selectionStart);
/** @type {?} */
const endPos = value.indexOf(' ', selectionStart) > -1 ? value.indexOf(' ', selectionStart) : value.length;
/** @type {?} */
const mention = value.substring(startPos, endPos);
if ((startPos > 0 && value[startPos - 1] !== ' ')
|| startPos < 0
|| mention.includes(prefix[i], 1)
|| mention.includes(' ')) {
this.cursorMention = null;
this.cursorMentionStart = -1;
this.cursorMentionEnd = -1;
}
else {
this.cursorMention = mention;
this.cursorMentionStart = startPos;
this.cursorMentionEnd = endPos;
return;
}
i--;
}
}
/**
* @private
* @return {?}
*/
updatePositions() {
/** @type {?} */
const coordinates = getCaretCoordinates(this.triggerNativeElement, this.cursorMentionStart);
/** @type {?} */
const top = coordinates.top
- this.triggerNativeElement.getBoundingClientRect().height
- this.triggerNativeElement.scrollTop
+ (this.nzPlacement === 'bottom' ? coordinates.height : 0);
/** @type {?} */
const left = coordinates.left - this.triggerNativeElement.scrollLeft;
this.positionStrategy.withDefaultOffsetX(left).withDefaultOffsetY(top);
if (this.nzPlacement === 'bottom') {
this.positionStrategy.withPositions([DEFAULT_MENTION_POSITIONS[0]]);
}
if (this.nzPlacement === 'top') {
this.positionStrategy.withPositions([DEFAULT_MENTION_POSITIONS[1]]);
}
this.positionStrategy.apply();
}
/**
* @private
* @return {?}
*/
subscribeOverlayBackdropClick() {
return merge(fromEvent(this.ngDocument, 'click'), fromEvent(this.ngDocument, 'touchend'))
.subscribe((/**
* @param {?} event
* @return {?}
*/
(event) => {
/** @type {?} */
const clickTarget = (/** @type {?} */ (event.target));
if (clickTarget !== this.trigger.el.nativeElement && this.isOpen) {
this.closeDropdown();
}
}));
}
/**
* @private
* @return {?}
*/
attachOverlay() {
if (!this.overlayRef) {
this.portal = new TemplatePortal(this.suggestionsTemp, this.viewContainerRef);
this.overlayRef = this.overlay.create(this.getOverlayConfig());
}
if (this.overlayRef && !this.overlayRef.hasAttached()) {
this.overlayRef.attach(this.portal);
this.overlayBackdropClickSubscription = this.subscribeOverlayBackdropClick();
}
this.updatePositions();
}
/**
* @private
* @return {?}
*/
getOverlayConfig() {
return new OverlayConfig({
positionStrategy: this.getOverlayPosition(),
scrollStrategy: this.overlay.scrollStrategies.reposition()
});
}
/**
* @private
* @return {?}
*/
getOverlayPosition() {
/** @type {?} */
const positions = [
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
];
this.positionStrategy = this.overlay.position()
.flexibleConnectedTo(this.trigger.el)
.withPositions(positions)
.withFlexibleDimensions(false)
.withPush(false);
return this.positionStrategy;
}
}
NzMentionComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-mention',
template: "<ng-content></ng-content>\n<ng-template #suggestions>\n <ul class=\"ant-mention-dropdown\">\n <li class=\"ant-mention-dropdown-item\"\n *ngFor=\"let suggestion of filteredSuggestions; let i = index\"\n [class.focus]=\"i === activeIndex\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"selectSuggestion(suggestion)\">\n <ng-container *ngIf=\"suggestionTemplate else defaultSuggestion\">\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: {$implicit: suggestion}\"></ng-container>\n </ng-container>\n <ng-template #defaultSuggestion>{{ nzValueWith(suggestion) }}</ng-template>\n </li>\n <li class=\"ant-mention-dropdown-notfound ant-mention-dropdown-item\"\n *ngIf=\"filteredSuggestions.length === 0\">\n <span *ngIf=\"nzLoading\"><i nz-icon type=\"loading\"></i></span>\n <span *ngIf=\"!nzLoading\">{{ nzNotFoundContent }}</span>\n </li>\n </ul>\n</ng-template>\n",
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [`
.ant-mention-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
}
`]
}] }
];
/** @nocollapse */
NzMentionComponent.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
{ type: ChangeDetectorRef },
{ type: Overlay },
{ type: ViewContainerRef }
];
NzMentionComponent.propDecorators = {
nzValueWith: [{ type: Input }],
nzPrefix: [{ type: Input }],
nzLoading: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzPlacement: [{ type: Input }],
nzSuggestions: [{ type: Input }],
nzOnSelect: [{ type: Output }],
nzOnSearchChange: [{ type: Output }],
trigger: [{ type: ContentChild, args: [NzMentionTriggerDirective,] }],
suggestionsTemp: [{ type: ViewChild, args: [TemplateRef,] }],
suggestionChild: [{ type: ContentChild, args: [NzMentionSuggestionDirective, { read: TemplateRef },] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMentionComponent.prototype, "nzLoading", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const COMPONENTS = [NzMentionComponent, NzMentionTriggerDirective, NzMentionSuggestionDirective];
class NzMentionModule {
}
NzMentionModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, OverlayModule, NzIconModule],
declarations: [...COMPONENTS],
exports: [...COMPONENTS]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_MESSAGE_DEFAULT_CONFIG = new InjectionToken('NZ_MESSAGE_DEFAULT_CONFIG');
/** @type {?} */
const NZ_MESSAGE_CONFIG = new InjectionToken('NZ_MESSAGE_CONFIG');
/** @type {?} */
const NZ_MESSAGE_DEFAULT_CONFIG_PROVIDER = {
provide: NZ_MESSAGE_DEFAULT_CONFIG,
useValue: {
nzDuration: 3000,
nzAnimate: true,
nzPauseOnHover: true,
nzMaxStack: 7
}
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMessageContainerComponent {
/**
* @param {?} cdr
* @param {?} defaultConfig
* @param {?} config
*/
constructor(cdr, defaultConfig, config) {
this.cdr = cdr;
this.messages = [];
this.config = {};
this.setConfig(Object.assign({}, defaultConfig, config));
}
/**
* @param {?} config
* @return {?}
*/
setConfig(config) {
this.config = Object.assign({}, this.config, config);
}
/**
* Create a new message.
* @param {?} message Parsed message configuration.
* @return {?}
*/
createMessage(message) {
if (this.messages.length >= this.config.nzMaxStack) {
this.messages.splice(0, 1);
}
message.options = this._mergeMessageOptions(message.options);
message.onClose = new Subject();
this.messages.push(message);
this.cdr.detectChanges();
}
/**
* Remove a message by `messageId`.
* @param {?} messageId Id of the message to be removed.
* @param {?=} userAction Whether this is closed by user interaction.
* @return {?}
*/
removeMessage(messageId, userAction = false) {
this.messages.some((/**
* @param {?} message
* @param {?} index
* @return {?}
*/
(message, index) => {
if (message.messageId === messageId) {
this.messages.splice(index, 1);
this.cdr.detectChanges();
message.onClose.next(userAction);
message.onClose.complete();
return true;
}
}));
}
/**
* Remove all messages.
* @return {?}
*/
removeMessageAll() {
this.messages = [];
this.cdr.detectChanges();
}
/**
* Merge default options and custom message options
* @protected
* @param {?} options
* @return {?}
*/
_mergeMessageOptions(options) {
/** @type {?} */
const defaultOptions = {
nzDuration: this.config.nzDuration,
nzAnimate: this.config.nzAnimate,
nzPauseOnHover: this.config.nzPauseOnHover
};
return Object.assign({}, defaultOptions, options);
}
}
NzMessageContainerComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-message-container',
preserveWhitespaces: false,
template: "<div class=\"ant-message\">\n <nz-message *ngFor=\"let message of messages; let i = index\" [nzMessage]=\"message\" [nzIndex]=\"i\"></nz-message>\n</div>"
}] }
];
/** @nocollapse */
NzMessageContainerComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_MESSAGE_DEFAULT_CONFIG,] }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_MESSAGE_CONFIG,] }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const moveUpMotion = trigger('moveUpMotion', [
transition('* => enter', [
style({
transformOrigin: '0 0',
transform: 'translateY(-100%)',
opacity: 0
}),
animate(`${AnimationDuration.BASE}`, style({
transformOrigin: '0 0',
transform: 'translateY(0%)',
opacity: 1
}))
]),
transition('* => leave', [
style({
transformOrigin: '0 0',
transform: 'translateY(0%)',
opacity: 1
}),
animate(`${AnimationDuration.BASE}`, style({
transformOrigin: '0 0',
transform: 'translateY(-100%)',
opacity: 0
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMessageComponent {
// Time to live
/**
* @param {?} _messageContainer
* @param {?} cdr
*/
constructor(_messageContainer, cdr) {
this._messageContainer = _messageContainer;
this.cdr = cdr;
// Whether record timeout to auto destroy self
this._eraseTimer = null;
}
/**
* @return {?}
*/
ngOnInit() {
this._options = this.nzMessage.options;
if (this._options.nzAnimate) {
this.nzMessage.state = 'enter';
}
this._autoErase = this._options.nzDuration > 0;
if (this._autoErase) {
this._initErase();
this._startEraseTimeout();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
if (this._autoErase) {
this._clearEraseTimeout();
}
}
/**
* @return {?}
*/
onEnter() {
if (this._autoErase && this._options.nzPauseOnHover) {
this._clearEraseTimeout();
this._updateTTL();
}
}
/**
* @return {?}
*/
onLeave() {
if (this._autoErase && this._options.nzPauseOnHover) {
this._startEraseTimeout();
}
}
// Remove self
/**
* @protected
* @param {?=} userAction
* @return {?}
*/
_destroy(userAction = false) {
if (this._options.nzAnimate) {
this.nzMessage.state = 'leave';
this.cdr.detectChanges();
setTimeout((/**
* @return {?}
*/
() => this._messageContainer.removeMessage(this.nzMessage.messageId, userAction)), 200);
}
else {
this._messageContainer.removeMessage(this.nzMessage.messageId, userAction);
}
}
/**
* @private
* @return {?}
*/
_initErase() {
this._eraseTTL = this._options.nzDuration;
this._eraseTimingStart = Date.now();
}
/**
* @private
* @return {?}
*/
_updateTTL() {
if (this._autoErase) {
this._eraseTTL -= Date.now() - this._eraseTimingStart;
}
}
/**
* @private
* @return {?}
*/
_startEraseTimeout() {
if (this._eraseTTL > 0) {
this._clearEraseTimeout(); // To prevent calling _startEraseTimeout() more times to create more timer
// TODO: `window` should be removed in milestone II
this._eraseTimer = setTimeout((/**
* @return {?}
*/
() => this._destroy()), this._eraseTTL);
this._eraseTimingStart = Date.now();
}
else {
this._destroy();
}
}
/**
* @private
* @return {?}
*/
_clearEraseTimeout() {
if (this._eraseTimer !== null) {
clearTimeout(this._eraseTimer);
this._eraseTimer = null;
}
}
}
NzMessageComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-message',
preserveWhitespaces: false,
animations: [moveUpMotion],
template: "<div class=\"ant-message-notice\"\n [@moveUpMotion]=\"nzMessage.state\"\n (mouseenter)=\"onEnter()\"\n (mouseleave)=\"onLeave()\">\n <div class=\"ant-message-notice-content\">\n <div class=\"ant-message-custom-content\" [ngClass]=\"'ant-message-' + nzMessage.type\">\n <ng-container [ngSwitch]=\"nzMessage.type\">\n <i *ngSwitchCase=\"'success'\" nz-icon type=\"check-circle\"></i>\n <i *ngSwitchCase=\"'info'\" nz-icon type=\"info-circle\"></i>\n <i *ngSwitchCase=\"'warning'\" nz-icon type=\"exclamation-circle\"></i>\n <i *ngSwitchCase=\"'error'\" nz-icon type=\"close-circle\"></i>\n <i *ngSwitchCase=\"'loading'\" nz-icon type=\"loading\"></i>\n </ng-container>\n <span [innerHTML]=\"nzMessage.content\"></span>\n </div>\n </div>\n</div>"
}] }
];
/** @nocollapse */
NzMessageComponent.ctorParameters = () => [
{ type: NzMessageContainerComponent },
{ type: ChangeDetectorRef }
];
NzMessageComponent.propDecorators = {
nzMessage: [{ type: Input }],
nzIndex: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
let globalCounter = 0;
/**
* @template ContainerClass, MessageData, MessageConfig
*/
class NzMessageBaseService$$1 {
/**
* @param {?} overlay
* @param {?} containerClass
* @param {?} injector
* @param {?} cfr
* @param {?} appRef
* @param {?=} _idPrefix
*/
constructor(overlay, containerClass, injector, cfr, appRef, _idPrefix = '') {
this.overlay = overlay;
this.containerClass = containerClass;
this.injector = injector;
this.cfr = cfr;
this.appRef = appRef;
this._idPrefix = _idPrefix;
this._container = this.createContainer();
}
/**
* @param {?=} messageId
* @return {?}
*/
remove(messageId) {
if (messageId) {
this._container.removeMessage(messageId);
}
else {
this._container.removeMessageAll();
}
}
/**
* @param {?} message
* @param {?=} options
* @return {?}
*/
createMessage(message, options) {
// TODO: spread on literal has been disallow on latest proposal
/** @type {?} */
const resultMessage = Object.assign({}, ((/** @type {?} */ (message))), {
messageId: this._generateMessageId(),
options,
createdAt: new Date()
});
this._container.createMessage(resultMessage);
return resultMessage;
}
/**
* @param {?} config
* @return {?}
*/
config(config) {
this._container.setConfig(config);
}
/**
* @protected
* @return {?}
*/
_generateMessageId() {
return this._idPrefix + globalCounter++;
}
// Manually creating container for overlay to avoid multi-checking error, see: https://github.com/NG-ZORRO/ng-zorro-antd/issues/391
// NOTE: we never clean up the container component and it's overlay resources, if we should, we need to do it by our own codes.
/**
* @private
* @return {?}
*/
createContainer() {
/** @type {?} */
const factory = this.cfr.resolveComponentFactory(this.containerClass);
/** @type {?} */
const componentRef = factory.create(this.injector);
componentRef.changeDetectorRef.detectChanges(); // Immediately change detection to avoid multi-checking error
this.appRef.attachView(componentRef.hostView); // Load view into app root
// Load view into app root
/** @type {?} */
const overlayPane = this.overlay.create().overlayElement;
overlayPane.style.zIndex = '1010'; // Patching: assign the same zIndex of ant-message to it's parent overlay panel, to the ant-message's zindex work.
overlayPane.appendChild((/** @type {?} */ (((/** @type {?} */ (componentRef.hostView))).rootNodes[0])));
return componentRef.instance;
}
}
class NzMessageService$$1 extends NzMessageBaseService$$1 {
/**
* @param {?} overlay
* @param {?} injector
* @param {?} cfr
* @param {?} appRef
*/
constructor(overlay, injector, cfr, appRef) {
super(overlay, NzMessageContainerComponent, injector, cfr, appRef, 'message-');
}
// Shortcut methods
/**
* @param {?} content
* @param {?=} options
* @return {?}
*/
success(content, options) {
return this.createMessage({ type: 'success', content }, options);
}
/**
* @param {?} content
* @param {?=} options
* @return {?}
*/
error(content, options) {
return this.createMessage({ type: 'error', content }, options);
}
/**
* @param {?} content
* @param {?=} options
* @return {?}
*/
info(content, options) {
return this.createMessage({ type: 'info', content }, options);
}
/**
* @param {?} content
* @param {?=} options
* @return {?}
*/
warning(content, options) {
return this.createMessage({ type: 'warning', content }, options);
}
/**
* @param {?} content
* @param {?=} options
* @return {?}
*/
loading(content, options) {
return this.createMessage({ type: 'loading', content }, options);
}
/**
* @param {?} type
* @param {?} content
* @param {?=} options
* @return {?}
*/
create(type, content, options) {
return this.createMessage({ type, content }, options);
}
}
NzMessageService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzMessageService$$1.ctorParameters = () => [
{ type: Overlay },
{ type: Injector },
{ type: ComponentFactoryResolver },
{ type: ApplicationRef }
];
/** @nocollapse */ NzMessageService$$1.ngInjectableDef = defineInjectable({ factory: function NzMessageService_Factory() { return new NzMessageService$$1(inject(Overlay), inject(INJECTOR), inject(ComponentFactoryResolver), inject(ApplicationRef)); }, token: NzMessageService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMessageModule {
}
NzMessageModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, NzIconModule],
declarations: [NzMessageContainerComponent, NzMessageComponent],
providers: [NZ_MESSAGE_DEFAULT_CONFIG_PROVIDER, NzMessageService$$1],
entryComponents: [NzMessageContainerComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class CssUnitPipe {
/**
* @param {?} value
* @param {?=} defaultUnit
* @return {?}
*/
transform(value, defaultUnit = 'px') {
/** @type {?} */
const formatted = +value;
return isNaN(formatted) ? `${value}` : `${formatted}${defaultUnit}`;
}
}
CssUnitPipe.decorators = [
{ type: Pipe, args: [{
name: 'toCssUnit'
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzModalControlService {
/**
* @param {?} parentService
*/
constructor(parentService) {
this.parentService = parentService;
this.rootOpenModals = this.parentService ? null : [];
this.rootAfterAllClose = this.parentService ? null : new Subject();
this.rootRegisteredMetaMap = this.parentService ? null : new Map();
}
// Track singleton afterAllClose through over the injection tree
/**
* @return {?}
*/
get afterAllClose() {
return this.parentService ? this.parentService.afterAllClose : this.rootAfterAllClose;
}
// Track singleton openModals array through over the injection tree
/**
* @return {?}
*/
get openModals() {
return this.parentService ? this.parentService.openModals : this.rootOpenModals;
}
/**
* @private
* @return {?}
*/
get registeredMetaMap() {
return this.parentService ? this.parentService.registeredMetaMap : this.rootRegisteredMetaMap;
}
// Register a modal to listen its open/close
/**
* @param {?} modalRef
* @return {?}
*/
registerModal(modalRef) {
if (!this.hasRegistered(modalRef)) {
/** @type {?} */
const afterOpenSubscription = modalRef.afterOpen.subscribe((/**
* @return {?}
*/
() => this.openModals.push(modalRef)));
/** @type {?} */
const afterCloseSubscription = modalRef.afterClose.subscribe((/**
* @return {?}
*/
() => this.removeOpenModal(modalRef)));
this.registeredMetaMap.set(modalRef, { modalRef, afterOpenSubscription, afterCloseSubscription });
}
}
// deregister modals
/**
* @param {?} modalRef
* @return {?}
*/
deregisterModal(modalRef) {
/** @type {?} */
const registeredMeta = this.registeredMetaMap.get(modalRef);
if (registeredMeta) {
// Remove this modal if it is still in the opened modal list (NOTE: it may trigger "afterAllClose")
this.removeOpenModal(registeredMeta.modalRef);
registeredMeta.afterOpenSubscription.unsubscribe();
registeredMeta.afterCloseSubscription.unsubscribe();
this.registeredMetaMap.delete(modalRef);
}
}
/**
* @param {?} modalRef
* @return {?}
*/
hasRegistered(modalRef) {
return this.registeredMetaMap.has(modalRef);
}
// Close all registered opened modals
/**
* @return {?}
*/
closeAll() {
/** @type {?} */
let i = this.openModals.length;
while (i--) {
this.openModals[i].close();
}
}
/**
* @private
* @param {?} modalRef
* @return {?}
*/
removeOpenModal(modalRef) {
/** @type {?} */
const index = this.openModals.indexOf(modalRef);
if (index > -1) {
this.openModals.splice(index, 1);
if (!this.openModals.length) {
this.afterAllClose.next();
}
}
}
}
NzModalControlService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzModalControlService.ctorParameters = () => [
{ type: NzModalControlService, decorators: [{ type: Optional }, { type: SkipSelf }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// tslint:disable-next-line:no-any
/**
* @param {?} obj
* @return {?}
*/
function isPromise(obj) {
return !!obj && typeof obj.then === 'function' && typeof obj.catch === 'function';
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class ModalUtil {
/**
* @param {?} document
*/
constructor(document) {
this.document = document;
this.lastPosition = null;
this.listenDocumentClick();
}
/**
* @return {?}
*/
getLastClickPosition() {
return this.lastPosition;
}
/**
* @return {?}
*/
listenDocumentClick() {
this.document.addEventListener('click', (/**
* @param {?} event
* @return {?}
*/
(event) => {
this.lastPosition = { x: event.clientX, y: event.clientY };
}));
}
}
var ModalUtil$1 = new ModalUtil(document);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_MODAL_DEFAULT_CONFIG = {
autoBodyPadding: true
};
/** @type {?} */
const NZ_MODAL_CONFIG = new InjectionToken('NzModalConfig', {
providedIn: 'root',
factory: (/**
* @return {?}
*/
() => NZ_MODAL_DEFAULT_CONFIG) // Default config
});
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* API class that public to users to handle the modal instance.
* NzModalRef is aim to avoid accessing to the modal instance directly by users.
* @abstract
* @template T, R
*/
class NzModalRef {
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const MODAL_ANIMATE_DURATION = 200;
/**
* @template T, R
*/
// tslint:disable-next-line:no-any
class NzModalComponent extends NzModalRef {
/**
* @param {?} overlay
* @param {?} i18n
* @param {?} cfr
* @param {?} elementRef
* @param {?} viewContainer
* @param {?} modalControl
* @param {?} focusTrapFactory
* @param {?} cdr
* @param {?} config
* @param {?} document
*/
constructor(overlay, i18n, cfr, elementRef, viewContainer, modalControl, focusTrapFactory, cdr, config, document) {
super();
this.overlay = overlay;
this.i18n = i18n;
this.cfr = cfr;
this.elementRef = elementRef;
this.viewContainer = viewContainer;
this.modalControl = modalControl;
this.focusTrapFactory = focusTrapFactory;
this.cdr = cdr;
this.config = config;
this.document = document;
this.nzVisible = false;
this.nzClosable = true;
this.nzMask = true;
this.nzMaskClosable = true;
this.nzOkLoading = false;
this.nzOkDisabled = false;
this.nzCancelDisabled = false;
this.nzCancelLoading = false;
this.nzKeyboard = true;
this.nzNoAnimation = false;
// [STATIC] Default Modal ONLY
this.nzGetContainer = (/**
* @return {?}
*/
() => this.overlay.create()); // [STATIC]
// [STATIC]
this.nzZIndex = 1000;
this.nzWidth = 520;
this.nzOkType = 'primary';
this.nzIconType = 'question-circle'; // Confirm Modal ONLY
// Confirm Modal ONLY
this.nzModalType = 'default';
this.nzOnOk = new EventEmitter();
this.nzOnCancel = new EventEmitter();
this.nzAfterOpen = new EventEmitter(); // Trigger when modal open(visible) after animations
// Trigger when modal open(visible) after animations
this.nzAfterClose = new EventEmitter(); // Trigger when modal leave-animation over
// Trigger when modal leave-animation over
this.nzVisibleChange = new EventEmitter();
// Indicate whether this dialog should hidden
this.locale = {};
this.transformOrigin = '0px 0px 0px'; // The origin point that animation based on
this.unsubscribe$ = new Subject();
this.config = this.mergeDefaultConfig(this.config);
this.scrollStrategy = this.overlay.scrollStrategies.block();
}
// Only aim to focus the ok button that needs to be auto focused
/**
* @return {?}
*/
get afterOpen() {
return this.nzAfterOpen.asObservable();
}
/**
* @return {?}
*/
get afterClose() {
return this.nzAfterClose.asObservable();
}
/**
* @return {?}
*/
get cancelText() {
return this.nzCancelText || this.locale.cancelText;
}
/**
* @return {?}
*/
get okText() {
return this.nzOkText || this.locale.okText;
}
/**
* @return {?}
*/
get hidden() {
return !this.nzVisible && !this.animationState;
} // Indicate whether this dialog should hidden
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.unsubscribe$)).subscribe((/**
* @return {?}
*/
() => {
this.locale = (/** @type {?} */ (this.i18n.getLocaleData('Modal')));
}));
fromEvent(this.document.body, 'keydown').pipe(takeUntil(this.unsubscribe$)).subscribe((/**
* @param {?} e
* @return {?}
*/
e => this.keydownListener(e)));
if (this.isComponent(this.nzContent)) {
this.createDynamicComponent((/** @type {?} */ (this.nzContent))); // Create component along without View
}
if (this.isModalButtons(this.nzFooter)) { // Setup default button options
this.nzFooter = this.formatModalButtons((/** @type {?} */ (this.nzFooter)));
}
// Place the modal dom to elsewhere
this.container = typeof this.nzGetContainer === 'function' ? this.nzGetContainer() : this.nzGetContainer;
if (this.container instanceof HTMLElement) {
this.container.appendChild(this.elementRef.nativeElement);
}
else if (this.container instanceof OverlayRef) { // NOTE: only attach the dom to overlay, the view container is not changed actually
this.container.overlayElement.appendChild(this.elementRef.nativeElement);
}
// Register modal when afterOpen/afterClose is stable
this.modalControl.registerModal(this);
}
// [NOTE] NOT available when using by service!
// Because ngOnChanges never be called when using by service,
// here we can't support "nzContent"(Component) etc. as inputs that initialized dynamically.
// BUT: User also can change "nzContent" dynamically to trigger UI changes (provided you don't use Component that needs initializations)
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzVisible) {
this.handleVisibleStateChange(this.nzVisible, !changes.nzVisible.firstChange); // Do not trigger animation while initializing
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
// If using Component, it is the time to attach View while bodyContainer is ready
if (this.contentComponentRef) {
this.bodyContainer.insert(this.contentComponentRef.hostView);
}
if (this.autoFocusButtonOk) {
((/** @type {?} */ (this.autoFocusButtonOk.nativeElement))).focus();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
// Close self before destructing
this.changeVisibleFromInside(false).then((/**
* @return {?}
*/
() => {
this.modalControl.deregisterModal(this);
if (this.container instanceof OverlayRef) {
this.container.dispose();
}
this.unsubscribe$.next();
this.unsubscribe$.complete();
}));
}
/**
* @param {?} event
* @return {?}
*/
keydownListener(event) {
if (event.keyCode === ESCAPE && this.nzKeyboard) {
this.onClickOkCancel('cancel');
}
}
/**
* @return {?}
*/
open() {
this.changeVisibleFromInside(true);
}
/**
* @param {?=} result
* @return {?}
*/
close(result) {
this.changeVisibleFromInside(false, result);
}
/**
* @param {?=} result
* @return {?}
*/
destroy(result) {
this.close(result);
}
/**
* @return {?}
*/
triggerOk() {
this.onClickOkCancel('ok');
}
/**
* @return {?}
*/
triggerCancel() {
this.onClickOkCancel('cancel');
}
/**
* @return {?}
*/
getInstance() {
return this;
}
/**
* @return {?}
*/
getContentComponentRef() {
return this.contentComponentRef;
}
/**
* @return {?}
*/
getContentComponent() {
return this.contentComponentRef && this.contentComponentRef.instance;
}
/**
* @return {?}
*/
getElement() {
return this.elementRef && this.elementRef.nativeElement;
}
/**
* @param {?} $event
* @return {?}
*/
onClickMask($event) {
if (this.nzMask &&
this.nzMaskClosable &&
((/** @type {?} */ ($event.target))).classList.contains('ant-modal-wrap') &&
this.nzVisible) {
this.onClickOkCancel('cancel');
}
}
/**
* @param {?} type
* @return {?}
*/
isModalType(type) {
return this.nzModalType === type;
}
/**
* @return {?}
*/
onClickCloseBtn() {
if (this.nzVisible) {
this.onClickOkCancel('cancel');
}
}
/**
* @param {?} type
* @return {?}
*/
onClickOkCancel(type) {
/** @type {?} */
const trigger$$1 = { 'ok': this.nzOnOk, 'cancel': this.nzOnCancel }[type];
/** @type {?} */
const loadingKey = { 'ok': 'nzOkLoading', 'cancel': 'nzCancelLoading' }[type];
if (trigger$$1 instanceof EventEmitter) {
trigger$$1.emit(this.getContentComponent());
}
else if (typeof trigger$$1 === 'function') {
/** @type {?} */
const result = trigger$$1(this.getContentComponent());
/** @type {?} */
const caseClose = (/**
* @param {?} doClose
* @return {?}
*/
(doClose) => (doClose !== false) && this.close((/** @type {?} */ (doClose))));
if (isPromise(result)) {
this[loadingKey] = true;
/** @type {?} */
const handleThen = (/**
* @param {?} doClose
* @return {?}
*/
(doClose) => {
this[loadingKey] = false;
caseClose(doClose);
});
((/** @type {?} */ (result))).then(handleThen).catch(handleThen);
}
else {
caseClose(result);
}
}
}
/**
* @param {?} value
* @return {?}
*/
isNonEmptyString(value) {
return typeof value === 'string' && value !== '';
}
/**
* @param {?} value
* @return {?}
*/
isTemplateRef(value) {
return value instanceof TemplateRef;
}
/**
* @param {?} value
* @return {?}
*/
isComponent(value) {
return value instanceof Type;
}
/**
* @param {?} value
* @return {?}
*/
isModalButtons(value) {
return Array.isArray(value) && value.length > 0;
}
// Do rest things when visible state changed
/**
* @private
* @param {?} visible
* @param {?=} animation
* @param {?=} closeResult
* @return {?}
*/
handleVisibleStateChange(visible, animation = true, closeResult) {
if (visible) { // Hide scrollbar at the first time when shown up
this.scrollStrategy.enable();
this.savePreviouslyFocusedElement();
this.trapFocus();
}
return Promise
.resolve(animation && this.animateTo(visible))
.then((/**
* @return {?}
*/
() => {
if (visible) {
this.nzAfterOpen.emit();
}
else {
this.nzAfterClose.emit(closeResult);
this.restoreFocus();
this.scrollStrategy.disable();
// Mark the for check so it can react if the view container is using OnPush change detection.
this.cdr.markForCheck();
}
}));
}
// Lookup a button's property, if the prop is a function, call & then return the result, otherwise, return itself.
/**
* @param {?} options
* @param {?} prop
* @return {?}
*/
getButtonCallableProp(options, prop) {
/** @type {?} */
const value = options[prop];
/** @type {?} */
const args = [];
if (this.contentComponentRef) {
args.push(this.contentComponentRef.instance);
}
return typeof value === 'function' ? value.apply(options, args) : value;
}
// On nzFooter's modal button click
/**
* @param {?} button
* @return {?}
*/
onButtonClick(button) {
/** @type {?} */
const result = this.getButtonCallableProp(button, 'onClick');
if (isPromise(result)) {
button.loading = true;
((/** @type {?} */ (result))).then((/**
* @return {?}
*/
() => button.loading = false)).catch((/**
* @return {?}
*/
() => button.loading = false));
}
}
// Change nzVisible from inside
/**
* @private
* @param {?} visible
* @param {?=} closeResult
* @return {?}
*/
changeVisibleFromInside(visible, closeResult) {
if (this.nzVisible !== visible) {
// Change nzVisible value immediately
this.nzVisible = visible;
this.nzVisibleChange.emit(visible);
return this.handleVisibleStateChange(visible, true, closeResult);
}
return Promise.resolve();
}
/**
* @private
* @param {?} state
* @return {?}
*/
changeAnimationState(state$$1) {
this.animationState = state$$1;
if (state$$1) {
this.maskAnimationClassMap = {
[`fade-${state$$1}`]: true,
[`fade-${state$$1}-active`]: true
};
this.modalAnimationClassMap = {
[`zoom-${state$$1}`]: true,
[`zoom-${state$$1}-active`]: true
};
}
else {
this.maskAnimationClassMap = this.modalAnimationClassMap = null;
}
}
/**
* @private
* @param {?} isVisible
* @return {?}
*/
animateTo(isVisible) {
if (isVisible) { // Figure out the lastest click position when shows up
setTimeout((/**
* @return {?}
*/
() => this.updateTransformOrigin())); // [NOTE] Using timeout due to the document.click event is fired later than visible change, so if not postponed to next event-loop, we can't get the lastest click position
}
this.changeAnimationState(isVisible ? 'enter' : 'leave');
return new Promise((/**
* @param {?} resolve
* @return {?}
*/
(resolve) => setTimeout((/**
* @return {?}
*/
() => {
this.changeAnimationState(null);
resolve();
}), this.nzNoAnimation ? 0 : MODAL_ANIMATE_DURATION)));
}
/**
* @private
* @param {?} buttons
* @return {?}
*/
formatModalButtons(buttons) {
return buttons.map((/**
* @param {?} button
* @return {?}
*/
(button) => {
return Object.assign({
type: 'default',
size: 'default',
autoLoading: true,
show: true,
loading: false,
disabled: false
}, button);
}));
}
/**
* Create a component dynamically but not attach to any View (this action will be executed when bodyContainer is ready)
* @private
* @param {?} component Component class
* @return {?}
*/
createDynamicComponent(component) {
/** @type {?} */
const factory = this.cfr.resolveComponentFactory(component);
/** @type {?} */
const childInjector = Injector.create({
providers: [{ provide: NzModalRef, useValue: this }],
parent: this.viewContainer.parentInjector
});
this.contentComponentRef = factory.create(childInjector);
if (this.nzComponentParams) {
Object.assign(this.contentComponentRef.instance, this.nzComponentParams);
}
// Do the first change detection immediately (or we do detection at ngAfterViewInit, multi-changes error will be thrown)
this.contentComponentRef.changeDetectorRef.detectChanges();
}
// Update transform-origin to the last click position on document
/**
* @private
* @return {?}
*/
updateTransformOrigin() {
/** @type {?} */
const modalElement = (/** @type {?} */ (this.modalContainer.nativeElement));
/** @type {?} */
const lastPosition = ModalUtil$1.getLastClickPosition();
if (lastPosition) {
this.transformOrigin = `${lastPosition.x - modalElement.offsetLeft}px ${lastPosition.y - modalElement.offsetTop}px 0px`;
}
}
/**
* @private
* @param {?} config
* @return {?}
*/
mergeDefaultConfig(config) {
return Object.assign({}, NZ_MODAL_DEFAULT_CONFIG, config);
}
/**
* @private
* @return {?}
*/
savePreviouslyFocusedElement() {
if (this.document) {
this.previouslyFocusedElement = (/** @type {?} */ (this.document.activeElement));
}
}
/**
* @private
* @return {?}
*/
trapFocus() {
if (!this.focusTrap) {
this.focusTrap = this.focusTrapFactory.create(this.elementRef.nativeElement);
}
this.focusTrap.focusInitialElementWhenReady();
}
/**
* @private
* @return {?}
*/
restoreFocus() {
// We need the extra check, because IE can set the `activeElement` to null in some cases.
if (this.previouslyFocusedElement && typeof this.previouslyFocusedElement.focus === 'function') {
this.previouslyFocusedElement.focus();
}
if (this.focusTrap) {
this.focusTrap.destroy();
}
}
}
NzModalComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-modal',
template: "<ng-template #tplOriginContent><ng-content></ng-content></ng-template> <!-- Compatible: the <ng-content> can appear only once -->\n\n<div [nzNoAnimation]=\"nzNoAnimation\">\n <div *ngIf=\"nzMask\"\n class=\"ant-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.ant-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"nzMaskStyle\"\n [style.zIndex]=\"nzZIndex\"\n ></div>\n <div\n (click)=\"onClickMask($event)\"\n class=\"ant-modal-wrap {{ nzWrapClassName }}\"\n [style.zIndex]=\"nzZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\"\n role=\"dialog\"\n >\n <div #modalContainer\n class=\"ant-modal {{ nzClassName }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"nzStyle\"\n [style.width]=\"nzWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\"\n role=\"document\"\n >\n <div class=\"ant-modal-content\">\n <button *ngIf=\"nzClosable\" (click)=\"onClickCloseBtn()\" class=\"ant-modal-close\" aria-label=\"Close\">\n <span class=\"ant-modal-close-x\">\n <i nz-icon type=\"close\" class=\"ant-modal-close-icon\"></i>\n </span>\n </button>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\" [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\" [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n </ng-container>\n </div>\n </div>\n <div tabindex=\"0\" style=\"width: 0px; height: 0px; overflow: hidden;\">sentinel</div>\n </div>\n</div>\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"nzTitle\" class=\"ant-modal-header\">\n <div class=\"ant-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(nzTitle)\" [ngTemplateOutlet]=\"nzTitle\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(nzTitle)\"><div [innerHTML]=\"nzTitle\"></div></ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"ant-modal-body\" [ngStyle]=\"nzBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(nzContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(nzContent)\" [ngTemplateOutlet]=\"nzContent\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(nzContent)\"><div [innerHTML]=\"nzContent\"></div></ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"nzFooter !== null\" class=\"ant-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(nzFooter)\" [ngTemplateOutlet]=\"nzFooter\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(nzFooter)\"><div [innerHTML]=\"nzFooter\"></div></ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(nzFooter)\">\n <button *ngFor=\"let button of nzFooter\" nz-button\n (click)=\"onButtonClick(button)\"\n [hidden]=\"!getButtonCallableProp(button, 'show')\"\n [nzLoading]=\"getButtonCallableProp(button, 'loading')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [nzType]=\"button.type\"\n [nzShape]=\"button.shape\"\n [nzSize]=\"button.size\"\n [nzGhost]=\"button.ghost\"\n >{{ button.label }}</button>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button *ngIf=\"nzCancelText!==null\" nz-button (click)=\"onClickOkCancel('cancel')\" [nzLoading]=\"nzCancelLoading\" [disabled]=\"nzCancelDisabled\">\n {{ cancelText }}\n </button>\n <button *ngIf=\"nzOkText!==null\" nz-button [nzType]=\"nzOkType\" (click)=\"onClickOkCancel('ok')\" [nzLoading]=\"nzOkLoading\" [disabled]=\"nzOkDisabled\">\n {{ okText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"ant-modal-body\" [ngStyle]=\"nzBodyStyle\">\n <div class=\"ant-modal-confirm-body-wrapper\">\n <div class=\"ant-modal-confirm-body\">\n <i nz-icon [type]=\"nzIconType\"></i>\n <span class=\"ant-modal-confirm-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(nzTitle)\" [ngTemplateOutlet]=\"nzTitle\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(nzTitle)\"><span [innerHTML]=\"nzTitle\"></span></ng-container>\n </ng-container>\n </span>\n <div class=\"ant-modal-confirm-content\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(nzContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(nzContent)\" [ngTemplateOutlet]=\"nzContent\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(nzContent)\"><div [innerHTML]=\"nzContent\"></div></ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"ant-modal-confirm-btns\">\n <button nz-button *ngIf=\"nzCancelText!==null\" (click)=\"onClickOkCancel('cancel')\" [nzLoading]=\"nzCancelLoading\">\n {{ cancelText }}\n </button>\n <button *ngIf=\"nzOkText!==null\" #autoFocusButtonOk nz-button [nzType]=\"nzOkType\" (click)=\"onClickOkCancel('ok')\" [nzLoading]=\"nzOkLoading\">\n {{ okText }}\n </button>\n </div>\n </div> <!-- /.ant-modal-confirm-body-wrapper -->\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n",
// Using OnPush for modal caused footer can not to detect changes. we can fix it when 8.x.
changeDetection: ChangeDetectionStrategy.Default
}] }
];
/** @nocollapse */
NzModalComponent.ctorParameters = () => [
{ type: Overlay },
{ type: NzI18nService$$1 },
{ type: ComponentFactoryResolver },
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: NzModalControlService },
{ type: FocusTrapFactory },
{ type: ChangeDetectorRef },
{ type: undefined, decorators: [{ type: Inject, args: [NZ_MODAL_CONFIG,] }] },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
NzModalComponent.propDecorators = {
nzVisible: [{ type: Input }],
nzClosable: [{ type: Input }],
nzMask: [{ type: Input }],
nzMaskClosable: [{ type: Input }],
nzOkLoading: [{ type: Input }],
nzOkDisabled: [{ type: Input }],
nzCancelDisabled: [{ type: Input }],
nzCancelLoading: [{ type: Input }],
nzKeyboard: [{ type: Input }],
nzNoAnimation: [{ type: Input }],
nzContent: [{ type: Input }],
nzComponentParams: [{ type: Input }],
nzFooter: [{ type: Input }],
nzGetContainer: [{ type: Input }],
nzZIndex: [{ type: Input }],
nzWidth: [{ type: Input }],
nzWrapClassName: [{ type: Input }],
nzClassName: [{ type: Input }],
nzStyle: [{ type: Input }],
nzTitle: [{ type: Input }],
nzMaskStyle: [{ type: Input }],
nzBodyStyle: [{ type: Input }],
nzOkText: [{ type: Input }],
nzCancelText: [{ type: Input }],
nzOkType: [{ type: Input }],
nzIconType: [{ type: Input }],
nzModalType: [{ type: Input }],
nzOnOk: [{ type: Input }, { type: Output }],
nzOnCancel: [{ type: Input }, { type: Output }],
nzAfterOpen: [{ type: Output }],
nzAfterClose: [{ type: Output }],
nzVisibleChange: [{ type: Output }],
modalContainer: [{ type: ViewChild, args: ['modalContainer',] }],
bodyContainer: [{ type: ViewChild, args: ['bodyContainer', { read: ViewContainerRef },] }],
autoFocusButtonOk: [{ type: ViewChild, args: ['autoFocusButtonOk', { read: ElementRef },] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzVisible", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzClosable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzMask", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzMaskClosable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzOkLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzOkDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzCancelDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzCancelLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzModalComponent.prototype, "nzKeyboard", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzModalComponent.prototype, "nzNoAnimation", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// A builder used for managing service creating modals
class ModalBuilderForService {
/**
* @param {?} overlay
* @param {?=} options
*/
constructor(overlay, options = {}) {
this.overlay = overlay;
this.createModal();
if (!('nzGetContainer' in options)) { // As we use CDK to create modal in service by force, there is no need to use nzGetContainer
options.nzGetContainer = null; // Override nzGetContainer's default value to prevent creating another overlay
}
this.changeProps(options);
this.modalRef.instance.open();
this.modalRef.instance.nzAfterClose.subscribe((/**
* @return {?}
*/
() => this.destroyModal())); // [NOTE] By default, close equals destroy when using as Service
}
/**
* @return {?}
*/
getInstance() {
return this.modalRef && this.modalRef.instance;
}
/**
* @return {?}
*/
destroyModal() {
if (this.modalRef) {
this.overlayRef.dispose();
this.modalRef = null;
}
}
/**
* @private
* @param {?} options
* @return {?}
*/
changeProps(options) {
if (this.modalRef) {
Object.assign(this.modalRef.instance, options); // DANGER: here not limit user's inputs at runtime
}
}
// Create component to ApplicationRef
/**
* @private
* @return {?}
*/
createModal() {
this.overlayRef = this.overlay.create();
this.modalRef = this.overlayRef.attach(new ComponentPortal(NzModalComponent));
}
}
class NzModalService {
/**
* @param {?} overlay
* @param {?} logger
* @param {?} modalControl
*/
constructor(overlay, logger, modalControl) {
this.overlay = overlay;
this.logger = logger;
this.modalControl = modalControl;
}
// Track of the current close modals (we assume invisible is close this time)
/**
* @return {?}
*/
get openModals() {
return this.modalControl.openModals;
}
/**
* @return {?}
*/
get afterAllClose() {
return this.modalControl.afterAllClose.asObservable();
}
// Closes all of the currently-open dialogs
/**
* @return {?}
*/
closeAll() {
this.modalControl.closeAll();
}
/**
* @template T
* @param {?=} options
* @return {?}
*/
create(options = {}) {
if (typeof options.nzOnCancel !== 'function') {
options.nzOnCancel = (/**
* @return {?}
*/
() => {
}); // Leave a empty function to close this modal by default
}
/** @type {?} */
const modalRef = new ModalBuilderForService(this.overlay, options).getInstance();
return modalRef;
}
/**
* @template T
* @param {?=} options
* @param {?=} confirmType
* @return {?}
*/
confirm(options = {}, confirmType = 'confirm') {
if ('nzFooter' in options) {
this.logger.warn(`The Confirm-Modal doesn't support "nzFooter", this property will be ignored.`);
}
if (!('nzWidth' in options)) {
options.nzWidth = 416;
}
if (typeof options.nzOnOk !== 'function') { // NOTE: only support function currently by calling confirm()
options.nzOnOk = (/**
* @return {?}
*/
() => {
}); // Leave a empty function to close this modal by default
}
options.nzModalType = 'confirm';
options.nzClassName = `ant-modal-confirm ant-modal-confirm-${confirmType} ${options.nzClassName || ''}`;
options.nzMaskClosable = false;
return this.create(options);
}
/**
* @template T
* @param {?=} options
* @return {?}
*/
info(options = {}) {
return this.simpleConfirm(options, 'info');
}
/**
* @template T
* @param {?=} options
* @return {?}
*/
success(options = {}) {
return this.simpleConfirm(options, 'success');
}
/**
* @template T
* @param {?=} options
* @return {?}
*/
error(options = {}) {
return this.simpleConfirm(options, 'error');
}
/**
* @template T
* @param {?=} options
* @return {?}
*/
warning(options = {}) {
return this.simpleConfirm(options, 'warning');
}
/**
* @private
* @template T
* @param {?=} options
* @param {?=} confirmType
* @return {?}
*/
simpleConfirm(options = {}, confirmType) {
if (!('nzIconType' in options)) {
options.nzIconType = {
'info': 'info-circle',
'success': 'check-circle',
'error': 'close-circle',
'warning': 'exclamation-circle'
}[confirmType];
}
if (!('nzCancelText' in options)) { // Remove the Cancel button if the user not specify a Cancel button
options.nzCancelText = null;
}
return this.confirm(options, confirmType);
}
}
NzModalService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzModalService.ctorParameters = () => [
{ type: Overlay },
{ type: LoggerService },
{ type: NzModalControlService }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzModalModule {
}
NzModalModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, NzI18nModule, NzButtonModule, LoggerModule, NzIconModule, NzNoAnimationModule],
exports: [NzModalComponent],
declarations: [NzModalComponent, CssUnitPipe],
entryComponents: [NzModalComponent],
providers: [NzModalControlService, NzModalService]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const NZ_NOTIFICATION_DEFAULT_CONFIG = new InjectionToken('NZ_NOTIFICATION_DEFAULT_CONFIG');
/** @type {?} */
const NZ_NOTIFICATION_CONFIG = new InjectionToken('NZ_NOTIFICATION_CONFIG');
/** @type {?} */
const NZ_NOTIFICATION_DEFAULT_CONFIG_PROVIDER = {
provide: NZ_NOTIFICATION_DEFAULT_CONFIG,
useValue: {
nzTop: '24px',
nzBottom: '24px',
nzPlacement: 'topRight',
nzDuration: 4500,
nzMaxStack: 7,
nzPauseOnHover: true,
nzAnimate: true
}
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzNotificationContainerComponent extends NzMessageContainerComponent {
/**
* @param {?} cdr
* @param {?} defaultConfig
* @param {?} config
*/
constructor(cdr, defaultConfig, config) {
super(cdr, defaultConfig, config);
/**
* A list of notifications displayed on the screen.
* @override
*/
this.messages = [];
}
/**
* Create a new notification.
* If there's a notification whose `nzKey` is same with `nzKey` in `NzNotificationDataFilled`, replace its content instead of create a new one.
* @override
* @param {?} notification
* @return {?}
*/
createMessage(notification) {
notification.options = this._mergeMessageOptions(notification.options);
notification.onClose = new Subject();
/** @type {?} */
const key = notification.options.nzKey;
/** @type {?} */
const notificationWithSameKey = this.messages.find((/**
* @param {?} msg
* @return {?}
*/
msg => msg.options.nzKey === notification.options.nzKey));
if (key && notificationWithSameKey) {
this.replaceNotification(notificationWithSameKey, notification);
}
else {
if (this.messages.length >= this.config.nzMaxStack) {
this.messages.splice(0, 1);
}
this.messages.push(notification);
}
this.cdr.detectChanges();
}
/**
* @private
* @param {?} old
* @param {?} _new
* @return {?}
*/
replaceNotification(old, _new) {
old.title = _new.title;
old.content = _new.content;
old.template = _new.template;
old.type = _new.type;
}
}
NzNotificationContainerComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-notification-container',
preserveWhitespaces: false,
template: "<div\n class=\"ant-notification ant-notification-{{config.nzPlacement}}\"\n [style.top]=\"(config.nzPlacement==='topLeft'||config.nzPlacement=='topRight')? config.nzTop:null\"\n [style.bottom]=\"(config.nzPlacement==='bottomLeft'||config.nzPlacement=='bottomRight')? config.nzBottom:null\"\n [style.right]=\"(config.nzPlacement==='bottomRight'||config.nzPlacement=='topRight')?'0px':null\"\n [style.left]=\"(config.nzPlacement==='topLeft'||config.nzPlacement=='bottomLeft')?'0px':null\">\n <nz-notification *ngFor=\"let message of messages; let i = index\" [nzMessage]=\"message\" [nzIndex]=\"i\"></nz-notification>\n</div>"
}] }
];
/** @nocollapse */
NzNotificationContainerComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_NOTIFICATION_DEFAULT_CONFIG,] }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_NOTIFICATION_CONFIG,] }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const notificationMotion = trigger('notificationMotion', [
state('enterRight', style({ opacity: 1, transform: 'translateX(0)' })),
transition('* => enterRight', [
style({ opacity: 0, transform: 'translateX(5%)' }),
animate('100ms linear')
]),
state('enterLeft', style({ opacity: 1, transform: 'translateX(0)' })),
transition('* => enterLeft', [
style({ opacity: 0, transform: 'translateX(-5%)' }),
animate('100ms linear')
]),
state('leave', style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
})),
transition('* => leave', [
style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 0%'
}),
animate('100ms linear')
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzNotificationComponent extends NzMessageComponent {
/**
* @param {?} container
* @param {?} cdr
*/
constructor(container, cdr) {
super(container, cdr);
this.container = container;
this.cdr = cdr;
}
/**
* @return {?}
*/
close() {
this._destroy(true);
}
/**
* @return {?}
*/
get state() {
if (this.nzMessage.state === 'enter') {
if ((this.container.config.nzPlacement === 'topLeft') || (this.container.config.nzPlacement === 'bottomLeft')) {
return 'enterLeft';
}
else {
return 'enterRight';
}
}
else {
return this.nzMessage.state;
}
}
}
NzNotificationComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
selector: 'nz-notification',
preserveWhitespaces: false,
animations: [notificationMotion],
template: "<div class=\"ant-notification-notice ant-notification-notice-closable\"\n [ngStyle]=\"nzMessage.options.nzStyle\"\n [ngClass]=\"nzMessage.options.nzClass\"\n [@notificationMotion]=\"state\"\n (mouseenter)=\"onEnter()\"\n (mouseleave)=\"onLeave()\">\n <div *ngIf=\"!nzMessage.template\" class=\"ant-notification-notice-content\">\n <div class=\"ant-notification-notice-content\" [ngClass]=\"{ 'ant-notification-notice-with-icon': nzMessage.type !== 'blank' }\">\n <div [class.ant-notification-notice-with-icon]=\"nzMessage.type !== 'blank'\">\n <ng-container [ngSwitch]=\"nzMessage.type\">\n <i *ngSwitchCase=\"'success'\" nz-icon type=\"check-circle\" class=\"ant-notification-notice-icon ant-notification-notice-icon-success\"></i>\n <i *ngSwitchCase=\"'info'\" nz-icon type=\"info-circle\" class=\"ant-notification-notice-icon ant-notification-notice-icon-info\"></i>\n <i *ngSwitchCase=\"'warning'\" nz-icon type=\"exclamation-circle\" class=\"ant-notification-notice-icon ant-notification-notice-icon-warning\"></i>\n <i *ngSwitchCase=\"'error'\" nz-icon type=\"close-circle\" class=\"ant-notification-notice-icon ant-notification-notice-icon-error\"></i>\n </ng-container>\n <div class=\"ant-notification-notice-message\" [innerHTML]=\"nzMessage.title\"></div>\n <div class=\"ant-notification-notice-description\" [innerHTML]=\"nzMessage.content\"></div>\n </div>\n </div>\n </div>\n <ng-template\n [ngIf]=\"nzMessage.template\"\n [ngTemplateOutlet]=\"nzMessage.template\"\n [ngTemplateOutletContext]=\"{ $implicit: this, data: nzMessage.options?.nzData }\">\n </ng-template>\n <a tabindex=\"0\" class=\"ant-notification-notice-close\" (click)=\"close()\">\n <span class=\"ant-notification-notice-close-x\">\n <i nz-icon type=\"close\" class=\"ant-notification-close-icon\"></i>\n </span>\n </a>\n</div>"
}] }
];
/** @nocollapse */
NzNotificationComponent.ctorParameters = () => [
{ type: NzNotificationContainerComponent },
{ type: ChangeDetectorRef }
];
NzNotificationComponent.propDecorators = {
nzMessage: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzNotificationService$$1 extends NzMessageBaseService$$1 {
/**
* @param {?} overlay
* @param {?} injector
* @param {?} cfr
* @param {?} appRef
*/
constructor(overlay, injector, cfr, appRef) {
super(overlay, NzNotificationContainerComponent, injector, cfr, appRef, 'notification-');
}
// Shortcut methods
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
success(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'success', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
error(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'error', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
info(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'info', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
warning(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'warning', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
blank(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'blank', title, content }, options)));
}
/**
* @param {?} type
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
create(type, title, content, options) {
return (/** @type {?} */ (this.createMessage({ type, title, content }, options)));
}
// For content with template
/**
* @param {?} template
* @param {?=} options
* @return {?}
*/
template(template, options) {
return (/** @type {?} */ (this.createMessage({ template }, options)));
}
}
NzNotificationService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzNotificationService$$1.ctorParameters = () => [
{ type: Overlay },
{ type: Injector },
{ type: ComponentFactoryResolver },
{ type: ApplicationRef }
];
/** @nocollapse */ NzNotificationService$$1.ngInjectableDef = defineInjectable({ factory: function NzNotificationService_Factory() { return new NzNotificationService$$1(inject(Overlay), inject(INJECTOR), inject(ComponentFactoryResolver), inject(ApplicationRef)); }, token: NzNotificationService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzNotificationModule {
}
NzNotificationModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, NzIconModule],
declarations: [NzNotificationComponent, NzNotificationContainerComponent],
providers: [NZ_NOTIFICATION_DEFAULT_CONFIG_PROVIDER, NzNotificationService$$1],
entryComponents: [NzNotificationContainerComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPaginationComponent {
/**
* @param {?} i18n
* @param {?} cdr
*/
constructor(i18n, cdr) {
this.i18n = i18n;
this.cdr = cdr;
// tslint:disable-next-line:no-any
this.locale = {};
this.firstIndex = 1;
this.pages = [];
this.$destroy = new Subject();
this.nzPageSizeChange = new EventEmitter();
this.nzPageIndexChange = new EventEmitter();
this.nzInTable = false;
this.nzSize = 'default';
this.nzPageSizeOptions = [10, 20, 30, 40];
this.nzShowSizeChanger = false;
this.nzHideOnSinglePage = false;
this.nzShowQuickJumper = false;
this.nzSimple = false;
this.nzTotal = 0;
this.nzPageIndex = 1;
this.nzPageSize = 10;
}
/**
* @param {?} value
* @return {?}
*/
validatePageIndex(value) {
if (value > this.lastIndex) {
return this.lastIndex;
}
else if (value < this.firstIndex) {
return this.firstIndex;
}
else {
return value;
}
}
/**
* @param {?} page
* @return {?}
*/
updatePageIndexValue(page) {
this.nzPageIndex = page;
this.nzPageIndexChange.emit(this.nzPageIndex);
this.buildIndexes();
}
/**
* @param {?} value
* @return {?}
*/
isPageIndexValid(value) {
return this.validatePageIndex(value) === value;
}
/**
* @param {?} index
* @return {?}
*/
jumpPage(index) {
if (index !== this.nzPageIndex) {
/** @type {?} */
const pageIndex = this.validatePageIndex(index);
if (pageIndex !== this.nzPageIndex) {
this.updatePageIndexValue(pageIndex);
}
}
}
/**
* @param {?} diff
* @return {?}
*/
jumpDiff(diff) {
this.jumpPage(this.nzPageIndex + diff);
}
/**
* @param {?} $event
* @return {?}
*/
onPageSizeChange($event) {
this.nzPageSize = $event;
this.nzPageSizeChange.emit($event);
this.buildIndexes();
if (this.nzPageIndex > this.lastIndex) {
this.updatePageIndexValue(this.lastIndex);
}
}
/**
* @param {?} _
* @param {?} input
* @param {?} clearInputValue
* @return {?}
*/
handleKeyDown(_, input, clearInputValue) {
/** @type {?} */
const target = input;
/** @type {?} */
const page = toNumber(target.value, this.nzPageIndex);
if (isInteger(page) && this.isPageIndexValid(page) && page !== this.nzPageIndex) {
this.updatePageIndexValue(page);
}
if (clearInputValue) {
target.value = null;
}
else {
target.value = `${this.nzPageIndex}`;
}
}
/**
* generate indexes list
* @return {?}
*/
buildIndexes() {
/** @type {?} */
const pages = [];
if (this.lastIndex <= 9) {
for (let i = 2; i <= this.lastIndex - 1; i++) {
pages.push(i);
}
}
else {
/** @type {?} */
const current = +this.nzPageIndex;
/** @type {?} */
let left = Math.max(2, current - 2);
/** @type {?} */
let right = Math.min(current + 2, this.lastIndex - 1);
if (current - 1 <= 2) {
right = 5;
}
if (this.lastIndex - current <= 2) {
left = this.lastIndex - 4;
}
for (let i = left; i <= right; i++) {
pages.push(i);
}
}
this.pages = pages;
this.cdr.markForCheck();
}
/**
* @return {?}
*/
get lastIndex() {
return Math.ceil(this.nzTotal / this.nzPageSize);
}
/**
* @return {?}
*/
get isLastIndex() {
return this.nzPageIndex === this.lastIndex;
}
/**
* @return {?}
*/
get isFirstIndex() {
return this.nzPageIndex === this.firstIndex;
}
/**
* @return {?}
*/
get ranges() {
return [(this.nzPageIndex - 1) * this.nzPageSize + 1, Math.min(this.nzPageIndex * this.nzPageSize, this.nzTotal)];
}
/**
* @return {?}
*/
get showAddOption() {
return this.nzPageSizeOptions.indexOf(this.nzPageSize) === -1;
}
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.$destroy)).subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Pagination');
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.$destroy.next();
this.$destroy.complete();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzTotal || changes.nzPageSize || changes.nzPageIndex) {
this.buildIndexes();
}
}
}
NzPaginationComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-pagination',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template #renderItemTemplate let-type let-page=\"page\">\n <a class=\"ant-pagination-item-link\" *ngIf=\"type==='pre'\"><i nz-icon type=\"left\"></i></a>\n <a class=\"ant-pagination-item-link\" *ngIf=\"type==='next'\"><i nz-icon type=\"right\"></i></a>\n <a *ngIf=\"type=='page'\">{{ page }}</a>\n</ng-template>\n<ng-container *ngIf=\"nzHideOnSinglePage && (nzTotal > nzPageSize) || !nzHideOnSinglePage\">\n <ul class=\"ant-pagination\"\n [class.ant-table-pagination]=\"nzInTable\"\n [class.ant-pagination-simple]=\"nzSimple\"\n [class.mini]=\"(nzSize === 'small') && !nzSimple\">\n <ng-container *ngIf=\"nzSimple; else normalTemplate\">\n <li class=\"ant-pagination-prev\"\n [attr.title]=\"locale.prev_page\"\n [class.ant-pagination-disabled]=\"isFirstIndex\"\n (click)=\"jumpDiff(-1)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'pre'}\"></ng-template>\n </li>\n <li [attr.title]=\"nzPageIndex+'/'+lastIndex\" class=\"ant-pagination-simple-pager\">\n <input #simplePagerInput [value]=\"nzPageIndex\" (keydown.enter)=\"handleKeyDown($event,simplePagerInput,false)\" size=\"3\">\n <span class=\"ant-pagination-slash\">\uFF0F</span>\n {{ lastIndex }}\n </li>\n <li class=\"ant-pagination-next\"\n [attr.title]=\"locale.next_page\"\n [class.ant-pagination-disabled]=\"isLastIndex\"\n (click)=\"jumpDiff(1)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'next'}\"></ng-template>\n </li>\n </ng-container>\n <ng-template #normalTemplate>\n <li class=\"ant-pagination-total-text\" *ngIf=\"nzShowTotal\">\n <ng-template [ngTemplateOutlet]=\"nzShowTotal\" [ngTemplateOutletContext]=\"{ $implicit: nzTotal,range:ranges }\"></ng-template>\n </li>\n <li class=\"ant-pagination-prev\"\n [attr.title]=\"locale.prev_page\"\n [class.ant-pagination-disabled]=\"isFirstIndex\"\n (click)=\"jumpDiff(-1)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'pre'}\"></ng-template>\n </li>\n <li class=\"ant-pagination-item\"\n [attr.title]=\"firstIndex\"\n [class.ant-pagination-item-active]=\"isFirstIndex\"\n (click)=\"jumpPage(firstIndex)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'page',page: firstIndex }\"></ng-template>\n </li>\n <li class=\"ant-pagination-jump-prev\"\n *ngIf=\"(lastIndex > 9) && (nzPageIndex - 3 > firstIndex)\"\n [attr.title]=\"locale.prev_5\"\n (click)=\"jumpDiff(-5)\">\n <a class=\"ant-pagination-item-link\">\n <div class=\"ant-pagination-item-container\">\n <i nz-icon type=\"double-left\" class=\"ant-pagination-item-link-icon\"></i>\n <span class=\"ant-pagination-item-ellipsis\">\u2022\u2022\u2022</span>\n </div>\n </a>\n </li>\n <li class=\"ant-pagination-item\"\n *ngFor=\"let page of pages\"\n [attr.title]=\"page\"\n [class.ant-pagination-item-active]=\"nzPageIndex === page\"\n (click)=\"jumpPage(page)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'page',page: page }\"></ng-template>\n </li>\n <li class=\"ant-pagination-jump-next ant-pagination-item-link-icon\"\n [attr.title]=\"locale.next_5\"\n (click)=\"jumpDiff(5)\"\n *ngIf=\"(lastIndex > 9) && (nzPageIndex + 3 < lastIndex)\">\n <a class=\"ant-pagination-item-link\">\n <div class=\"ant-pagination-item-container\">\n <i nz-icon type=\"double-right\" class=\"ant-pagination-item-link-icon\"></i>\n <span class=\"ant-pagination-item-ellipsis\">\u2022\u2022\u2022</span>\n </div>\n </a>\n </li>\n <li class=\"ant-pagination-item\"\n [attr.title]=\"lastIndex\"\n (click)=\"jumpPage(lastIndex)\"\n *ngIf=\"(lastIndex > 0) && (lastIndex !== firstIndex)\"\n [class.ant-pagination-item-active]=\"isLastIndex\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'page',page: lastIndex }\"></ng-template>\n </li>\n <li class=\"ant-pagination-next\"\n [title]=\"locale.next_page\"\n [class.ant-pagination-disabled]=\"isLastIndex\"\n (click)=\"jumpDiff(1)\">\n <ng-template [ngTemplateOutlet]=\"nzItemRender\" [ngTemplateOutletContext]=\"{ $implicit: 'next'}\"></ng-template>\n </li>\n <div class=\"ant-pagination-options\" *ngIf=\"nzShowQuickJumper || nzShowSizeChanger\">\n <nz-select class=\"ant-pagination-options-size-changer\"\n *ngIf=\"nzShowSizeChanger\"\n [nzSize]=\"nzSize\"\n [ngModel]=\"nzPageSize\"\n (ngModelChange)=\"onPageSizeChange($event)\">\n <nz-option *ngFor=\"let option of nzPageSizeOptions\"\n [nzLabel]=\"option + locale.items_per_page\"\n [nzValue]=\"option\">\n </nz-option>\n <nz-option *ngIf=\"showAddOption\"\n [nzLabel]=\"nzPageSize + locale.items_per_page\"\n [nzValue]=\"nzPageSize\">\n </nz-option>\n </nz-select>\n <div class=\"ant-pagination-options-quick-jumper\" *ngIf=\"nzShowQuickJumper\">\n {{ locale.jump_to }}\n <input #quickJumperInput (keydown.enter)=\"handleKeyDown($event,quickJumperInput,true)\">\n {{ locale.page }}\n </div>\n </div>\n </ng-template>\n </ul>\n</ng-container>"
}] }
];
/** @nocollapse */
NzPaginationComponent.ctorParameters = () => [
{ type: NzI18nService$$1 },
{ type: ChangeDetectorRef }
];
NzPaginationComponent.propDecorators = {
nzPageSizeChange: [{ type: Output }],
nzPageIndexChange: [{ type: Output }],
nzShowTotal: [{ type: Input }],
nzInTable: [{ type: Input }],
nzSize: [{ type: Input }],
nzPageSizeOptions: [{ type: Input }],
nzItemRender: [{ type: Input }, { type: ViewChild, args: ['renderItemTemplate',] }],
nzShowSizeChanger: [{ type: Input }],
nzHideOnSinglePage: [{ type: Input }],
nzShowQuickJumper: [{ type: Input }],
nzSimple: [{ type: Input }],
nzTotal: [{ type: Input }],
nzPageIndex: [{ type: Input }],
nzPageSize: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzShowSizeChanger", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzHideOnSinglePage", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzShowQuickJumper", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzSimple", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzTotal", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzPageIndex", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzPaginationComponent.prototype, "nzPageSize", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPaginationModule {
}
NzPaginationModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzPaginationComponent],
exports: [NzPaginationComponent],
imports: [CommonModule, FormsModule, NzSelectModule, NzI18nModule, NzIconModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzToolTipComponent {
/**
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(cdr, noAnimation) {
this.cdr = cdr;
this.noAnimation = noAnimation;
this._hasBackdrop = false;
this._prefix = 'ant-tooltip-placement';
this._positions = [...DEFAULT_TOOLTIP_POSITIONS];
this._classMap = {};
this._placement = 'top';
this._trigger = 'hover';
this.visibleSource = new BehaviorSubject(false);
this.visible$ = this.visibleSource.asObservable();
this.nzOverlayClassName = '';
this.nzOverlayStyle = {};
this.nzMouseEnterDelay = 0.15; // second
// second
this.nzMouseLeaveDelay = 0.1; // second
this.nzVisibleChange = new EventEmitter();
}
// second
/**
* @param {?} value
* @return {?}
*/
set nzVisible(value) {
/** @type {?} */
const visible = toBoolean(value);
if (this.visibleSource.value !== visible) {
this.visibleSource.next(visible);
this.nzVisibleChange.emit(visible);
}
}
/**
* @return {?}
*/
get nzVisible() {
return this.visibleSource.value;
}
/**
* @param {?} value
* @return {?}
*/
set nzTrigger(value) {
this._trigger = value;
this._hasBackdrop = this._trigger === 'click';
}
/**
* @return {?}
*/
get nzTrigger() {
return this._trigger;
}
/**
* @param {?} value
* @return {?}
*/
set nzPlacement(value) {
if (value !== this._placement) {
this._placement = value;
this._positions = [POSITION_MAP[this.nzPlacement], ...this._positions];
}
}
/**
* @return {?}
*/
get nzPlacement() {
return this._placement;
}
/**
* @return {?}
*/
ngOnChanges() {
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.updatePosition();
}));
}
// Manually force updating current overlay's position
/**
* @return {?}
*/
updatePosition() {
if (this.overlay && this.overlay.overlayRef) {
this.overlay.overlayRef.updatePosition();
}
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.nzPlacement = getPlacementName(position);
this.setClassMap();
this.cdr.detectChanges(); // TODO: performance?
}
/**
* @return {?}
*/
show() {
if (!this.isContentEmpty()) {
this.nzVisible = true;
}
}
/**
* @return {?}
*/
hide() {
this.nzVisible = false;
}
/**
* @param {?} e
* @return {?}
*/
_afterVisibilityAnimation(e) {
if (e.toState === 'false' && !this.nzVisible) {
this.nzVisibleChange.emit(false);
}
if (e.toState === 'true' && this.nzVisible) {
this.nzVisibleChange.emit(true);
}
}
/**
* @return {?}
*/
setClassMap() {
this._classMap = {
[this.nzOverlayClassName]: true,
[`${this._prefix}-${this._placement}`]: true
};
}
/**
* @param {?} origin
* @return {?}
*/
setOverlayOrigin(origin) {
this.overlayOrigin = origin;
}
/**
* @protected
* @return {?}
*/
isContentEmpty() {
return this.nzTitle instanceof TemplateRef ? false : (this.nzTitle === '' || !isNotNil(this.nzTitle));
}
}
NzToolTipComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tooltip',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
animations: [zoomBigMotion],
template: "<ng-content></ng-content>\n<ng-template\n #overlay=\"cdkConnectedOverlay\"\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"visible$ | async\"\n [cdkConnectedOverlayHasBackdrop]=\"_hasBackdrop\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n (backdropClick)=\"hide()\"\n (detach)=\"hide()\"\n (positionChange)=\"onPositionChange($event)\">\n <div\n class=\"ant-tooltip\"\n [ngClass]=\"_classMap\"\n [ngStyle]=\"nzOverlayStyle\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@zoomBigMotion]=\"'active'\"\n (@zoomBigMotion.done)=\"_afterVisibilityAnimation($event)\">\n <div class=\"ant-tooltip-content\">\n <div class=\"ant-tooltip-arrow\"></div>\n <div class=\"ant-tooltip-inner\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n </div>\n </div>\n</ng-template>",
preserveWhitespaces: false,
styles: [`
.ant-tooltip {
position: relative;
}
`]
}] }
];
/** @nocollapse */
NzToolTipComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzToolTipComponent.propDecorators = {
overlay: [{ type: ViewChild, args: ['overlay',] }],
nzTitle: [{ type: Input }, { type: ContentChild, args: ['nzTemplate',] }],
nzOverlayClassName: [{ type: Input }],
nzOverlayStyle: [{ type: Input }],
nzMouseEnterDelay: [{ type: Input }],
nzMouseLeaveDelay: [{ type: Input }],
nzVisible: [{ type: Input }],
nzTrigger: [{ type: Input }],
nzPlacement: [{ type: Input }],
nzVisibleChange: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopconfirmComponent extends NzToolTipComponent {
/**
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(cdr, noAnimation) {
super(cdr, noAnimation);
this.noAnimation = noAnimation;
this._prefix = 'ant-popover-placement';
this._trigger = 'click';
this._hasBackdrop = true;
this.nzOkType = 'primary';
this.nzCondition = false;
this.nzOnCancel = new EventEmitter();
this.nzOnConfirm = new EventEmitter();
}
/**
* @return {?}
*/
show() {
if (!this.nzCondition) {
this.nzVisible = true;
}
else {
this.onConfirm();
}
}
/**
* @return {?}
*/
onCancel() {
this.nzOnCancel.emit();
this.nzVisible = false;
}
/**
* @return {?}
*/
onConfirm() {
this.nzOnConfirm.emit();
this.nzVisible = false;
}
}
NzPopconfirmComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-popconfirm',
preserveWhitespaces: false,
animations: [zoomBigMotion],
template: "<ng-content></ng-content>\n<ng-template\n #overlay=\"cdkConnectedOverlay\"\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayHasBackdrop]=\"_hasBackdrop\"\n (backdropClick)=\"hide()\"\n (detach)=\"hide()\"\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayOpen]=\"visible$ | async\">\n <div class=\"ant-popover\"\n [ngClass]=\"_classMap\"\n [ngStyle]=\"nzOverlayStyle\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@zoomBigMotion]=\"'active'\"\n (@zoomBigMotion.done)=\"_afterVisibilityAnimation($event)\">\n <div class=\"ant-popover-content\">\n <div class=\"ant-popover-arrow\"></div>\n <div class=\"ant-popover-inner\">\n <div>\n <div class=\"ant-popover-inner-content\">\n <div class=\"ant-popover-message\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzIcon\">\n <i nz-icon [nzType]=\"nzIcon || 'exclamation-circle'\" nzTheme=\"fill\"></i>\n </ng-container>\n <div class=\"ant-popover-message-title\">{{ nzTitle }}</div>\n </ng-container>\n </div>\n <div class=\"ant-popover-buttons\">\n <button nz-button [nzSize]=\"'small'\" (click)=\"onCancel()\">\n <ng-container *ngIf=\"nzCancelText\">{{ nzCancelText }}</ng-container>\n <ng-container *ngIf=\"!nzCancelText\">{{ 'Modal.cancelText' | nzI18n }}</ng-container>\n </button>\n <button nz-button [nzSize]=\"'small'\" [nzType]=\"nzOkType\" (click)=\"onConfirm()\">\n <ng-container *ngIf=\"nzOkText\">{{ nzOkText }}</ng-container>\n <ng-container *ngIf=\"!nzOkText\">{{ 'Modal.okText' | nzI18n }}</ng-container>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>",
styles: [`
.ant-popover {
position: relative;
}
`]
}] }
];
/** @nocollapse */
NzPopconfirmComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzPopconfirmComponent.propDecorators = {
nzOkText: [{ type: Input }],
nzOkType: [{ type: Input }],
nzCancelText: [{ type: Input }],
nzCondition: [{ type: Input }],
nzIcon: [{ type: Input }],
nzOnCancel: [{ type: Output }],
nzOnConfirm: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzPopconfirmComponent.prototype, "nzCondition", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTooltipDirective {
/**
* @param {?} elementRef
* @param {?} hostView
* @param {?} resolver
* @param {?} renderer
* @param {?} tooltip
* @param {?=} noAnimation
*/
constructor(elementRef, hostView, resolver, renderer, tooltip, noAnimation) {
this.elementRef = elementRef;
this.hostView = hostView;
this.resolver = resolver;
this.renderer = renderer;
this.tooltip = tooltip;
this.noAnimation = noAnimation;
// [NOTE] Here hard coded, and nzTitle used only under NzTooltipDirective currently.
this.isTooltipOpen = false;
this.isDynamicTooltip = false; // Indicate whether current tooltip is dynamic created
this.factory = this.resolver.resolveComponentFactory(NzToolTipComponent);
/**
* Names of properties that should be proxy to child component.
*/
this.needProxyProperties = [
'nzTitle',
'nzContent',
'nzOverlayClassName',
'nzOverlayStyle',
'nzMouseEnterDelay',
'nzMouseLeaveDelay',
'nzVisible',
'nzTrigger',
'nzPlacement'
];
this.subs_ = new Subscription();
this.nzVisibleChange = new EventEmitter();
}
/**
* @param {?} title
* @return {?}
*/
set setTitle(title) {
this.nzTitle = title;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
this.updateProxies(changes);
}
/**
* @return {?}
*/
ngOnInit() {
// Support faster tooltip mode: <a nz-tooltip="xxx"></a>. [NOTE] Used only under NzTooltipDirective currently.
if (!this.tooltip) {
/** @type {?} */
const tooltipComponent = this.hostView.createComponent(this.factory);
this.tooltip = tooltipComponent.instance;
this.tooltip.noAnimation = this.noAnimation;
// Remove element when use directive https://github.com/NG-ZORRO/ng-zorro-antd/issues/1967
this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), tooltipComponent.location.nativeElement);
this.isDynamicTooltip = true;
this.needProxyProperties.forEach((/**
* @param {?} property
* @return {?}
*/
property => this.updateCompValue(property, this[property])));
/** @type {?} */
const visible_ = this.tooltip.nzVisibleChange.pipe(distinctUntilChanged()).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
this.visible = data;
this.nzVisibleChange.emit(data);
}));
this.subs_.add(visible_);
}
this.tooltip.setOverlayOrigin(this);
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.tooltip.nzTrigger === 'hover') {
/** @type {?} */
let overlayElement;
this.renderer.listen(this.elementRef.nativeElement, 'mouseenter', (/**
* @return {?}
*/
() => this.delayEnterLeave(true, true, this.tooltip.nzMouseEnterDelay)));
this.renderer.listen(this.elementRef.nativeElement, 'mouseleave', (/**
* @return {?}
*/
() => {
this.delayEnterLeave(true, false, this.tooltip.nzMouseLeaveDelay);
if (this.tooltip.overlay.overlayRef && !overlayElement) { // NOTE: we bind events under "mouseleave" due to the overlayRef is only created after the overlay was completely shown up
overlayElement = this.tooltip.overlay.overlayRef.overlayElement;
this.renderer.listen(overlayElement, 'mouseenter', (/**
* @return {?}
*/
() => this.delayEnterLeave(false, true)));
this.renderer.listen(overlayElement, 'mouseleave', (/**
* @return {?}
*/
() => this.delayEnterLeave(false, false)));
}
}));
}
else if (this.tooltip.nzTrigger === 'focus') {
this.renderer.listen(this.elementRef.nativeElement, 'focus', (/**
* @return {?}
*/
() => this.show()));
this.renderer.listen(this.elementRef.nativeElement, 'blur', (/**
* @return {?}
*/
() => this.hide()));
}
else if (this.tooltip.nzTrigger === 'click') {
this.renderer.listen(this.elementRef.nativeElement, 'click', (/**
* @param {?} e
* @return {?}
*/
(e) => {
e.preventDefault();
this.show();
}));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.subs_.unsubscribe();
}
// tslint:disable-next-line:no-any
/**
* @protected
* @param {?} key
* @param {?} value
* @return {?}
*/
updateCompValue(key, value) {
if (this.isDynamicTooltip && isNotNil(value)) {
this.tooltip[key] = value;
}
}
/**
* @private
* @return {?}
*/
show() {
this.tooltip.show();
this.isTooltipOpen = true;
}
/**
* @private
* @return {?}
*/
hide() {
this.tooltip.hide();
this.isTooltipOpen = false;
}
/**
* @private
* @param {?} isOrigin
* @param {?} isEnter
* @param {?=} delay
* @return {?}
*/
delayEnterLeave(isOrigin, isEnter, delay$$1 = -1) {
if (this.delayTimer) { // Clear timer during the delay time
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
else if (delay$$1 > 0) {
this.delayTimer = setTimeout((/**
* @return {?}
*/
() => {
this.delayTimer = null;
isEnter ? this.show() : this.hide();
}), delay$$1 * 1000);
}
else {
isEnter && isOrigin ? this.show() : this.hide(); // [Compatible] The "isOrigin" is used due to the tooltip will not hide immediately (may caused by the fade-out animation)
}
}
/**
* Set inputs of child components when this component's inputs change.
* @private
* @param {?} changes
* @return {?}
*/
updateProxies(changes) {
if (this.tooltip) {
Object.keys(changes).forEach((/**
* @param {?} key
* @return {?}
*/
key => {
/** @type {?} */
const change = changes[key];
if (change) {
this.updateCompValue(key, change.currentValue);
}
}));
if (changes.setTitle) {
this.nzTitle = changes.setTitle.currentValue;
this.updateCompValue('nzTitle', changes.setTitle.currentValue);
}
}
}
}
NzTooltipDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-tooltip]',
host: {
'[class.ant-tooltip-open]': 'isTooltipOpen'
}
},] }
];
/** @nocollapse */
NzTooltipDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: ComponentFactoryResolver },
{ type: Renderer2 },
{ type: NzToolTipComponent, decorators: [{ type: Optional }] },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzTooltipDirective.propDecorators = {
nzVisibleChange: [{ type: Output }],
nzTitle: [{ type: Input, args: ['nz-tooltip',] }],
setTitle: [{ type: Input, args: ['nzTitle',] }],
nzContent: [{ type: Input }],
nzMouseEnterDelay: [{ type: Input }],
nzMouseLeaveDelay: [{ type: Input }],
nzOverlayClassName: [{ type: Input }],
nzOverlayStyle: [{ type: Input }],
nzTrigger: [{ type: Input }],
nzVisible: [{ type: Input }],
nzPlacement: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopconfirmDirective extends NzTooltipDirective {
/**
* @param {?} elementRef
* @param {?} hostView
* @param {?} resolver
* @param {?} renderer
* @param {?} tooltip
* @param {?=} noAnimation
*/
constructor(elementRef, hostView, resolver, renderer, tooltip, noAnimation) {
super(elementRef, hostView, resolver, renderer, tooltip, noAnimation);
this.noAnimation = noAnimation;
this.factory = this.resolver.resolveComponentFactory(NzPopconfirmComponent);
this.needProxyProperties = [
'nzTitle',
'nzContent',
'nzOverlayClassName',
'nzOverlayStyle',
'nzMouseEnterDelay',
'nzMouseLeaveDelay',
'nzVisible',
'nzTrigger',
'nzPlacement',
'nzOkText',
'nzOkType',
'nzCancelText',
'nzCondition',
'nzIcon'
];
this.nzOnCancel = new EventEmitter();
this.nzOnConfirm = new EventEmitter();
}
/**
* @return {?}
*/
ngOnInit() {
if (!this.tooltip) {
/** @type {?} */
const tooltipComponent = this.hostView.createComponent(this.factory);
this.tooltip = tooltipComponent.instance;
this.tooltip.noAnimation = this.noAnimation;
// Remove element when use directive https://github.com/NG-ZORRO/ng-zorro-antd/issues/1967
this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), tooltipComponent.location.nativeElement);
this.isDynamicTooltip = true;
this.needProxyProperties.forEach((/**
* @param {?} property
* @return {?}
*/
property => this.updateCompValue(property, this[property])));
/** @type {?} */
const visible_ = this.tooltip.nzVisibleChange.pipe(distinctUntilChanged()).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
this.visible = data;
this.nzVisibleChange.emit(data);
}));
/** @type {?} */
const cancel_ = ((/** @type {?} */ (this.tooltip))).nzOnCancel.subscribe((/**
* @return {?}
*/
() => {
this.nzOnCancel.emit();
}));
/** @type {?} */
const confirm_ = ((/** @type {?} */ (this.tooltip))).nzOnConfirm.subscribe((/**
* @return {?}
*/
() => {
this.nzOnConfirm.emit();
}));
this.subs_.add(visible_);
this.subs_.add(cancel_);
this.subs_.add(confirm_);
}
this.tooltip.setOverlayOrigin(this);
}
}
NzPopconfirmDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-popconfirm]',
host: {
'[class.ant-popover-open]': 'isTooltipOpen'
}
},] }
];
/** @nocollapse */
NzPopconfirmDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: ComponentFactoryResolver },
{ type: Renderer2 },
{ type: NzPopconfirmComponent, decorators: [{ type: Optional }] },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzPopconfirmDirective.propDecorators = {
nzOkText: [{ type: Input }],
nzOkType: [{ type: Input }],
nzCancelText: [{ type: Input }],
nzIcon: [{ type: Input }],
nzCondition: [{ type: Input }],
nzOnCancel: [{ type: Output }],
nzOnConfirm: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzPopconfirmDirective.prototype, "nzCondition", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopconfirmModule {
}
NzPopconfirmModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzPopconfirmComponent, NzPopconfirmDirective],
exports: [NzPopconfirmComponent, NzPopconfirmDirective],
imports: [
CommonModule,
NzButtonModule,
OverlayModule,
NzI18nModule,
NzIconModule,
NzAddOnModule,
NzOverlayModule,
NzNoAnimationModule
],
entryComponents: [NzPopconfirmComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopoverComponent extends NzToolTipComponent {
/**
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(cdr, noAnimation) {
super(cdr, noAnimation);
this.noAnimation = noAnimation;
this._prefix = 'ant-popover-placement';
}
/**
* @protected
* @return {?}
*/
isContentEmpty() {
/** @type {?} */
const isTitleEmpty = this.nzTitle instanceof TemplateRef ? false : (this.nzTitle === '' || !isNotNil(this.nzTitle));
/** @type {?} */
const isContentEmpty = this.nzContent instanceof TemplateRef ? false : (this.nzContent === '' || !isNotNil(this.nzContent));
return isTitleEmpty && isContentEmpty;
}
}
NzPopoverComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-popover',
animations: [zoomBigMotion],
template: "<ng-content></ng-content>\n<ng-template\n #overlay=\"cdkConnectedOverlay\"\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayHasBackdrop]=\"_hasBackdrop\"\n (backdropClick)=\"hide()\"\n (detach)=\"hide()\"\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayOpen]=\"visible$ | async\">\n <div class=\"ant-popover\"\n [ngClass]=\"_classMap\"\n [ngStyle]=\"nzOverlayStyle\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [@zoomBigMotion]=\"'active'\"\n (@zoomBigMotion.done)=\"_afterVisibilityAnimation($event)\">\n <div class=\"ant-popover-content\">\n <div class=\"ant-popover-arrow\"></div>\n <div class=\"ant-popover-inner\" role=\"tooltip\">\n <div>\n <div class=\"ant-popover-title\" *ngIf=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-popover-inner-content\">\n <ng-container *nzStringTemplateOutlet=\"nzContent\">{{ nzContent }}</ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
styles: [`
.ant-popover {
position: relative;
}
`]
}] }
];
/** @nocollapse */
NzPopoverComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzPopoverComponent.propDecorators = {
nzTitle: [{ type: Input }, { type: ContentChild, args: ['neverUsedTemplate',] }],
nzContent: [{ type: Input }, { type: ContentChild, args: ['nzTemplate',] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopoverDirective extends NzTooltipDirective {
/**
* @param {?} elementRef
* @param {?} hostView
* @param {?} resolver
* @param {?} renderer
* @param {?} tooltip
* @param {?=} noAnimation
*/
constructor(elementRef, hostView, resolver, renderer, tooltip, noAnimation) {
super(elementRef, hostView, resolver, renderer, tooltip, noAnimation);
this.noAnimation = noAnimation;
this.factory = this.resolver.resolveComponentFactory(NzPopoverComponent);
}
}
NzPopoverDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-popover]',
host: {
'[class.ant-popover-open]': 'isTooltipOpen'
}
},] }
];
/** @nocollapse */
NzPopoverDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: ComponentFactoryResolver },
{ type: Renderer2 },
{ type: NzPopoverComponent, decorators: [{ type: Optional }] },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopoverModule {
}
NzPopoverModule.decorators = [
{ type: NgModule, args: [{
entryComponents: [NzPopoverComponent],
exports: [NzPopoverDirective, NzPopoverComponent],
declarations: [NzPopoverDirective, NzPopoverComponent],
imports: [CommonModule, OverlayModule, NzAddOnModule, NzOverlayModule, NzNoAnimationModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzProgressComponent {
constructor() {
this._gapDegree = 0;
this._gapPosition = 'top';
this._percent = 0;
this._status = 'normal';
this._cacheStatus = 'normal';
this._strokeLinecap = 'round';
this._strokeWidth = 8;
this._size = 'default';
this._type = 'line';
this._format = (/**
* @param {?} percent
* @return {?}
*/
(percent) => `${percent}%`);
this.isStatusSet = false;
this.isStrokeWidthSet = false;
this.isFormatSet = false;
this.isGapDegreeSet = false;
this.isGapPositionSet = false;
this.statusColorMap = {
normal: '#108ee9',
exception: '#ff5500',
success: '#87d068'
};
this.nzShowInfo = true;
this.nzWidth = 132;
this.nzSuccessPercent = 0;
}
/**
* @param {?} value
* @return {?}
*/
set nzSize(value) {
this._size = value;
if (this.nzSize === 'small' && !this.isStrokeWidthSet) {
this._strokeWidth = 6;
}
}
/**
* @return {?}
*/
get nzSize() {
return this._size;
}
/**
* @param {?} value
* @return {?}
*/
set nzFormat(value) {
if (isNotNil(value)) {
this._format = value;
this.isFormatSet = true;
}
}
/**
* @return {?}
*/
get nzFormat() {
return this._format;
}
/**
* @param {?} value
* @return {?}
*/
set nzPercent(value) {
this._percent = value;
if (isNotNil(value)) {
/** @type {?} */
const fillAll = parseInt(value.toString(), 10) >= 100;
if (fillAll && !this.isStatusSet) {
this._status = 'success';
}
else {
this._status = this._cacheStatus;
}
this.updatePathStyles();
this.updateIcon();
}
}
/**
* @return {?}
*/
get nzPercent() {
return this._percent;
}
/**
* @param {?} value
* @return {?}
*/
set nzStrokeWidth(value) {
if (isNotNil(value)) {
this._strokeWidth = value;
this.isStrokeWidthSet = true;
this.updatePathStyles();
}
}
/**
* @return {?}
*/
get nzStrokeWidth() {
return this._strokeWidth;
}
/**
* @param {?} value
* @return {?}
*/
set nzStatus(value) {
if (isNotNil(value)) {
this._status = value;
this._cacheStatus = value;
this.isStatusSet = true;
this.updateIcon();
}
}
/**
* @return {?}
*/
get nzStatus() {
return this._status;
}
/**
* @param {?} value
* @return {?}
*/
set nzType(value) {
this._type = value;
if (!this.isStrokeWidthSet) {
if (this.nzType !== 'line') {
this._strokeWidth = 6;
}
}
if (this.nzType === 'dashboard') {
if (!this.isGapPositionSet) {
this._gapPosition = 'bottom';
}
if (!this.isGapDegreeSet) {
this._gapDegree = 75;
}
}
this.updateIcon();
this.updatePathStyles();
}
/**
* @return {?}
*/
get nzType() {
return this._type;
}
/**
* @param {?} value
* @return {?}
*/
set nzGapDegree(value) {
if (isNotNil(value)) {
this._gapDegree = value;
this.isGapDegreeSet = true;
this.updatePathStyles();
}
}
/**
* @return {?}
*/
get nzGapDegree() {
return this._gapDegree;
}
/**
* @param {?} value
* @return {?}
*/
set nzGapPosition(value) {
if (isNotNil(value)) {
this._gapPosition = value;
this.isGapPositionSet = true;
this.updatePathStyles();
}
}
/**
* @return {?}
*/
get nzGapPosition() {
return this._gapPosition;
}
/**
* @param {?} value
* @return {?}
*/
set nzStrokeLinecap(value) {
this._strokeLinecap = value;
this.updatePathStyles();
}
/**
* @return {?}
*/
get nzStrokeLinecap() {
return this._strokeLinecap;
}
/**
* @return {?}
*/
get isCirCleStyle() {
return this.nzType === 'circle' || this.nzType === 'dashboard';
}
/**
* @return {?}
*/
updatePathStyles() {
/** @type {?} */
const radius = 50 - (this.nzStrokeWidth / 2);
/** @type {?} */
let beginPositionX = 0;
/** @type {?} */
let beginPositionY = -radius;
/** @type {?} */
let endPositionX = 0;
/** @type {?} */
let endPositionY = radius * -2;
switch (this.nzGapPosition) {
case 'left':
beginPositionX = -radius;
beginPositionY = 0;
endPositionX = radius * 2;
endPositionY = 0;
break;
case 'right':
beginPositionX = radius;
beginPositionY = 0;
endPositionX = radius * -2;
endPositionY = 0;
break;
case 'bottom':
beginPositionY = radius;
endPositionY = radius * 2;
break;
default:
}
this.pathString = `M 50,50 m ${beginPositionX},${beginPositionY}
a ${radius},${radius} 0 1 1 ${endPositionX},${-endPositionY}
a ${radius},${radius} 0 1 1 ${-endPositionX},${endPositionY}`;
/** @type {?} */
const len = Math.PI * 2 * radius;
this.trailPathStyle = {
strokeDasharray: `${len - this.nzGapDegree}px ${len}px`,
strokeDashoffset: `-${this.nzGapDegree / 2}px`,
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s'
};
this.strokePathStyle = {
strokeDasharray: `${(this.nzPercent / 100) * (len - this.nzGapDegree)}px ${len}px`,
strokeDashoffset: `-${this.nzGapDegree / 2}px`,
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s' // eslint-disable-line
};
}
/**
* @return {?}
*/
updateIcon() {
/** @type {?} */
const isCircle = (this.nzType === 'circle' || this.nzType === 'dashboard');
/** @type {?} */
let ret = '';
if (this.nzStatus === 'success') {
ret = 'check';
}
if (this.nzStatus === 'exception') {
ret = 'close';
}
if (ret) {
if (!isCircle) {
ret += '-circle';
this.iconTheme = 'fill';
}
else {
this.iconTheme = 'outline';
}
}
this.icon = ret;
}
/**
* @return {?}
*/
ngOnInit() {
this.updatePathStyles();
this.updateIcon();
}
}
NzProgressComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-progress',
preserveWhitespaces: false,
template: "<ng-template #progressInfoTemplate>\n <span class=\"ant-progress-text\" *ngIf=\"nzShowInfo\">\n <ng-container *ngIf=\"(nzStatus=='exception')||(nzStatus=='success')&&(!isFormatSet); else formatTemplate\">\n <!-- Theme is handled in type here. -->\n <i nz-icon [type]=\"icon\" [theme]=\"iconTheme\"></i>\n </ng-container>\n <ng-template #formatTemplate>\n {{ nzFormat(nzPercent) }}\n </ng-template>\n </span>\n</ng-template>\n<div [ngClass]=\"'ant-progress ant-progress-status-'+nzStatus\"\n [class.ant-progress-line]=\"nzType=='line'\"\n [class.ant-progress-small]=\"nzSize=='small'\"\n [class.ant-progress-show-info]=\"nzShowInfo\"\n [class.ant-progress-circle]=\"isCirCleStyle\">\n <div *ngIf=\"nzType=='line'\">\n <div class=\"ant-progress-outer\">\n <div class=\"ant-progress-inner\">\n <div class=\"ant-progress-bg\"\n [style.width.%]=\"nzPercent\"\n [style.border-radius]=\"nzStrokeLinecap === 'round' ? '100px' : '0'\"\n [style.background]=\"nzStrokeColor\"\n [style.height.px]=\"nzStrokeWidth\">\n </div>\n <div class=\"ant-progress-success-bg\"\n [style.width.%]=\"nzSuccessPercent\"\n [style.border-radius]=\"nzStrokeLinecap === 'round' ? '100px' : '0'\"\n [style.height.px]=\"nzStrokeWidth\"></div>\n </div>\n </div>\n <ng-template [ngTemplateOutlet]=\"progressInfoTemplate\"></ng-template>\n </div>\n <div\n [style.width.px]=\"this.nzWidth\"\n [style.height.px]=\"this.nzWidth\"\n [style.fontSize.px]=\"this.nzWidth*0.15+6\"\n class=\"ant-progress-inner\"\n *ngIf=\"isCirCleStyle\">\n <svg class=\"ant-progress-circle \" viewBox=\"0 0 100 100\">\n <path\n class=\"ant-progress-circle-trail\"\n stroke=\"#f3f3f3\"\n fill-opacity=\"0\"\n [attr.stroke-width]=\"nzStrokeWidth\"\n [ngStyle]=\"trailPathStyle\"\n [attr.d]=\"pathString\">\n </path>\n <path\n class=\"ant-progress-circle-path\"\n [attr.d]=\"pathString\"\n [attr.stroke-linecap]=\"nzStrokeLinecap\"\n fill-opacity=\"0\"\n [attr.stroke]=\"nzStrokeColor || statusColorMap[nzStatus]\"\n [attr.stroke-width]=\"nzPercent?nzStrokeWidth:0\"\n [ngStyle]=\"strokePathStyle\">\n </path>\n </svg>\n <ng-template [ngTemplateOutlet]=\"progressInfoTemplate\"></ng-template>\n </div>\n</div>"
}] }
];
NzProgressComponent.propDecorators = {
nzShowInfo: [{ type: Input }],
nzWidth: [{ type: Input }],
nzSuccessPercent: [{ type: Input }],
nzStrokeColor: [{ type: Input }],
nzSize: [{ type: Input }],
nzFormat: [{ type: Input }],
nzPercent: [{ type: Input }],
nzStrokeWidth: [{ type: Input }],
nzStatus: [{ type: Input }],
nzType: [{ type: Input }],
nzGapDegree: [{ type: Input }],
nzGapPosition: [{ type: Input }],
nzStrokeLinecap: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzProgressModule {
}
NzProgressModule.decorators = [
{ type: NgModule, args: [{
exports: [NzProgressComponent],
declarations: [NzProgressComponent],
imports: [CommonModule, NzIconModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzToolTipModule {
}
NzToolTipModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzToolTipComponent, NzTooltipDirective],
exports: [NzToolTipComponent, NzTooltipDirective],
imports: [CommonModule, OverlayModule, NzAddOnModule, NzOverlayModule, NzNoAnimationModule],
entryComponents: [NzToolTipComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRateItemComponent {
constructor() {
this.allowHalf = false;
this.itemHover = new EventEmitter();
this.itemClick = new EventEmitter();
}
/**
* @param {?} isHalf
* @return {?}
*/
hoverRate(isHalf) {
this.itemHover.next(isHalf && this.allowHalf);
}
/**
* @param {?} isHalf
* @return {?}
*/
clickRate(isHalf) {
this.itemClick.next(isHalf && this.allowHalf);
}
}
NzRateItemComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: '[nz-rate-item]',
template: "<div class=\"ant-rate-star-second\"\n (mouseover)=\"hoverRate(false); $event.stopPropagation();\"\n (click)=\"clickRate(false); $event.stopPropagation();\">\n <ng-template [ngTemplateOutlet]=\"character || defaultCharacter\"></ng-template>\n</div>\n<div class=\"ant-rate-star-first\"\n (mouseover)=\"hoverRate(true); $event.stopPropagation();\"\n (click)=\"clickRate(true); $event.stopPropagation();\">\n <ng-template [ngTemplateOutlet]=\"character || defaultCharacter\"></ng-template>\n</div>\n\n<ng-template #defaultCharacter>\n <i nz-icon\n type=\"star\"\n theme=\"fill\"></i>\n</ng-template>\n"
}] }
];
NzRateItemComponent.propDecorators = {
character: [{ type: Input }],
allowHalf: [{ type: Input }],
itemHover: [{ type: Output }],
itemClick: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRateItemComponent.prototype, "allowHalf", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRateComponent {
/**
* @param {?} renderer
* @param {?} cdr
*/
constructor(renderer, cdr) {
this.renderer = renderer;
this.cdr = cdr;
this.nzAllowClear = true;
this.nzAllowHalf = false;
this.nzDisabled = false;
this.nzAutoFocus = false;
this.nzTooltips = [];
this.nzOnBlur = new EventEmitter();
this.nzOnFocus = new EventEmitter();
this.nzOnHoverChange = new EventEmitter();
this.nzOnKeyDown = new EventEmitter();
this.hasHalf = false;
this.hoverValue = 0;
this.prefixCls = 'ant-rate';
this.innerPrefixCls = `${this.prefixCls}-star`;
this.isFocused = false;
this.isInit = false;
this.starArray = [];
this._count = 5;
this._value = 0;
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
}
/**
* @param {?} value
* @return {?}
*/
set nzCount(value) {
if (this._count === value) {
return;
}
this._count = value;
this.updateStarArray();
}
/**
* @return {?}
*/
get nzCount() {
return this._count;
}
/**
* @return {?}
*/
get nzValue() { return this._value; }
/**
* @param {?} input
* @return {?}
*/
set nzValue(input) {
if (this._value === input) {
return;
}
this._value = input;
this.hasHalf = !Number.isInteger(input);
this.hoverValue = Math.ceil(input);
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzAutoFocus && !changes.nzAutoFocus.isFirstChange()) {
if (this.nzAutoFocus && !this.nzDisabled) {
this.renderer.setAttribute(this.ulElement.nativeElement, 'autofocus', 'autofocus');
}
else {
this.renderer.removeAttribute(this.ulElement.nativeElement, 'autofocus');
}
}
}
/**
* @return {?}
*/
ngOnInit() {
this.updateStarArray();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.isInit = true;
}
/**
* @param {?} index
* @param {?} isHalf
* @return {?}
*/
onItemClick(index, isHalf) {
if (this.nzDisabled) {
return;
}
this.hoverValue = index + 1;
/** @type {?} */
const actualValue = isHalf ? index + 0.5 : index + 1;
if (this.nzValue === actualValue) {
if (this.nzAllowClear) {
this.nzValue = 0;
this.onChange(this.nzValue);
}
}
else {
this.nzValue = actualValue;
this.onChange(this.nzValue);
}
}
/**
* @param {?} index
* @param {?} isHalf
* @return {?}
*/
onItemHover(index, isHalf) {
if (this.nzDisabled ||
(this.hoverValue === index + 1 && isHalf === this.hasHalf)) {
return;
}
this.hoverValue = index + 1;
this.hasHalf = isHalf;
this.nzOnHoverChange.emit(this.hoverValue);
}
/**
* @return {?}
*/
onRateLeave() {
this.hasHalf = !Number.isInteger(this.nzValue);
this.hoverValue = Math.ceil(this.nzValue);
}
/**
* @param {?} e
* @return {?}
*/
onFocus(e) {
this.isFocused = true;
this.nzOnFocus.emit(e);
}
/**
* @param {?} e
* @return {?}
*/
onBlur(e) {
this.isFocused = false;
this.nzOnBlur.emit(e);
}
/**
* @return {?}
*/
focus() {
this.ulElement.nativeElement.focus();
}
/**
* @return {?}
*/
blur() {
this.ulElement.nativeElement.blur();
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
/** @type {?} */
const oldVal = this.nzValue;
if (e.keyCode === RIGHT_ARROW && (this.nzValue < this.nzCount)) {
this.nzValue += this.nzAllowHalf ? 0.5 : 1;
}
else if (e.keyCode === LEFT_ARROW && (this.nzValue > 0)) {
this.nzValue -= this.nzAllowHalf ? 0.5 : 1;
}
if (oldVal !== this.nzValue) {
this.onChange(this.nzValue);
this.nzOnKeyDown.emit(e);
this.cdr.markForCheck();
}
}
/**
* @param {?} i
* @return {?}
*/
setClasses(i) {
return {
[`${this.innerPrefixCls}-full`]: (i + 1 < this.hoverValue) || (!this.hasHalf) && (i + 1 === this.hoverValue),
[`${this.innerPrefixCls}-half`]: (this.hasHalf) && (i + 1 === this.hoverValue),
[`${this.innerPrefixCls}-active`]: (this.hasHalf) && (i + 1 === this.hoverValue),
[`${this.innerPrefixCls}-zero`]: (i + 1 > this.hoverValue),
[`${this.innerPrefixCls}-focused`]: (this.hasHalf) && (i + 1 === this.hoverValue) && this.isFocused
};
}
/**
* @private
* @return {?}
*/
updateStarArray() {
this.starArray = Array(this.nzCount).fill(0).map((/**
* @param {?} _
* @param {?} i
* @return {?}
*/
(_, i) => i));
}
// #region Implement `ControlValueAccessor`
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.nzValue = value || 0;
this.cdr.markForCheck();
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
}
NzRateComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-rate',
preserveWhitespaces: false,
template: "<ul #ulElement\n class=\"ant-rate\"\n [class.ant-rate-disabled]=\"nzDisabled\"\n [ngClass]=\"classMap\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (keydown)=\"onKeyDown($event); $event.preventDefault();\"\n (mouseleave)=\"onRateLeave(); $event.stopPropagation();\"\n [tabindex]=\"nzDisabled ? -1 : 1\">\n <li *ngFor=\"let star of starArray; let i = index\"\n class=\"ant-rate-star\"\n [ngClass]=\"setClasses(star)\"\n nz-tooltip\n [nzTitle]=\"nzTooltips[ i ]\">\n <div nz-rate-item\n [allowHalf]=\"nzAllowHalf\"\n [character]=\"nzCharacter\"\n (itemHover)=\"onItemHover(i, $event)\"\n (itemClick)=\"onItemClick(i, $event)\">\n </div>\n </li>\n</ul>\n",
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzRateComponent)),
multi: true
}
]
}] }
];
/** @nocollapse */
NzRateComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ChangeDetectorRef }
];
NzRateComponent.propDecorators = {
ulElement: [{ type: ViewChild, args: ['ulElement',] }],
nzAllowClear: [{ type: Input }],
nzAllowHalf: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzAutoFocus: [{ type: Input }],
nzCharacter: [{ type: Input }],
nzTooltips: [{ type: Input }],
nzOnBlur: [{ type: Output }],
nzOnFocus: [{ type: Output }],
nzOnHoverChange: [{ type: Output }],
nzOnKeyDown: [{ type: Output }],
nzCount: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRateComponent.prototype, "nzAllowClear", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRateComponent.prototype, "nzAllowHalf", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRateComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzRateComponent.prototype, "nzAutoFocus", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzRateModule {
}
NzRateModule.decorators = [
{ type: NgModule, args: [{
exports: [NzRateComponent],
declarations: [NzRateComponent, NzRateItemComponent],
imports: [CommonModule, NzIconModule, NzToolTipModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSkeletonComponent {
/**
* @param {?} cdr
* @param {?} renderer
* @param {?} elementRef
*/
constructor(cdr, renderer, elementRef) {
this.cdr = cdr;
this.nzActive = false;
this.nzLoading = true;
this.nzTitle = true;
this.nzAvatar = false;
this.nzParagraph = true;
this.rowsList = [];
this.widthList = [];
renderer.addClass(elementRef.nativeElement, 'ant-skeleton');
}
/**
* @param {?=} value
* @return {?}
*/
toCSSUnit(value = '') {
return toCssPixel(value);
}
/**
* @private
* @return {?}
*/
getTitleProps() {
/** @type {?} */
const hasAvatar = !!this.nzAvatar;
/** @type {?} */
const hasParagraph = !!this.nzParagraph;
/** @type {?} */
let width;
if (!hasAvatar && hasParagraph) {
width = '38%';
}
else if (hasAvatar && hasParagraph) {
width = '50%';
}
return Object.assign({ width }, this.getProps(this.nzTitle));
}
/**
* @private
* @return {?}
*/
getAvatarProps() {
/** @type {?} */
const shape = (!!this.nzTitle && !this.nzParagraph) ? 'square' : 'circle';
/** @type {?} */
const size = 'large';
return Object.assign({ shape, size }, this.getProps(this.nzAvatar));
}
/**
* @private
* @return {?}
*/
getParagraphProps() {
/** @type {?} */
const hasAvatar = !!this.nzAvatar;
/** @type {?} */
const hasTitle = !!this.nzTitle;
/** @type {?} */
const basicProps = {};
// Width
if (!hasAvatar || !hasTitle) {
basicProps.width = '61%';
}
// Rows
if (!hasAvatar && hasTitle) {
basicProps.rows = 3;
}
else {
basicProps.rows = 2;
}
return Object.assign({}, basicProps, this.getProps(this.nzParagraph));
}
/**
* @private
* @template T
* @param {?} prop
* @return {?}
*/
getProps(prop) {
return prop && typeof prop === 'object' ? prop : {};
}
/**
* @private
* @return {?}
*/
getWidthList() {
const { width, rows } = this.paragraph;
/** @type {?} */
let widthList = [];
if (width && Array.isArray(width)) {
widthList = width;
}
else if (width && !Array.isArray(width)) {
widthList = [];
widthList[rows - 1] = width;
}
return widthList;
}
/**
* @private
* @return {?}
*/
updateProps() {
this.title = this.getTitleProps();
this.avatar = this.getAvatarProps();
this.paragraph = this.getParagraphProps();
this.rowsList = [...Array(this.paragraph.rows)];
this.widthList = this.getWidthList();
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnInit() {
this.updateProps();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzTitle || changes.nzAvatar || changes.nzParagraph) {
this.updateProps();
}
}
}
NzSkeletonComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-skeleton',
template: "<ng-container *ngIf=\"nzLoading\">\n <div class=\"ant-skeleton-header\">\n <span\n *ngIf=\"!!nzAvatar\"\n class=\"ant-skeleton-avatar\"\n [class.ant-skeleton-avatar-lg]=\"avatar.size === 'large'\"\n [class.ant-skeleton-avatar-sm]=\"avatar.size === 'small'\"\n [class.ant-skeleton-avatar-circle]=\"avatar.shape === 'circle'\"\n [class.ant-skeleton-avatar-square]=\"avatar.shape === 'square'\">\n </span>\n </div>\n <div class=\"ant-skeleton-content\">\n <h3 *ngIf=\"!!nzTitle\" class=\"ant-skeleton-title\" [style.width]=\"toCSSUnit(title.width)\"></h3>\n <ul *ngIf=\"!!nzParagraph\" class=\"ant-skeleton-paragraph\">\n <li *ngFor=\"let row of rowsList; let i=index\" [style.width]=\"toCSSUnit(widthList[i])\">\n </li>\n </ul>\n </div>\n</ng-container>\n<ng-container *ngIf=\"!nzLoading\">\n <ng-content></ng-content>\n</ng-container>",
host: {
'[class.ant-skeleton-with-avatar]': '!!nzAvatar',
'[class.ant-skeleton-active]': 'nzActive'
}
}] }
];
/** @nocollapse */
NzSkeletonComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: ElementRef }
];
NzSkeletonComponent.propDecorators = {
nzActive: [{ type: Input }],
nzLoading: [{ type: Input }],
nzTitle: [{ type: Input }],
nzAvatar: [{ type: Input }],
nzParagraph: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSkeletonModule {
}
NzSkeletonModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzSkeletonComponent],
imports: [CommonModule],
exports: [NzSkeletonComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} min
* @param {?} max
* @param {?} value
* @return {?}
*/
function getPercent(min, max, value) {
return (value - min) / (max - min) * 100;
}
/**
* @param {?} num
* @return {?}
*/
function getPrecision(num) {
/** @type {?} */
const numStr = num.toString();
/** @type {?} */
const dotIndex = numStr.indexOf('.');
return dotIndex >= 0 ? numStr.length - dotIndex - 1 : 0;
}
/**
* @param {?} num
* @param {?} min
* @param {?} max
* @return {?}
*/
function ensureNumberInRange(num, min, max) {
if (isNaN(num) || num < min) {
return min;
}
else if (num > max) {
return max;
}
else {
return num;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class Marks {
}
/**
* @param {?} value
* @return {?}
*/
function isValueARange(value) {
if (value instanceof Array) {
return value.length === 2;
}
else {
return false;
}
}
/**
* @param {?} config
* @return {?}
*/
function isConfigAObject(config) {
return config instanceof Object;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @return {?}
*/
function getValueTypeNotMatchError() {
return new Error(`The "nzRange" can't match the "ngModel"'s type, please check these properties: "nzRange", "ngModel", "nzDefaultValue".`);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderComponent {
/**
* @param {?} cdr
*/
constructor(cdr) {
this.cdr = cdr;
this.nzDisabled = false;
this.nzDots = false;
this.nzIncluded = true;
this.nzRange = false;
this.nzVertical = false;
this.nzMarks = null;
this.nzMax = 100;
this.nzMin = 0;
this.nzStep = 1;
this.nzTooltipVisible = 'default';
/**
* @deprecated 8.0.0, This API is redundant for Angular.
*/
this.nzDefaultValue = null;
this.nzOnAfterChange = new EventEmitter();
this.value = null; // CORE value state
this.cacheSliderStart = null;
this.cacheSliderLength = null;
this.activeValueIndex = null; // Current activated handle's index ONLY for range=true
// Current activated handle's index ONLY for range=true
this.track = { offset: null, length: null }; // Track's offset and length
// "steps" in array type with more data & FILTER out the invalid mark
this.bounds = { lower: null, upper: null }; // now for nz-slider-step
// now for nz-slider-step
this.isDragging = false; // Current dragging state
}
/**
* @return {?}
*/
ngOnInit() {
this.handles = this.generateHandles(this.nzRange ? 2 : 1);
this.sliderDOM = this.slider.nativeElement;
this.marksArray = this.nzMarks ? this.generateMarkItems(this.nzMarks) : null;
this.createDraggingObservables();
this.toggleDragDisabled(this.nzDisabled);
if (this.getValue() === null) {
this.setValue(this.formatValue(null));
}
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { nzDisabled, nzMarks, nzRange } = changes;
if (nzDisabled && !nzDisabled.firstChange) {
this.toggleDragDisabled(nzDisabled.currentValue);
}
else if (nzMarks && !nzMarks.firstChange) {
this.marksArray = this.nzMarks ? this.generateMarkItems(this.nzMarks) : null;
}
else if (nzRange && !nzRange.firstChange) {
this.setValue(this.formatValue(null));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.unsubscribeDrag();
}
/**
* @param {?} val
* @return {?}
*/
writeValue(val) {
this.setValue(val, true);
}
/**
* @param {?} _value
* @return {?}
*/
onValueChange(_value) {
}
/**
* @return {?}
*/
onTouched() {
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onValueChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.toggleDragDisabled(isDisabled);
}
/**
* @private
* @param {?} value
* @param {?=} isWriteValue
* @return {?}
*/
setValue(value, isWriteValue = false) {
if (isWriteValue) {
this.value = this.formatValue(value);
this.updateTrackAndHandles();
}
else if (!this.valuesEqual(this.value, value)) {
this.value = value;
this.updateTrackAndHandles();
this.onValueChange(this.getValue(true));
}
}
/**
* @private
* @param {?=} cloneAndSort
* @return {?}
*/
getValue(cloneAndSort = false) {
if (cloneAndSort && isValueARange(this.value)) {
return shallowCopyArray(this.value).sort((/**
* @param {?} a
* @param {?} b
* @return {?}
*/
(a, b) => a - b));
}
return this.value;
}
/**
* Clone & sort current value and convert them to offsets, then return the new one.
* @private
* @param {?=} value
* @return {?}
*/
getValueToOffset(value) {
/** @type {?} */
let normalizedValue = value;
if (typeof normalizedValue === 'undefined') {
normalizedValue = this.getValue(true);
}
return isValueARange(normalizedValue)
? normalizedValue.map((/**
* @param {?} val
* @return {?}
*/
val => this.valueToOffset(val)))
: this.valueToOffset(normalizedValue);
}
/**
* Find the closest value to be activated (only for range = true).
* @private
* @param {?} pointerValue
* @return {?}
*/
setActiveValueIndex(pointerValue) {
/** @type {?} */
const value = this.getValue();
if (isValueARange(value)) {
/** @type {?} */
let minimal = null;
/** @type {?} */
let gap;
/** @type {?} */
let activeIndex;
value.forEach((/**
* @param {?} val
* @param {?} index
* @return {?}
*/
(val, index) => {
gap = Math.abs(pointerValue - val);
if (minimal === null || gap < minimal) {
minimal = gap;
activeIndex = index;
}
}));
this.activeValueIndex = activeIndex;
}
}
/**
* @private
* @param {?} pointerValue
* @return {?}
*/
setActiveValue(pointerValue) {
if (isValueARange(this.value)) {
/** @type {?} */
const newValue = shallowCopyArray(this.value);
newValue[this.activeValueIndex] = pointerValue;
this.setValue(newValue);
}
else {
this.setValue(pointerValue);
}
}
/**
* Update track and handles' position and length.
* @private
* @return {?}
*/
updateTrackAndHandles() {
/** @type {?} */
const value = this.getValue();
/** @type {?} */
const offset = this.getValueToOffset(value);
/** @type {?} */
const valueSorted = this.getValue(true);
/** @type {?} */
const offsetSorted = this.getValueToOffset(valueSorted);
/** @type {?} */
const boundParts = this.nzRange ? (/** @type {?} */ (valueSorted)) : [0, valueSorted];
/** @type {?} */
const trackParts = this.nzRange ? [offsetSorted[0], offsetSorted[1] - offsetSorted[0]] : [0, offsetSorted];
this.handles.forEach((/**
* @param {?} handle
* @param {?} index
* @return {?}
*/
(handle, index) => {
handle.offset = this.nzRange ? offset[index] : offset;
handle.value = this.nzRange ? value[index] : value;
}));
[this.bounds.lower, this.bounds.upper] = boundParts;
[this.track.offset, this.track.length] = trackParts;
this.cdr.markForCheck();
}
/**
* @private
* @param {?} value
* @return {?}
*/
onDragStart(value) {
this.toggleDragMoving(true);
this.cacheSliderProperty();
this.setActiveValueIndex(value);
this.setActiveValue(value);
this.showHandleTooltip(this.nzRange ? this.activeValueIndex : 0);
}
/**
* @private
* @param {?} value
* @return {?}
*/
onDragMove(value) {
this.setActiveValue(value);
this.cdr.markForCheck();
}
/**
* @private
* @return {?}
*/
onDragEnd() {
this.nzOnAfterChange.emit(this.getValue(true));
this.toggleDragMoving(false);
this.cacheSliderProperty(true);
this.hideAllHandleTooltip();
this.cdr.markForCheck();
}
/**
* Create user interactions handles.
* @private
* @return {?}
*/
createDraggingObservables() {
/** @type {?} */
const sliderDOM = this.sliderDOM;
/** @type {?} */
const orientField = this.nzVertical ? 'pageY' : 'pageX';
/** @type {?} */
const mouse = {
start: 'mousedown',
move: 'mousemove',
end: 'mouseup',
pluckKey: [orientField]
};
/** @type {?} */
const touch = {
start: 'touchstart',
move: 'touchmove',
end: 'touchend',
pluckKey: ['touches', '0', orientField],
filter: (/**
* @param {?} e
* @return {?}
*/
(e) => e instanceof TouchEvent)
};
[mouse, touch].forEach((/**
* @param {?} source
* @return {?}
*/
source => {
const { start, move, end, pluckKey, filter: filterFunc = ((/**
* @return {?}
*/
() => true)) } = source;
source.startPlucked$ = fromEvent(sliderDOM, start).pipe(filter(filterFunc), tap(silentEvent), pluck(...pluckKey), map((/**
* @param {?} position
* @return {?}
*/
(position) => this.findClosestValue(position))));
source.end$ = fromEvent(document, end);
source.moveResolved$ = fromEvent(document, move).pipe(filter(filterFunc), tap(silentEvent), pluck(...pluckKey), distinctUntilChanged(), map((/**
* @param {?} position
* @return {?}
*/
(position) => this.findClosestValue(position))), distinctUntilChanged(), takeUntil(source.end$));
}));
this.dragStart$ = merge(mouse.startPlucked$, touch.startPlucked$);
this.dragMove$ = merge(mouse.moveResolved$, touch.moveResolved$);
this.dragEnd$ = merge(mouse.end$, touch.end$);
}
/**
* @private
* @param {?=} periods
* @return {?}
*/
subscribeDrag(periods = ['start', 'move', 'end']) {
if (periods.indexOf('start') !== -1 && this.dragStart$ && !this.dragStart_) {
this.dragStart_ = this.dragStart$.subscribe(this.onDragStart.bind(this));
}
if (periods.indexOf('move') !== -1 && this.dragMove$ && !this.dragMove_) {
this.dragMove_ = this.dragMove$.subscribe(this.onDragMove.bind(this));
}
if (periods.indexOf('end') !== -1 && this.dragEnd$ && !this.dragEnd_) {
this.dragEnd_ = this.dragEnd$.subscribe(this.onDragEnd.bind(this));
}
}
/**
* @private
* @param {?=} periods
* @return {?}
*/
unsubscribeDrag(periods = ['start', 'move', 'end']) {
if (periods.indexOf('start') !== -1 && this.dragStart_) {
this.dragStart_.unsubscribe();
this.dragStart_ = null;
}
if (periods.indexOf('move') !== -1 && this.dragMove_) {
this.dragMove_.unsubscribe();
this.dragMove_ = null;
}
if (periods.indexOf('end') !== -1 && this.dragEnd_) {
this.dragEnd_.unsubscribe();
this.dragEnd_ = null;
}
}
/**
* @private
* @param {?} movable
* @return {?}
*/
toggleDragMoving(movable) {
/** @type {?} */
const periods = ['move', 'end'];
if (movable) {
this.isDragging = true;
this.subscribeDrag(periods);
}
else {
this.isDragging = false;
this.unsubscribeDrag(periods);
}
}
/**
* @private
* @param {?} disabled
* @return {?}
*/
toggleDragDisabled(disabled) {
if (disabled) {
this.unsubscribeDrag();
}
else {
this.subscribeDrag(['start']);
}
}
/**
* @private
* @param {?} position
* @return {?}
*/
findClosestValue(position) {
/** @type {?} */
const sliderStart = this.getSliderStartPosition();
/** @type {?} */
const sliderLength = this.getSliderLength();
/** @type {?} */
const ratio = ensureNumberInRange((position - sliderStart) / sliderLength, 0, 1);
/** @type {?} */
const val = (this.nzMax - this.nzMin) * (this.nzVertical ? 1 - ratio : ratio) + this.nzMin;
/** @type {?} */
const points = (this.nzMarks === null ? [] : Object.keys(this.nzMarks).map(parseFloat));
if (this.nzStep !== null && !this.nzDots) {
/** @type {?} */
const closestOne = Math.round(val / this.nzStep) * this.nzStep;
points.push(closestOne);
}
/** @type {?} */
const gaps = points.map((/**
* @param {?} point
* @return {?}
*/
point => Math.abs(val - point)));
/** @type {?} */
const closest = points[gaps.indexOf(Math.min(...gaps))];
return this.nzStep === null ? closest : parseFloat(closest.toFixed(getPrecision(this.nzStep)));
}
/**
* @private
* @param {?} value
* @return {?}
*/
valueToOffset(value) {
return getPercent(this.nzMin, this.nzMax, value);
}
/**
* @private
* @return {?}
*/
getSliderStartPosition() {
if (this.cacheSliderStart !== null) {
return this.cacheSliderStart;
}
/** @type {?} */
const offset = getElementOffset(this.sliderDOM);
return this.nzVertical ? offset.top : offset.left;
}
/**
* @private
* @return {?}
*/
getSliderLength() {
if (this.cacheSliderLength !== null) {
return this.cacheSliderLength;
}
/** @type {?} */
const sliderDOM = this.sliderDOM;
return this.nzVertical ? sliderDOM.clientHeight : sliderDOM.clientWidth;
}
/**
* Cache DOM layout/reflow operations for performance (may not necessary?)
* @private
* @param {?=} remove
* @return {?}
*/
cacheSliderProperty(remove = false) {
this.cacheSliderStart = remove ? null : this.getSliderStartPosition();
this.cacheSliderLength = remove ? null : this.getSliderLength();
}
/**
* @private
* @param {?} value
* @return {?}
*/
formatValue(value) {
/** @type {?} */
let res = value;
if (!this.assertValueValid(value)) {
res = this.nzDefaultValue === null
? (this.nzRange ? [this.nzMin, this.nzMax] : this.nzMin)
: this.nzDefaultValue;
}
else {
res = isValueARange(value)
? value.map((/**
* @param {?} val
* @return {?}
*/
val => ensureNumberInRange(val, this.nzMin, this.nzMax)))
: ensureNumberInRange(value, this.nzMin, this.nzMax);
}
return res;
}
/**
* Check if value is valid and throw error if value-type/range not match.
* @private
* @param {?} value
* @return {?}
*/
assertValueValid(value) {
if (value === null || value === undefined) {
return false;
}
if (!Array.isArray(value) && isNaN(typeof value !== 'number' ? parseFloat(value) : value)) {
return false;
}
return this.assertValueTypeMatch(value);
}
/**
* Assert that if `this.nzRange` is `true`, value is also a range, vice versa.
* @private
* @param {?} value
* @return {?}
*/
assertValueTypeMatch(value) {
if (isValueARange(value) !== this.nzRange) {
throw getValueTypeNotMatchError();
}
return true;
}
/**
* @private
* @param {?} valA
* @param {?} valB
* @return {?}
*/
valuesEqual(valA, valB) {
if (typeof valA !== typeof valB) {
return false;
}
return isValueARange(valA) && isValueARange(valB) ? arraysEqual(valA, valB) : valA === valB;
}
/**
* Show one handle's tooltip and hide others'.
* @private
* @param {?=} handleIndex
* @return {?}
*/
showHandleTooltip(handleIndex = 0) {
this.handles.forEach((/**
* @param {?} handle
* @param {?} index
* @return {?}
*/
(handle, index) => {
handle.active = index === handleIndex;
}));
}
/**
* @private
* @return {?}
*/
hideAllHandleTooltip() {
this.handles.forEach((/**
* @param {?} handle
* @return {?}
*/
handle => handle.active = false));
}
/**
* @private
* @param {?} amount
* @return {?}
*/
generateHandles(amount) {
return Array(amount).fill(0).map((/**
* @return {?}
*/
() => ({ offset: null, value: null, active: false })));
}
/**
* @private
* @param {?} marks
* @return {?}
*/
generateMarkItems(marks) {
/** @type {?} */
const marksArray = [];
for (const key in marks) {
/** @type {?} */
const mark = marks[key];
/** @type {?} */
const val = typeof key === 'number' ? key : parseFloat(key);
if (val >= this.nzMin && val <= this.nzMax) {
marksArray.push({ value: val, offset: this.valueToOffset(val), config: mark });
}
}
return marksArray.length ? marksArray : null;
}
}
NzSliderComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-slider',
preserveWhitespaces: false,
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzSliderComponent)),
multi: true
}],
template: "<div #slider\n class=\"ant-slider\"\n [class.ant-slider-disabled]=\"nzDisabled\"\n [class.ant-slider-vertical]=\"nzVertical\"\n [class.ant-slider-with-marks]=\"marksArray\">\n <div class=\"ant-slider-rail\"></div>\n <nz-slider-track\n [nzVertical]=\"nzVertical\"\n [nzIncluded]=\"nzIncluded\"\n [nzOffset]=\"track.offset\"\n [nzLength]=\"track.length\"></nz-slider-track>\n <nz-slider-step\n *ngIf=\"marksArray\"\n [nzVertical]=\"nzVertical\"\n [nzLowerBound]=\"bounds.lower\"\n [nzUpperBound]=\"bounds.upper\"\n [nzMarksArray]=\"marksArray\"\n [nzIncluded]=\"nzIncluded\"></nz-slider-step>\n <nz-slider-handle\n *ngFor=\"let handle of handles\"\n [nzVertical]=\"nzVertical\"\n [nzOffset]=\"handle.offset\"\n [nzValue]=\"handle.value\"\n [nzActive]=\"handle.active\"\n [nzTipFormatter]=\"nzTipFormatter\"\n [nzTooltipVisible]=\"nzTooltipVisible\"></nz-slider-handle>\n <nz-slider-marks \n *ngIf=\"marksArray\"\n [nzVertical]=\"nzVertical\"\n [nzMin]=\"nzMin\"\n [nzMax]=\"nzMax\"\n [nzLowerBound]=\"bounds.lower\"\n [nzUpperBound]=\"bounds.upper\"\n [nzMarksArray]=\"marksArray\"\n [nzIncluded]=\"nzIncluded\"></nz-slider-marks>\n</div>"
}] }
];
/** @nocollapse */
NzSliderComponent.ctorParameters = () => [
{ type: ChangeDetectorRef }
];
NzSliderComponent.propDecorators = {
slider: [{ type: ViewChild, args: ['slider',] }],
nzDisabled: [{ type: Input }],
nzDots: [{ type: Input }],
nzIncluded: [{ type: Input }],
nzRange: [{ type: Input }],
nzVertical: [{ type: Input }],
nzMarks: [{ type: Input }],
nzMax: [{ type: Input }],
nzMin: [{ type: Input }],
nzStep: [{ type: Input }],
nzTooltipVisible: [{ type: Input }],
nzTipFormatter: [{ type: Input }],
nzDefaultValue: [{ type: Input }],
nzOnAfterChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzSliderComponent.prototype, "nzDots", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzSliderComponent.prototype, "nzIncluded", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzSliderComponent.prototype, "nzRange", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzSliderComponent.prototype, "nzVertical", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderHandleComponent {
/**
* @param {?} sliderComponent
* @param {?} cdr
*/
constructor(sliderComponent, cdr) {
this.sliderComponent = sliderComponent;
this.cdr = cdr;
this.nzTooltipVisible = 'default';
this.nzActive = false;
this.style = {};
this.hovers_ = new Subscription();
this.enterHandle = (/**
* @return {?}
*/
() => {
if (!this.sliderComponent.isDragging) {
this.toggleTooltip(true);
this.updateTooltipPosition();
this.cdr.detectChanges();
}
});
this.leaveHandle = (/**
* @return {?}
*/
() => {
if (!this.sliderComponent.isDragging) {
this.toggleTooltip(false);
this.cdr.detectChanges();
}
});
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
const { nzOffset, nzValue, nzActive, nzTooltipVisible } = changes;
if (nzOffset) {
this.updateStyle();
}
if (nzValue) {
this.updateTooltipTitle();
this.updateTooltipPosition();
}
if (nzActive) {
if (nzActive.currentValue) {
this.toggleTooltip(true);
}
else {
this.toggleTooltip(false);
}
}
if (nzTooltipVisible && nzTooltipVisible.currentValue === 'always') {
Promise.resolve().then((/**
* @return {?}
*/
() => this.toggleTooltip(true, true)));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.hovers_.unsubscribe();
}
/**
* @private
* @param {?} show
* @param {?=} force
* @return {?}
*/
toggleTooltip(show, force = false) {
if (!force && (this.nzTooltipVisible !== 'default' || !this.tooltip)) {
return;
}
if (show) {
this.tooltip.show();
}
else {
this.tooltip.hide();
}
}
/**
* @private
* @return {?}
*/
updateTooltipTitle() {
this.tooltipTitle = this.nzTipFormatter ? this.nzTipFormatter(this.nzValue) : `${this.nzValue}`;
}
/**
* @private
* @return {?}
*/
updateTooltipPosition() {
if (this.tooltip) {
Promise.resolve().then((/**
* @return {?}
*/
() => this.tooltip.updatePosition()));
}
}
/**
* @private
* @return {?}
*/
updateStyle() {
this.style[this.nzVertical ? 'bottom' : 'left'] = `${this.nzOffset}%`;
}
}
NzSliderHandleComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-slider-handle',
preserveWhitespaces: false,
template: "<nz-tooltip\n *ngIf=\"nzTipFormatter !== null && nzTooltipVisible !== 'never'\"\n [nzTitle]=\"tooltipTitle\"\n [nzTrigger]=\"null\">\n <div nz-tooltip class=\"ant-slider-handle\" [ngStyle]=\"style\"></div>\n</nz-tooltip>\n<div *ngIf=\"nzTipFormatter === null || nzTooltipVisible === 'never'\" class=\"ant-slider-handle\" [ngStyle]=\"style\"></div>\n",
host: {
'(mouseenter)': 'enterHandle()',
'(mouseleave)': 'leaveHandle()'
}
}] }
];
/** @nocollapse */
NzSliderHandleComponent.ctorParameters = () => [
{ type: NzSliderComponent },
{ type: ChangeDetectorRef }
];
NzSliderHandleComponent.propDecorators = {
tooltip: [{ type: ViewChild, args: [NzToolTipComponent,] }],
nzVertical: [{ type: Input }],
nzOffset: [{ type: Input }],
nzValue: [{ type: Input }],
nzTooltipVisible: [{ type: Input }],
nzTipFormatter: [{ type: Input }],
nzActive: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderHandleComponent.prototype, "nzActive", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderMarksComponent {
constructor() {
this.nzLowerBound = null;
this.nzUpperBound = null;
this.nzVertical = false;
this.nzIncluded = false;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzMarksArray) {
this.buildMarks();
}
if (changes.nzMarksArray || changes.nzLowerBound || changes.nzUpperBound) {
this.togglePointActive();
}
}
/**
* @param {?} _index
* @param {?} mark
* @return {?}
*/
trackById(_index, mark) {
return mark.value;
}
/**
* @private
* @return {?}
*/
buildMarks() {
/** @type {?} */
const range = this.nzMax - this.nzMin;
this.marks = this.nzMarksArray.map((/**
* @param {?} mark
* @return {?}
*/
mark => {
const { value, offset, config } = mark;
/** @type {?} */
const style$$1 = this.buildStyles(value, range, config);
/** @type {?} */
const label = isConfigAObject(config) ? config.label : config;
return {
label,
offset,
style: style$$1,
value,
config,
active: false
};
}));
}
/**
* @private
* @param {?} value
* @param {?} range
* @param {?} config
* @return {?}
*/
buildStyles(value, range, config) {
/** @type {?} */
let style$$1;
if (this.nzVertical) {
style$$1 = {
marginBottom: '-50%',
bottom: `${(value - this.nzMin) / range * 100}%`
};
}
else {
/** @type {?} */
const marksCount = this.nzMarksArray.length;
/** @type {?} */
const unit = 100 / (marksCount - 1);
/** @type {?} */
const markWidth = unit * 0.9;
style$$1 = {
width: `${markWidth}%`,
marginLeft: `${-markWidth / 2}%`,
left: `${(value - this.nzMin) / range * 100}%`
};
}
if (isConfigAObject(config) && config.style) {
style$$1 = Object.assign({}, style$$1, config.style);
}
return style$$1;
}
/**
* @private
* @return {?}
*/
togglePointActive() {
if (this.marks && this.nzLowerBound !== null && this.nzUpperBound !== null) {
this.marks.forEach((/**
* @param {?} mark
* @return {?}
*/
mark => {
/** @type {?} */
const value = mark.value;
/** @type {?} */
const isActive = (!this.nzIncluded && value === this.nzUpperBound) ||
(this.nzIncluded && value <= this.nzUpperBound && value >= this.nzLowerBound);
mark.active = isActive;
}));
}
}
}
NzSliderMarksComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
selector: 'nz-slider-marks',
template: "<div class=\"ant-slider-mark\">\n <span\n class=\"ant-slider-mark-text\"\n *ngFor=\"let attr of marks; trackBy: trackById\"\n [class.ant-slider-mark-active]=\"attr.active\"\n [ngStyle]=\"attr.style\"\n [innerHTML]=\"attr.label\">\n </span>\n</div>"
}] }
];
NzSliderMarksComponent.propDecorators = {
nzLowerBound: [{ type: Input }],
nzUpperBound: [{ type: Input }],
nzMarksArray: [{ type: Input }],
nzMin: [{ type: Input }],
nzMax: [{ type: Input }],
nzVertical: [{ type: Input }],
nzIncluded: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderMarksComponent.prototype, "nzVertical", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderMarksComponent.prototype, "nzIncluded", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderStepComponent {
constructor() {
this.nzLowerBound = null;
this.nzUpperBound = null;
this.nzVertical = false;
this.nzIncluded = false;
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzMarksArray) {
this.buildSteps();
}
if (changes.nzMarksArray || changes.nzLowerBound || changes.nzUpperBound) {
this.togglePointActive();
}
}
/**
* @param {?} _index
* @param {?} step
* @return {?}
*/
trackById(_index, step) {
return step.value;
}
/**
* @private
* @return {?}
*/
buildSteps() {
/** @type {?} */
const orient = this.nzVertical ? 'bottom' : 'left';
this.steps = this.nzMarksArray.map((/**
* @param {?} mark
* @return {?}
*/
mark => {
const { value, offset, config } = mark;
return {
value,
offset,
config,
active: false,
style: {
[orient]: `${offset}%`
}
};
}));
}
/**
* @private
* @return {?}
*/
togglePointActive() {
if (this.steps && this.nzLowerBound !== null && this.nzUpperBound !== null) {
this.steps.forEach((/**
* @param {?} step
* @return {?}
*/
step => {
/** @type {?} */
const value = step.value;
/** @type {?} */
const isActive = (!this.nzIncluded && value === this.nzUpperBound) ||
(this.nzIncluded && value <= this.nzUpperBound && value >= this.nzLowerBound);
step.active = isActive;
}));
}
}
}
NzSliderStepComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-slider-step',
preserveWhitespaces: false,
template: "<div class=\"ant-slider-step\">\n <span\n class=\"ant-slider-dot\"\n *ngFor=\"let mark of steps; trackBy: trackById\"\n [class.ant-slider-dot-active]=\"mark.active\"\n [ngStyle]=\"mark.style\">\n </span>\n</div>"
}] }
];
NzSliderStepComponent.propDecorators = {
nzLowerBound: [{ type: Input }],
nzUpperBound: [{ type: Input }],
nzMarksArray: [{ type: Input }],
nzVertical: [{ type: Input }],
nzIncluded: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderStepComponent.prototype, "nzVertical", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderStepComponent.prototype, "nzIncluded", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderTrackComponent {
constructor() {
this.nzVertical = false;
this.nzIncluded = false;
this.style = {};
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzIncluded) {
this.style.visibility = this.nzIncluded ? 'visible' : 'hidden';
}
if (changes.nzVertical || changes.nzOffset || changes.nzLength) {
if (this.nzVertical) {
this.style.bottom = `${this.nzOffset}%`;
this.style.height = `${this.nzLength}%`;
this.style.left = null;
this.style.width = null;
}
else {
this.style.left = `${this.nzOffset}%`;
this.style.width = `${this.nzLength}%`;
this.style.bottom = null;
this.style.height = null;
}
}
}
}
NzSliderTrackComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-slider-track',
preserveWhitespaces: false,
template: "<div class=\"ant-slider-track\" [ngStyle]=\"style\"></div>"
}] }
];
NzSliderTrackComponent.propDecorators = {
nzOffset: [{ type: Input }],
nzLength: [{ type: Input }],
nzVertical: [{ type: Input }],
nzIncluded: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderTrackComponent.prototype, "nzVertical", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSliderTrackComponent.prototype, "nzIncluded", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSliderModule {
}
NzSliderModule.decorators = [
{ type: NgModule, args: [{
exports: [
NzSliderComponent,
NzSliderTrackComponent,
NzSliderHandleComponent,
NzSliderStepComponent,
NzSliderMarksComponent
],
declarations: [
NzSliderComponent,
NzSliderTrackComponent,
NzSliderHandleComponent,
NzSliderStepComponent,
NzSliderMarksComponent
],
imports: [CommonModule, NzToolTipModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const REFRESH_INTERVAL = 1000 / 30;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStatisticComponent {
constructor() {
this.nzValueStyle = {};
}
}
NzStatisticComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-statistic',
template: "<div class=\"ant-statistic-title\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n</div>\n<div class=\"ant-statistic-content\" [ngStyle]=\"nzValueStyle\">\n <span *ngIf=\"nzPrefix\" class=\"ant-statistic-content-prefix\">\n <ng-container *nzStringTemplateOutlet=\"nzPrefix\">{{ nzPrefix }}</ng-container>\n </span>\n <nz-statistic-number\n [nzValue]=\"nzValue\"\n [nzValueTemplate]=\"nzValueTemplate\">\n </nz-statistic-number>\n <span *ngIf=\"nzSuffix\" class=\"ant-statistic-content-suffix\">\n <ng-container *nzStringTemplateOutlet=\"nzSuffix\">{{ nzSuffix }}</ng-container>\n </span>\n</div>\n",
host: {
class: 'ant-statistic'
},
styles: ['nz-statistic { display: block; }']
}] }
];
NzStatisticComponent.propDecorators = {
nzPrefix: [{ type: Input }],
nzSuffix: [{ type: Input }],
nzTitle: [{ type: Input }],
nzValue: [{ type: Input }],
nzValueStyle: [{ type: Input }],
nzValueTemplate: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzCountdownComponent extends NzStatisticComponent {
/**
* @param {?} cdr
* @param {?} ngZone
*/
constructor(cdr, ngZone) {
super();
this.cdr = cdr;
this.ngZone = ngZone;
/**
* @override
*/
this.nzFormat = 'HH:mm:ss';
}
/**
* @override
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzValue) {
this.target = Number(changes.nzValue.currentValue);
if (!changes.nzValue.isFirstChange()) {
this.syncTimer();
}
}
}
/**
* @return {?}
*/
ngOnInit() {
this.syncTimer();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.stopTimer();
}
/**
* @return {?}
*/
syncTimer() {
if (this.target >= Date.now()) {
this.startTimer();
}
else {
this.stopTimer();
}
}
/**
* @return {?}
*/
startTimer() {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
this.stopTimer();
this.updater_ = interval(REFRESH_INTERVAL).subscribe((/**
* @return {?}
*/
() => {
this.updateValue();
this.cdr.detectChanges();
}));
}));
}
/**
* @return {?}
*/
stopTimer() {
if (this.updater_) {
this.updater_.unsubscribe();
this.updater_ = null;
}
}
/**
* Update time that should be displayed on the screen.
* @protected
* @return {?}
*/
updateValue() {
this.diff = Math.max(this.target - Date.now(), 0);
if (this.diff === 0) {
this.stopTimer();
}
}
}
NzCountdownComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-countdown',
template: "<nz-statistic\n [nzValue]=\"diff\"\n [nzValueStyle]=\"nzValueStyle\"\n [nzValueTemplate]=\"nzValueTemplate || countDownTpl\"\n [nzTitle]=\"nzTitle\"\n [nzPrefix]=\"nzPrefix\"\n [nzSuffix]=\"nzSuffix\">\n</nz-statistic>\n\n<ng-template #countDownTpl>{{ diff | nzTimeRange: nzFormat }}</ng-template>"
}] }
];
/** @nocollapse */
NzCountdownComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NgZone }
];
NzCountdownComponent.propDecorators = {
nzFormat: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStatisticNumberComponent {
/**
* @param {?} locale_id
*/
constructor(locale_id) {
this.locale_id = locale_id;
this.displayInt = '';
this.displayDecimal = '';
}
/**
* @return {?}
*/
ngOnChanges() {
this.formatNumber();
}
/**
* @private
* @return {?}
*/
formatNumber() {
/** @type {?} */
const decimalSeparator = typeof this.nzValue === 'number'
? '.'
: getLocaleNumberSymbol(this.locale_id, NumberSymbol.Decimal);
/** @type {?} */
const value = String(this.nzValue);
const [int, decimal] = value.split(decimalSeparator);
this.displayInt = int;
this.displayDecimal = decimal ? `${decimalSeparator}${decimal}` : '';
}
}
NzStatisticNumberComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
selector: 'nz-statistic-number',
template: "<ng-container\n *ngIf=\"nzValueTemplate\"\n [ngTemplateOutlet]=\"nzValueTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: nzValue }\">\n</ng-container>\n<ng-container *ngIf=\"!nzValueTemplate\">\n <span *ngIf=\"displayInt\" class=\"ant-statistic-content-value-int\">{{ displayInt }}</span>\n <span *ngIf=\"displayDecimal\" class=\"ant-statistic-content-value-decimal\">{{ displayDecimal }}</span>\n</ng-container>\n",
host: {
'class': 'ant-statistic-content-value'
},
styles: ['nz-number { display: inline }']
}] }
];
/** @nocollapse */
NzStatisticNumberComponent.ctorParameters = () => [
{ type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
];
NzStatisticNumberComponent.propDecorators = {
nzValue: [{ type: Input }],
nzValueTemplate: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimeRangePipe {
/**
* @param {?} value
* @param {?=} format
* @return {?}
*/
transform(value, format = 'HH:mm:ss') {
/** @type {?} */
let duration = Number(value || 0);
return timeUnits.reduce((/**
* @param {?} current
* @param {?} __1
* @return {?}
*/
(current, [name, unit]) => {
if (current.indexOf(name) !== -1) {
/** @type {?} */
const v = Math.floor(duration / unit);
duration -= v * unit;
return current.replace(new RegExp(`${name}+`, 'g'), (/**
* @param {?} match
* @return {?}
*/
(match) => {
return padStart(v.toString(), match.length, '0');
}));
}
return current;
}), format);
}
}
NzTimeRangePipe.decorators = [
{ type: Pipe, args: [{
name: 'nzTimeRange',
pure: true
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStatisticModule {
}
NzStatisticModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzAddOnModule],
declarations: [NzStatisticComponent, NzCountdownComponent, NzStatisticNumberComponent, NzTimeRangePipe],
exports: [NzStatisticComponent, NzCountdownComponent, NzStatisticNumberComponent, NzTimeRangePipe]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStepComponent {
/**
* @param {?} cdr
* @param {?} renderer
* @param {?} elementRef
*/
constructor(cdr, renderer, elementRef) {
this.cdr = cdr;
this.isCustomStatus = false;
this._status = 'wait';
this.oldAPIIcon = true;
this.isIconString = true;
// Set by parent.
this.direction = 'horizontal';
this.index = 0;
this.last = false;
this.outStatus = 'process';
this.showProcessDot = false;
this._currentIndex = 0;
renderer.addClass(elementRef.nativeElement, 'ant-steps-item');
}
/**
* @return {?}
*/
get nzStatus() {
return this._status;
}
/**
* @param {?} status
* @return {?}
*/
set nzStatus(status) {
this._status = status;
this.isCustomStatus = true;
}
/**
* @return {?}
*/
get nzIcon() {
return this._icon;
}
/**
* @param {?} value
* @return {?}
*/
set nzIcon(value) {
if (!(value instanceof TemplateRef)) {
this.isIconString = true;
this.oldAPIIcon = typeof value === 'string' && value.indexOf('anticon') > -1;
}
else {
this.isIconString = false;
}
this._icon = value;
}
/**
* @return {?}
*/
get currentIndex() {
return this._currentIndex;
}
/**
* @param {?} current
* @return {?}
*/
set currentIndex(current) {
this._currentIndex = current;
if (!this.isCustomStatus) {
this._status = current > this.index
? 'finish'
: current === this.index
? this.outStatus || ''
: 'wait';
}
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
}
NzStepComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-step',
preserveWhitespaces: false,
template: "<div class=\"ant-steps-item-tail\" *ngIf=\"last !== true\"></div>\n<div class=\"ant-steps-item-icon\">\n <ng-template [ngIf]=\"!showProcessDot\">\n <span class=\"ant-steps-icon\" *ngIf=\"nzStatus === 'finish' && !nzIcon\"><i nz-icon type=\"check\"></i></span>\n <span class=\"ant-steps-icon\" *ngIf=\"nzStatus === 'error'\"><i nz-icon type=\"close\"></i></span>\n <span class=\"ant-steps-icon\" *ngIf=\"(nzStatus === 'process' || nzStatus === 'wait') && !nzIcon\">{{ index + 1 }}</span>\n <span class=\"ant-steps-icon\" *ngIf=\"nzIcon\">\n <ng-container *ngIf=\"isIconString; else iconTemplate\">\n <i nz-icon [type]=\"!oldAPIIcon && nzIcon\" [ngClass]=\"oldAPIIcon && nzIcon\"></i>\n </ng-container>\n <ng-template #iconTemplate>\n <ng-template [ngTemplateOutlet]=\"nzIcon\"></ng-template>\n </ng-template>\n </span>\n </ng-template>\n <ng-template [ngIf]=\"showProcessDot\">\n <span class=\"ant-steps-icon\">\n <ng-template #processDotTemplate>\n <span class=\"ant-steps-icon-dot\"></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customProcessTemplate||processDotTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: processDotTemplate, status:nzStatus, index:index }\">\n </ng-template>\n </span>\n </ng-template>\n</div>\n<div class=\"ant-steps-item-content\">\n <div class=\"ant-steps-item-title\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-steps-item-description\">\n <ng-container *nzStringTemplateOutlet=\"nzDescription\">{{ nzDescription }}</ng-container>\n </div>\n</div>\n",
host: {
'[class.ant-steps-item-wait]': 'nzStatus === "wait"',
'[class.ant-steps-item-process]': 'nzStatus === "process"',
'[class.ant-steps-item-finish]': 'nzStatus === "finish"',
'[class.ant-steps-item-error]': 'nzStatus === "error"',
'[class.ant-steps-custom]': '!!nzIcon',
'[class.ant-steps-next-error]': '(outStatus === "error") && (currentIndex === index + 1)'
}
}] }
];
/** @nocollapse */
NzStepComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: ElementRef }
];
NzStepComponent.propDecorators = {
processDotTemplate: [{ type: ViewChild, args: ['processDotTemplate',] }],
nzTitle: [{ type: Input }],
nzDescription: [{ type: Input }],
nzStatus: [{ type: Input }],
nzIcon: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStepsComponent {
constructor() {
this.nzCurrent = 0;
this.nzDirection = 'horizontal';
this.nzLabelPlacement = 'horizontal';
this.nzSize = 'default';
this.nzStartIndex = 0;
this.nzStatus = 'process';
this.showProcessDot = false;
this.destroy$ = new Subject();
}
/**
* @param {?} value
* @return {?}
*/
set nzProgressDot(value) {
if (value instanceof TemplateRef) {
this.showProcessDot = true;
this.customProcessDotTemplate = value;
}
else {
this.showProcessDot = toBoolean(value);
}
this.updateChildrenSteps();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzStartIndex || changes.nzDirection || changes.nzStatus || changes.nzCurrent) {
this.updateChildrenSteps();
}
if (changes.nzDirection || changes.nzProgressDot || changes.nzLabelPlacement || changes.nzSize) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.updateChildrenSteps();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.updateChildrenSteps();
if (this.steps) {
this.steps.changes.pipe(takeUntil(this.destroy$)).subscribe(this.updateChildrenSteps);
}
}
/**
* @private
* @return {?}
*/
updateChildrenSteps() {
if (this.steps) {
/** @type {?} */
const length = this.steps.length;
this.steps.toArray().forEach((/**
* @param {?} step
* @param {?} index
* @return {?}
*/
(step, index) => {
Promise.resolve().then((/**
* @return {?}
*/
() => {
step.outStatus = this.nzStatus;
step.showProcessDot = this.showProcessDot;
if (this.customProcessDotTemplate) {
step.customProcessTemplate = this.customProcessDotTemplate;
}
step.direction = this.nzDirection;
step.index = index + this.nzStartIndex;
step.currentIndex = this.nzCurrent;
step.last = length === index + 1;
step.markForCheck();
}));
}));
}
}
/**
* @private
* @return {?}
*/
setClassMap() {
this.classMap = {
[`ant-steps-${this.nzDirection}`]: true,
[`ant-steps-label-horizontal`]: this.nzDirection === 'horizontal',
[`ant-steps-label-vertical`]: (this.showProcessDot || this.nzLabelPlacement === 'vertical') && this.nzDirection === 'horizontal',
[`ant-steps-dot`]: this.showProcessDot,
['ant-steps-small']: this.nzSize === 'small'
};
}
}
NzStepsComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
selector: 'nz-steps',
template: "<div class=\"ant-steps\" [ngClass]=\"classMap\">\n <ng-content></ng-content>\n</div>"
}] }
];
NzStepsComponent.propDecorators = {
steps: [{ type: ContentChildren, args: [NzStepComponent,] }],
nzCurrent: [{ type: Input }],
nzDirection: [{ type: Input }],
nzLabelPlacement: [{ type: Input }],
nzSize: [{ type: Input }],
nzStartIndex: [{ type: Input }],
nzStatus: [{ type: Input }],
nzProgressDot: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzStepsModule {
}
NzStepsModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, NzIconModule, NzAddOnModule],
exports: [NzStepsComponent, NzStepComponent],
declarations: [NzStepsComponent, NzStepComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSwitchComponent {
/**
* @param {?} cdr
* @param {?} focusMonitor
*/
constructor(cdr, focusMonitor) {
this.cdr = cdr;
this.focusMonitor = focusMonitor;
this.checked = false;
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
this.nzLoading = false;
this.nzDisabled = false;
this.nzControl = false;
}
/**
* @param {?} e
* @return {?}
*/
hostClick(e) {
e.preventDefault();
if (!this.nzDisabled && !this.nzLoading && !this.nzControl) {
this.updateValue(!this.checked);
}
}
/**
* @param {?} value
* @return {?}
*/
updateValue(value) {
if (this.checked !== value) {
this.checked = value;
this.onChange(this.checked);
}
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
if (!this.nzControl && !this.nzDisabled && !this.nzLoading) {
if (e.keyCode === LEFT_ARROW) {
this.updateValue(false);
e.preventDefault();
}
else if (e.keyCode === RIGHT_ARROW) {
this.updateValue(true);
e.preventDefault();
}
else if (e.keyCode === SPACE || e.keyCode === ENTER) {
this.updateValue(!this.checked);
e.preventDefault();
}
}
}
/**
* @return {?}
*/
focus() {
this.focusMonitor.focusVia(this.switchElement.nativeElement, 'keyboard');
}
/**
* @return {?}
*/
blur() {
this.switchElement.nativeElement.blur();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.focusMonitor.monitor(this.switchElement.nativeElement, true).subscribe((/**
* @param {?} focusOrigin
* @return {?}
*/
focusOrigin => {
if (!focusOrigin) {
// When a focused element becomes disabled, the browser *immediately* fires a blur event.
// Angular does not expect events to be raised during change detection, so any state change
// (such as a form control's 'ng-touched') will cause a changed-after-checked error.
// See https://github.com/angular/angular/issues/17793. To work around this, we defer
// telling the form control it has been touched until the next tick.
Promise.resolve().then((/**
* @return {?}
*/
() => this.onTouched()));
}
}));
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
this.checked = value;
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.cdr.markForCheck();
}
}
NzSwitchComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-switch',
preserveWhitespaces: false,
template: "<button type=\"button\" #switchElement\n nz-wave\n class=\"ant-switch\"\n [disabled]=\"nzDisabled\"\n [class.ant-switch-checked]=\"checked\"\n [class.ant-switch-loading]=\"nzLoading\"\n [class.ant-switch-disabled]=\"nzDisabled\"\n [class.ant-switch-small]=\"nzSize === 'small'\"\n [nzWaveExtraNode]=\"true\"\n (keydown)=\"onKeyDown($event)\">\n <i *ngIf=\"nzLoading\" nz-icon type=\"loading\" class=\"ant-switch-loading-icon\"></i>\n <span class=\"ant-switch-inner\">\n <span>\n <ng-container *ngIf=\"checked\">\n <ng-container *nzStringTemplateOutlet=\"nzCheckedChildren\">{{ nzCheckedChildren }}</ng-container>\n </ng-container>\n <ng-container *ngIf=\"!checked\">\n <ng-container *nzStringTemplateOutlet=\"nzUnCheckedChildren\">{{ nzUnCheckedChildren }}</ng-container>\n </ng-container>\n </span>\n </span>\n</button>",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzSwitchComponent)),
multi: true
}
],
host: {
'(click)': 'hostClick($event)'
},
styles: [`
nz-switch {
display: inline-block;
}`]
}] }
];
/** @nocollapse */
NzSwitchComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: FocusMonitor }
];
NzSwitchComponent.propDecorators = {
switchElement: [{ type: ViewChild, args: ['switchElement',] }],
nzLoading: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzControl: [{ type: Input }],
nzCheckedChildren: [{ type: Input }],
nzUnCheckedChildren: [{ type: Input }],
nzSize: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSwitchComponent.prototype, "nzLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSwitchComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSwitchComponent.prototype, "nzControl", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSwitchModule {
}
NzSwitchModule.decorators = [
{ type: NgModule, args: [{
exports: [NzSwitchComponent],
declarations: [NzSwitchComponent],
imports: [CommonModule, NzWaveModule, NzIconModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMeasureScrollbarService {
// tslint:disable-next-line:no-any
/**
* @param {?} document
*/
constructor(document) {
this.document = document;
this.scrollbarMeasure = {
position: 'absolute',
top: '-9999px',
width: '50px',
height: '50px',
overflow: 'scroll'
};
this.initScrollBarWidth();
}
/**
* @return {?}
*/
get scrollBarWidth() {
if (isNotNil(this._scrollbarWidth)) {
return this._scrollbarWidth;
}
this.initScrollBarWidth();
return this._scrollbarWidth;
}
/**
* @return {?}
*/
initScrollBarWidth() {
/** @type {?} */
const scrollDiv = this.document.createElement('div');
for (const scrollProp in this.scrollbarMeasure) {
if (this.scrollbarMeasure.hasOwnProperty(scrollProp)) {
scrollDiv.style[scrollProp] = this.scrollbarMeasure[scrollProp];
}
}
this.document.body.appendChild(scrollDiv);
/** @type {?} */
const width = scrollDiv.offsetWidth - scrollDiv.clientWidth;
this.document.body.removeChild(scrollDiv);
this._scrollbarWidth = width;
}
}
NzMeasureScrollbarService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzMeasureScrollbarService.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
/** @nocollapse */ NzMeasureScrollbarService.ngInjectableDef = defineInjectable({ factory: function NzMeasureScrollbarService_Factory() { return new NzMeasureScrollbarService(inject(DOCUMENT)); }, token: NzMeasureScrollbarService, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzThComponent {
/**
* @param {?} cdr
* @param {?} i18n
*/
constructor(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 {?}
*/
updateSortValue() {
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 {?}
*/
setSortValue(value) {
this.nzSort = value;
this.nzSortChangeWithKey.emit({ key: this.nzSortKey, value: this.nzSort });
this.nzSortChange.emit(this.nzSort);
}
/**
* @return {?}
*/
get filterList() {
return this.multipleFilterList.filter((/**
* @param {?} item
* @return {?}
*/
item => item.checked)).map((/**
* @param {?} item
* @return {?}
*/
item => item.value));
}
/* tslint:disable-next-line:no-any */
/**
* @return {?}
*/
get filterValue() {
/** @type {?} */
const checkedFilter = this.singleFilterList.find((/**
* @param {?} item
* @return {?}
*/
item => item.checked));
return checkedFilter ? checkedFilter.value : null;
}
/**
* @return {?}
*/
updateFilterStatus() {
if (this.nzFilterMultiple) {
this.hasFilterValue = this.filterList.length > 0;
}
else {
this.hasFilterValue = isNotNil(this.filterValue);
}
}
/**
* @return {?}
*/
search() {
this.updateFilterStatus();
if (this.nzFilterMultiple) {
this.nzFilterChange.emit(this.filterList);
}
else {
this.nzFilterChange.emit(this.filterValue);
}
}
/**
* @return {?}
*/
reset() {
this.initMultipleFilterList(true);
this.initSingleFilterList(true);
this.hasFilterValue = false;
}
/**
* @param {?} filter
* @return {?}
*/
checkMultiple(filter$$1) {
filter$$1.checked = !filter$$1.checked;
}
/**
* @param {?} filter
* @return {?}
*/
checkSingle(filter$$1) {
this.singleFilterList.forEach((/**
* @param {?} item
* @return {?}
*/
item => item.checked = item === filter$$1));
}
/**
* @return {?}
*/
hideDropDown() {
this.nzDropDownComponent.setVisibleStateWhen(false);
this.filterVisible = false;
}
/**
* @param {?} value
* @return {?}
*/
dropDownVisibleChange(value) {
this.filterVisible = value;
if (!value) {
this.search();
}
}
/**
* @param {?=} force
* @return {?}
*/
initMultipleFilterList(force) {
this.multipleFilterList = this.nzFilters.map((/**
* @param {?} item
* @return {?}
*/
item => {
/** @type {?} */
const checked = force ? false : !!item.byDefault;
if (checked) {
this.hasDefaultFilter = true;
}
return { text: item.text, value: item.value, checked };
}));
this.checkDefaultFilters();
}
/**
* @param {?=} force
* @return {?}
*/
initSingleFilterList(force) {
this.singleFilterList = this.nzFilters.map((/**
* @param {?} item
* @return {?}
*/
item => {
/** @type {?} */
const checked = force ? false : !!item.byDefault;
if (checked) {
this.hasDefaultFilter = true;
}
return { text: item.text, value: item.value, checked };
}));
this.checkDefaultFilters();
}
/**
* @return {?}
*/
checkDefaultFilters() {
if (!this.nzFilters || this.nzFilters.length === 0 || !this.hasDefaultFilter) {
return;
}
this.updateFilterStatus();
}
/**
* @return {?}
*/
marForCheck() {
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Table');
this.cdr.markForCheck();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzFilters) {
this.initMultipleFilterList();
this.initSingleFilterList();
this.updateFilterStatus();
}
if (changes.nzWidth) {
this.nzWidthChange$.next(this.nzWidth);
}
}
/**
* @return {?}
*/
ngOnDestroy() {
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 = () => [
{ type: ChangeDetectorRef },
{ type: NzI18nService$$1 }
];
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 }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowCheckbox", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzCustomFilter", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowSort", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowFilter", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzThComponent.prototype, "nzShowRowSelection", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzVirtualScrollDirective {
/* tslint:disable-next-line:no-any */
/**
* @param {?} templateRef
*/
constructor(templateRef) {
this.templateRef = templateRef;
}
}
NzVirtualScrollDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-virtual-scroll]'
},] }
];
/** @nocollapse */
NzVirtualScrollDirective.ctorParameters = () => [
{ type: TemplateRef }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTableComponent {
/**
* @param {?} renderer
* @param {?} ngZone
* @param {?} cdr
* @param {?} nzMeasureScrollbarService
* @param {?} i18n
* @param {?} elementRef
*/
constructor(renderer, ngZone, cdr, nzMeasureScrollbarService, i18n, elementRef) {
this.renderer = renderer;
this.ngZone = ngZone;
this.cdr = cdr;
this.nzMeasureScrollbarService = nzMeasureScrollbarService;
this.i18n = i18n;
/**
* public data for ngFor tr
*/
this.data = [];
/* tslint:disable-next-line:no-any */
this.locale = {};
this.lastScrollLeft = 0;
this.headerBottomStyle = {};
this.destroy$ = new Subject();
this.nzSize = 'default';
this.nzPageSizeOptions = [10, 20, 30, 40, 50];
this.nzVirtualScroll = false;
this.nzVirtualItemSize = 0;
this.nzVirtualMaxBufferPx = 200;
this.nzVirtualMinBufferPx = 100;
this.nzLoadingDelay = 0;
this.nzTotal = 0;
this.nzWidthConfig = [];
this.nzPageIndex = 1;
this.nzPageSize = 10;
this.nzData = [];
this.nzPaginationPosition = 'bottom';
this.nzScroll = { x: null, y: null };
this.nzFrontPagination = true;
this.nzTemplateMode = false;
this.nzBordered = false;
this.nzShowPagination = true;
this.nzLoading = false;
this.nzShowSizeChanger = false;
this.nzHideOnSinglePage = false;
this.nzShowQuickJumper = false;
this.nzSimple = false;
this.nzPageSizeChange = new EventEmitter();
this.nzPageIndexChange = new EventEmitter();
/* tslint:disable-next-line:no-any */
this.nzCurrentPageDataChange = new EventEmitter();
renderer.addClass(elementRef.nativeElement, 'ant-table-wrapper');
}
/**
* @return {?}
*/
get tableBodyNativeElement() {
return this.tableBodyElement && this.tableBodyElement.nativeElement;
}
/**
* @return {?}
*/
get tableHeaderNativeElement() {
return this.tableHeaderElement && this.tableHeaderElement.nativeElement;
}
/**
* @return {?}
*/
get cdkVirtualScrollNativeElement() {
return this.cdkVirtualScrollElement && this.cdkVirtualScrollElement.nativeElement;
}
/**
* @return {?}
*/
get mixTableBodyNativeElement() {
return this.tableBodyNativeElement || this.cdkVirtualScrollNativeElement;
}
/**
* @param {?} size
* @param {?} index
* @return {?}
*/
emitPageSizeOrIndex(size, index) {
if (this.nzPageSize !== size || this.nzPageIndex !== index) {
if (this.nzPageSize !== size) {
this.nzPageSize = size;
this.nzPageSizeChange.emit(this.nzPageSize);
}
if (this.nzPageIndex !== index) {
this.nzPageIndex = index;
this.nzPageIndexChange.emit(this.nzPageIndex);
}
this.updateFrontPaginationDataIfNeeded(this.nzPageSize !== size);
}
}
/**
* @param {?} e
* @return {?}
*/
syncScrollTable(e) {
if (e.currentTarget === e.target) {
/** @type {?} */
const target = (/** @type {?} */ (e.target));
if (target.scrollLeft !== this.lastScrollLeft && this.nzScroll && this.nzScroll.x) {
if (target === this.mixTableBodyNativeElement && this.tableHeaderNativeElement) {
this.tableHeaderNativeElement.scrollLeft = target.scrollLeft;
}
else if (target === this.tableHeaderNativeElement && this.mixTableBodyNativeElement) {
this.mixTableBodyNativeElement.scrollLeft = target.scrollLeft;
}
this.setScrollPositionClassName();
}
this.lastScrollLeft = target.scrollLeft;
}
}
/**
* @return {?}
*/
setScrollPositionClassName() {
if (this.mixTableBodyNativeElement && this.nzScroll && this.nzScroll.x) {
if ((this.mixTableBodyNativeElement.scrollWidth === this.mixTableBodyNativeElement.clientWidth) && (this.mixTableBodyNativeElement.scrollWidth !== 0)) {
this.setScrollName();
}
else if (this.mixTableBodyNativeElement.scrollLeft === 0) {
this.setScrollName('left');
}
else if (this.mixTableBodyNativeElement.scrollWidth === (this.mixTableBodyNativeElement.scrollLeft + this.mixTableBodyNativeElement.clientWidth)) {
this.setScrollName('right');
}
else {
this.setScrollName('middle');
}
}
}
/**
* @param {?=} position
* @return {?}
*/
setScrollName(position) {
/** @type {?} */
const prefix = 'ant-table-scroll-position';
/** @type {?} */
const classList = ['left', 'right', 'middle'];
classList.forEach((/**
* @param {?} name
* @return {?}
*/
name => {
this.renderer.removeClass(this.tableMainElement.nativeElement, `${prefix}-${name}`);
}));
if (position) {
this.renderer.addClass(this.tableMainElement.nativeElement, `${prefix}-${position}`);
}
}
/**
* @return {?}
*/
fitScrollBar() {
/** @type {?} */
const scrollbarWidth = this.nzMeasureScrollbarService.scrollBarWidth;
if (scrollbarWidth) {
this.headerBottomStyle = {
marginBottom: `-${scrollbarWidth}px`,
paddingBottom: `0px`
};
this.cdr.markForCheck();
}
}
/**
* @param {?=} isPageSizeOrDataChange
* @return {?}
*/
updateFrontPaginationDataIfNeeded(isPageSizeOrDataChange = false) {
/** @type {?} */
let data = [];
if (this.nzFrontPagination) {
this.nzTotal = this.nzData.length;
if (isPageSizeOrDataChange) {
/** @type {?} */
const maxPageIndex = Math.ceil(this.nzData.length / this.nzPageSize) || 1;
/** @type {?} */
const pageIndex = this.nzPageIndex > maxPageIndex ? maxPageIndex : this.nzPageIndex;
if (pageIndex !== this.nzPageIndex) {
this.nzPageIndex = pageIndex;
Promise.resolve().then((/**
* @return {?}
*/
() => this.nzPageIndexChange.emit(pageIndex)));
}
}
data = this.nzData.slice((this.nzPageIndex - 1) * this.nzPageSize, this.nzPageIndex * this.nzPageSize);
}
else {
data = this.nzData;
}
this.data = [...data];
this.nzCurrentPageDataChange.next(this.data);
}
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Table');
this.cdr.markForCheck();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzScroll) {
if (changes.nzScroll.currentValue) {
this.nzScroll = changes.nzScroll.currentValue;
}
else {
this.nzScroll = { x: null, y: null };
}
this.setScrollPositionClassName();
}
if (changes.nzPageIndex || changes.nzPageSize || changes.nzFrontPagination || changes.nzData) {
this.updateFrontPaginationDataIfNeeded(!!(changes.nzPageSize || changes.nzData));
}
}
/**
* @return {?}
*/
ngAfterViewInit() {
setTimeout((/**
* @return {?}
*/
() => this.setScrollPositionClassName()));
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
merge(this.tableHeaderNativeElement ? fromEvent(this.tableHeaderNativeElement, 'scroll') : EMPTY, this.mixTableBodyNativeElement ? fromEvent(this.mixTableBodyNativeElement, 'scroll') : EMPTY).pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
(data) => {
this.syncScrollTable(data);
}));
fromEvent(window, 'resize').pipe(startWith(true), takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.fitScrollBar();
this.setScrollPositionClassName();
}));
}));
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.listOfNzThComponent.changes.pipe(startWith(true), flatMap((/**
* @return {?}
*/
() => merge(this.listOfNzThComponent.changes, ...this.listOfNzThComponent.map((/**
* @param {?} th
* @return {?}
*/
th => th.nzWidthChange$))))), takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzTableComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-table',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-template #renderItemTemplate let-type let-page=\"page\">\n <a class=\"ant-pagination-item-link\" *ngIf=\"type==='pre'\"><i nz-icon type=\"left\"></i></a>\n <a class=\"ant-pagination-item-link\" *ngIf=\"type==='next'\"><i nz-icon type=\"right\"></i></a>\n <a *ngIf=\"type=='page'\">{{ page }}</a>\n</ng-template>\n<ng-template #colGroupTemplate>\n <colgroup>\n <col [style.width]=\"width\" [style.minWidth]=\"width\" *ngFor=\"let width of nzWidthConfig\">\n <col [style.width]=\"th.nzWidth\" [style.minWidth]=\"th.nzWidth\" *ngFor=\"let th of listOfNzThComponent\">\n </colgroup>\n</ng-template>\n<ng-template #headerTemplate>\n <ng-template [ngTemplateOutlet]=\"colGroupTemplate\"></ng-template>\n <thead class=\"ant-table-thead\" *ngIf=\"!nzScroll.y\">\n <ng-template [ngTemplateOutlet]=\"nzTheadComponent?.templateRef\"></ng-template>\n </thead>\n</ng-template>\n<ng-template #tableInnerTemplate>\n <div #tableHeaderElement\n *ngIf=\"nzScroll.x || nzScroll.y\"\n [ngStyle]=\"headerBottomStyle\"\n class=\"ant-table-header\">\n <table [class.ant-table-fixed]=\"nzScroll.x\" [style.width]=\"nzScroll.x\">\n <ng-template [ngTemplateOutlet]=\"colGroupTemplate\"></ng-template>\n <thead class=\"ant-table-thead\" *ngIf=\"nzScroll.y\">\n <ng-template [ngTemplateOutlet]=\"nzTheadComponent?.templateRef\"></ng-template>\n </thead>\n </table>\n </div>\n <div #tableBodyElement *ngIf=\"!nzVirtualScroll;else scrollViewTpl\"\n class=\"ant-table-body\"\n [style.maxHeight]=\"nzScroll.y\"\n [style.overflow-y]=\"nzScroll.y ? 'scroll' : ''\"\n [style.overflow-x]=\"nzScroll.x ? 'auto' : ''\">\n <table [class.ant-table-fixed]=\"nzScroll.x\" [style.width]=\"nzScroll.x\">\n <ng-template [ngIf]=\"!nzVirtualScroll\" [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\n <ng-content></ng-content>\n </table>\n </div>\n <ng-template #scrollViewTpl>\n <cdk-virtual-scroll-viewport\n class=\"ant-table-body\"\n [itemSize]=\"nzVirtualItemSize\"\n [maxBufferPx]=\"nzVirtualMaxBufferPx\"\n [minBufferPx]=\"nzVirtualMinBufferPx\"\n [style.height]=\"nzScroll.y\">\n <table [class.ant-table-fixed]=\"nzScroll.x\" [style.width]=\"nzScroll.x\">\n <ng-template [ngIf]=\"nzVirtualScroll\" [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\n <tbody>\n <ng-container *cdkVirtualFor=\"let item of data; let i = index\">\n <ng-template [ngTemplateOutlet]=\"nzVirtualScrollDirective?.templateRef\" [ngTemplateOutletContext]=\"{$implicit:item, index:i}\"></ng-template>\n </ng-container>\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n </ng-template>\n <div class=\"ant-table-placeholder\" *ngIf=\"data.length === 0 && !nzLoading && !nzTemplateMode\">\n <nz-embed-empty [nzComponentName]=\"'table'\" [specificContent]=\"nzNoResult\"></nz-embed-empty>\n </div>\n <div class=\"ant-table-footer\" *ngIf=\"nzFooter\">\n <ng-container *nzStringTemplateOutlet=\"nzFooter\">{{ nzFooter }}</ng-container>\n </div>\n</ng-template>\n<ng-template #paginationTemplate>\n <nz-pagination *ngIf=\"nzShowPagination && data.length\"\n [nzInTable]=\"true\"\n [nzShowSizeChanger]=\"nzShowSizeChanger\"\n [nzPageSizeOptions]=\"nzPageSizeOptions\"\n [nzItemRender]=\"nzItemRender\"\n [nzShowQuickJumper]=\"nzShowQuickJumper\"\n [nzHideOnSinglePage]=\"nzHideOnSinglePage\"\n [nzShowTotal]=\"nzShowTotal\"\n [nzSize]=\"(nzSize === 'middle' || nzSize=='small') ? 'small' : ''\"\n [nzPageSize]=\"nzPageSize\"\n [nzTotal]=\"nzTotal\"\n [nzSimple]=\"nzSimple\"\n [nzPageIndex]=\"nzPageIndex\"\n (nzPageSizeChange)=\"emitPageSizeOrIndex($event,nzPageIndex)\"\n (nzPageIndexChange)=\"emitPageSizeOrIndex(nzPageSize,$event)\">\n </nz-pagination>\n</ng-template>\n<nz-spin [nzDelay]=\"nzLoadingDelay\" [nzSpinning]=\"nzLoading\">\n <ng-container *ngIf=\"nzPaginationPosition === 'both' || nzPaginationPosition === 'top'\">\n <ng-template [ngTemplateOutlet]=\"paginationTemplate\"></ng-template>\n </ng-container>\n <div #tableMainElement\n class=\"ant-table\"\n [class.ant-table-fixed-header]=\"nzScroll.x || nzScroll.y\"\n [class.ant-table-bordered]=\"nzBordered\"\n [class.ant-table-default]=\"nzSize === 'default'\"\n [class.ant-table-middle]=\"nzSize === 'middle'\"\n [class.ant-table-small]=\"nzSize === 'small'\">\n <div class=\"ant-table-title\" *ngIf=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-table-content\">\n <ng-container *ngIf=\"nzScroll.x || nzScroll.y; else tableInnerTemplate\">\n <div class=\"ant-table-scroll\">\n <ng-template [ngTemplateOutlet]=\"tableInnerTemplate\"></ng-template>\n </div>\n </ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"nzPaginationPosition === 'both' || nzPaginationPosition === 'bottom'\">\n <ng-template [ngTemplateOutlet]=\"paginationTemplate\"></ng-template>\n </ng-container>\n</nz-spin>\n",
host: {
'[class.ant-table-empty]': 'data.length === 0'
},
styles: [`
nz-table {
display: block
}
`]
}] }
];
/** @nocollapse */
NzTableComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: NgZone },
{ type: ChangeDetectorRef },
{ type: NzMeasureScrollbarService },
{ type: NzI18nService$$1 },
{ type: ElementRef }
];
NzTableComponent.propDecorators = {
listOfNzThComponent: [{ type: ContentChildren, args: [NzThComponent, { descendants: true },] }],
tableHeaderElement: [{ type: ViewChild, args: ['tableHeaderElement', { read: ElementRef },] }],
tableBodyElement: [{ type: ViewChild, args: ['tableBodyElement', { read: ElementRef },] }],
tableMainElement: [{ type: ViewChild, args: ['tableMainElement', { read: ElementRef },] }],
cdkVirtualScrollElement: [{ type: ViewChild, args: [CdkVirtualScrollViewport, { read: ElementRef },] }],
nzVirtualScrollDirective: [{ type: ContentChild, args: [NzVirtualScrollDirective,] }],
nzSize: [{ type: Input }],
nzShowTotal: [{ type: Input }],
nzPageSizeOptions: [{ type: Input }],
nzVirtualScroll: [{ type: Input }],
nzVirtualItemSize: [{ type: Input }],
nzVirtualMaxBufferPx: [{ type: Input }],
nzVirtualMinBufferPx: [{ type: Input }],
nzLoadingDelay: [{ type: Input }],
nzTotal: [{ type: Input }],
nzTitle: [{ type: Input }],
nzFooter: [{ type: Input }],
nzNoResult: [{ type: Input }],
nzWidthConfig: [{ type: Input }],
nzPageIndex: [{ type: Input }],
nzPageSize: [{ type: Input }],
nzData: [{ type: Input }],
nzPaginationPosition: [{ type: Input }],
nzScroll: [{ type: Input }],
nzItemRender: [{ type: Input }, { type: ViewChild, args: ['renderItemTemplate',] }],
nzFrontPagination: [{ type: Input }],
nzTemplateMode: [{ type: Input }],
nzBordered: [{ type: Input }],
nzShowPagination: [{ type: Input }],
nzLoading: [{ type: Input }],
nzShowSizeChanger: [{ type: Input }],
nzHideOnSinglePage: [{ type: Input }],
nzShowQuickJumper: [{ type: Input }],
nzSimple: [{ type: Input }],
nzPageSizeChange: [{ type: Output }],
nzPageIndexChange: [{ type: Output }],
nzCurrentPageDataChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzVirtualScroll", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzVirtualItemSize", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzVirtualMaxBufferPx", void 0);
__decorate([
InputNumber(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzVirtualMinBufferPx", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzFrontPagination", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzTemplateMode", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzBordered", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzShowPagination", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzLoading", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzShowSizeChanger", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzHideOnSinglePage", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzShowQuickJumper", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTableComponent.prototype, "nzSimple", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTbodyDirective {
/**
* @param {?} nzTableComponent
*/
constructor(nzTableComponent) {
this.nzTableComponent = nzTableComponent;
}
}
NzTbodyDirective.decorators = [
{ type: Directive, args: [{
// tslint:disable-next-line:directive-selector
selector: 'tbody',
host: {
'[class.ant-table-tbody]': 'nzTableComponent'
}
},] }
];
/** @nocollapse */
NzTbodyDirective.ctorParameters = () => [
{ type: NzTableComponent, decorators: [{ type: Host }, { type: Optional }] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTdComponent {
/**
* @param {?} elementRef
* @param {?} nzUpdateHostClassService
*/
constructor(elementRef, nzUpdateHostClassService) {
this.elementRef = elementRef;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.nzChecked = false;
this.nzDisabled = false;
this.nzIndeterminate = false;
this.nzExpand = false;
this.nzShowExpand = false;
this.nzShowCheckbox = false;
this.nzCheckedChange = new EventEmitter();
this.nzExpandChange = new EventEmitter();
}
/**
* @param {?} e
* @return {?}
*/
expandChange(e) {
e.stopPropagation();
this.nzExpand = !this.nzExpand;
this.nzExpandChange.emit(this.nzExpand);
}
/**
* @return {?}
*/
setClassMap() {
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`ant-table-row-expand-icon-cell`]: this.nzShowExpand && !isNotNil(this.nzIndentSize),
[`ant-table-selection-column`]: this.nzShowCheckbox,
[`ant-table-td-left-sticky`]: isNotNil(this.nzLeft),
[`ant-table-td-right-sticky`]: isNotNil(this.nzRight)
});
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzIndentSize || changes.nzShowExpand || changes.nzShowCheckbox || changes.nzRight || changes.nzLeft) {
this.setClassMap();
}
}
}
NzTdComponent.decorators = [
{ type: Component, args: [{
// tslint:disable-next-line:component-selector
selector: 'td:not(.nz-disable-td)',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
template: "<span class=\"ant-table-row-indent\" *ngIf=\"nzIndentSize >= 0\" [style.padding-left.px]=\"nzIndentSize\"></span>\n<label *ngIf=\"nzShowCheckbox\"\n nz-checkbox\n [nzDisabled]=\"nzDisabled\"\n [(ngModel)]=\"nzChecked\"\n [nzIndeterminate]=\"nzIndeterminate\"\n (ngModelChange)=\"nzCheckedChange.emit($event)\">\n</label>\n<span *ngIf=\"!nzShowExpand && nzIndentSize >= 0\"\n class=\"ant-table-row-expand-icon ant-table-row-spaced\">\n</span>\n<span *ngIf=\"nzShowExpand\"\n class=\"ant-table-row-expand-icon\"\n [class.ant-table-row-expanded]=\"nzExpand\"\n [class.ant-table-row-collapsed]=\"!nzExpand\"\n (click)=\"expandChange($event)\">\n</span>\n<ng-content></ng-content>",
host: {
'[style.left]': 'nzLeft',
'[style.right]': 'nzRight',
'[style.text-align]': 'nzAlign'
}
}] }
];
/** @nocollapse */
NzTdComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzUpdateHostClassService }
];
NzTdComponent.propDecorators = {
nzChecked: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzIndeterminate: [{ type: Input }],
nzLeft: [{ type: Input }],
nzRight: [{ type: Input }],
nzAlign: [{ type: Input }],
nzIndentSize: [{ type: Input }],
nzExpand: [{ type: Input }],
nzShowExpand: [{ type: Input }],
nzShowCheckbox: [{ type: Input }],
nzCheckedChange: [{ type: Output }],
nzExpandChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTdComponent.prototype, "nzExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTdComponent.prototype, "nzShowExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTdComponent.prototype, "nzShowCheckbox", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTheadComponent {
// tslint:disable-next-line:no-any
/**
* @param {?} nzTableComponent
* @param {?} elementRef
* @param {?} renderer
*/
constructor(nzTableComponent, elementRef, renderer) {
this.nzTableComponent = nzTableComponent;
this.elementRef = elementRef;
this.renderer = renderer;
this.destroy$ = new Subject();
this.nzSingleSort = false;
this.nzSortChange = new EventEmitter();
if (this.nzTableComponent) {
this.nzTableComponent.nzTheadComponent = this;
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.listOfNzThComponent.changes.pipe(startWith(true), flatMap((/**
* @return {?}
*/
() => merge(...this.listOfNzThComponent.map((/**
* @param {?} th
* @return {?}
*/
th => th.nzSortChangeWithKey))))), takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
(data) => {
this.nzSortChange.emit(data);
if (this.nzSingleSort) {
this.listOfNzThComponent.forEach((/**
* @param {?} th
* @return {?}
*/
th => {
th.nzSort = (th.nzSortKey === data.key ? th.nzSort : null);
th.marForCheck();
}));
}
}));
}
/**
* @return {?}
*/
ngAfterViewInit() {
if (this.nzTableComponent) {
this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), this.elementRef.nativeElement);
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzTheadComponent.decorators = [
{ type: Component, args: [{
// tslint:disable-next-line:component-selector
selector: 'thead:not(.ant-table-thead)',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n<ng-container *ngIf=\"!nzTableComponent\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n</ng-container>"
}] }
];
/** @nocollapse */
NzTheadComponent.ctorParameters = () => [
{ type: NzTableComponent, decorators: [{ type: Host }, { type: Optional }] },
{ type: ElementRef },
{ type: Renderer2 }
];
NzTheadComponent.propDecorators = {
templateRef: [{ type: ViewChild, args: ['contentTemplate',] }],
listOfNzThComponent: [{ type: ContentChildren, args: [NzThComponent, { descendants: true },] }],
nzSingleSort: [{ type: Input }],
nzSortChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTheadComponent.prototype, "nzSingleSort", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTrDirective {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} nzTableComponent
*/
constructor(elementRef, renderer, nzTableComponent) {
this.elementRef = elementRef;
this.renderer = renderer;
this.nzTableComponent = nzTableComponent;
}
/**
* @param {?} value
* @return {?}
*/
set nzExpand(value) {
if (toBoolean(value)) {
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
this.renderer.addClass(this.elementRef.nativeElement, 'ant-table-expanded-row');
}
else {
this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');
this.renderer.removeClass(this.elementRef.nativeElement, 'ant-table-expanded-row');
}
}
}
NzTrDirective.decorators = [
{ type: Directive, args: [{
// tslint:disable-next-line:directive-selector
selector: 'tr',
host: {
'[class.ant-table-row]': 'nzTableComponent'
}
},] }
];
/** @nocollapse */
NzTrDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 },
{ type: NzTableComponent, decorators: [{ type: Host }, { type: Optional }] }
];
NzTrDirective.propDecorators = {
nzExpand: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTableModule {
}
NzTableModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzTableComponent, NzThComponent, NzTdComponent, NzTheadComponent, NzTbodyDirective, NzTrDirective, NzVirtualScrollDirective],
exports: [NzTableComponent, NzThComponent, NzTdComponent, NzTheadComponent, NzTbodyDirective, NzTrDirective, NzVirtualScrollDirective],
imports: [
NzMenuModule,
FormsModule,
NzAddOnModule,
NzRadioModule,
NzCheckboxModule,
NzDropDownModule,
CommonModule,
NzPaginationModule,
NzSpinModule,
NzI18nModule,
NzIconModule,
NzEmptyModule,
ScrollingModule
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabBodyComponent {
constructor() {
this.active = false;
this.forceRender = false;
}
}
NzTabBodyComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-tab-body]',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-container *ngIf=\"active || forceRender\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n</ng-container>",
host: {
'[class.ant-tabs-tabpane-active]': 'active',
'[class.ant-tabs-tabpane-inactive]': '!active'
}
}] }
];
NzTabBodyComponent.propDecorators = {
content: [{ type: Input }],
active: [{ type: Input }],
forceRender: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabLabelDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.disabled = false;
renderer.addClass(elementRef.nativeElement, 'ant-tabs-tab');
}
/**
* @return {?}
*/
getOffsetLeft() {
return this.elementRef.nativeElement.offsetLeft;
}
/**
* @return {?}
*/
getOffsetWidth() {
return this.elementRef.nativeElement.offsetWidth;
}
/**
* @return {?}
*/
getOffsetTop() {
return this.elementRef.nativeElement.offsetTop;
}
/**
* @return {?}
*/
getOffsetHeight() {
return this.elementRef.nativeElement.offsetHeight;
}
}
NzTabLabelDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-tab-label]',
host: {
'[class.ant-tabs-tab-disabled]': 'disabled'
}
},] }
];
/** @nocollapse */
NzTabLabelDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzTabLabelDirective.propDecorators = {
disabled: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabLabelDirective.prototype, "disabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Decorates the `ng-template` tags and reads out the template from it.
*/
class NzTabDirective {
}
NzTabDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-tab]'
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.position = null;
this.origin = null;
this.isActive = false;
this.stateChanges = new Subject();
this.nzForceRender = false;
this.nzDisabled = false;
this.nzClick = new EventEmitter();
this.nzSelect = new EventEmitter();
this.nzDeselect = new EventEmitter();
this.renderer.addClass(elementRef.nativeElement, 'ant-tabs-tabpane');
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzTitle || changes.nzForceRender || changes.nzDisabled) {
this.stateChanges.next();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.stateChanges.complete();
}
}
NzTabComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tab',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>"
}] }
];
/** @nocollapse */
NzTabComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzTabComponent.propDecorators = {
content: [{ type: ViewChild, args: [TemplateRef,] }],
template: [{ type: ContentChild, args: [NzTabDirective, { read: TemplateRef },] }],
nzTitle: [{ type: Input }],
nzForceRender: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzClick: [{ type: Output }],
nzSelect: [{ type: Output }],
nzDeselect: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabComponent.prototype, "nzForceRender", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabsInkBarDirective {
/**
* @param {?} renderer
* @param {?} elementRef
* @param {?} ngZone
*/
constructor(renderer, elementRef, ngZone) {
this.renderer = renderer;
this.elementRef = elementRef;
this.ngZone = ngZone;
this.nzAnimated = false;
this.nzPositionMode = 'horizontal';
renderer.addClass(elementRef.nativeElement, 'ant-tabs-ink-bar');
}
/**
* @param {?} element
* @return {?}
*/
alignToElement(element) {
if (typeof requestAnimationFrame !== 'undefined') {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
requestAnimationFrame((/**
* @return {?}
*/
() => this.setStyles(element)));
}));
}
else {
this.setStyles(element);
}
}
/**
* @param {?} element
* @return {?}
*/
setStyles(element) {
/** when horizontal remove height style and add transform left **/
if (this.nzPositionMode === 'horizontal') {
this.renderer.removeStyle(this.elementRef.nativeElement, 'height');
this.renderer.setStyle(this.elementRef.nativeElement, 'transform', `translate3d(${this.getLeftPosition(element)}, 0px, 0px)`);
this.renderer.setStyle(this.elementRef.nativeElement, 'width', this.getElementWidth(element));
}
else {
/** when vertical remove width style and add transform top **/
this.renderer.removeStyle(this.elementRef.nativeElement, 'width');
this.renderer.setStyle(this.elementRef.nativeElement, 'transform', `translate3d(0px, ${this.getTopPosition(element)}, 0px)`);
this.renderer.setStyle(this.elementRef.nativeElement, 'height', this.getElementHeight(element));
}
}
/**
* @param {?} element
* @return {?}
*/
getLeftPosition(element) {
return element ? element.offsetLeft + 'px' : '0';
}
/**
* @param {?} element
* @return {?}
*/
getElementWidth(element) {
return element ? element.offsetWidth + 'px' : '0';
}
/**
* @param {?} element
* @return {?}
*/
getTopPosition(element) {
return element ? element.offsetTop + 'px' : '0';
}
/**
* @param {?} element
* @return {?}
*/
getElementHeight(element) {
return element ? element.offsetHeight + 'px' : '0';
}
}
NzTabsInkBarDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-tabs-ink-bar]',
host: {
'[class.ant-tabs-ink-bar-animated]': 'nzAnimated',
'[class.ant-tabs-ink-bar-no-animated]': '!nzAnimated'
}
},] }
];
/** @nocollapse */
NzTabsInkBarDirective.ctorParameters = () => [
{ type: Renderer2 },
{ type: ElementRef },
{ type: NgZone }
];
NzTabsInkBarDirective.propDecorators = {
nzAnimated: [{ type: Input }],
nzPositionMode: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabsInkBarDirective.prototype, "nzAnimated", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const EXAGGERATED_OVERSCROLL = 64;
class NzTabsNavComponent {
/**
* @param {?} elementRef
* @param {?} ngZone
* @param {?} renderer
* @param {?} cdr
* @param {?} dir
*/
constructor(elementRef, ngZone, renderer, cdr, dir) {
this.elementRef = elementRef;
this.ngZone = ngZone;
this.renderer = renderer;
this.cdr = cdr;
this.dir = dir;
this._tabPositionMode = 'horizontal';
this._scrollDistance = 0;
this._selectedIndex = 0;
this.showPaginationControls = false;
this.disableScrollAfter = true;
this.disableScrollBefore = true;
this.selectedIndexChanged = false;
this.realignInkBar = null;
this.nzOnNextClick = new EventEmitter();
this.nzOnPrevClick = new EventEmitter();
this.nzAnimated = true;
this.nzHideBar = false;
this.nzShowPagination = true;
this.nzType = 'line';
}
/**
* @param {?} value
* @return {?}
*/
set nzPositionMode(value) {
this._tabPositionMode = value;
this.alignInkBarToSelectedTab();
if (this.nzShowPagination) {
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.updatePagination();
}));
}
}
/**
* @return {?}
*/
get nzPositionMode() {
return this._tabPositionMode;
}
/**
* @param {?} value
* @return {?}
*/
set selectedIndex(value) {
this.selectedIndexChanged = this._selectedIndex !== value;
this._selectedIndex = value;
}
/**
* @return {?}
*/
get selectedIndex() {
return this._selectedIndex;
}
/**
* @return {?}
*/
onContentChanges() {
/** @type {?} */
const textContent = this.elementRef.nativeElement.textContent;
// We need to diff the text content of the header, because the MutationObserver callback
// will fire even if the text content didn't change which is inefficient and is prone
// to infinite loops if a poorly constructed expression is passed in (see #14249).
if (textContent !== this.currentTextContent) {
this.ngZone.run((/**
* @return {?}
*/
() => {
if (this.nzShowPagination) {
this.updatePagination();
}
this.alignInkBarToSelectedTab();
this.cdr.markForCheck();
}));
}
}
/**
* @param {?} scrollDir
* @return {?}
*/
scrollHeader(scrollDir) {
if (scrollDir === 'before' && !this.disableScrollBefore) {
this.nzOnPrevClick.emit();
}
else if (scrollDir === 'after' && !this.disableScrollAfter) {
this.nzOnNextClick.emit();
}
// Move the scroll distance one-third the length of the tab list's viewport.
this.scrollDistance += (scrollDir === 'before' ? -1 : 1) * this.viewWidthHeightPix / 3;
}
/**
* @return {?}
*/
ngAfterContentChecked() {
if (this.tabLabelCount !== this.listOfNzTabLabelDirective.length) {
if (this.nzShowPagination) {
this.updatePagination();
}
this.tabLabelCount = this.listOfNzTabLabelDirective.length;
this.cdr.markForCheck();
}
if (this.selectedIndexChanged) {
this.scrollToLabel(this._selectedIndex);
if (this.nzShowPagination) {
this.checkScrollingControls();
}
this.alignInkBarToSelectedTab();
this.selectedIndexChanged = false;
this.cdr.markForCheck();
}
if (this.scrollDistanceChanged) {
if (this.nzShowPagination) {
this.updateTabScrollPosition();
}
this.scrollDistanceChanged = false;
this.cdr.markForCheck();
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.realignInkBar = this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
/** @type {?} */
const dirChange = this.dir ? this.dir.change : of(null);
/** @type {?} */
const resize = typeof window !== 'undefined' ?
fromEvent(window, 'resize').pipe(auditTime(10)) :
of(null);
return merge(dirChange, resize).pipe(startWith(null)).subscribe((/**
* @return {?}
*/
() => {
if (this.nzShowPagination) {
this.updatePagination();
}
this.alignInkBarToSelectedTab();
}));
}));
}
/**
* @return {?}
*/
updateTabScrollPosition() {
/** @type {?} */
const scrollDistance = this.scrollDistance;
if (this.nzPositionMode === 'horizontal') {
/** @type {?} */
const translateX = this.getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
this.renderer.setStyle(this.navListElement.nativeElement, 'transform', `translate3d(${translateX}px, 0, 0)`);
}
else {
this.renderer.setStyle(this.navListElement.nativeElement, 'transform', `translate3d(0,${-scrollDistance}px, 0)`);
}
}
/**
* @return {?}
*/
updatePagination() {
this.checkPaginationEnabled();
this.checkScrollingControls();
this.updateTabScrollPosition();
}
/**
* @return {?}
*/
checkPaginationEnabled() {
/** @type {?} */
const isEnabled = this.tabListScrollWidthHeightPix > this.tabListScrollOffSetWidthHeight;
if (!isEnabled) {
this.scrollDistance = 0;
}
if (isEnabled !== this.showPaginationControls) {
this.cdr.markForCheck();
}
this.showPaginationControls = isEnabled;
}
/**
* @param {?} labelIndex
* @return {?}
*/
scrollToLabel(labelIndex) {
/** @type {?} */
const selectedLabel = this.listOfNzTabLabelDirective
? this.listOfNzTabLabelDirective.toArray()[labelIndex]
: null;
if (selectedLabel) {
// The view length is the visible width of the tab labels.
/** @type {?} */
let labelBeforePos;
/** @type {?} */
let labelAfterPos;
if (this.nzPositionMode === 'horizontal') {
if (this.getLayoutDirection() === 'ltr') {
labelBeforePos = selectedLabel.getOffsetLeft();
labelAfterPos = labelBeforePos + selectedLabel.getOffsetWidth();
}
else {
labelAfterPos = this.navListElement.nativeElement.offsetWidth - selectedLabel.getOffsetLeft();
labelBeforePos = labelAfterPos - selectedLabel.getOffsetWidth();
}
}
else {
labelBeforePos = selectedLabel.getOffsetTop();
labelAfterPos = labelBeforePos + selectedLabel.getOffsetHeight();
}
/** @type {?} */
const beforeVisiblePos = this.scrollDistance;
/** @type {?} */
const afterVisiblePos = this.scrollDistance + this.viewWidthHeightPix;
if (labelBeforePos < beforeVisiblePos) {
// Scroll header to move label to the before direction
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
}
else if (labelAfterPos > afterVisiblePos) {
// Scroll header to move label to the after direction
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
}
}
}
/**
* @return {?}
*/
checkScrollingControls() {
// Check if the pagination arrows should be activated.
this.disableScrollBefore = this.scrollDistance === 0;
this.disableScrollAfter = this.scrollDistance === this.getMaxScrollDistance();
this.cdr.markForCheck();
}
/**
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
* is equal to the difference in width between the tab list container and tab header container.
*
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
* should be called sparingly.
* @return {?}
*/
getMaxScrollDistance() {
return (this.tabListScrollWidthHeightPix - this.viewWidthHeightPix) || 0;
}
/**
* Sets the distance in pixels that the tab header should be transformed in the X-axis.
* @param {?} v
* @return {?}
*/
set scrollDistance(v) {
this._scrollDistance = Math.max(0, Math.min(this.getMaxScrollDistance(), v));
// Mark that the scroll distance has changed so that after the view is checked, the CSS
// transformation can move the header.
this.scrollDistanceChanged = true;
this.checkScrollingControls();
}
/**
* @return {?}
*/
get scrollDistance() {
return this._scrollDistance;
}
/**
* @return {?}
*/
get viewWidthHeightPix() {
/** @type {?} */
let PAGINATION_PIX = 0;
if (this.showPaginationControls) {
PAGINATION_PIX = 64;
}
if (this.nzPositionMode === 'horizontal') {
return this.navContainerElement.nativeElement.offsetWidth - PAGINATION_PIX;
}
else {
return this.navContainerElement.nativeElement.offsetHeight - PAGINATION_PIX;
}
}
/**
* @return {?}
*/
get tabListScrollWidthHeightPix() {
if (this.nzPositionMode === 'horizontal') {
return this.navListElement.nativeElement.scrollWidth;
}
else {
return this.navListElement.nativeElement.scrollHeight;
}
}
/**
* @return {?}
*/
get tabListScrollOffSetWidthHeight() {
if (this.nzPositionMode === 'horizontal') {
return this.scrollListElement.nativeElement.offsetWidth;
}
else {
return this.elementRef.nativeElement.offsetHeight;
}
}
/**
* @return {?}
*/
getLayoutDirection() {
return this.dir && this.dir.value === 'rtl' ? 'rtl' : 'ltr';
}
/**
* @return {?}
*/
alignInkBarToSelectedTab() {
if (this.nzType === 'line') {
/** @type {?} */
const selectedLabelWrapper = this.listOfNzTabLabelDirective && this.listOfNzTabLabelDirective.length
? this.listOfNzTabLabelDirective.toArray()[this.selectedIndex].elementRef.nativeElement
: null;
if (this.nzTabsInkBarDirective) {
this.nzTabsInkBarDirective.alignToElement(selectedLabelWrapper);
}
}
}
}
NzTabsNavComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-tabs-nav]',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div style=\"float:right;\" *ngIf=\"nzTabBarExtraContent\" class=\"ant-tabs-extra-content\">\n <ng-template [ngTemplateOutlet]=\"nzTabBarExtraContent\"></ng-template>\n</div>\n<div class=\"ant-tabs-nav-container\"\n [class.ant-tabs-nav-container-scrolling]=\"showPaginationControls\"\n #navContainerElement>\n <span class=\"ant-tabs-tab-prev\"\n (click)=\"scrollHeader('before')\"\n [class.ant-tabs-tab-btn-disabled]=\"disableScrollBefore\"\n [class.ant-tabs-tab-arrow-show]=\"showPaginationControls\">\n <span class=\"ant-tabs-tab-prev-icon\">\n <i nz-icon [type]=\"nzPositionMode === 'horizontal' ? 'left' : 'up'\" class=\"ant-tabs-tab-prev-icon-target\"></i>\n </span>\n </span>\n <span class=\"ant-tabs-tab-next\"\n (click)=\"scrollHeader('after')\"\n [class.ant-tabs-tab-btn-disabled]=\"disableScrollAfter\"\n [class.ant-tabs-tab-arrow-show]=\"showPaginationControls\">\n <span class=\"ant-tabs-tab-next-icon\">\n <i nz-icon [type]=\"nzPositionMode === 'horizontal' ? 'right' : 'down'\" class=\"ant-tabs-tab-next-icon-target\"></i>\n </span>\n </span>\n <div class=\"ant-tabs-nav-wrap\">\n <div class=\"ant-tabs-nav-scroll\" #scrollListElement>\n <div class=\"ant-tabs-nav\"\n [class.ant-tabs-nav-animated]=\"nzAnimated\"\n #navListElement\n (cdkObserveContent)=\"onContentChanges()\">\n <div>\n <ng-content></ng-content>\n </div>\n <div nz-tabs-ink-bar [hidden]=\"nzHideBar\" [nzAnimated]=\"nzAnimated\" [nzPositionMode]=\"nzPositionMode\" style=\"display: block;\"></div>\n </div>\n </div>\n </div>\n</div>"
}] }
];
/** @nocollapse */
NzTabsNavComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NgZone },
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: Directionality, decorators: [{ type: Optional }] }
];
NzTabsNavComponent.propDecorators = {
listOfNzTabLabelDirective: [{ type: ContentChildren, args: [NzTabLabelDirective,] }],
nzTabsInkBarDirective: [{ type: ViewChild, args: [NzTabsInkBarDirective,] }],
navContainerElement: [{ type: ViewChild, args: ['navContainerElement',] }],
navListElement: [{ type: ViewChild, args: ['navListElement',] }],
scrollListElement: [{ type: ViewChild, args: ['scrollListElement',] }],
nzOnNextClick: [{ type: Output }],
nzOnPrevClick: [{ type: Output }],
nzTabBarExtraContent: [{ type: Input }],
nzAnimated: [{ type: Input }],
nzHideBar: [{ type: Input }],
nzShowPagination: [{ type: Input }],
nzType: [{ type: Input }],
nzPositionMode: [{ type: Input }],
selectedIndex: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabsNavComponent.prototype, "nzAnimated", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabsNavComponent.prototype, "nzHideBar", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTabsNavComponent.prototype, "nzShowPagination", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabChangeEvent {
}
class NzTabSetComponent {
/**
* @param {?} renderer
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
* @param {?} cdr
*/
constructor(renderer, nzUpdateHostClassService, elementRef, cdr) {
this.renderer = renderer;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.elementRef = elementRef;
this.cdr = cdr;
this.indexToSelect = 0;
this.el = this.elementRef.nativeElement;
this._selectedIndex = null;
/**
* Subscription to tabs being added/removed.
*/
this.tabsSubscription = Subscription.EMPTY;
/**
* Subscription to changes in the tab labels.
*/
this.tabLabelSubscription = Subscription.EMPTY;
this.tabPositionMode = 'horizontal';
this.nzShowPagination = true;
this.nzAnimated = true;
this.nzHideAll = false;
this.nzTabPosition = 'top';
this.nzSize = 'default';
this.nzType = 'line';
this.nzOnNextClick = new EventEmitter();
this.nzOnPrevClick = new EventEmitter();
this.nzSelectChange = new EventEmitter(true);
this.nzSelectedIndexChange = new EventEmitter();
}
/**
* @param {?} value
* @return {?}
*/
set nzSelectedIndex(value) {
this.indexToSelect = toNumber(value, null);
}
/**
* @return {?}
*/
get nzSelectedIndex() {
return this._selectedIndex;
}
/**
* @return {?}
*/
get inkBarAnimated() {
return (this.nzAnimated === true) || (((/** @type {?} */ (this.nzAnimated))).inkBar === true);
}
/**
* @return {?}
*/
get tabPaneAnimated() {
return (this.nzAnimated === true) || (((/** @type {?} */ (this.nzAnimated))).tabPane === true);
}
/**
* @param {?} value
* @return {?}
*/
setPosition(value) {
if (this.tabContent) {
if (value === 'bottom') {
this.renderer.insertBefore(this.el, this.tabContent.nativeElement, this.nzTabsNavComponent.elementRef.nativeElement);
}
else {
this.renderer.insertBefore(this.el, this.nzTabsNavComponent.elementRef.nativeElement, this.tabContent.nativeElement);
}
}
}
/**
* @return {?}
*/
setClassMap() {
this.nzUpdateHostClassService.updateHostClass(this.el, {
[`ant-tabs`]: true,
[`ant-tabs-vertical`]: (this.nzTabPosition === 'left') || (this.nzTabPosition === 'right'),
[`ant-tabs-${this.nzTabPosition}`]: this.nzTabPosition,
[`ant-tabs-no-animation`]: (this.nzAnimated === false) || (((/** @type {?} */ (this.nzAnimated))).tabPane === false),
[`ant-tabs-${this.nzType}`]: this.nzType,
[`ant-tabs-large`]: this.nzSize === 'large',
[`ant-tabs-small`]: this.nzSize === 'small'
});
}
/**
* @param {?} index
* @param {?} disabled
* @return {?}
*/
clickLabel(index, disabled) {
if (!disabled) {
this.nzSelectedIndex = index;
this.listOfNzTabComponent.toArray()[index].nzClick.emit();
}
}
/**
* @param {?} index
* @return {?}
*/
createChangeEvent(index) {
/** @type {?} */
const event = new NzTabChangeEvent();
event.index = index;
if (this.listOfNzTabComponent && this.listOfNzTabComponent.length) {
event.tab = this.listOfNzTabComponent.toArray()[index];
this.listOfNzTabComponent.forEach((/**
* @param {?} item
* @param {?} i
* @return {?}
*/
(item, i) => {
if (i !== index) {
item.nzDeselect.emit();
}
}));
event.tab.nzSelect.emit();
}
return event;
}
/**
* Clamps the given index to the bounds of 0 and the tabs length.
* @private
* @param {?} index
* @return {?}
*/
clampTabIndex(index) {
// Note the `|| 0`, which ensures that values like NaN can't get through
// and which would otherwise throw the component into an infinite loop
// (since Math.max(NaN, 0) === NaN).
return Math.min(this.listOfNzTabComponent.length - 1, Math.max(index || 0, 0));
}
/**
* @private
* @return {?}
*/
subscribeToTabLabels() {
if (this.tabLabelSubscription) {
this.tabLabelSubscription.unsubscribe();
}
this.tabLabelSubscription = merge(...this.listOfNzTabComponent.map((/**
* @param {?} tab
* @return {?}
*/
tab => tab.stateChanges))).subscribe((/**
* @return {?}
*/
() => this.cdr.markForCheck()));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzTabPosition) {
if ((this.nzTabPosition === 'top') || (this.nzTabPosition === 'bottom')) {
this.tabPositionMode = 'horizontal';
}
else {
this.tabPositionMode = 'vertical';
}
this.setPosition(this.nzTabPosition);
}
if (changes.nzType) {
if (this.nzType === 'card') {
this.nzAnimated = false;
}
}
if (changes.nzSize || changes.nzAnimated || changes.nzTabPosition || changes.nzType) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
}
/**
* @return {?}
*/
ngAfterContentChecked() {
if (this.listOfNzTabComponent && this.listOfNzTabComponent.length) {
// Don't clamp the `indexToSelect` immediately in the setter because it can happen that
// the amount of tabs changes before the actual change detection runs.
/** @type {?} */
const indexToSelect = this.indexToSelect = this.clampTabIndex(this.indexToSelect);
// If there is a change in selected index, emit a change event. Should not trigger if
// the selected index has not yet been initialized.
if (this._selectedIndex !== indexToSelect) {
/** @type {?} */
const isFirstRun = this._selectedIndex == null;
if (!isFirstRun) {
this.nzSelectChange.emit(this.createChangeEvent(indexToSelect));
}
// Changing these values after change detection has run
// since the checked content may contain references to them.
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.listOfNzTabComponent.forEach((/**
* @param {?} tab
* @param {?} index
* @return {?}
*/
(tab, index) => tab.isActive = index === indexToSelect));
if (!isFirstRun) {
this.nzSelectedIndexChange.emit(indexToSelect);
}
}));
}
// Setup the position for each tab and optionally setup an origin on the next selected tab.
this.listOfNzTabComponent.forEach((/**
* @param {?} tab
* @param {?} index
* @return {?}
*/
(tab, index) => {
tab.position = index - indexToSelect;
// If there is already a selected tab, then set up an origin for the next selected tab
// if it doesn't have one already.
if (this._selectedIndex != null && tab.position === 0 && !tab.origin) {
tab.origin = indexToSelect - this._selectedIndex;
}
}));
if (this._selectedIndex !== indexToSelect) {
this._selectedIndex = indexToSelect;
this.cdr.markForCheck();
}
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.subscribeToTabLabels();
// Subscribe to changes in the amount of tabs, in order to be
// able to re-render the content as new tabs are added or removed.
this.tabsSubscription = this.listOfNzTabComponent.changes.subscribe((/**
* @return {?}
*/
() => {
/** @type {?} */
const indexToSelect = this.clampTabIndex(this.indexToSelect);
// Maintain the previously-selected tab if a new tab is added or removed and there is no
// explicit change that selects a different tab.
if (indexToSelect === this._selectedIndex) {
/** @type {?} */
const tabs = this.listOfNzTabComponent.toArray();
for (let i = 0; i < tabs.length; i++) {
if (tabs[i].isActive) {
// Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
// event, otherwise the consumer may end up in an infinite loop in some edge cases like
// adding a tab within the `selectedIndexChange` event.
this.indexToSelect = this._selectedIndex = i;
break;
}
}
}
this.subscribeToTabLabels();
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
this.tabsSubscription.unsubscribe();
this.tabLabelSubscription.unsubscribe();
}
/**
* @return {?}
*/
ngAfterViewInit() {
this.setPosition(this.nzTabPosition);
}
}
NzTabSetComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tabset',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [NzUpdateHostClassService],
template: "<ng-container *ngIf=\"listOfNzTabComponent\">\n <div nz-tabs-nav\n role=\"tablist\"\n tabindex=\"0\"\n class=\"ant-tabs-bar\"\n [class.ant-tabs-card-bar]=\"nzType === 'card'\"\n [class.ant-tabs-top-bar]=\"nzTabPosition === 'top'\"\n [class.ant-tabs-bottom-bar]=\"nzTabPosition === 'bottom'\"\n [class.ant-tabs-left-bar]=\"nzTabPosition === 'left'\"\n [class.ant-tabs-right-bar]=\"nzTabPosition === 'right'\"\n [class.ant-tabs-small-bar]=\"nzSize === 'small'\"\n [class.ant-tabs-default-bar]=\"nzSize === 'default'\"\n [class.ant-tabs-large-bar]=\"nzSize === 'large'\"\n [nzType]=\"nzType\"\n [nzShowPagination]=\"nzShowPagination\"\n [nzPositionMode]=\"tabPositionMode\"\n [nzAnimated]=\"inkBarAnimated\"\n [ngStyle]=\"nzTabBarStyle\"\n [nzHideBar]=\"nzHideAll\"\n [nzTabBarExtraContent]=\"nzTabBarExtraContent\"\n [selectedIndex]=\"nzSelectedIndex\"\n (nzOnNextClick)=\"nzOnNextClick.emit()\"\n (nzOnPrevClick)=\"nzOnPrevClick.emit()\">\n <div nz-tab-label\n role=\"tab\"\n [style.margin-right.px]=\"nzTabBarGutter\"\n [class.ant-tabs-tab-active]=\"(nzSelectedIndex == i) && !nzHideAll\"\n [disabled]=\"tab.nzDisabled\"\n (click)=\"clickLabel(i,tab.nzDisabled)\"\n *ngFor=\"let tab of listOfNzTabComponent; let i = index\">\n <ng-container *nzStringTemplateOutlet=\"tab.nzTitle\">{{ tab.nzTitle }}</ng-container>\n </div>\n </div>\n <div #tabContent\n class=\"ant-tabs-content\"\n [class.ant-tabs-top-content]=\"nzTabPosition === 'top'\"\n [class.ant-tabs-bottom-content]=\"nzTabPosition === 'bottom'\"\n [class.ant-tabs-left-content]=\"nzTabPosition === 'left'\"\n [class.ant-tabs-right-content]=\"nzTabPosition === 'right'\"\n [class.ant-tabs-content-animated]=\"tabPaneAnimated\"\n [class.ant-tabs-content-no-animated]=\"!tabPaneAnimated\"\n [style.margin-left.%]=\"(tabPositionMode === 'horizontal') && tabPaneAnimated && (-nzSelectedIndex*100)\">\n <div nz-tab-body\n class=\"ant-tabs-tabpane\"\n *ngFor=\"let tab of listOfNzTabComponent; let i = index\"\n [active]=\"(nzSelectedIndex == i) && !nzHideAll\"\n [forceRender]=\"tab.nzForceRender\"\n [content]=\"tab.template || tab.content\">\n </div>\n </div>\n</ng-container>",
styles: [`
nz-tabset {
display: block;
}
`]
}] }
];
/** @nocollapse */
NzTabSetComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: NzUpdateHostClassService },
{ type: ElementRef },
{ type: ChangeDetectorRef }
];
NzTabSetComponent.propDecorators = {
listOfNzTabComponent: [{ type: ContentChildren, args: [NzTabComponent,] }],
nzTabsNavComponent: [{ type: ViewChild, args: [NzTabsNavComponent,] }],
tabContent: [{ type: ViewChild, args: ['tabContent',] }],
nzTabBarExtraContent: [{ type: Input }],
nzShowPagination: [{ type: Input }],
nzAnimated: [{ type: Input }],
nzHideAll: [{ type: Input }],
nzTabPosition: [{ type: Input }],
nzSize: [{ type: Input }],
nzTabBarGutter: [{ type: Input }],
nzTabBarStyle: [{ type: Input }],
nzType: [{ type: Input }],
nzOnNextClick: [{ type: Output }],
nzOnPrevClick: [{ type: Output }],
nzSelectChange: [{ type: Output }],
nzSelectedIndexChange: [{ type: Output }],
nzSelectedIndex: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTabsModule {
}
NzTabsModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzTabComponent, NzTabDirective, NzTabSetComponent, NzTabsNavComponent, NzTabLabelDirective, NzTabsInkBarDirective, NzTabBodyComponent],
exports: [NzTabComponent, NzTabDirective, NzTabSetComponent, NzTabsNavComponent, NzTabLabelDirective, NzTabsInkBarDirective, NzTabBodyComponent],
imports: [CommonModule, ObserversModule, NzIconModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTagComponent {
/**
* @param {?} renderer
* @param {?} elementRef
* @param {?} nzUpdateHostClassService
*/
constructor(renderer, elementRef, nzUpdateHostClassService) {
this.renderer = renderer;
this.elementRef = elementRef;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.presetColor = false;
this.nzMode = 'default';
this.nzChecked = false;
this.nzNoAnimation = false;
this.nzAfterClose = new EventEmitter();
this.nzOnClose = new EventEmitter();
this.nzCheckedChange = new EventEmitter();
}
/**
* @private
* @param {?=} color
* @return {?}
*/
isPresetColor(color) {
if (!color) {
return false;
}
return (/^(pink|red|yellow|orange|cyan|green|blue|purple|geekblue|magenta|volcano|gold|lime)(-inverse)?$/
.test(color));
}
/**
* @private
* @return {?}
*/
updateClassMap() {
this.presetColor = this.isPresetColor(this.nzColor);
/** @type {?} */
const prefix = 'ant-tag';
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`${prefix}`]: true,
[`${prefix}-has-color`]: this.nzColor && !this.presetColor,
[`${prefix}-${this.nzColor}`]: this.presetColor,
[`${prefix}-checkable`]: this.nzMode === 'checkable',
[`${prefix}-checkable-checked`]: this.nzChecked
});
}
/**
* @return {?}
*/
updateCheckedStatus() {
if (this.nzMode === 'checkable') {
this.nzChecked = !this.nzChecked;
this.nzCheckedChange.emit(this.nzChecked);
this.updateClassMap();
}
}
/**
* @param {?} e
* @return {?}
*/
closeTag(e) {
this.nzOnClose.emit(e);
if (!e.defaultPrevented) {
this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), this.elementRef.nativeElement);
}
}
/**
* @param {?} e
* @return {?}
*/
afterAnimation(e) {
if (e.toState === 'void') {
this.nzAfterClose.emit();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.updateClassMap();
}
/**
* @return {?}
*/
ngOnChanges() {
this.updateClassMap();
}
}
NzTagComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tag',
preserveWhitespaces: false,
providers: [NzUpdateHostClassService],
animations: [fadeMotion],
template: "<ng-content></ng-content>\n<i nz-icon type=\"close\" *ngIf=\"nzMode==='closeable'\" tabindex=\"-1\" (click)=\"closeTag($event)\"></i>\n",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[@fadeMotion]': '',
'(@fadeMotion.done)': 'afterAnimation($event)',
'(click)': 'updateCheckedStatus()',
'[style.background-color]': 'presetColor? null : nzColor'
}
}] }
];
/** @nocollapse */
NzTagComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzUpdateHostClassService }
];
NzTagComponent.propDecorators = {
nzMode: [{ type: Input }],
nzColor: [{ type: Input }],
nzChecked: [{ type: Input }],
nzNoAnimation: [{ type: Input }],
nzAfterClose: [{ type: Output }],
nzOnClose: [{ type: Output }],
nzCheckedChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTagComponent.prototype, "nzChecked", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTagComponent.prototype, "nzNoAnimation", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTagModule {
}
NzTagModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzIconModule],
declarations: [
NzTagComponent
],
exports: [
NzTagComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimelineItemComponent {
/**
* @param {?} renderer
* @param {?} cdr
*/
constructor(renderer, cdr) {
this.renderer = renderer;
this.cdr = cdr;
this.nzColor = 'blue';
this.isLast = false;
}
/**
* @return {?}
*/
ngOnInit() {
this.tryUpdateCustomColor();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzColor) {
this.tryUpdateCustomColor();
}
}
/**
* @return {?}
*/
detectChanges() {
this.cdr.detectChanges();
}
/**
* @private
* @return {?}
*/
tryUpdateCustomColor() {
/** @type {?} */
const defaultColors = ['blue', 'red', 'green'];
/** @type {?} */
const circle = this.liTemplate.nativeElement.querySelector('.ant-timeline-item-head');
if (defaultColors.indexOf(this.nzColor) === -1) {
this.renderer.setStyle(circle, 'border-color', this.nzColor);
}
else {
this.renderer.removeStyle(circle, 'border-color');
}
}
}
NzTimelineItemComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
selector: 'nz-timeline-item, [nz-timeline-item]',
template: "<li\n class=\"ant-timeline-item\"\n [class.ant-timeline-item-right]=\"position === 'right'\"\n [class.ant-timeline-item-left]=\"position === 'left'\"\n [class.ant-timeline-item-last]=\"isLast\"\n #liTemplate>\n <div class=\"ant-timeline-item-tail\"></div>\n <div\n class=\"ant-timeline-item-head\"\n [class.ant-timeline-item-head-red]=\"nzColor === 'red'\"\n [class.ant-timeline-item-head-blue]=\"nzColor === 'blue'\"\n [class.ant-timeline-item-head-green]=\"nzColor === 'green'\"\n [class.ant-timeline-item-head-custom]=\"!!nzDot\">\n <ng-container *nzStringTemplateOutlet=\"nzDot\">{{ nzDot }}</ng-container>\n </div>\n <div class=\"ant-timeline-item-content\">\n <ng-content></ng-content>\n </div>\n</li>"
}] }
];
/** @nocollapse */
NzTimelineItemComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ChangeDetectorRef }
];
NzTimelineItemComponent.propDecorators = {
liTemplate: [{ type: ViewChild, args: ['liTemplate',] }],
nzColor: [{ type: Input }],
nzDot: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimelineComponent {
/**
* @param {?} cdr
*/
constructor(cdr) {
this.cdr = cdr;
this.nzReverse = false;
this.isPendingBoolean = false;
this.destroy$ = new Subject();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
/** @type {?} */
const modeChanges = changes.nzMode;
/** @type {?} */
const reverseChanges = changes.nzReverse;
/** @type {?} */
const pendingChanges = changes.nzPending;
if (modeChanges && (modeChanges.previousValue !== modeChanges.currentValue || modeChanges.isFirstChange())) {
this.updateChildren();
}
if (reverseChanges && reverseChanges.previousValue !== reverseChanges.currentValue && !reverseChanges.isFirstChange()) {
this.reverseChildTimelineDots();
}
if (pendingChanges) {
this.isPendingBoolean = pendingChanges.currentValue === true;
}
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.updateChildren();
if (this.listOfTimeLine) {
this.listOfTimeLine.changes.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.updateChildren();
}));
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
/**
* @private
* @return {?}
*/
updateChildren() {
if (this.listOfTimeLine && this.listOfTimeLine.length) {
/** @type {?} */
const length = this.listOfTimeLine.length;
this.listOfTimeLine.toArray().forEach((/**
* @param {?} item
* @param {?} index
* @return {?}
*/
(item, index) => {
item.isLast = !this.nzReverse ? index === length - 1 : index === 0;
item.position = this.nzMode === 'left' || !this.nzMode
? undefined
: this.nzMode === 'right'
? 'right'
: this.nzMode === 'alternate' && index % 2 === 0 ? 'left' : 'right';
item.detectChanges();
}));
this.cdr.markForCheck();
}
}
/**
* @private
* @return {?}
*/
reverseChildTimelineDots() {
reverseChildNodes((/** @type {?} */ (this.timeline.nativeElement)));
this.updateChildren();
}
}
NzTimelineComponent.decorators = [
{ type: Component, args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
selector: 'nz-timeline',
template: "<ul\n class=\"ant-timeline\"\n [class.ant-timeline-right]=\"nzMode === 'right'\"\n [class.ant-timeline-alternate]=\"nzMode === 'alternate'\"\n [class.ant-timeline-pending]=\"!!nzPending\"\n [class.ant-timeline-reverse]=\"nzReverse\"\n #timeline>\n <!-- User inserted timeline dots. -->\n <ng-content></ng-content>\n <!-- Pending dot. -->\n <li *ngIf=\"nzPending\" class=\"ant-timeline-item ant-timeline-item-pending\">\n <div class=\"ant-timeline-item-tail\"></div>\n <div class=\"ant-timeline-item-head ant-timeline-item-head-custom ant-timeline-item-head-blue\">\n <ng-container *nzStringTemplateOutlet=\"nzPendingDot\">\n {{ nzPendingDot }}<i *ngIf=\"!nzPendingDot\" nz-icon type=\"loading\"></i>\n </ng-container>\n </div>\n <div class=\"ant-timeline-item-content\">\n <ng-container *nzStringTemplateOutlet=\"nzPending\">\n {{ isPendingBoolean ? '' : nzPending }}\n </ng-container>\n </div>\n </li>\n</ul>\n"
}] }
];
/** @nocollapse */
NzTimelineComponent.ctorParameters = () => [
{ type: ChangeDetectorRef }
];
NzTimelineComponent.propDecorators = {
timeline: [{ type: ViewChild, args: ['timeline',] }],
listOfTimeLine: [{ type: ContentChildren, args: [NzTimelineItemComponent,] }],
_pendingContent: [{ type: ContentChild, args: ['pending',] }],
nzMode: [{ type: Input }],
nzPending: [{ type: Input }],
nzPendingDot: [{ type: Input }],
nzReverse: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTimelineModule {
}
NzTimelineModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzTimelineItemComponent, NzTimelineComponent],
exports: [NzTimelineItemComponent, NzTimelineComponent],
imports: [CommonModule, NzIconModule, NzAddOnModule]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTransferListComponent {
// #endregion
/**
* @param {?} el
* @param {?} updateHostClassService
* @param {?} cdr
*/
constructor(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 {?}
*/
setClassMap() {
/** @type {?} */
const classMap = {
[this.prefixCls]: true,
[`${this.prefixCls}-with-footer`]: !!this.footer
};
this.updateHostClassService.updateHostClass(this.el.nativeElement, classMap);
}
/**
* @param {?} status
* @return {?}
*/
onHandleSelectAll(status) {
this.dataSource.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
if (!item.disabled && !item._hiden) {
item.checked = status;
}
}));
this.updateCheckStatus();
this.handleSelectAll.emit(status);
}
/**
* @private
* @return {?}
*/
updateCheckStatus() {
/** @type {?} */
const validCount = this.dataSource.filter((/**
* @param {?} w
* @return {?}
*/
w => !w.disabled)).length;
this.stat.checkCount = this.dataSource.filter((/**
* @param {?} w
* @return {?}
*/
w => w.checked && !w.disabled)).length;
this.stat.shownCount = this.dataSource.filter((/**
* @param {?} w
* @return {?}
*/
w => !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
/**
* @param {?} value
* @return {?}
*/
handleFilter(value) {
this.filter = value;
this.dataSource.forEach((/**
* @param {?} item
* @return {?}
*/
item => {
item._hiden = value.length > 0 && !this.matchFilter(value, item);
}));
this.stat.shownCount = this.dataSource.filter((/**
* @param {?} w
* @return {?}
*/
w => !w._hiden)).length;
this.filterChange.emit({ direction: this.direction, value });
}
/**
* @return {?}
*/
handleClear() {
this.handleFilter('');
}
/**
* @private
* @param {?} text
* @param {?} item
* @return {?}
*/
matchFilter(text, item) {
if (this.filterOption) {
return this.filterOption(text, item);
}
return item.title.includes(text);
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if ('footer' in changes) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
}
/**
* @return {?}
*/
markForCheck() {
this.updateCheckStatus();
this.cdr.markForCheck();
}
/**
* @param {?} item
* @return {?}
*/
_handleSelect(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 class=\"ant-transfer-list-content\">\n <ng-container *ngFor=\"let item of dataSource\">\n <li *ngIf=\"!item._hiden\"\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)\" [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 </ng-container>\n </ul>\n <div *ngIf=\"dataSource.length === 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 = () => [
{ 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 }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTransferSearchComponent {
// endregion
/**
* @param {?} cdr
*/
constructor(cdr) {
this.cdr = cdr;
this.valueChanged = new EventEmitter();
this.valueClear = new EventEmitter();
}
/**
* @return {?}
*/
_handle() {
this.valueChanged.emit(this.value);
}
/**
* @return {?}
*/
_clear() {
if (this.disabled) {
return;
}
this.value = '';
this.valueClear.emit();
}
/**
* @return {?}
*/
ngOnChanges() {
this.cdr.detectChanges();
}
}
NzTransferSearchComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-transfer-search]',
preserveWhitespaces: false,
template: "<input [(ngModel)]=\"value\" (ngModelChange)=\"_handle()\" [disabled]=\"disabled\" [placeholder]=\"placeholder\"\n class=\"ant-input ant-transfer-list-search\" [ngClass]=\"{'ant-input-disabled': disabled}\">\n<a *ngIf=\"value && value.length > 0; else def\" class=\"ant-transfer-list-search-action\" (click)=\"_clear()\">\n <i nz-icon type=\"close-circle\"></i>\n</a>\n<ng-template #def>\n <span class=\"ant-transfer-list-search-action\"><i nz-icon type=\"search\"></i></span>\n</ng-template>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzTransferSearchComponent.ctorParameters = () => [
{ type: ChangeDetectorRef }
];
NzTransferSearchComponent.propDecorators = {
placeholder: [{ type: Input }],
value: [{ type: Input }],
disabled: [{ type: Input }],
valueChanged: [{ type: Output }],
valueClear: [{ type: Output }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTransferComponent {
// #endregion
/**
* @param {?} cdr
* @param {?} i18n
* @param {?} renderer
* @param {?} elementRef
*/
constructor(cdr, i18n, renderer, elementRef) {
this.cdr = cdr;
this.i18n = i18n;
this.unsubscribe$ = new Subject();
// tslint:disable-next-line:no-any
this.locale = {};
this.leftFilter = '';
this.rightFilter = '';
// #region fields
this.nzDisabled = false;
this.nzDataSource = [];
this.nzTitles = ['', ''];
this.nzOperations = [];
this.nzCanMove = (/**
* @param {?} arg
* @return {?}
*/
(arg) => of(arg.list));
this.nzShowSearch = false;
// events
this.nzChange = new EventEmitter();
this.nzSearchChange = new EventEmitter();
this.nzSelectChange = new EventEmitter();
// #endregion
// #region process data
// left
this.leftDataSource = [];
// right
this.rightDataSource = [];
this.handleLeftSelectAll = (/**
* @param {?} checked
* @return {?}
*/
(checked) => this.handleSelect('left', checked));
this.handleRightSelectAll = (/**
* @param {?} checked
* @return {?}
*/
(checked) => this.handleSelect('right', checked));
this.handleLeftSelect = (/**
* @param {?} item
* @return {?}
*/
(item) => this.handleSelect('left', item.checked, item));
this.handleRightSelect = (/**
* @param {?} item
* @return {?}
*/
(item) => this.handleSelect('right', item.checked, item));
// #endregion
// #region operation
this.leftActive = false;
this.rightActive = false;
this.moveToLeft = (/**
* @return {?}
*/
() => this.moveTo('left'));
this.moveToRight = (/**
* @return {?}
*/
() => this.moveTo('right'));
renderer.addClass(elementRef.nativeElement, 'ant-transfer');
}
/**
* @private
* @return {?}
*/
splitDataSource() {
this.leftDataSource = [];
this.rightDataSource = [];
this.nzDataSource.forEach((/**
* @param {?} record
* @return {?}
*/
record => {
if (record.direction === 'right') {
this.rightDataSource.push(record);
}
else {
this.leftDataSource.push(record);
}
}));
}
/**
* @private
* @param {?} direction
* @return {?}
*/
getCheckedData(direction) {
return this[direction === 'left' ? 'leftDataSource' : 'rightDataSource'].filter((/**
* @param {?} w
* @return {?}
*/
w => w.checked));
}
/**
* @param {?} direction
* @param {?} checked
* @param {?=} item
* @return {?}
*/
handleSelect(direction, checked, item) {
/** @type {?} */
const list = this.getCheckedData(direction);
this.updateOperationStatus(direction, list.length);
this.nzSelectChange.emit({ direction, checked, list, item });
}
/**
* @param {?} ret
* @return {?}
*/
handleFilterChange(ret) {
this.nzSearchChange.emit(ret);
}
/**
* @private
* @param {?} direction
* @param {?=} count
* @return {?}
*/
updateOperationStatus(direction, count) {
this[direction === 'right' ? 'leftActive' : 'rightActive'] = (typeof count === 'undefined' ? this.getCheckedData(direction).filter((/**
* @param {?} w
* @return {?}
*/
w => !w.disabled)).length : count) > 0;
}
/**
* @param {?} direction
* @return {?}
*/
moveTo(direction) {
/** @type {?} */
const oppositeDirection = direction === 'left' ? 'right' : 'left';
this.updateOperationStatus(oppositeDirection, 0);
/** @type {?} */
const datasource = direction === 'left' ? this.rightDataSource : this.leftDataSource;
/** @type {?} */
const moveList = datasource.filter((/**
* @param {?} item
* @return {?}
*/
item => item.checked === true && !item.disabled));
this.nzCanMove({ direction, list: moveList })
.subscribe((/**
* @param {?} newMoveList
* @return {?}
*/
newMoveList => this.truthMoveTo(direction, newMoveList.filter((/**
* @param {?} i
* @return {?}
*/
i => !!i)))), (/**
* @return {?}
*/
() => moveList.forEach((/**
* @param {?} i
* @return {?}
*/
i => i.checked = false))));
}
/**
* @private
* @param {?} direction
* @param {?} list
* @return {?}
*/
truthMoveTo(direction, list) {
/** @type {?} */
const oppositeDirection = direction === 'left' ? 'right' : 'left';
/** @type {?} */
const datasource = direction === 'left' ? this.rightDataSource : this.leftDataSource;
/** @type {?} */
const targetDatasource = direction === 'left' ? this.leftDataSource : this.rightDataSource;
for (const item of list) {
item.checked = false;
targetDatasource.push(item);
datasource.splice(datasource.indexOf(item), 1);
}
this.updateOperationStatus(oppositeDirection);
this.nzChange.emit({
from: oppositeDirection,
to: direction,
list
});
this.markForCheckAllList();
}
/**
* @private
* @return {?}
*/
markForCheckAllList() {
if (!this.lists) {
return;
}
this.lists.forEach((/**
* @param {?} i
* @return {?}
*/
i => i.markForCheck()));
}
/**
* @return {?}
*/
ngOnInit() {
this.i18n.localeChange.pipe(takeUntil(this.unsubscribe$)).subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Transfer');
this.markForCheckAllList();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if ('nzDataSource' in changes) {
this.splitDataSource();
this.updateOperationStatus('left');
this.updateOperationStatus('right');
this.cdr.detectChanges();
this.markForCheckAllList();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.unsubscribe$.next();
this.unsubscribe$.complete();
}
}
NzTransferComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-transfer',
preserveWhitespaces: false,
template: "<nz-transfer-list class=\"ant-transfer-list\" [ngStyle]=\"nzListStyle\" data-direction=\"left\"\n [titleText]=\"nzTitles[0]\"\n [dataSource]=\"leftDataSource\"\n [filter]=\"leftFilter\"\n [filterOption]=\"nzFilterOption\"\n (filterChange)=\"handleFilterChange($event)\"\n [render]=\"nzRender\"\n [disabled]=\"nzDisabled\"\n [showSearch]=\"nzShowSearch\"\n [searchPlaceholder]=\"nzSearchPlaceholder || locale.searchPlaceholder\"\n [notFoundContent]=\"nzNotFoundContent\"\n [itemUnit]=\"nzItemUnit || locale.itemUnit\"\n [itemsUnit]=\"nzItemsUnit || locale.itemsUnit\"\n [footer]=\"nzFooter\"\n (handleSelect)=\"handleLeftSelect($event)\"\n (handleSelectAll)=\"handleLeftSelectAll($event)\">\n</nz-transfer-list>\n<div class=\"ant-transfer-operation\">\n <button nz-button (click)=\"moveToLeft()\" [disabled]=\"nzDisabled || !leftActive\" [nzType]=\"'primary'\" [nzSize]=\"'small'\">\n <i nz-icon type=\"left\"></i><span *ngIf=\"nzOperations[1]\">{{ nzOperations[1] }}</span>\n </button>\n <button nz-button (click)=\"moveToRight()\" [disabled]=\"nzDisabled || !rightActive\" [nzType]=\"'primary'\" [nzSize]=\"'small'\">\n <i nz-icon type=\"right\"></i><span *ngIf=\"nzOperations[0]\">{{ nzOperations[0] }}</span>\n </button>\n</div>\n<nz-transfer-list class=\"ant-transfer-list\" [ngStyle]=\"nzListStyle\" data-direction=\"right\"\n [titleText]=\"nzTitles[1]\"\n [dataSource]=\"rightDataSource\"\n [filter]=\"rightFilter\"\n [filterOption]=\"nzFilterOption\"\n (filterChange)=\"handleFilterChange($event)\"\n [render]=\"nzRender\"\n [disabled]=\"nzDisabled\"\n [showSearch]=\"nzShowSearch\"\n [searchPlaceholder]=\"nzSearchPlaceholder || locale.searchPlaceholder\"\n [notFoundContent]=\"nzNotFoundContent\"\n [itemUnit]=\"nzItemUnit || locale.itemUnit\"\n [itemsUnit]=\"nzItemsUnit || locale.itemsUnit\"\n [footer]=\"nzFooter\"\n (handleSelect)=\"handleRightSelect($event)\"\n (handleSelectAll)=\"handleRightSelectAll($event)\">\n</nz-transfer-list>",
host: {
'[class.ant-transfer-disabled]': 'nzDisabled'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzTransferComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzI18nService$$1 },
{ type: Renderer2 },
{ type: ElementRef }
];
NzTransferComponent.propDecorators = {
lists: [{ type: ViewChildren, args: [NzTransferListComponent,] }],
nzDisabled: [{ type: Input }],
nzDataSource: [{ type: Input }],
nzTitles: [{ type: Input }],
nzOperations: [{ type: Input }],
nzListStyle: [{ type: Input }],
nzItemUnit: [{ type: Input }],
nzItemsUnit: [{ type: Input }],
nzCanMove: [{ type: Input }],
nzRender: [{ type: Input }],
nzFooter: [{ type: Input }],
nzShowSearch: [{ type: Input }],
nzFilterOption: [{ type: Input }],
nzSearchPlaceholder: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzChange: [{ type: Output }],
nzSearchChange: [{ type: Output }],
nzSelectChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTransferComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTransferComponent.prototype, "nzShowSearch", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTransferModule {
}
NzTransferModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzCheckboxModule, NzButtonModule, NzInputModule, NzI18nModule, NzIconModule, NzEmptyModule],
declarations: [NzTransferComponent, NzTransferListComponent, NzTransferSearchComponent],
exports: [NzTransferComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeNode {
/**
* @param {?} option
* @param {?=} parent
* @param {?=} service
*/
constructor(option, parent = null, service) {
this.level = 0;
if (option instanceof NzTreeNode) {
return option;
}
this._service = service;
this._title = option.title || '---';
this.key = option.key || null;
this._icon = option.icon || '';
this._isLeaf = option.isLeaf || false;
this.origin = option;
this._children = [];
this.parentNode = parent;
// option params
this._isChecked = option.checked || false;
this._isSelectable = option.disabled || (option.selectable === false ? false : true);
this._isDisabled = option.disabled || false;
this._isDisableCheckbox = option.disableCheckbox || false;
this._isExpanded = option.isLeaf ? false : (option.expanded || false);
this._isHalfChecked = false;
this._isSelected = (!option.disabled && option.selected) || false;
this._isLoading = false;
this.isMatched = false;
/**
* parent's checked status will affect children while initializing
*/
if (parent) {
this.level = parent.level + 1;
}
else {
this.level = 0;
}
if (typeof (option.children) !== 'undefined' && option.children !== null) {
option.children.forEach((/**
* @param {?} nodeOptions
* @return {?}
*/
(nodeOptions) => {
if ((this.treeService && !this.treeService.isCheckStrictly) && option.checked && !option.disabled && !nodeOptions.disabled && !nodeOptions.disableCheckbox) {
nodeOptions.checked = option.checked;
}
this._children.push(new NzTreeNode(nodeOptions, this));
}));
}
}
/**
* @return {?}
*/
get treeService() {
if (this._service) {
return this._service;
}
else if (this.parentNode) {
return this.parentNode.treeService;
}
}
/**
* auto generate
* get
* set
* @return {?}
*/
get service() {
return this._service;
}
/**
* @param {?} value
* @return {?}
*/
set service(value) {
this._service = value;
}
/**
* @return {?}
*/
get title() {
return this._title;
}
/**
* @param {?} value
* @return {?}
*/
set title(value) {
this._title = value;
this.update();
}
/**
* @return {?}
*/
get icon() {
return this._icon;
}
/**
* @param {?} value
* @return {?}
*/
set icon(value) {
this._icon = value;
this.update();
}
/**
* @return {?}
*/
get children() {
return this._children;
}
/**
* @param {?} value
* @return {?}
*/
set children(value) {
this._children = value;
this.update();
}
/**
* @return {?}
*/
get isLeaf() {
return this._isLeaf;
}
/**
* @param {?} value
* @return {?}
*/
set isLeaf(value) {
this._isLeaf = value;
this.update();
}
/**
* @return {?}
*/
get isChecked() {
return this._isChecked;
}
/**
* @param {?} value
* @return {?}
*/
set isChecked(value) {
this._isChecked = value;
this.origin.checked = value;
this.treeService.setCheckedNodeList(this);
this.update();
}
/**
* @return {?}
*/
get isHalfChecked() {
return this._isHalfChecked;
}
/**
* @param {?} value
* @return {?}
*/
set isHalfChecked(value) {
this._isHalfChecked = value;
this.treeService.setHalfCheckedNodeList(this);
this.update();
}
/**
* @return {?}
*/
get isSelectable() {
return this._isSelectable;
}
/**
* @param {?} value
* @return {?}
*/
set isSelectable(value) {
this._isSelectable = value;
this.update();
}
/**
* @return {?}
*/
get isDisabled() {
return this._isDisabled;
}
/**
* @param {?} value
* @return {?}
*/
set isDisabled(value) {
this._isDisabled = value;
this.update();
}
/**
* @return {?}
*/
get isDisableCheckbox() {
return this._isDisableCheckbox;
}
/**
* @param {?} value
* @return {?}
*/
set isDisableCheckbox(value) {
this._isDisableCheckbox = value;
this.update();
}
/**
* @return {?}
*/
get isExpanded() {
return this._isExpanded;
}
/**
* @param {?} value
* @return {?}
*/
set isExpanded(value) {
this._isExpanded = value;
this.origin.expanded = value;
this.treeService.setExpandedNodeList(this);
this.update();
}
/**
* @return {?}
*/
get isSelected() {
return this._isSelected;
}
/**
* @param {?} value
* @return {?}
*/
set isSelected(value) {
this._isSelected = value;
this.origin.selected = value;
this.treeService.setNodeActive(this);
this.update();
}
/**
* @return {?}
*/
get isLoading() {
return this._isLoading;
}
/**
* @param {?} value
* @return {?}
*/
set isLoading(value) {
this._isLoading = value;
this.update();
}
/**
* end
* get
* set
* @return {?}
*/
getParentNode() {
return this.parentNode;
}
/**
* @return {?}
*/
getChildren() {
return this.children;
}
/**
* 支持按索引位置插入,叶子节点不可添加
* @param {?} children
* @param {?=} childPos
* @return {?}
*/
// tslint:disable-next-line:no-any
addChildren(children, childPos = -1) {
if (!this.isLeaf) {
children.forEach((/**
* @param {?} node
* @return {?}
*/
(node) => {
/** @type {?} */
const refreshLevel = (/**
* @param {?} n
* @return {?}
*/
(n) => {
n.getChildren().forEach((/**
* @param {?} c
* @return {?}
*/
c => {
c.level = c.getParentNode().level + 1;
// flush origin
c.origin.level = c.level;
refreshLevel(c);
}));
});
/** @type {?} */
let child = node;
if (child instanceof NzTreeNode) {
child.parentNode = this;
}
else {
child = new NzTreeNode(node, this);
}
child.level = this.level + 1;
child.origin.level = child.level;
refreshLevel(child);
try {
childPos === -1 ? this.children.push(child) : this.children.splice(childPos, 0, child);
// flush origin
}
catch (e) {
}
}));
this.origin.children = this.getChildren().map((/**
* @param {?} v
* @return {?}
*/
v => v.origin));
// remove loading state
this.isLoading = false;
this.treeService.triggerEventChange$.next({
'eventName': 'addChildren',
'node': this
});
}
}
/**
* @return {?}
*/
clearChildren() {
this.getChildren().forEach((/**
* @param {?} n
* @return {?}
*/
(n) => {
this.treeService.afterRemove(n, false);
}));
this.getChildren().splice(0, this.getChildren().length);
this.origin.children = [];
// refresh checked state
this.treeService.calcCheckedKeys(this.treeService.checkedNodeList.map((/**
* @param {?} v
* @return {?}
*/
v => v.key)), this.treeService.rootNodes, this.treeService.isCheckStrictly);
this.update();
}
/**
* @return {?}
*/
remove() {
if (this.getParentNode()) {
/** @type {?} */
const index = this.getParentNode().getChildren().findIndex((/**
* @param {?} n
* @return {?}
*/
n => n.key === this.key));
this.getParentNode().getChildren().splice(index, 1);
this.getParentNode().origin.children.splice(index, 1);
this.treeService.afterRemove(this);
this.update();
}
}
/**
* @return {?}
*/
update() {
if (this.component) {
this.component.setClassMap();
this.component.markForCheck();
}
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} node
* @return {?}
*/
function isCheckDisabled(node) {
const { isDisabled, isDisableCheckbox } = node;
return !!(isDisabled || isDisableCheckbox);
}
// tslint:disable-next-line:no-any
/**
* @param {?} needle
* @param {?} haystack
* @return {?}
*/
function isInArray(needle, haystack) {
return (haystack.length > 0 && haystack.indexOf(needle) > -1);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeBaseService {
constructor() {
this.DRAG_SIDE_RANGE = 0.25;
this.DRAG_MIN_GAP = 2;
this.isCheckStrictly = false;
this.isMultiple = false;
this.rootNodes = [];
this.selectedNodeList = [];
this.expandedNodeList = [];
this.checkedNodeList = [];
this.halfCheckedNodeList = [];
this.matchedNodeList = [];
this.triggerEventChange$ = new Subject();
}
/**
* trigger event
* @return {?}
*/
eventTriggerChanged() {
return this.triggerEventChange$.asObservable();
}
/**
* reset tree nodes will clear default node list
* @param {?} nzNodes
* @return {?}
*/
initTree(nzNodes) {
this.rootNodes = nzNodes;
this.expandedNodeList = [];
this.selectedNodeList = [];
this.halfCheckedNodeList = [];
this.checkedNodeList = [];
this.matchedNodeList = [];
// refresh node checked state
setTimeout((/**
* @return {?}
*/
() => {
this.refreshCheckState(this.isCheckStrictly);
}));
}
/**
* @return {?}
*/
getSelectedNode() {
return this.selectedNode;
}
/**
* get some list
* @return {?}
*/
getSelectedNodeList() {
return this.conductNodeState('select');
}
/**
* return checked nodes
* @return {?}
*/
getCheckedNodeList() {
return this.conductNodeState('check');
}
/**
* @return {?}
*/
getHalfCheckedNodeList() {
return this.conductNodeState('halfCheck');
}
/**
* return expanded nodes
* @return {?}
*/
getExpandedNodeList() {
return this.conductNodeState('expand');
}
/**
* return search matched nodes
* @return {?}
*/
getMatchedNodeList() {
return this.conductNodeState('match');
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
isArrayOfNzTreeNode(value) {
return value.every((/**
* @param {?} item
* @return {?}
*/
item => item instanceof NzTreeNode));
}
/**
* reset selectedNodeList
* @param {?} selectedKeys
* @param {?} nzNodes
* @param {?=} isMulti
* @return {?}
*/
calcSelectedKeys(selectedKeys, nzNodes, isMulti = false) {
/** @type {?} */
const calc = (/**
* @param {?} nodes
* @return {?}
*/
(nodes) => {
return nodes.every((/**
* @param {?} node
* @return {?}
*/
node => {
if (isInArray(node.key, selectedKeys)) {
node.isSelected = true;
if (!isMulti) {
// if not support multi select
return false;
}
}
else {
node.isSelected = false;
}
if (node.children.length > 0) {
// Recursion
return calc(node.children);
}
return true;
}));
});
calc(nzNodes);
}
/**
* reset expandedNodeList
* @param {?} expandedKeys
* @param {?} nzNodes
* @return {?}
*/
calcExpandedKeys(expandedKeys, nzNodes) {
this.expandedNodeList = [];
/** @type {?} */
const calc = (/**
* @param {?} nodes
* @return {?}
*/
(nodes) => {
nodes.forEach((/**
* @param {?} node
* @return {?}
*/
node => {
if (isInArray(node.key, expandedKeys)) {
node.isExpanded = true;
}
else {
node.isExpanded = false;
}
if (node.children.length > 0) {
calc(node.children);
}
}));
});
calc(nzNodes);
}
/**
* reset checkedNodeList
* @param {?} checkedKeys
* @param {?} nzNodes
* @param {?=} isCheckStrictly
* @return {?}
*/
calcCheckedKeys(checkedKeys, nzNodes, isCheckStrictly = false) {
this.checkedNodeList = [];
this.halfCheckedNodeList = [];
/** @type {?} */
const calc = (/**
* @param {?} nodes
* @return {?}
*/
(nodes) => {
nodes.forEach((/**
* @param {?} node
* @return {?}
*/
node => {
if (isInArray(node.key, checkedKeys)) {
node.isChecked = true;
node.isHalfChecked = false;
}
else {
node.isChecked = false;
node.isHalfChecked = false;
}
if (node.children.length > 0) {
calc(node.children);
}
}));
});
calc(nzNodes);
// controlled state
this.refreshCheckState(isCheckStrictly);
}
/**
* set drag node
* @param {?=} node
* @return {?}
*/
setSelectedNode(node) {
this.selectedNode = null;
if (node) {
this.selectedNode = node;
}
}
/**
* set node selected status
* @param {?} node
* @return {?}
*/
setNodeActive(node) {
if (!this.isMultiple && node.isSelected) {
this.selectedNodeList.forEach((/**
* @param {?} n
* @return {?}
*/
n => {
if (node.key !== n.key) {
// reset other nodes
n.isSelected = false;
}
}));
// single mode: remove pre node
this.selectedNodeList = [];
}
this.setSelectedNodeList(node, this.isMultiple);
}
/**
* add or remove node to selectedNodeList
* @param {?} node
* @param {?=} isMultiple
* @return {?}
*/
setSelectedNodeList(node, isMultiple = false) {
/** @type {?} */
let index = this.selectedNodeList.findIndex((/**
* @param {?} n
* @return {?}
*/
n => node.key === n.key));
if (isMultiple) {
if (node.isSelected && index === -1) {
this.selectedNodeList.push(node);
}
}
else {
if (node.isSelected && index === -1) {
this.selectedNodeList = [node];
}
}
index = this.selectedNodeList.findIndex((/**
* @param {?} n
* @return {?}
*/
n => node.key === n.key));
if (!node.isSelected && index > -1) {
this.selectedNodeList.splice(index, 1);
}
}
/**
* merge checked nodes
* @param {?} node
* @return {?}
*/
setHalfCheckedNodeList(node) {
/** @type {?} */
const index = this.halfCheckedNodeList.findIndex((/**
* @param {?} n
* @return {?}
*/
n => node.key === n.key));
if (node.isHalfChecked && index === -1) {
this.halfCheckedNodeList.push(node);
}
else if (!node.isHalfChecked && index > -1) {
this.halfCheckedNodeList.splice(index, 1);
}
}
/**
* @param {?} node
* @return {?}
*/
setCheckedNodeList(node) {
/** @type {?} */
const index = this.checkedNodeList.findIndex((/**
* @param {?} n
* @return {?}
*/
n => node.key === n.key));
if (node.isChecked && index === -1) {
this.checkedNodeList.push(node);
}
else if (!node.isChecked && index > -1) {
this.checkedNodeList.splice(index, 1);
}
}
/**
* conduct checked/selected/expanded keys
* @param {?=} type
* @return {?}
*/
conductNodeState(type = 'check') {
/** @type {?} */
let resultNodesList = [];
switch (type) {
case 'select':
resultNodesList = this.selectedNodeList;
break;
case 'expand':
resultNodesList = this.expandedNodeList;
break;
case 'match':
resultNodesList = this.matchedNodeList;
break;
case 'check':
resultNodesList = this.checkedNodeList;
/** @type {?} */
const isIgnore = (/**
* @param {?} node
* @return {?}
*/
(node) => {
if (node.getParentNode()) {
if (this.checkedNodeList.findIndex((/**
* @param {?} v
* @return {?}
*/
v => v.key === node.getParentNode().key)) > -1) {
return true;
}
else {
return isIgnore(node.getParentNode());
}
}
return false;
});
// merge checked
if (!this.isCheckStrictly) {
resultNodesList = this.checkedNodeList.filter((/**
* @param {?} n
* @return {?}
*/
n => !isIgnore(n)));
}
break;
case 'halfCheck':
if (!this.isCheckStrictly) {
resultNodesList = this.halfCheckedNodeList;
}
break;
}
return resultNodesList;
}
/**
* set expanded nodes
* @param {?} node
* @return {?}
*/
setExpandedNodeList(node) {
if (node.isLeaf) {
return;
}
/** @type {?} */
const index = this.expandedNodeList.findIndex((/**
* @param {?} n
* @return {?}
*/
n => node.key === n.key));
if (node.isExpanded && index === -1) {
this.expandedNodeList.push(node);
}
else if (!node.isExpanded && index > -1) {
this.expandedNodeList.splice(index, 1);
}
}
/**
* check state
* @param {?=} isCheckStrictly
* @return {?}
*/
refreshCheckState(isCheckStrictly = false) {
if (isCheckStrictly) {
return;
}
this.checkedNodeList.forEach((/**
* @param {?} node
* @return {?}
*/
node => {
this.conduct(node);
}));
}
// reset other node checked state based current node
/**
* @param {?} node
* @return {?}
*/
conduct(node) {
/** @type {?} */
const isChecked = node.isChecked;
if (node) {
this.conductUp(node);
this.conductDown(node, isChecked);
}
}
/**
* 1、children half checked
* 2、children all checked, parent checked
* 3、no children checked
* @param {?} node
* @return {?}
*/
conductUp(node) {
/** @type {?} */
const parentNode = node.getParentNode();
// 全禁用节点不选中
if (parentNode) {
if (!isCheckDisabled(parentNode)) {
if (parentNode.children.every((/**
* @param {?} child
* @return {?}
*/
child => isCheckDisabled(child) || (!child.isHalfChecked && child.isChecked)))) {
parentNode.isChecked = true;
parentNode.isHalfChecked = false;
}
else if (parentNode.children.some((/**
* @param {?} child
* @return {?}
*/
child => child.isHalfChecked || child.isChecked))) {
parentNode.isChecked = false;
parentNode.isHalfChecked = true;
}
else {
parentNode.isChecked = false;
parentNode.isHalfChecked = false;
}
}
this.setCheckedNodeList(parentNode);
this.setHalfCheckedNodeList(parentNode);
this.conductUp(parentNode);
}
}
/**
* reset child check state
* @param {?} node
* @param {?} value
* @return {?}
*/
conductDown(node, value) {
if (!isCheckDisabled(node)) {
node.isChecked = value;
node.isHalfChecked = false;
this.setCheckedNodeList(node);
this.setHalfCheckedNodeList(node);
node.children.forEach((/**
* @param {?} n
* @return {?}
*/
n => {
this.conductDown(n, value);
}));
}
}
/**
* search value & expand node
* should add expandlist
* @param {?} value
* @return {?}
*/
searchExpand(value) {
this.matchedNodeList = [];
/** @type {?} */
const expandedKeys = [];
if (!isNotNil(value)) {
return;
}
// to reset expandedNodeList
/** @type {?} */
const expandParent = (/**
* @param {?} p
* @return {?}
*/
(p) => {
// expand parent node
if (p.getParentNode()) {
expandedKeys.push(p.getParentNode().key);
expandParent(p.getParentNode());
}
});
/** @type {?} */
const searchChild = (/**
* @param {?} n
* @return {?}
*/
(n) => {
if (value && n.title.includes(value)) {
// match the node
n.isMatched = true;
this.matchedNodeList.push(n);
// expand parentNode
expandParent(n);
}
else {
n.isMatched = false;
}
n.children.forEach((/**
* @param {?} child
* @return {?}
*/
child => {
searchChild(child);
}));
});
this.rootNodes.forEach((/**
* @param {?} child
* @return {?}
*/
child => {
searchChild(child);
}));
// expand matched keys
this.calcExpandedKeys(expandedKeys, this.rootNodes);
}
/**
* flush after delete node
* @param {?} node
* @param {?=} removeSelf
* @return {?}
*/
afterRemove(node, removeSelf = true) {
/** @type {?} */
let index;
// to reset selectedNodeList & expandedNodeList
/** @type {?} */
const loopNode = (/**
* @param {?} n
* @return {?}
*/
(n) => {
// remove selected node
index = this.selectedNodeList.findIndex((/**
* @param {?} v
* @return {?}
*/
v => v.key === n.key));
if (index > -1) {
this.selectedNodeList.splice(index, 1);
}
// remove expanded node
index = this.expandedNodeList.findIndex((/**
* @param {?} v
* @return {?}
*/
v => v.key === n.key));
if (index > -1) {
this.expandedNodeList.splice(index, 1);
}
// remove checked node
index = this.checkedNodeList.findIndex((/**
* @param {?} v
* @return {?}
*/
v => v.key === n.key));
if (index > -1) {
this.checkedNodeList.splice(index, 1);
}
if (n.children) {
n.children.forEach((/**
* @param {?} child
* @return {?}
*/
child => {
loopNode(child);
}));
}
});
loopNode(node);
if (removeSelf) {
this.refreshCheckState(this.isCheckStrictly);
}
}
/**
* drag event
* @param {?} node
* @return {?}
*/
refreshDragNode(node) {
if (node.children.length === 0) {
// until root
this.conductUp(node);
}
else {
node.children.forEach((/**
* @param {?} child
* @return {?}
*/
(child) => {
this.refreshDragNode(child);
}));
}
}
// reset node level
/**
* @param {?} node
* @return {?}
*/
resetNodeLevel(node) {
if (node.getParentNode()) {
node.level = node.getParentNode().level + 1;
}
else {
node.level = 0;
}
for (const child of node.children) {
this.resetNodeLevel(child);
}
}
/**
* @param {?} event
* @return {?}
*/
calcDropPosition(event) {
const { clientY } = event;
// to fix firefox undefined
const { top, bottom, height } = event.srcElement ? event.srcElement.getBoundingClientRect() : ((/** @type {?} */ (event.target))).getBoundingClientRect();
/** @type {?} */
const des = Math.max(height * this.DRAG_SIDE_RANGE, this.DRAG_MIN_GAP);
if (clientY <= top + des) {
return -1;
}
else if (clientY >= bottom - des) {
return 1;
}
return 0;
}
/**
* drop
* 0: inner -1: pre 1: next
* @param {?} targetNode
* @param {?=} dragPos
* @return {?}
*/
dropAndApply(targetNode, dragPos = -1) {
if (!targetNode || dragPos > 1) {
return;
}
/** @type {?} */
const treeService = targetNode.treeService;
/** @type {?} */
const targetParent = targetNode.getParentNode();
/** @type {?} */
const isSelectedRootNode = this.selectedNode.getParentNode();
// remove the dragNode
if (isSelectedRootNode) {
isSelectedRootNode.children.splice(isSelectedRootNode.children.indexOf(this.selectedNode), 1);
}
else {
this.rootNodes.splice(this.rootNodes.indexOf(this.selectedNode), 1);
}
switch (dragPos) {
case 0:
targetNode.addChildren([this.selectedNode]);
this.resetNodeLevel(targetNode);
break;
case -1:
case 1:
/** @type {?} */
const tIndex = dragPos === 1 ? 1 : 0;
if (targetParent) {
targetParent.addChildren([this.selectedNode], targetParent.children.indexOf(targetNode) + tIndex);
if (this.selectedNode.getParentNode()) {
this.resetNodeLevel(this.selectedNode.getParentNode());
}
}
else {
/** @type {?} */
const targetIndex = this.rootNodes.indexOf(targetNode) + tIndex;
// 根节点插入
this.rootNodes.splice(targetIndex, 0, this.selectedNode);
this.rootNodes[targetIndex].parentNode = null;
this.rootNodes[targetIndex].level = 0;
}
break;
}
// flush all nodes
this.rootNodes.forEach((/**
* @param {?} child
* @return {?}
*/
(child) => {
if (!child.treeService) {
child.service = treeService;
}
this.refreshDragNode(child);
}));
}
/**
* emit Structure
* eventName
* node
* event: MouseEvent / DragEvent
* dragNode
* @param {?} eventName
* @param {?} node
* @param {?} event
* @return {?}
*/
formatEvent(eventName, node, event) {
/** @type {?} */
const emitStructure = {
'eventName': eventName,
'node': node,
'event': event
};
switch (eventName) {
case 'dragstart':
case 'dragenter':
case 'dragover':
case 'dragleave':
case 'drop':
case 'dragend':
Object.assign(emitStructure, { 'dragNode': this.getSelectedNode() });
break;
case 'click':
case 'dblclick':
Object.assign(emitStructure, { 'selectedKeys': this.selectedNodeList });
Object.assign(emitStructure, { 'nodes': this.selectedNodeList });
Object.assign(emitStructure, { 'keys': this.selectedNodeList.map((/**
* @param {?} n
* @return {?}
*/
n => n.key)) });
break;
case 'check':
/** @type {?} */
const checkedNodeList = this.getCheckedNodeList();
Object.assign(emitStructure, { 'checkedKeys': checkedNodeList });
Object.assign(emitStructure, { 'nodes': checkedNodeList });
Object.assign(emitStructure, { 'keys': checkedNodeList.map((/**
* @param {?} n
* @return {?}
*/
n => n.key)) });
break;
case 'search':
Object.assign(emitStructure, { 'matchedKeys': this.getMatchedNodeList() });
Object.assign(emitStructure, { 'nodes': this.getMatchedNodeList() });
Object.assign(emitStructure, { 'keys': this.getMatchedNodeList().map((/**
* @param {?} n
* @return {?}
*/
n => n.key)) });
break;
case 'expand':
Object.assign(emitStructure, { 'nodes': this.expandedNodeList });
Object.assign(emitStructure, { 'keys': this.expandedNodeList.map((/**
* @param {?} n
* @return {?}
*/
n => n.key)) });
break;
}
return emitStructure;
}
/**
* @return {?}
*/
ngOnDestroy() {
this.triggerEventChange$.complete();
this.triggerEventChange$ = null;
}
}
NzTreeBaseService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeNodeComponent {
/**
* @param {?} nzTreeService
* @param {?} ngZone
* @param {?} renderer
* @param {?} elRef
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(nzTreeService, ngZone, renderer, elRef, cdr, noAnimation) {
this.nzTreeService = nzTreeService;
this.ngZone = ngZone;
this.renderer = renderer;
this.elRef = elRef;
this.cdr = cdr;
this.noAnimation = noAnimation;
this.nzHideUnMatched = false;
this.nzNoAnimation = false;
this.nzSelectMode = false;
this.nzShowIcon = false;
// default var
this.prefixCls = 'ant-tree';
this.highlightKeys = [];
this.nzNodeClass = {};
this.nzNodeSwitcherClass = {};
this.nzNodeContentClass = {};
this.nzNodeCheckboxClass = {};
this.nzNodeContentIconClass = {};
this.nzNodeContentLoadingClass = {};
/**
* drag var
*/
this.destroy$ = new Subject();
this.dragPos = 2;
this.dragPosClass = {
'0': 'drag-over',
'1': 'drag-over-gap-bottom',
'-1': 'drag-over-gap-top'
};
/**
* default set
*/
this._searchValue = '';
this._nzDraggable = false;
this._nzExpandAll = false;
}
/**
* @param {?} value
* @return {?}
*/
set nzDraggable(value) {
this._nzDraggable = value;
this.handDragEvent();
}
/**
* @return {?}
*/
get nzDraggable() {
return this._nzDraggable;
}
/**
* @deprecated use
* nzExpandAll instead
* @param {?} value
* @return {?}
*/
set nzDefaultExpandAll(value) {
this._nzExpandAll = value;
if (value && this.nzTreeNode && !this.nzTreeNode.isLeaf) {
this.nzTreeNode.isExpanded = true;
}
}
/**
* @return {?}
*/
get nzDefaultExpandAll() {
return this._nzExpandAll;
}
// default set
/**
* @param {?} value
* @return {?}
*/
set nzExpandAll(value) {
this._nzExpandAll = value;
if (value && this.nzTreeNode && !this.nzTreeNode.isLeaf) {
this.nzTreeNode.isExpanded = true;
}
}
/**
* @return {?}
*/
get nzExpandAll() {
return this._nzExpandAll;
}
/**
* @param {?} value
* @return {?}
*/
set nzSearchValue(value) {
this.highlightKeys = [];
if (value && this.nzTreeNode.title.includes(value)) {
// match the search value
/** @type {?} */
const index = this.nzTreeNode.title.indexOf(value);
this.highlightKeys = [this.nzTreeNode.title.slice(0, index), this.nzTreeNode.title.slice(index + value.length, this.nzTreeNode.title.length)];
}
this._searchValue = value;
}
/**
* @return {?}
*/
get nzSearchValue() {
return this._searchValue;
}
/**
* @return {?}
*/
get nzIcon() {
return this.nzTreeNode.icon;
}
/**
* @return {?}
*/
get canDraggable() {
return (this.nzDraggable && !this.nzTreeNode.isDisabled) ? true : null;
}
/**
* @return {?}
*/
get isShowLineIcon() {
return !this.nzTreeNode.isLeaf && this.nzShowLine;
}
/**
* @return {?}
*/
get isShowSwitchIcon() {
return !this.nzTreeNode.isLeaf && !this.nzShowLine;
}
/**
* @return {?}
*/
get isSwitcherOpen() {
return (this.nzTreeNode.isExpanded && !this.nzTreeNode.isLeaf);
}
/**
* @return {?}
*/
get isSwitcherClose() {
return (!this.nzTreeNode.isExpanded && !this.nzTreeNode.isLeaf);
}
/**
* @return {?}
*/
get displayStyle() {
// to hide unmatched nodes
return (this.nzSearchValue && this.nzHideUnMatched && !this.nzTreeNode.isMatched && !this.nzTreeNode.isExpanded) ? 'none' : '';
}
/**
* reset node class
* @return {?}
*/
setClassMap() {
this.prefixCls = this.nzSelectMode ? 'ant-select-tree' : 'ant-tree';
this.nzNodeClass = {
[`${this.prefixCls}-treenode-disabled`]: this.nzTreeNode.isDisabled,
[`${this.prefixCls}-treenode-switcher-open`]: this.isSwitcherOpen,
[`${this.prefixCls}-treenode-switcher-close`]: this.isSwitcherClose,
[`${this.prefixCls}-treenode-checkbox-checked`]: this.nzTreeNode.isChecked,
[`${this.prefixCls}-treenode-checkbox-indeterminate`]: this.nzTreeNode.isHalfChecked,
[`${this.prefixCls}-treenode-selected`]: this.nzTreeNode.isSelected,
[`${this.prefixCls}-treenode-loading`]: this.nzTreeNode.isLoading
};
this.nzNodeSwitcherClass = {
[`${this.prefixCls}-switcher`]: true,
[`${this.prefixCls}-switcher-noop`]: this.nzTreeNode.isLeaf,
[`${this.prefixCls}-switcher_open`]: this.isSwitcherOpen,
[`${this.prefixCls}-switcher_close`]: this.isSwitcherClose
};
this.nzNodeCheckboxClass = {
[`${this.prefixCls}-checkbox`]: true,
[`${this.prefixCls}-checkbox-checked`]: this.nzTreeNode.isChecked,
[`${this.prefixCls}-checkbox-indeterminate`]: this.nzTreeNode.isHalfChecked,
[`${this.prefixCls}-checkbox-disabled`]: this.nzTreeNode.isDisabled || this.nzTreeNode.isDisableCheckbox
};
this.nzNodeContentClass = {
[`${this.prefixCls}-node-content-wrapper`]: true,
[`${this.prefixCls}-node-content-wrapper-open`]: this.isSwitcherOpen,
[`${this.prefixCls}-node-content-wrapper-close`]: this.isSwitcherClose,
[`${this.prefixCls}-node-selected`]: this.nzTreeNode.isSelected
};
this.nzNodeContentIconClass = {
[`${this.prefixCls}-iconEle`]: true,
[`${this.prefixCls}-icon__customize`]: true
};
this.nzNodeContentLoadingClass = {
[`${this.prefixCls}-iconEle`]: true
};
}
/**
* @param {?} event
* @return {?}
*/
onMousedown(event) {
if (this.nzSelectMode) {
event.preventDefault();
}
}
/**
* click node to select, 200ms to dbl click
* @param {?} event
* @return {?}
*/
nzClick(event) {
event.preventDefault();
event.stopPropagation();
if (this.nzTreeNode.isSelectable && !this.nzTreeNode.isDisabled) {
this.nzTreeNode.isSelected = !this.nzTreeNode.isSelected;
}
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('click', this.nzTreeNode, event);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* @param {?} event
* @return {?}
*/
nzDblClick(event) {
event.preventDefault();
event.stopPropagation();
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dblclick', this.nzTreeNode, event);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* @param {?} event
* @return {?}
*/
nzContextMenu(event) {
event.preventDefault();
event.stopPropagation();
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('contextmenu', this.nzTreeNode, event);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* collapse node
* @param {?} event
* @return {?}
*/
_clickExpand(event) {
event.preventDefault();
event.stopPropagation();
if (!this.nzTreeNode.isLoading && !this.nzTreeNode.isLeaf) {
// set async state
if (this.nzAsyncData && this.nzTreeNode.children.length === 0 && !this.nzTreeNode.isExpanded) {
this.nzTreeNode.isLoading = true;
}
this.nzTreeNode.isExpanded = !this.nzTreeNode.isExpanded;
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('expand', this.nzTreeNode, event);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
}
/**
* check node
* @param {?} event
* @return {?}
*/
_clickCheckBox(event) {
event.preventDefault();
event.stopPropagation();
// return if node is disabled
if (this.nzTreeNode.isDisabled || this.nzTreeNode.isDisableCheckbox) {
return;
}
this.nzTreeNode.isChecked = !this.nzTreeNode.isChecked;
this.nzTreeNode.isHalfChecked = false;
if (!this.nzTreeService.isCheckStrictly) {
this.nzTreeService.conduct(this.nzTreeNode);
}
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('check', this.nzTreeNode, event);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* drag event
* @return {?}
*/
clearDragClass() {
/** @type {?} */
const dragClass = ['drag-over-gap-top', 'drag-over-gap-bottom', 'drag-over'];
dragClass.forEach((/**
* @param {?} e
* @return {?}
*/
e => {
this.renderer.removeClass(this.dragElement.nativeElement, e);
}));
}
/**
* @param {?} e
* @return {?}
*/
handleDragStart(e) {
e.stopPropagation();
try {
// ie throw error
// firefox-need-it
e.dataTransfer.setData('text/plain', this.nzTreeNode.key);
}
catch (error) {
// empty
}
this.nzTreeService.setSelectedNode(this.nzTreeNode);
this.nzTreeNode.isExpanded = false;
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dragstart', this.nzTreeNode, e);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* @param {?} e
* @return {?}
*/
handleDragEnter(e) {
e.preventDefault();
e.stopPropagation();
// reset position
this.dragPos = 2;
this.ngZone.run((/**
* @return {?}
*/
() => {
/** @type {?} */
const node = this.nzTreeService.getSelectedNode();
if (node && node.key !== this.nzTreeNode.key && !this.nzTreeNode.isExpanded && !this.nzTreeNode.isLeaf) {
this.nzTreeNode.isExpanded = true;
}
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dragenter', this.nzTreeNode, e);
this.nzTreeService.triggerEventChange$.next(eventNext);
}));
}
/**
* @param {?} e
* @return {?}
*/
handleDragOver(e) {
e.preventDefault();
e.stopPropagation();
/** @type {?} */
const dropPosition = this.nzTreeService.calcDropPosition(e);
if (this.dragPos !== dropPosition) {
this.clearDragClass();
this.dragPos = dropPosition;
// leaf node will pass
if (!(this.dragPos === 0 && this.nzTreeNode.isLeaf)) {
this.renderer.addClass(this.dragElement.nativeElement, this.dragPosClass[this.dragPos]);
}
}
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dragover', this.nzTreeNode, e);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* @param {?} e
* @return {?}
*/
handleDragLeave(e) {
e.stopPropagation();
this.ngZone.run((/**
* @return {?}
*/
() => {
this.clearDragClass();
}));
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dragleave', this.nzTreeNode, e);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
/**
* @param {?} e
* @return {?}
*/
handleDragDrop(e) {
e.preventDefault();
e.stopPropagation();
this.ngZone.run((/**
* @return {?}
*/
() => {
this.clearDragClass();
/** @type {?} */
const node = this.nzTreeService.getSelectedNode();
if (!node || (node && node.key === this.nzTreeNode.key) || (this.dragPos === 0 && this.nzTreeNode.isLeaf)) {
return;
}
// pass if node is leafNo
/** @type {?} */
const dropEvent = this.nzTreeService.formatEvent('drop', this.nzTreeNode, e);
/** @type {?} */
const dragEndEvent = this.nzTreeService.formatEvent('dragend', this.nzTreeNode, e);
if (this.nzBeforeDrop) {
this.nzBeforeDrop({
dragNode: this.nzTreeService.getSelectedNode(),
node: this.nzTreeNode,
pos: this.dragPos
}).subscribe((/**
* @param {?} canDrop
* @return {?}
*/
(canDrop) => {
if (canDrop) {
this.nzTreeService.dropAndApply(this.nzTreeNode, this.dragPos);
}
this.nzTreeService.triggerEventChange$.next(dropEvent);
this.nzTreeService.triggerEventChange$.next(dragEndEvent);
}));
}
else if (this.nzTreeNode) {
this.nzTreeService.dropAndApply(this.nzTreeNode, this.dragPos);
this.nzTreeService.triggerEventChange$.next(dropEvent);
}
}));
}
/**
* @param {?} e
* @return {?}
*/
handleDragEnd(e) {
e.stopPropagation();
this.ngZone.run((/**
* @return {?}
*/
() => {
// if user do not custom beforeDrop
if (!this.nzBeforeDrop) {
this.nzTreeService.setSelectedNode(null);
/** @type {?} */
const eventNext = this.nzTreeService.formatEvent('dragend', this.nzTreeNode, e);
this.nzTreeService.triggerEventChange$.next(eventNext);
}
}));
}
/**
* 监听拖拽事件
* @return {?}
*/
handDragEvent() {
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
() => {
if (this.nzDraggable) {
this.destroy$ = new Subject();
fromEvent(this.elRef.nativeElement, 'dragstart').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragStart(e)));
fromEvent(this.elRef.nativeElement, 'dragenter').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragEnter(e)));
fromEvent(this.elRef.nativeElement, 'dragover').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragOver(e)));
fromEvent(this.elRef.nativeElement, 'dragleave').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragLeave(e)));
fromEvent(this.elRef.nativeElement, 'drop').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragDrop(e)));
fromEvent(this.elRef.nativeElement, 'dragend').pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} e
* @return {?}
*/
(e) => this.handleDragEnd(e)));
}
else {
this.destroy$.next();
this.destroy$.complete();
}
}));
}
/**
* @return {?}
*/
markForCheck() {
this.cdr.markForCheck();
}
/**
* @return {?}
*/
ngOnInit() {
// init expanded / selected / checked list
if (this.nzTreeNode.isSelected) {
this.nzTreeService.setNodeActive(this.nzTreeNode);
}
if (this.nzTreeNode.isExpanded) {
this.nzTreeService.setExpandedNodeList(this.nzTreeNode);
}
if (this.nzTreeNode.isChecked) {
this.nzTreeService.setCheckedNodeList(this.nzTreeNode);
}
// TODO
this.nzTreeNode.component = this;
this.nzTreeService.eventTriggerChanged().pipe(filter((/**
* @param {?} data
* @return {?}
*/
data => data.node.key === this.nzTreeNode.key)), takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
() => {
this.setClassMap();
this.markForCheck();
}));
this.setClassMap();
}
/**
* @return {?}
*/
ngOnChanges() {
this.setClassMap();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzTreeNodeComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tree-node',
template: "<li\n #dragElement\n role=\"treeitem\"\n [style.display]=\"displayStyle\"\n [ngClass]=\"nzNodeClass\">\n <ng-container *ngIf=\"nzShowExpand\">\n <span\n [ngClass]=\"nzNodeSwitcherClass\"\n (click)=\"_clickExpand($event)\">\n <ng-container *ngIf=\"isShowSwitchIcon\">\n <i *ngIf=\"!nzTreeNode.isLoading\"\n nz-icon\n type=\"caret-down\"\n [class.ant-select-switcher-icon]=\"nzSelectMode\"\n [class.ant-tree-switcher-icon]=\"!nzSelectMode\"></i>\n <i *ngIf=\"nzTreeNode.isLoading\" nz-icon type=\"loading\" [spin]=\"true\" class=\"ant-tree-switcher-loading-icon\"></i>\n </ng-container>\n <ng-container *ngIf=\"nzShowLine\">\n <i *ngIf=\"isShowLineIcon\" nz-icon [type]=\"isSwitcherOpen ? 'minus-square' : 'plus-square'\" class=\"ant-tree-switcher-line-icon\"></i>\n <i *ngIf=\"!isShowLineIcon\" nz-icon type=\"file\" class=\"ant-tree-switcher-line-icon\"></i>\n </ng-container>\n </span>\n </ng-container>\n <ng-container *ngIf=\"nzCheckable\">\n <span\n [ngClass]=\"nzNodeCheckboxClass\"\n (click)=\"_clickCheckBox($event)\">\n <span [class.ant-tree-checkbox-inner]=\"!nzSelectMode\"\n [class.ant-select-tree-checkbox-inner]=\"nzSelectMode\"></span>\n </span>\n </ng-container>\n <ng-container *ngIf=\"!nzTreeTemplate\">\n <span\n title=\"{{nzTreeNode.title}}\"\n [attr.draggable]=\"canDraggable\"\n [attr.aria-grabbed]=\"canDraggable\"\n [ngClass]=\"nzNodeContentClass\"\n [class.draggable]=\"canDraggable\">\n <span\n *ngIf=\"nzTreeNode.icon && nzShowIcon\"\n [class.ant-tree-icon__open]=\"isSwitcherOpen\"\n [class.ant-tree-icon__close]=\"isSwitcherClose\"\n [class.ant-tree-icon_loading]=\"nzTreeNode.isLoading\"\n [ngClass]=\"nzNodeContentLoadingClass\">\n <span\n [ngClass]=\"nzNodeContentIconClass\">\n <i nz-icon *ngIf=\"nzIcon\" [type]=\"nzIcon\"></i>\n </span>\n </span>\n <span class=\"ant-tree-title\">\n <ng-container *ngIf=\"nzTreeNode.isMatched\">\n <span>\n {{highlightKeys[0]}}<span class=\"font-highlight\">{{nzSearchValue}}</span>{{highlightKeys[1]}}\n </span>\n </ng-container>\n <ng-container *ngIf=\"!nzTreeNode.isMatched\">\n {{nzTreeNode.title}}\n </ng-container>\n </span>\n </span>\n </ng-container>\n <ng-template\n [ngTemplateOutlet]=\"nzTreeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: nzTreeNode }\">\n </ng-template>\n\n <ul\n role=\"group\"\n class=\"ant-tree-child-tree\"\n [class.ant-tree-child-tree-open]=\"!nzSelectMode || nzTreeNode.isExpanded\"\n data-expanded=\"true\"\n [@.disabled]=\"noAnimation?.nzNoAnimation\"\n [@collapseMotion]=\"nzTreeNode.isExpanded ? 'expanded' : 'collapsed'\">\n <nz-tree-node\n *ngFor=\"let node of nzTreeNode.getChildren()\"\n [nzTreeNode]=\"node\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [nzSelectMode]=\"nzSelectMode\"\n [nzShowLine]=\"nzShowLine\"\n [nzDraggable]=\"nzDraggable\"\n [nzCheckable]=\"nzCheckable\"\n [nzShowExpand]=\"nzShowExpand\"\n [nzAsyncData]=\"nzAsyncData\"\n [nzExpandAll]=\"nzExpandAll\"\n [nzDefaultExpandAll]=\"nzDefaultExpandAll\"\n [nzShowIcon]=\"nzShowIcon\"\n [nzSearchValue]=\"nzSearchValue\"\n [nzHideUnMatched]=\"nzHideUnMatched\"\n [nzBeforeDrop]=\"nzBeforeDrop\"\n [nzCheckStrictly]=\"nzCheckStrictly\"\n [nzTreeTemplate]=\"nzTreeTemplate\">\n </nz-tree-node>\n </ul>\n</li>",
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
animations: [collapseMotion]
}] }
];
/** @nocollapse */
NzTreeNodeComponent.ctorParameters = () => [
{ type: NzTreeBaseService },
{ type: NgZone },
{ type: Renderer2 },
{ type: ElementRef },
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzTreeNodeComponent.propDecorators = {
dragElement: [{ type: ViewChild, args: ['dragElement',] }],
nzTreeNode: [{ type: Input }],
nzShowLine: [{ type: Input }],
nzShowExpand: [{ type: Input }],
nzCheckable: [{ type: Input }],
nzAsyncData: [{ type: Input }],
nzCheckStrictly: [{ type: Input }],
nzHideUnMatched: [{ type: Input }],
nzNoAnimation: [{ type: Input }],
nzSelectMode: [{ type: Input }],
nzShowIcon: [{ type: Input }],
nzTreeTemplate: [{ type: Input }],
nzBeforeDrop: [{ type: Input }],
nzDraggable: [{ type: Input }],
nzDefaultExpandAll: [{ type: Input }],
nzExpandAll: [{ type: Input }],
nzSearchValue: [{ type: Input }],
onMousedown: [{ type: HostListener, args: ['mousedown', ['$event'],] }],
nzClick: [{ type: HostListener, args: ['click', ['$event'],] }],
nzDblClick: [{ type: HostListener, args: ['dblclick', ['$event'],] }],
nzContextMenu: [{ type: HostListener, args: ['contextmenu', ['$event'],] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTreeNodeComponent.prototype, "nzShowLine", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTreeNodeComponent.prototype, "nzShowExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTreeNodeComponent.prototype, "nzCheckable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTreeNodeComponent.prototype, "nzAsyncData", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzTreeNodeComponent.prototype, "nzCheckStrictly", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeNodeComponent.prototype, "nzHideUnMatched", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeNodeComponent.prototype, "nzNoAnimation", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeNodeComponent.prototype, "nzSelectMode", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeNodeComponent.prototype, "nzShowIcon", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeSelectService extends NzTreeBaseService {
}
NzTreeSelectService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeService extends NzTreeBaseService {
}
NzTreeService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} treeSelectService
* @param {?} treeService
* @return {?}
*/
function NzTreeServiceFactory(treeSelectService, treeService) {
return treeSelectService ? treeSelectService : treeService;
}
class NzTreeComponent {
/**
* @param {?} nzTreeService
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(nzTreeService, cdr, noAnimation) {
this.nzTreeService = nzTreeService;
this.cdr = cdr;
this.noAnimation = noAnimation;
this.nzShowIcon = false;
this.nzShowLine = false;
this.nzCheckStrictly = false;
this.nzCheckable = false;
this.nzShowExpand = true;
this.nzAsyncData = false;
this.nzDraggable = false;
this.nzExpandAll = false;
this.nzHideUnMatched = false;
this.nzSelectMode = false;
/**
* @deprecated use
* nzExpandAll instead
*/
this.nzDefaultExpandAll = false;
// model bind
this.nzExpandedKeysChange = new EventEmitter();
this.nzSelectedKeysChange = new EventEmitter();
this.nzCheckedKeysChange = new EventEmitter();
this.nzSearchValueChange = new EventEmitter();
/**
* @deprecated use
* nzSearchValueChange instead
*/
this.nzOnSearchNode = new EventEmitter();
this.nzClick = new EventEmitter();
this.nzDblClick = new EventEmitter();
this.nzContextMenu = new EventEmitter();
this.nzCheckBoxChange = new EventEmitter();
this.nzExpandChange = new EventEmitter();
this.nzOnDragStart = new EventEmitter();
this.nzOnDragEnter = new EventEmitter();
this.nzOnDragOver = new EventEmitter();
this.nzOnDragLeave = new EventEmitter();
this.nzOnDrop = new EventEmitter();
this.nzOnDragEnd = new EventEmitter();
this._searchValue = null;
this._nzMultiple = false;
this.nzDefaultSubject = new ReplaySubject(6);
this.destroy$ = new Subject();
this.nzNodes = [];
this.prefixCls = 'ant-tree';
this.classMap = {};
this.onChange = (/**
* @return {?}
*/
() => null);
this.onTouched = (/**
* @return {?}
*/
() => null);
}
/**
* @param {?} value
* @return {?}
*/
set nzMultiple(value) {
this._nzMultiple = value;
this.nzTreeService.isMultiple = value;
}
/**
* @return {?}
*/
get nzMultiple() {
return this._nzMultiple;
}
/**
* @param {?} value
* @return {?}
*/
set nzData(value) {
if (Array.isArray(value)) {
if (!this.nzTreeService.isArrayOfNzTreeNode(value)) {
// has not been new NzTreeNode
this.nzNodes = value.map((/**
* @param {?} item
* @return {?}
*/
item => (new NzTreeNode(item, null, this.nzTreeService))));
}
else {
this.nzNodes = value.map((/**
* @param {?} item
* @return {?}
*/
(item) => {
item.service = this.nzTreeService;
return item;
}));
}
this.nzTreeService.isCheckStrictly = this.nzCheckStrictly;
this.nzTreeService.isMultiple = this.nzMultiple;
this.nzTreeService.initTree(this.nzNodes);
}
else {
if (value !== null) {
console.warn('ngModel only accepts an array and must be not empty');
}
}
}
/**
* @deprecated use
* nzExpandedKeys instead
* @param {?} value
* @return {?}
*/
set nzDefaultExpandedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzExpandedKeys', keys: value });
}
/**
* @deprecated use
* nzSelectedKeys instead
* @param {?} value
* @return {?}
*/
set nzDefaultSelectedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzSelectedKeys', keys: value });
}
/**
* @deprecated use
* nzCheckedKeys instead
* @param {?} value
* @return {?}
*/
set nzDefaultCheckedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzCheckedKeys', keys: value });
}
/**
* @param {?} value
* @return {?}
*/
set nzExpandedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzExpandedKeys', keys: value });
}
/**
* @param {?} value
* @return {?}
*/
set nzSelectedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzSelectedKeys', keys: value });
}
/**
* @param {?} value
* @return {?}
*/
set nzCheckedKeys(value) {
this.nzDefaultSubject.next({ type: 'nzCheckedKeys', keys: value });
}
/**
* @param {?} value
* @return {?}
*/
set nzSearchValue(value) {
this._searchValue = value;
this.nzTreeService.searchExpand(value);
if (isNotNil(value)) {
this.nzSearchValueChange.emit(this.nzTreeService.formatEvent('search', null, null));
this.nzOnSearchNode.emit(this.nzTreeService.formatEvent('search', null, null));
}
}
/**
* @return {?}
*/
get nzSearchValue() {
return this._searchValue;
}
/**
* @return {?}
*/
getTreeNodes() {
return this.nzTreeService.rootNodes;
}
/**
* @param {?} key
* @return {?}
*/
getTreeNodeByKey(key) {
/** @type {?} */
let targetNode = null;
/** @type {?} */
const getNode = (/**
* @param {?} node
* @return {?}
*/
(node) => {
if (node.key === key) {
targetNode = node;
// break every
return false;
}
else {
node.getChildren().every((/**
* @param {?} n
* @return {?}
*/
n => {
return getNode(n);
}));
}
return true;
});
this.nzNodes.every((/**
* @param {?} n
* @return {?}
*/
n => {
return getNode(n);
}));
return targetNode;
}
/**
* public function
* @return {?}
*/
getCheckedNodeList() {
return this.nzTreeService.getCheckedNodeList();
}
/**
* @return {?}
*/
getSelectedNodeList() {
return this.nzTreeService.getSelectedNodeList();
}
/**
* @return {?}
*/
getHalfCheckedNodeList() {
return this.nzTreeService.getHalfCheckedNodeList();
}
/**
* @return {?}
*/
getExpandedNodeList() {
return this.nzTreeService.getExpandedNodeList();
}
/**
* @return {?}
*/
getMatchedNodeList() {
return this.nzTreeService.getMatchedNodeList();
}
/**
* @return {?}
*/
setClassMap() {
this.classMap = {
[this.prefixCls]: true,
[this.prefixCls + '-show-line']: this.nzShowLine,
[`${this.prefixCls}-icon-hide`]: !this.nzShowIcon,
['draggable-tree']: this.nzDraggable,
['ant-select-tree']: this.nzSelectMode
};
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
if (Array.isArray(value)) {
this.nzNodes = value.map((/**
* @param {?} item
* @return {?}
*/
(item) => {
item.service = this.nzTreeService;
return item;
}));
this.nzTreeService.isCheckStrictly = this.nzCheckStrictly;
this.nzTreeService.isMultiple = this.nzMultiple;
this.nzTreeService.initTree(this.nzNodes);
this.cdr.markForCheck();
}
else {
if (value !== null) {
console.warn('ngModel only accepts an array and should be not empty');
}
}
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.nzDefaultSubscription = this.nzDefaultSubject.subscribe((/**
* @param {?} data
* @return {?}
*/
(data) => {
if (!data || !data.keys) {
return;
}
switch (data.type) {
case 'nzExpandedKeys':
this.nzTreeService.calcExpandedKeys(data.keys, this.nzNodes);
this.nzExpandedKeysChange.emit(data.keys);
break;
case 'nzSelectedKeys':
this.nzTreeService.calcSelectedKeys(data.keys, this.nzNodes, this.nzMultiple);
this.nzSelectedKeysChange.emit(data.keys);
break;
case 'nzCheckedKeys':
this.nzTreeService.calcCheckedKeys(data.keys, this.nzNodes, this.nzCheckStrictly);
this.nzCheckedKeysChange.emit(data.keys);
break;
}
this.cdr.markForCheck();
}));
this.nzTreeService.eventTriggerChanged().pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
switch (data.eventName) {
case 'expand':
this.nzExpandChange.emit(data);
break;
case 'click':
this.nzClick.emit(data);
break;
case 'check':
this.nzCheckBoxChange.emit(data);
break;
case 'dblclick':
this.nzDblClick.emit(data);
break;
case 'contextmenu':
this.nzContextMenu.emit(data);
break;
// drag drop
case 'dragstart':
this.nzOnDragStart.emit(data);
break;
case 'dragenter':
this.nzOnDragEnter.emit(data);
break;
case 'dragover':
this.nzOnDragOver.emit(data);
break;
case 'dragleave':
this.nzOnDragLeave.emit(data);
break;
case 'drop':
this.nzOnDrop.emit(data);
break;
case 'dragend':
this.nzOnDragEnd.emit(data);
break;
}
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzCheckStrictly) {
this.nzTreeService.isCheckStrictly = changes.nzCheckStrictly.currentValue;
}
if (changes.nzMultiple) {
this.nzTreeService.isMultiple = changes.nzMultiple.currentValue;
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
this.destroy$ = null;
if (this.nzDefaultSubscription) {
this.nzDefaultSubscription.unsubscribe();
this.nzDefaultSubscription = null;
}
}
}
NzTreeComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tree',
template: "<ul\n role=\"tree\"\n unselectable=\"on\"\n [ngClass]=\"classMap\">\n <ng-container *ngFor=\"let node of nzNodes\">\n <nz-tree-node\n [nzTreeNode]=\"node\"\n [nzSelectMode]=\"nzSelectMode\"\n [nzShowLine]=\"nzShowLine\"\n [nzDraggable]=\"nzDraggable\"\n [nzCheckable]=\"nzCheckable\"\n [nzShowExpand]=\"nzShowExpand\"\n [nzAsyncData]=\"nzAsyncData\"\n [nzSearchValue]=\"nzSearchValue\"\n [nzHideUnMatched]=\"nzHideUnMatched\"\n [nzBeforeDrop]=\"nzBeforeDrop\"\n [nzCheckStrictly]=\"nzCheckStrictly\"\n [nzExpandAll]=\"nzExpandAll\"\n [nzDefaultExpandAll]=\"nzDefaultExpandAll\"\n [nzShowIcon]=\"nzShowIcon\"\n [nzTreeTemplate]=\"nzTreeTemplate\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\">\n </nz-tree-node>\n </ng-container>\n</ul>",
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
NzTreeService,
{
provide: NzTreeBaseService,
useFactory: NzTreeServiceFactory,
deps: [
[
new SkipSelf(),
new Optional(),
NzTreeSelectService
],
NzTreeService
]
},
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzTreeComponent)),
multi: true
}
]
}] }
];
/** @nocollapse */
NzTreeComponent.ctorParameters = () => [
{ type: NzTreeBaseService },
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzTreeComponent.propDecorators = {
nzShowIcon: [{ type: Input }],
nzShowLine: [{ type: Input }],
nzCheckStrictly: [{ type: Input }],
nzCheckable: [{ type: Input }],
nzShowExpand: [{ type: Input }],
nzAsyncData: [{ type: Input }],
nzDraggable: [{ type: Input }],
nzExpandAll: [{ type: Input }],
nzHideUnMatched: [{ type: Input }],
nzSelectMode: [{ type: Input }],
nzDefaultExpandAll: [{ type: Input }],
nzBeforeDrop: [{ type: Input }],
nzMultiple: [{ type: Input }],
nzData: [{ type: Input }],
nzDefaultExpandedKeys: [{ type: Input }],
nzDefaultSelectedKeys: [{ type: Input }],
nzDefaultCheckedKeys: [{ type: Input }],
nzExpandedKeys: [{ type: Input }],
nzSelectedKeys: [{ type: Input }],
nzCheckedKeys: [{ type: Input }],
nzSearchValue: [{ type: Input }],
nzExpandedKeysChange: [{ type: Output }],
nzSelectedKeysChange: [{ type: Output }],
nzCheckedKeysChange: [{ type: Output }],
nzSearchValueChange: [{ type: Output }],
nzOnSearchNode: [{ type: Output }],
nzClick: [{ type: Output }],
nzDblClick: [{ type: Output }],
nzContextMenu: [{ type: Output }],
nzCheckBoxChange: [{ type: Output }],
nzExpandChange: [{ type: Output }],
nzOnDragStart: [{ type: Output }],
nzOnDragEnter: [{ type: Output }],
nzOnDragOver: [{ type: Output }],
nzOnDragLeave: [{ type: Output }],
nzOnDrop: [{ type: Output }],
nzOnDragEnd: [{ type: Output }],
nzTreeTemplate: [{ type: ContentChild, args: ['nzTreeTemplate',] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzShowIcon", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzShowLine", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzCheckStrictly", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzCheckable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzShowExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzAsyncData", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzDraggable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzExpandAll", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzHideUnMatched", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzSelectMode", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeComponent.prototype, "nzDefaultExpandAll", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Boolean),
__metadata("design:paramtypes", [Boolean])
], NzTreeComponent.prototype, "nzMultiple", null);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeModule {
}
NzTreeModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
NzIconModule,
NzNoAnimationModule,
NzAddOnModule
],
declarations: [
NzTreeComponent,
NzTreeNodeComponent
],
exports: [
NzTreeComponent,
NzTreeNodeComponent
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeSelectComponent {
/**
* @param {?} renderer
* @param {?} cdr
* @param {?} nzTreeService
* @param {?} elementRef
* @param {?=} noAnimation
*/
constructor(renderer, cdr, nzTreeService, elementRef, noAnimation) {
this.renderer = renderer;
this.cdr = cdr;
this.nzTreeService = nzTreeService;
this.elementRef = elementRef;
this.noAnimation = noAnimation;
this.nzAllowClear = true;
this.nzShowExpand = true;
this.nzDropdownMatchSelectWidth = true;
this.nzCheckable = false;
this.nzShowSearch = false;
this.nzDisabled = false;
this.nzShowLine = false;
this.nzAsyncData = false;
this.nzMultiple = false;
this.nzDefaultExpandAll = false;
this.nzNodes = [];
this.nzOpen = false;
this.nzSize = 'default';
this.nzPlaceHolder = '';
this.nzDefaultExpandedKeys = [];
this.nzDisplayWith = (/**
* @param {?} node
* @return {?}
*/
(node) => node.title);
this.nzOpenChange = new EventEmitter();
this.nzCleared = new EventEmitter();
this.nzRemoved = new EventEmitter();
this.nzExpandChange = new EventEmitter();
this.nzTreeClick = new EventEmitter();
this.nzTreeCheckBoxChange = new EventEmitter();
this.isComposing = false;
this.isDestroy = true;
this.isNotFound = false;
this.inputValue = '';
this.dropDownPosition = 'bottom';
this.selectedNodes = [];
this.value = [];
this.onTouched = (/**
* @return {?}
*/
() => null);
this.renderer.addClass(this.elementRef.nativeElement, 'ant-select');
}
/**
* @return {?}
*/
get placeHolderDisplay() {
return this.inputValue || this.isComposing || this.selectedNodes.length ? 'none' : 'block';
}
/**
* @return {?}
*/
get searchDisplay() {
return this.nzOpen ? 'block' : 'none';
}
/**
* @return {?}
*/
get isMultiple() {
return this.nzMultiple || this.nzCheckable;
}
/**
* @return {?}
*/
get selectedValueDisplay() {
/** @type {?} */
let showSelectedValue = false;
/** @type {?} */
let opacity = 1;
if (!this.nzShowSearch) {
showSelectedValue = true;
}
else {
if (this.nzOpen) {
showSelectedValue = !(this.inputValue || this.isComposing);
if (showSelectedValue) {
opacity = 0.4;
}
}
else {
showSelectedValue = true;
}
}
return {
display: showSelectedValue ? 'block' : 'none',
opacity: `${opacity}`
};
}
/**
* @return {?}
*/
ngOnInit() {
this.isDestroy = false;
this.selectionChangeSubscription = this.subscribeSelectionChange();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.isDestroy = true;
this.closeDropDown();
this.selectionChangeSubscription.unsubscribe();
}
/**
* @param {?} isDisabled
* @return {?}
*/
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
this.closeDropDown();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.hasOwnProperty('nzNodes')) {
this.updateSelectedNodes(true);
}
}
/**
* @param {?} value
* @return {?}
*/
writeValue(value) {
if (value) {
if (this.isMultiple && Array.isArray(value)) {
this.value = value;
}
else {
this.value = [((/** @type {?} */ (value)))];
}
this.updateSelectedNodes(true);
}
else {
this.value = [];
this.selectedNodes.forEach((/**
* @param {?} node
* @return {?}
*/
node => {
this.removeSelected(node, false);
}));
this.selectedNodes = [];
}
this.cdr.markForCheck();
}
/**
* @param {?} fn
* @return {?}
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* @param {?} fn
* @return {?}
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* @return {?}
*/
trigger() {
if (this.nzDisabled || (!this.nzDisabled && this.nzOpen)) {
this.closeDropDown();
}
else {
this.openDropdown();
if (this.nzShowSearch || this.isMultiple) {
this.focusOnInput();
}
}
}
/**
* @return {?}
*/
openDropdown() {
if (!this.nzDisabled) {
this.nzOpen = true;
this.nzOpenChange.emit(this.nzOpen);
this.updateCdkConnectedOverlayStatus();
this.updatePosition();
}
}
/**
* @return {?}
*/
closeDropDown() {
this.onTouched();
this.nzOpen = false;
this.nzOpenChange.emit(this.nzOpen);
this.cdr.markForCheck();
}
/**
* @param {?} e
* @return {?}
*/
onKeyDownInput(e) {
/** @type {?} */
const keyCode = e.keyCode;
/** @type {?} */
const eventTarget = (/** @type {?} */ (e.target));
if (this.isMultiple &&
!eventTarget.value &&
keyCode === BACKSPACE) {
e.preventDefault();
if (this.selectedNodes.length) {
/** @type {?} */
const removeNode = this.selectedNodes[this.selectedNodes.length - 1];
this.removeSelected(removeNode);
this.nzTreeService.triggerEventChange$.next({
'eventName': 'removeSelect',
'node': removeNode
});
}
}
}
/**
* @param {?} value
* @return {?}
*/
onExpandedKeysChange(value) {
this.nzExpandChange.emit(value);
this.nzDefaultExpandedKeys = [...value.keys];
}
/**
* @param {?} value
* @return {?}
*/
setInputValue(value) {
this.inputValue = value;
this.updateInputWidth();
this.updatePosition();
}
/**
* @param {?} node
* @param {?=} emit
* @param {?=} event
* @return {?}
*/
removeSelected(node, emit = true, event) {
node.isSelected = false;
node.isChecked = false;
if (this.nzCheckable) {
this.nzTreeService.conduct(node);
}
else {
this.nzTreeService.setSelectedNodeList(node, this.nzMultiple);
}
if (emit) {
this.nzRemoved.emit(node);
}
// Do not trigger the popup
if (event && event.stopPropagation) {
event.stopPropagation();
}
}
/**
* @return {?}
*/
focusOnInput() {
setTimeout((/**
* @return {?}
*/
() => {
if (this.inputElement) {
this.inputElement.nativeElement.focus();
}
}));
}
/**
* @return {?}
*/
subscribeSelectionChange() {
return merge(this.nzTreeClick.pipe(tap((/**
* @param {?} event
* @return {?}
*/
(event) => {
/** @type {?} */
const node = event.node;
if (this.nzCheckable && !node.isDisabled && !node.isDisableCheckbox) {
node.isChecked = !node.isChecked;
this.nzTreeService.conduct(node);
}
if (this.nzCheckable) {
node.isSelected = false;
}
})), filter((/**
* @param {?} event
* @return {?}
*/
(event) => {
return this.nzCheckable ? (!event.node.isDisabled && !event.node.isDisableCheckbox) : !event.node.isDisabled;
}))), this.nzCheckable ? this.nzTreeCheckBoxChange : of(), this.nzCleared, this.nzRemoved).subscribe((/**
* @return {?}
*/
() => {
this.updateSelectedNodes();
/** @type {?} */
const value = this.selectedNodes.map((/**
* @param {?} node
* @return {?}
*/
node => node.key));
this.value = [...value];
if (this.nzShowSearch || this.isMultiple) {
this.inputValue = '';
this.isNotFound = false;
}
if (this.isMultiple) {
this.onChange(value);
this.focusOnInput();
this.updatePosition();
}
else {
this.closeDropDown();
this.onChange(value.length ? value[0] : null);
}
}));
}
/**
* @param {?=} init
* @return {?}
*/
updateSelectedNodes(init = false) {
if (init) {
/** @type {?} */
let nodes;
this.nzTreeService.isMultiple = this.isMultiple;
if (!this.nzTreeService.isArrayOfNzTreeNode(this.nzNodes)) {
// has not been new NzTreeNode
nodes = this.nzNodes.map((/**
* @param {?} item
* @return {?}
*/
item => (new NzTreeNode(item, null, this.nzTreeService))));
}
else {
nodes = this.nzNodes.map((/**
* @param {?} item
* @return {?}
*/
item => (new NzTreeNode(Object.assign({}, item.origin), null, this.nzTreeService))));
}
this.nzTreeService.initTree(nodes);
if (this.nzCheckable) {
this.nzTreeService.calcCheckedKeys(this.value, nodes);
}
else {
this.nzTreeService.calcSelectedKeys(this.value, nodes, this.isMultiple);
}
}
this.selectedNodes = [...(this.nzCheckable ? this.nzTreeService.getCheckedNodeList() : this.nzTreeService.getSelectedNodeList())];
}
/**
* @return {?}
*/
updatePosition() {
setTimeout((/**
* @return {?}
*/
() => {
if (this.cdkConnectedOverlay && this.cdkConnectedOverlay.overlayRef) {
this.cdkConnectedOverlay.overlayRef.updatePosition();
}
}));
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.dropDownPosition = position.connectionPair.originY;
}
/**
* @return {?}
*/
updateInputWidth() {
if (this.isMultiple && this.inputElement) {
if (this.inputValue || this.isComposing) {
this.renderer.setStyle(this.inputElement.nativeElement, 'width', `${this.inputElement.nativeElement.scrollWidth}px`);
}
else {
this.renderer.removeStyle(this.inputElement.nativeElement, 'width');
}
}
}
/**
* @param {?} $event
* @return {?}
*/
onClearSelection($event) {
$event.stopPropagation();
$event.preventDefault();
this.selectedNodes.forEach((/**
* @param {?} node
* @return {?}
*/
node => {
this.removeSelected(node, false);
}));
this.nzCleared.emit();
}
/**
* @param {?} $event
* @return {?}
*/
setSearchValues($event) {
Promise.resolve().then((/**
* @return {?}
*/
() => {
this.isNotFound = (this.nzShowSearch || this.isMultiple)
&& this.inputValue
&& $event.matchedKeys.length === 0;
}));
}
/**
* @return {?}
*/
updateCdkConnectedOverlayStatus() {
this.triggerWidth = this.cdkOverlayOrigin.elementRef.nativeElement.getBoundingClientRect().width;
}
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
trackValue(_index, option) {
return option.key;
}
}
NzTreeSelectComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tree-select',
animations: [slideMotion, zoomMotion],
template: "<ng-template #inputTemplate>\n <input\n #inputElement\n autocomplete=\"off\"\n class=\"ant-select-search__field\"\n (compositionstart)=\"isComposing = true\"\n (compositionend)=\"isComposing = false\"\n (keydown)=\"onKeyDownInput($event)\"\n [ngModel]=\"inputValue\"\n (ngModelChange)=\"setInputValue($event)\"\n [disabled]=\"nzDisabled\">\n</ng-template>\n\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"cdkOverlayOrigin\"\n [cdkConnectedOverlayOpen]=\"nzOpen\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayMinWidth]=\"nzDropdownMatchSelectWidth? null : triggerWidth\"\n [cdkConnectedOverlayWidth]=\"nzDropdownMatchSelectWidth? triggerWidth : null\"\n (backdropClick)=\"closeDropDown()\"\n (detach)=\"closeDropDown()\"\n (positionChange)=\"onPositionChange($event)\">\n <div class=\"ant-select-dropdown ant-select-tree-dropdown\"\n [@slideMotion]=\"nzOpen ? dropDownPosition : 'void'\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [class.ant-select-dropdown--single]=\"!nzMultiple\"\n [class.ant-select-dropdown--multiple]=\"nzMultiple\"\n [class.ant-select-dropdown-placement-bottomLeft]=\"dropDownPosition === 'bottom'\"\n [class.ant-select-dropdown-placement-topLeft]=\"dropDownPosition === 'top'\"\n [ngStyle]=\"nzDropdownStyle\">\n <nz-tree\n #treeRef\n [hidden]=\"isNotFound\"\n nzNoAnimation\n nzSelectMode\n [nzData]=\"nzNodes\"\n [nzMultiple]=\"nzMultiple\"\n [nzSearchValue]=\"inputValue\"\n [nzCheckable]=\"nzCheckable\"\n [nzAsyncData]=\"nzAsyncData\"\n [nzShowExpand]=\"nzShowExpand\"\n [nzShowLine]=\"nzShowLine\"\n [nzExpandAll]=\"nzDefaultExpandAll\"\n [nzExpandedKeys]=\"nzDefaultExpandedKeys\"\n [nzCheckedKeys]=\"nzCheckable ? value : []\"\n [nzSelectedKeys]=\"!nzCheckable ? value : []\"\n (nzExpandChange)=\"onExpandedKeysChange($event)\"\n (nzClick)=\"nzTreeClick.emit($event)\"\n (nzCheckedKeysChange)=\"updateSelectedNodes()\"\n (nzSelectedKeysChange)=\"updateSelectedNodes()\"\n (nzCheckBoxChange)=\"nzTreeCheckBoxChange.emit($event)\"\n (nzSearchValueChange)=\"setSearchValues($event)\">\n </nz-tree>\n <span *ngIf=\"nzNodes.length === 0 || isNotFound\" class=\"ant-select-not-found\">\n <nz-embed-empty [nzComponentName]=\"'tree-select'\" [specificContent]=\"nzNotFoundContent\"></nz-embed-empty>\n </span>\n </div>\n</ng-template>\n\n<div\n cdkOverlayOrigin\n class=\"ant-select-selection\"\n [class.ant-select-selection--single]=\"!isMultiple\"\n [class.ant-select-selection--multiple]=\"isMultiple\"\n tabindex=\"0\">\n <ng-container *ngIf=\"!isMultiple\">\n <div class=\"ant-select-selection__rendered\">\n <div\n *ngIf=\"nzPlaceHolder && selectedNodes.length === 0\"\n [style.display]=\"placeHolderDisplay\"\n class=\"ant-select-selection__placeholder\">\n {{ nzPlaceHolder }}\n </div>\n\n <div\n *ngIf=\"selectedNodes.length === 1\"\n class=\"ant-select-selection-selected-value\"\n [attr.title]=\"nzDisplayWith(selectedNodes[0])\"\n [ngStyle]=\"selectedValueDisplay\">\n {{ nzDisplayWith(selectedNodes[0]) }}\n </div>\n\n <div\n *ngIf=\"nzShowSearch\"\n [style.display]=\"searchDisplay\"\n class=\"ant-select-search ant-select-search--inline\">\n <div class=\"ant-select-search__field__wrap\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n <span class=\"ant-select-search__field__mirror\">{{inputValue}} </span>\n </div>\n </div>\n\n </div>\n </ng-container>\n <ng-container *ngIf=\"isMultiple\">\n <ul class=\"ant-select-selection__rendered\">\n <div\n *ngIf=\"nzPlaceHolder && selectedNodes.length === 0\"\n [style.display]=\"placeHolderDisplay\"\n class=\"ant-select-selection__placeholder\">\n {{ nzPlaceHolder }}\n </div>\n <ng-container *ngFor=\"let node of selectedNodes | slice: 0 : nzMaxTagCount; trackBy:trackValue\">\n <li\n [@zoomMotion]\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [attr.title]=\"nzDisplayWith(node)\"\n [class.ant-select-selection__choice__disabled]=\"node.isDisabled\"\n class=\"ant-select-selection__choice\">\n <span *ngIf=\"!node.isDisabled\" class=\"ant-select-selection__choice__remove\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"removeSelected(node, true, $event)\">\n <i nz-icon type=\"close\" class=\"ant-select-remove-icon\"></i>\n </span>\n <span class=\"ant-select-selection__choice__content\">{{ nzDisplayWith(node) }}</span>\n </li>\n </ng-container>\n <li [@zoomMotion]\n *ngIf=\"selectedNodes.length > nzMaxTagCount\"\n class=\"ant-select-selection__choice\">\n <div class=\"ant-select-selection__choice__content\">\n <ng-container *ngIf=\"nzMaxTagPlaceholder\">\n <ng-template\n [ngTemplateOutlet]=\"nzMaxTagPlaceholder\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedNodes | slice: nzMaxTagCount}\">\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!nzMaxTagPlaceholder\">\n + {{ selectedNodes.length - nzMaxTagCount }} ...\n </ng-container>\n </div>\n </li>\n <li class=\"ant-select-search ant-select-search--inline\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n </li>\n </ul>\n </ng-container>\n <span *ngIf=\"nzAllowClear\" class=\"ant-select-selection__clear\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onClearSelection($event)\">\n <i nz-icon type=\"close-circle\" class=\"ant-select-clear-icon\" theme=\"fill\"></i>\n </span>\n <span *ngIf=\"!isMultiple\" class=\"ant-select-arrow\">\n <i nz-icon type=\"down\" class=\"ant-select-arrow-icon\"></i>\n </span>\n</div>",
providers: [
NzTreeSelectService,
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef((/**
* @return {?}
*/
() => NzTreeSelectComponent)),
multi: true
}
],
host: {
'[class.ant-select-lg]': 'nzSize==="large"',
'[class.ant-select-sm]': 'nzSize==="small"',
'[class.ant-select-enabled]': '!nzDisabled',
'[class.ant-select-disabled]': 'nzDisabled',
'[class.ant-select-allow-clear]': 'nzAllowClear',
'[class.ant-select-open]': 'nzOpen',
'(click)': 'trigger()'
},
styles: [`
.ant-select-dropdown {
top: 100%;
left: 0;
position: relative;
width: 100%;
margin-top: 4px;
margin-bottom: 4px;
overflow: auto;
}
`]
}] }
];
/** @nocollapse */
NzTreeSelectComponent.ctorParameters = () => [
{ type: Renderer2 },
{ type: ChangeDetectorRef },
{ type: NzTreeSelectService },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzTreeSelectComponent.propDecorators = {
nzAllowClear: [{ type: Input }],
nzShowExpand: [{ type: Input }],
nzDropdownMatchSelectWidth: [{ type: Input }],
nzCheckable: [{ type: Input }],
nzShowSearch: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzShowLine: [{ type: Input }],
nzAsyncData: [{ type: Input }],
nzMultiple: [{ type: Input }],
nzDefaultExpandAll: [{ type: Input }],
nzNotFoundContent: [{ type: Input }],
nzNodes: [{ type: Input }],
nzOpen: [{ type: Input }],
nzSize: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzDropdownStyle: [{ type: Input }],
nzDefaultExpandedKeys: [{ type: Input }],
nzDisplayWith: [{ type: Input }],
nzMaxTagCount: [{ type: Input }],
nzMaxTagPlaceholder: [{ type: Input }],
nzOpenChange: [{ type: Output }],
nzCleared: [{ type: Output }],
nzRemoved: [{ type: Output }],
nzExpandChange: [{ type: Output }],
nzTreeClick: [{ type: Output }],
nzTreeCheckBoxChange: [{ type: Output }],
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
treeRef: [{ type: ViewChild, args: ['treeRef',] }],
cdkOverlayOrigin: [{ type: ViewChild, args: [CdkOverlayOrigin,] }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzAllowClear", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzShowExpand", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzDropdownMatchSelectWidth", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzCheckable", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzShowSearch", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzShowLine", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzAsyncData", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzMultiple", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzTreeSelectComponent.prototype, "nzDefaultExpandAll", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzTreeSelectModule {
}
NzTreeSelectModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, OverlayModule, FormsModule, NzTreeModule, NzIconModule, NzEmptyModule, NzOverlayModule, NzNoAnimationModule],
declarations: [NzTreeSelectComponent],
exports: [NzTreeSelectComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzUploadBtnComponent {
// #endregion
/**
* @param {?} http
* @param {?} el
* @param {?} updateHostClassService
*/
constructor(http, el, updateHostClassService) {
this.http = http;
this.el = el;
this.updateHostClassService = updateHostClassService;
this.reqs = {};
this.inited = false;
this.destroy = false;
// #region fields
this.classes = {};
// #region styles
this.prefixCls = 'ant-upload';
if (!http) {
throw new Error(`Not found 'HttpClient', You can import 'HttpClientModule' in your root module.`);
}
}
// #endregion
/**
* @return {?}
*/
onClick() {
if (this.options.disabled || !this.options.openFileDialogOnClick) {
return;
}
((/** @type {?} */ (this.file.nativeElement))).click();
}
/**
* @param {?} e
* @return {?}
*/
onKeyDown(e) {
if (this.options.disabled) {
return;
}
if (e.key === 'Enter' || e.keyCode === ENTER) {
this.onClick();
}
}
/**
* @param {?} e
* @return {?}
*/
onFileDrop(e) {
if (this.options.disabled || e.type === 'dragover') {
e.preventDefault();
return;
}
if (this.options.directory) {
this.traverseFileTree(e.dataTransfer.items);
}
else {
/** @type {?} */
const files = Array.prototype.slice.call(e.dataTransfer.files).filter((/**
* @param {?} file
* @return {?}
*/
(file) => this.attrAccept(file, this.options.accept)));
if (files.length) {
this.uploadFiles(files);
}
}
e.preventDefault();
}
/**
* @param {?} e
* @return {?}
*/
onChange(e) {
if (this.options.disabled) {
return;
}
/** @type {?} */
const hie = (/** @type {?} */ (e.target));
this.uploadFiles(hie.files);
hie.value = '';
}
/**
* @private
* @param {?} files
* @return {?}
*/
traverseFileTree(files) {
// tslint:disable-next-line:no-any
/** @type {?} */
const _traverseFileTree = (/**
* @param {?} item
* @param {?} path
* @return {?}
*/
(item, path) => {
if (item.isFile) {
item.file((/**
* @param {?} file
* @return {?}
*/
(file) => {
if (this.attrAccept(file, this.options.accept)) {
this.uploadFiles([file]);
}
}));
}
else if (item.isDirectory) {
/** @type {?} */
const dirReader = item.createReader();
dirReader.readEntries((/**
* @param {?} entries
* @return {?}
*/
(entries) => {
for (const entrieItem of entries) {
_traverseFileTree(entrieItem, `${path}${item.name}/`);
}
}));
}
});
// tslint:disable-next-line:no-any
for (const file of (/** @type {?} */ (files))) {
_traverseFileTree(file.webkitGetAsEntry(), '');
}
}
/**
* @private
* @param {?} file
* @param {?} acceptedFiles
* @return {?}
*/
attrAccept(file, acceptedFiles) {
if (file && acceptedFiles) {
/** @type {?} */
const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
/** @type {?} */
const fileName = '' + file.name;
/** @type {?} */
const mimeType = '' + file.type;
/** @type {?} */
const baseMimeType = mimeType.replace(/\/.*$/, '');
return acceptedFilesArray.some((/**
* @param {?} type
* @return {?}
*/
type => {
/** @type {?} */
const validType = type.trim();
if (validType.charAt(0) === '.') {
return fileName.toLowerCase().indexOf(validType.toLowerCase(), fileName.toLowerCase().length - validType.toLowerCase().length) !== -1;
}
else if (/\/\*$/.test(validType)) {
// This is something like a image/* mime type
return baseMimeType === validType.replace(/\/.*$/, '');
}
return mimeType === validType;
}));
}
return true;
}
/**
* @private
* @param {?} file
* @return {?}
*/
attachUid(file) {
if (!file.uid) {
file.uid = Math.random().toString(36).substring(2);
}
return file;
}
/**
* @param {?} fileList
* @return {?}
*/
uploadFiles(fileList) {
/** @type {?} */
let filters$ = of(Array.prototype.slice.call(fileList));
this.options.filters.forEach((/**
* @param {?} f
* @return {?}
*/
f => {
filters$ = filters$.pipe(switchMap((/**
* @param {?} list
* @return {?}
*/
list => {
/** @type {?} */
const fnRes = f.fn(list);
return fnRes instanceof Observable ? fnRes : of(fnRes);
})));
}));
filters$.subscribe((/**
* @param {?} list
* @return {?}
*/
list => {
list.forEach((/**
* @param {?} file
* @return {?}
*/
(file) => {
this.attachUid(file);
this.upload(file, list);
}));
}), (/**
* @param {?} e
* @return {?}
*/
e => {
console.warn(`Unhandled upload filter error`, e);
}));
}
/**
* @private
* @param {?} file
* @param {?} fileList
* @return {?}
*/
upload(file, fileList) {
if (!this.options.beforeUpload) {
return this.post(file);
}
/** @type {?} */
const before = this.options.beforeUpload(file, fileList);
if (before instanceof Observable) {
before.subscribe((/**
* @param {?} processedFile
* @return {?}
*/
(processedFile) => {
/** @type {?} */
const processedFileType = Object.prototype.toString.call(processedFile);
if (processedFileType === '[object File]' || processedFileType === '[object Blob]') {
this.attachUid(processedFile);
this.post(processedFile);
}
else if (typeof processedFile === 'boolean' && processedFile !== false) {
this.post(file);
}
}), (/**
* @param {?} e
* @return {?}
*/
e => {
console.warn(`Unhandled upload beforeUpload error`, e);
}));
}
else if (before !== false) {
return this.post(file);
}
}
/**
* @private
* @param {?} file
* @return {?}
*/
post(file) {
if (this.destroy) {
return;
}
/** @type {?} */
const opt = this.options;
const { uid } = file;
let { data, headers } = opt;
if (typeof data === 'function') {
data = ((/** @type {?} */ (data)))(file);
}
if (typeof headers === 'function') {
headers = ((/** @type {?} */ (headers)))(file);
}
/** @type {?} */
const args = {
action: opt.action,
name: opt.name,
headers,
file,
data,
withCredentials: opt.withCredentials,
onProgress: opt.onProgress ? (/**
* @param {?} e
* @return {?}
*/
e => {
opt.onProgress(e, file);
}) : null,
onSuccess: (/**
* @param {?} ret
* @param {?} xhr
* @return {?}
*/
(ret, xhr) => {
this.clean(uid);
opt.onSuccess(ret, file, xhr);
}),
onError: (/**
* @param {?} xhr
* @return {?}
*/
(xhr) => {
this.clean(uid);
opt.onError(xhr, file);
})
};
/** @type {?} */
const req$ = (opt.customRequest || this.xhr).call(this, args);
if (!(req$ instanceof Subscription)) {
console.warn(`Must return Subscription type in '[nzCustomRequest]' property`);
}
this.reqs[uid] = req$;
opt.onStart(file);
}
/**
* @private
* @param {?} args
* @return {?}
*/
xhr(args) {
/** @type {?} */
const formData = new FormData();
// tslint:disable-next-line:no-any
formData.append(args.name, (/** @type {?} */ (args.file)));
if (args.data) {
Object.keys(args.data).map((/**
* @param {?} key
* @return {?}
*/
key => {
formData.append(key, args.data[key]);
}));
}
if (!args.headers) {
args.headers = {};
}
if (args.headers['X-Requested-With'] !== null) {
args.headers['X-Requested-With'] = `XMLHttpRequest`;
}
else {
delete args.headers['X-Requested-With'];
}
/** @type {?} */
const req = new HttpRequest('POST', args.action, formData, {
reportProgress: true,
withCredentials: args.withCredentials,
headers: new HttpHeaders(args.headers)
});
return this.http.request(req).subscribe((/**
* @param {?} event
* @return {?}
*/
(event) => {
if (event.type === HttpEventType.UploadProgress) {
if (event.total > 0) {
// tslint:disable-next-line:no-any
((/** @type {?} */ (event))).percent = event.loaded / event.total * 100;
}
args.onProgress(event, args.file);
}
else if (event instanceof HttpResponse) {
args.onSuccess(event.body, args.file, event);
}
}), (/**
* @param {?} err
* @return {?}
*/
(err) => {
this.abort(args.file);
args.onError(err, args.file);
}));
}
/**
* @private
* @param {?} uid
* @return {?}
*/
clean(uid) {
/** @type {?} */
const req$ = this.reqs[uid];
if (req$ instanceof Subscription) {
req$.unsubscribe();
}
delete this.reqs[uid];
}
/**
* @param {?=} file
* @return {?}
*/
abort(file) {
if (file) {
this.clean(file && file.uid);
}
else {
Object.keys(this.reqs).forEach((/**
* @param {?} uid
* @return {?}
*/
(uid) => this.clean(uid)));
}
}
/**
* @private
* @return {?}
*/
setClassMap() {
/** @type {?} */
const classMap = Object.assign({ [this.prefixCls]: true, [`${this.prefixCls}-disabled`]: this.options.disabled }, this.classes);
this.updateHostClassService.updateHostClass(this.el.nativeElement, classMap);
}
/**
* @return {?}
*/
ngOnInit() {
this.inited = true;
this.setClassMap();
}
/**
* @return {?}
*/
ngOnChanges() {
if (this.inited) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy = true;
this.abort();
}
}
NzUploadBtnComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-upload-btn]',
template: "<input type=\"file\" #file (change)=\"onChange($event)\"\n [attr.accept]=\"options.accept\"\n [attr.directory]=\"options.directory ? 'directory': null\"\n [attr.webkitdirectory]=\"options.directory ? 'webkitdirectory': null\"\n [multiple]=\"options.multiple\" style=\"display: none;\">\n<ng-content></ng-content>",
host: {
'[attr.tabindex]': '"0"',
'[attr.role]': '"button"'
},
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None
}] }
];
/** @nocollapse */
NzUploadBtnComponent.ctorParameters = () => [
{ type: HttpClient, decorators: [{ type: Optional }] },
{ type: ElementRef },
{ type: NzUpdateHostClassService }
];
NzUploadBtnComponent.propDecorators = {
file: [{ type: ViewChild, args: ['file',] }],
classes: [{ type: Input }],
options: [{ type: Input }],
onClick: [{ type: HostListener, args: ['click',] }],
onKeyDown: [{ type: HostListener, args: ['keydown', ['$event'],] }],
onFileDrop: [{ type: HostListener, args: ['drop', ['$event'],] }, { type: HostListener, args: ['dragover', ['$event'],] }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzUploadListComponent {
// #endregion
/**
* @param {?} el
* @param {?} cdr
* @param {?} updateHostClassService
*/
constructor(el, cdr, updateHostClassService) {
this.el = el;
this.cdr = cdr;
this.updateHostClassService = updateHostClassService;
this.imageTypes = ['image', 'webp', 'png', 'svg', 'gif', 'jpg', 'jpeg', 'bmp'];
// #region fields
// tslint:disable-next-line:no-any
this.locale = {};
// #endregion
// #region styles
this.prefixCls = 'ant-upload-list';
}
/**
* @return {?}
*/
get showPic() {
return this.listType === 'picture' || this.listType === 'picture-card';
}
/**
* @param {?} list
* @return {?}
*/
set items(list) {
list.forEach((/**
* @param {?} file
* @return {?}
*/
file => {
file.linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps;
}));
this._items = list;
}
/**
* @return {?}
*/
get items() {
return this._items;
}
/**
* @private
* @return {?}
*/
setClassMap() {
/** @type {?} */
const classMap = {
[this.prefixCls]: true,
[`${this.prefixCls}-${this.listType}`]: true
};
this.updateHostClassService.updateHostClass(this.el.nativeElement, classMap);
}
// #endregion
// #region render
/**
* @private
* @param {?} url
* @return {?}
*/
extname(url) {
/** @type {?} */
const temp = url.split('/');
/** @type {?} */
const filename = temp[temp.length - 1];
/** @type {?} */
const filenameWithoutSuffix = filename.split(/#|\?/)[0];
return (/\.[^./\\]*$/.exec(filenameWithoutSuffix) || [''])[0];
}
/**
* @param {?} file
* @return {?}
*/
isImageUrl(file) {
if (~this.imageTypes.indexOf(file.type)) {
return true;
}
/** @type {?} */
const url = (/** @type {?} */ ((file.thumbUrl || file.url || '')));
if (!url) {
return false;
}
/** @type {?} */
const extension = this.extname(url);
if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|bmp)$/i.test(extension)) {
return true;
}
else if (/^data:/.test(url)) {
// other file types of base64
return false;
}
else if (extension) {
// other file types which have extension
return false;
}
return true;
}
/**
* @private
* @param {?} file
* @param {?} callback
* @return {?}
*/
previewFile(file, callback) {
if (file.type && this.imageTypes.indexOf(file.type) === -1) {
callback('');
}
/** @type {?} */
const reader = new FileReader();
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
reader.onloadend = (/**
* @return {?}
*/
() => callback((/** @type {?} */ (reader.result))));
reader.readAsDataURL(file);
}
/**
* @private
* @return {?}
*/
genThumb() {
// tslint:disable-next-line:no-any
/** @type {?} */
const win = (/** @type {?} */ (window));
if (!this.showPic ||
typeof document === 'undefined' ||
typeof win === 'undefined' ||
!win.FileReader ||
!win.File) {
return;
}
this.items
.filter((/**
* @param {?} file
* @return {?}
*/
file => file.originFileObj instanceof File && file.thumbUrl === undefined))
.forEach((/**
* @param {?} file
* @return {?}
*/
file => {
file.thumbUrl = '';
this.previewFile(file.originFileObj, (/**
* @param {?} previewDataUrl
* @return {?}
*/
(previewDataUrl) => {
file.thumbUrl = previewDataUrl;
this.detectChanges();
}));
}));
}
/**
* @param {?} file
* @return {?}
*/
showPreview(file) {
const { showPreviewIcon, hidePreviewIconInNonImage } = this.icons;
if (!showPreviewIcon) {
return false;
}
return this.isImageUrl(file) ? true : !hidePreviewIconInNonImage;
}
/**
* @param {?} file
* @param {?} e
* @return {?}
*/
handlePreview(file, e) {
if (!this.onPreview) {
return;
}
e.preventDefault();
return this.onPreview(file);
}
/**
* @param {?} file
* @param {?} e
* @return {?}
*/
handleRemove(file, e) {
e.preventDefault();
if (this.onRemove) {
this.onRemove(file);
}
return;
}
/**
* @return {?}
*/
detectChanges() {
this.cdr.detectChanges();
}
/**
* @return {?}
*/
ngOnChanges() {
this.setClassMap();
this.genThumb();
}
}
NzUploadListComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-upload-list',
template: "<div *ngFor=\"let file of items\" class=\"ant-upload-list-item ant-upload-list-item-{{file.status}}\" @itemState>\n <ng-template #icon>\n <ng-container *ngIf=\"showPic; else noPicTpl\">\n <div *ngIf=\"listType === 'picture-card' && file.status === 'uploading'; else thumbUrlCheck\" class=\"ant-upload-list-item-uploading-text\">{{ locale.uploading }}</div>\n </ng-container>\n <ng-template #thumbUrlCheck>\n <i *ngIf=\"!file.thumbUrl && !file.url; else thumbTpl\"\n class=\"ant-upload-list-item-thumbnail\" nz-icon type=\"picture\" theme=\"twotone\"></i>\n </ng-template>\n <ng-template #thumbTpl>\n <a class=\"ant-upload-list-item-thumbnail\" target=\"_blank\" rel=\"noopener noreferrer\"\n [href]=\"file.thumbUrl || file.url\"\n (click)=\"handlePreview(file, $event)\">\n <img *ngIf=\"isImageUrl(file); else noThumbTpl\" [src]=\"file.thumbUrl || file.url\" [attr.alt]=\"file.name\" />\n </a>\n </ng-template>\n <ng-template #noThumbTpl><i class=\"ant-upload-list-item-icon\" nz-icon type=\"file\" theme=\"twotone\"></i></ng-template>\n <ng-template #noPicTpl><i nz-icon [type]=\"file.status === 'uploading' ? 'loading' : 'paper-clip'\"></i></ng-template>\n </ng-template>\n <ng-template #preview>\n <ng-container *ngIf=\"file.url; else prevText\">\n <a [href]=\"file.thumbUrl || file.url\" target=\"_blank\" rel=\"noopener noreferrer\" [attr.download]=\"file.linkProps && file.linkProps.download\"\n (click)=\"handlePreview(file, $event)\" class=\"ant-upload-list-item-name\" title=\"{{ file.name }}\">{{ file.name }}</a>\n </ng-container>\n <ng-template #prevText>\n <span (click)=\"handlePreview(file, $event)\" class=\"ant-upload-list-item-name\" title=\"{{ file.name }}\">{{ file.name }}</span>\n </ng-template>\n </ng-template>\n <div class=\"ant-upload-list-item-info\">\n <span *ngIf=\"file.status === 'error'\" nz-tooltip [nzTitle]=\"file.message\">\n <ng-template [ngTemplateOutlet]=\"icon\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"preview\"></ng-template>\n </span>\n <span *ngIf=\"file.status !== 'error'\">\n <ng-template [ngTemplateOutlet]=\"icon\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"preview\"></ng-template>\n </span>\n </div>\n <ng-container *ngIf=\"listType === 'picture-card' && file.status !== 'uploading'; else close\">\n <span class=\"ant-upload-list-item-actions\">\n <a *ngIf=\"showPreview(file)\" [href]=\"file.thumbUrl || file.url\"\n target=\"_blank\" rel=\"noopener noreferrer\"\n title=\"{{ locale.previewFile }}\"\n [ngStyle]=\"!(file.url || file.thumbUrl) && {'opacity': .5, 'pointer-events': 'none'}\"\n (click)=\"handlePreview(file, $event)\">\n <i nz-icon type=\"eye-o\"></i>\n </a>\n <i *ngIf=\"icons.showRemoveIcon\" (click)=\"handleRemove(file, $event)\" class=\"anticon anticon-delete\" title=\"{{ locale.removeFile }}\"></i>\n </span>\n </ng-container>\n <ng-template #close>\n <i *ngIf=\"icons.showRemoveIcon\" (click)=\"handleRemove(file, $event)\" nz-icon type=\"close\" title=\"{{ locale.removeFile }}\"></i>\n </ng-template>\n <div *ngIf=\"file.status === 'uploading'\" class=\"ant-upload-list-item-progress\">\n <nz-progress [nzPercent]=\"file.percent\" [nzShowInfo]=\"false\" [nzStrokeWidth]=\"2\"></nz-progress>\n </div>\n</div>",
providers: [NzUpdateHostClassService],
animations: [
trigger('itemState', [
transition(':enter', [
style({ height: '0', width: '0', opacity: 0 }),
animate(150, style({ height: '*', width: '*', opacity: 1 }))
]),
transition(':leave', [
animate(150, style({ height: '0', width: '0', opacity: 0 }))
])
])
],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzUploadListComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: ChangeDetectorRef },
{ type: NzUpdateHostClassService }
];
NzUploadListComponent.propDecorators = {
locale: [{ type: Input }],
listType: [{ type: Input }],
items: [{ type: Input }],
icons: [{ type: Input }],
onPreview: [{ type: Input }],
onRemove: [{ type: Input }]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzUploadComponent {
// #endregion
/**
* @param {?} cdr
* @param {?} i18n
*/
constructor(cdr, i18n) {
this.cdr = cdr;
this.i18n = i18n;
// tslint:disable-next-line:no-any
this.locale = {};
// #region fields
this.nzType = 'select';
this._limit = 0;
this._size = 0;
this.nzDirectory = false;
this.nzOpenFileDialogOnClick = true;
this.nzFilter = [];
this.nzFileList = [];
this.nzDisabled = false;
this.nzListType = 'text';
this.nzMultiple = false;
this.nzName = 'file';
this._showUploadList = true;
this.nzShowButton = true;
this.nzWithCredentials = false;
this.nzChange = new EventEmitter();
this.nzFileListChange = new EventEmitter();
this.onStart = (/**
* @param {?} file
* @return {?}
*/
(file) => {
if (!this.nzFileList) {
this.nzFileList = [];
}
/** @type {?} */
const targetItem = this.fileToObject(file);
targetItem.status = 'uploading';
this.nzFileList = this.nzFileList.concat(targetItem);
this.nzFileListChange.emit(this.nzFileList);
this.nzChange.emit({ file: targetItem, fileList: this.nzFileList, type: 'start' });
this.detectChangesList();
});
this.onProgress = (/**
* @param {?} e
* @param {?} file
* @return {?}
*/
(e, file) => {
/** @type {?} */
const fileList = this.nzFileList;
/** @type {?} */
const targetItem = this.getFileItem(file, fileList);
targetItem.percent = e.percent;
this.nzChange.emit({
event: e,
file: Object.assign({}, targetItem),
fileList: this.nzFileList,
type: 'progress'
});
this.detectChangesList();
});
this.onSuccess = (/**
* @param {?} res
* @param {?} file
* @return {?}
*/
(res, file) => {
/** @type {?} */
const fileList = this.nzFileList;
/** @type {?} */
const targetItem = this.getFileItem(file, fileList);
targetItem.status = 'done';
targetItem.response = res;
this.nzChange.emit({
file: Object.assign({}, targetItem),
fileList,
type: 'success'
});
this.detectChangesList();
});
this.onError = (/**
* @param {?} err
* @param {?} file
* @return {?}
*/
(err, file) => {
/** @type {?} */
const fileList = this.nzFileList;
/** @type {?} */
const targetItem = this.getFileItem(file, fileList);
targetItem.error = err;
targetItem.status = 'error';
targetItem.message = this.genErr(targetItem);
this.nzChange.emit({
file: Object.assign({}, targetItem),
fileList,
type: 'error'
});
this.detectChangesList();
});
this.onRemove = (/**
* @param {?} file
* @return {?}
*/
(file) => {
this.uploadComp.abort(file);
file.status = 'removed';
/** @type {?} */
const fnRes = typeof this.nzRemove === 'function' ?
this.nzRemove(file) : this.nzRemove == null ? true : this.nzRemove;
(fnRes instanceof Observable ? fnRes : of(fnRes))
.pipe(filter((/**
* @param {?} res
* @return {?}
*/
(res) => res)))
.subscribe((/**
* @return {?}
*/
() => {
this.nzFileList = this.removeFileItem(file, this.nzFileList);
this.nzChange.emit({
file,
fileList: this.nzFileList,
type: 'removed'
});
this.nzFileListChange.emit(this.nzFileList);
this.cdr.detectChanges();
}));
});
// #endregion
// #region styles
this.prefixCls = 'ant-upload';
this.classList = [];
}
/**
* @param {?} value
* @return {?}
*/
set nzLimit(value) {
this._limit = toNumber(value, null);
}
/**
* @return {?}
*/
get nzLimit() {
return this._limit;
}
/**
* @param {?} value
* @return {?}
*/
set nzSize(value) {
this._size = toNumber(value, null);
}
/**
* @return {?}
*/
get nzSize() {
return this._size;
}
/**
* @param {?} value
* @return {?}
*/
set nzShowUploadList(value) {
this._showUploadList = typeof value === 'boolean' ? toBoolean(value) : value;
}
/**
* @return {?}
*/
get nzShowUploadList() {
return this._showUploadList;
}
/**
* @private
* @template THIS
* @this {THIS}
* @return {THIS}
*/
zipOptions() {
if (typeof (/** @type {?} */ (this)).nzShowUploadList === 'boolean' && (/** @type {?} */ (this)).nzShowUploadList) {
(/** @type {?} */ (this)).nzShowUploadList = {
showPreviewIcon: true,
showRemoveIcon: true,
hidePreviewIconInNonImage: false
};
}
// filters
/** @type {?} */
const filters = (/** @type {?} */ (this)).nzFilter.slice();
if ((/** @type {?} */ (this)).nzMultiple && (/** @type {?} */ (this)).nzLimit > 0 && filters.findIndex((/**
* @param {?} w
* @return {?}
*/
w => w.name === 'limit')) === -1) {
filters.push({
name: 'limit',
fn: (/**
* @param {?} fileList
* @return {?}
*/
(fileList) => fileList.slice(-(/** @type {?} */ (this)).nzLimit))
});
}
if ((/** @type {?} */ (this)).nzSize > 0 && filters.findIndex((/**
* @param {?} w
* @return {?}
*/
w => w.name === 'size')) === -1) {
filters.push({
name: 'size',
fn: (/**
* @param {?} fileList
* @return {?}
*/
(fileList) => fileList.filter((/**
* @param {?} w
* @return {?}
*/
w => (w.size / 1024) <= (/** @type {?} */ (this)).nzSize)))
});
}
if ((/** @type {?} */ (this)).nzFileType && (/** @type {?} */ (this)).nzFileType.length > 0 && filters.findIndex((/**
* @param {?} w
* @return {?}
*/
w => w.name === 'type')) === -1) {
/** @type {?} */
const types = (/** @type {?} */ (this)).nzFileType.split(',');
filters.push({
name: 'type',
fn: (/**
* @param {?} fileList
* @return {?}
*/
(fileList) => fileList.filter((/**
* @param {?} w
* @return {?}
*/
w => ~types.indexOf(w.type))))
});
}
(/** @type {?} */ (this))._btnOptions = {
disabled: (/** @type {?} */ (this)).nzDisabled,
accept: (/** @type {?} */ (this)).nzAccept,
action: (/** @type {?} */ (this)).nzAction,
directory: (/** @type {?} */ (this)).nzDirectory,
openFileDialogOnClick: (/** @type {?} */ (this)).nzOpenFileDialogOnClick,
beforeUpload: (/** @type {?} */ (this)).nzBeforeUpload,
customRequest: (/** @type {?} */ (this)).nzCustomRequest,
data: (/** @type {?} */ (this)).nzData,
headers: (/** @type {?} */ (this)).nzHeaders,
name: (/** @type {?} */ (this)).nzName,
multiple: (/** @type {?} */ (this)).nzMultiple,
withCredentials: (/** @type {?} */ (this)).nzWithCredentials,
filters,
onStart: (/** @type {?} */ (this)).onStart,
onProgress: (/** @type {?} */ (this)).onProgress,
onSuccess: (/** @type {?} */ (this)).onSuccess,
onError: (/** @type {?} */ (this)).onError
};
return (/** @type {?} */ (this));
}
// #region upload
/**
* @private
* @param {?} file
* @return {?}
*/
fileToObject(file) {
return {
lastModified: file.lastModified,
lastModifiedDate: file.lastModifiedDate,
name: file.filename || file.name,
size: file.size,
type: file.type,
uid: file.uid,
response: file.response,
error: file.error,
percent: 0,
// tslint:disable-next-line:no-any
originFileObj: (/** @type {?} */ (file))
};
}
/**
* @private
* @param {?} file
* @param {?} fileList
* @return {?}
*/
getFileItem(file, fileList) {
return fileList.filter((/**
* @param {?} item
* @return {?}
*/
item => item.uid === file.uid))[0];
}
/**
* @private
* @param {?} file
* @param {?} fileList
* @return {?}
*/
removeFileItem(file, fileList) {
return fileList.filter((/**
* @param {?} item
* @return {?}
*/
item => item.uid !== file.uid));
}
/**
* @private
* @param {?} file
* @return {?}
*/
genErr(file) {
return file.response && typeof file.response === 'string' ?
file.response :
(file.error && file.error.statusText) || this.locale.uploadError;
}
/**
* @param {?} e
* @return {?}
*/
fileDrop(e) {
if (e.type === this.dragState) {
return;
}
this.dragState = e.type;
this.setClassMap();
}
// #endregion
// #region list
/**
* @private
* @return {?}
*/
detectChangesList() {
this.cdr.detectChanges();
this.listComp.detectChanges();
}
/**
* @private
* @return {?}
*/
setClassMap() {
/** @type {?} */
let subCls = [];
if (this.nzType === 'drag') {
subCls = [
this.nzFileList.some((/**
* @param {?} file
* @return {?}
*/
file => file.status === 'uploading')) && `${this.prefixCls}-drag-uploading`,
this.dragState === 'dragover' && `${this.prefixCls}-drag-hover`
];
}
else {
subCls = [
`${this.prefixCls}-select-${this.nzListType}`
];
}
this.classList = [
this.prefixCls,
`${this.prefixCls}-${this.nzType}`,
...subCls,
this.nzDisabled && `${this.prefixCls}-disabled`
].filter((/**
* @param {?} item
* @return {?}
*/
item => !!item));
this.cdr.detectChanges();
}
// #endregion
/**
* @return {?}
*/
ngOnInit() {
this.i18n$ = this.i18n.localeChange.subscribe((/**
* @return {?}
*/
() => {
this.locale = this.i18n.getLocaleData('Upload');
this.detectChangesList();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzFileList) {
(this.nzFileList || []).forEach((/**
* @param {?} file
* @return {?}
*/
file => file.message = this.genErr(file)));
}
this.zipOptions().setClassMap();
}
/**
* @return {?}
*/
ngOnDestroy() {
this.i18n$.unsubscribe();
}
}
NzUploadComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-upload',
template: "<ng-template #list>\n <nz-upload-list #listComp [style.display]=\"nzShowUploadList ? '' : 'none'\"\n [locale]=\"locale\"\n [listType]=\"nzListType\"\n [items]=\"nzFileList || []\"\n [icons]=\"nzShowUploadList\"\n [onPreview]=\"nzPreview\"\n [onRemove]=\"onRemove\"></nz-upload-list>\n</ng-template>\n<ng-template #con><ng-content></ng-content></ng-template>\n<ng-template #btn>\n <div [ngClass]=\"classList\" [style.display]=\"nzShowButton ? '' : 'none'\">\n <div nz-upload-btn #uploadComp [options]=\"_btnOptions\">\n <ng-template [ngTemplateOutlet]=\"con\"></ng-template>\n </div>\n </div>\n</ng-template>\n<ng-container *ngIf=\"nzType === 'drag'; else select\">\n <div [ngClass]=\"classList\"\n (drop)=\"fileDrop($event)\"\n (dragover)=\"fileDrop($event)\"\n (dragleave)=\"fileDrop($event)\">\n <div nz-upload-btn #upload [options]=\"_btnOptions\" [classes]=\"{'ant-upload-btn': true}\">\n <div class=\"ant-upload-drag-container\">\n <ng-template [ngTemplateOutlet]=\"con\"></ng-template>\n </div>\n </div>\n </div>\n <ng-template [ngTemplateOutlet]=\"list\"></ng-template>\n</ng-container>\n<ng-template #select>\n <ng-container *ngIf=\"nzListType === 'picture-card'; else pic\">\n <ng-template [ngTemplateOutlet]=\"list\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"btn\"></ng-template>\n </ng-container>\n</ng-template>\n<ng-template #pic>\n <ng-template [ngTemplateOutlet]=\"btn\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"list\"></ng-template>\n</ng-template>",
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
NzUploadComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzI18nService$$1 }
];
NzUploadComponent.propDecorators = {
uploadComp: [{ type: ViewChild, args: ['uploadComp',] }],
listComp: [{ type: ViewChild, args: ['listComp',] }],
nzType: [{ type: Input }],
nzLimit: [{ type: Input }],
nzSize: [{ type: Input }],
nzFileType: [{ type: Input }],
nzAccept: [{ type: Input }],
nzAction: [{ type: Input }],
nzDirectory: [{ type: Input }],
nzOpenFileDialogOnClick: [{ type: Input }],
nzBeforeUpload: [{ type: Input }],
nzCustomRequest: [{ type: Input }],
nzData: [{ type: Input }],
nzFilter: [{ type: Input }],
nzFileList: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzHeaders: [{ type: Input }],
nzListType: [{ type: Input }],
nzMultiple: [{ type: Input }],
nzName: [{ type: Input }],
nzShowUploadList: [{ type: Input }],
nzShowButton: [{ type: Input }],
nzWithCredentials: [{ type: Input }],
nzRemove: [{ type: Input }],
nzPreview: [{ type: Input }],
nzChange: [{ type: Output }],
nzFileListChange: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzDirectory", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzOpenFileDialogOnClick", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzMultiple", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzShowButton", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzUploadComponent.prototype, "nzWithCredentials", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzUploadModule {
}
NzUploadModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzToolTipModule, NzProgressModule, NzI18nModule, NzIconModule],
declarations: [NzUploadComponent, NzUploadBtnComponent, NzUploadListComponent],
exports: [NzUploadComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzDropdownService$$1 {
/**
* @param {?} overlay
*/
constructor(overlay) {
this.overlay = overlay;
}
/**
* @param {?} $event
* @param {?} templateRef
* @return {?}
*/
create($event, templateRef) {
$event.preventDefault();
this.dispose();
this.overlayRef = this.overlay.create(new OverlayConfig({
scrollStrategy: this.overlay.scrollStrategies.close(),
positionStrategy: this.overlay.position().flexibleConnectedTo({
x: $event.x,
y: $event.y
}).withPositions([
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'top' }),
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' }),
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'bottom' }),
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'top' })
])
}));
/** @type {?} */
const positionChanges = ((/** @type {?} */ (this.overlayRef.getConfig().positionStrategy))).positionChanges;
/** @type {?} */
const instance = this.overlayRef.attach(new ComponentPortal(NzDropdownContextComponent)).instance;
fromEvent(document, 'click').pipe(filter((/**
* @param {?} event
* @return {?}
*/
event => !!this.overlayRef && !this.overlayRef.overlayElement.contains((/** @type {?} */ (event.target))))), take(1)).subscribe((/**
* @return {?}
*/
() => instance.close()));
instance.init(true, templateRef, positionChanges, this);
return instance;
}
/**
* @return {?}
*/
dispose() {
if (this.overlayRef && this.overlayRef.hasAttached()) {
this.overlayRef.dispose();
this.overlayRef = null;
}
}
}
NzDropdownService$$1.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzDropdownService$$1.ctorParameters = () => [
{ type: Overlay }
];
/** @nocollapse */ NzDropdownService$$1.ngInjectableDef = defineInjectable({ factory: function NzDropdownService_Factory() { return new NzDropdownService$$1(inject(Overlay)); }, token: NzDropdownService$$1, providedIn: "root" });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
const VERSION = new Version('7.0.2');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NgZorroAntdModule {
/**
* @deprecated Use `NgZorroAntdModule` instead.
* @return {?}
*/
static forRoot() {
return {
ngModule: NgZorroAntdModule
};
}
}
NgZorroAntdModule.decorators = [
{ type: NgModule, args: [{
exports: [
NzButtonModule,
NzCalendarModule,
NzGridModule,
NzSwitchModule,
NzSelectModule,
NzMenuModule,
NzMentionModule,
NzAnchorModule,
NzAffixModule,
NzDropDownModule,
NzLayoutModule,
NzBreadCrumbModule,
NzPaginationModule,
NzStepsModule,
NzInputModule,
NzCheckboxModule,
NzInputNumberModule,
NzSliderModule,
NzRateModule,
NzBadgeModule,
NzRadioModule,
NzAlertModule,
NzSpinModule,
NzProgressModule,
NzTabsModule,
NzIconModule,
NzCardModule,
NzAvatarModule,
NzTimelineModule,
NzTransferModule,
NzCarouselModule,
NzCollapseModule,
NzCommentModule,
NzTableModule,
NzDatePickerModule,
NzDividerModule,
NzDrawerModule,
NzFormModule,
NzListModule,
NzI18nModule,
NzUploadModule,
NzAutocompleteModule,
NzTagModule,
NzMessageModule,
NzNotificationModule,
NzPopoverModule,
NzToolTipModule,
NzPopconfirmModule,
NzModalModule,
NzBackTopModule,
NzCascaderModule,
NzTreeModule,
NzTreeSelectModule,
NzTimePickerModule,
NzWaveModule,
NzNoAnimationModule,
NzSkeletonModule,
NzStatisticModule,
NzEmptyModule
]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { NgZorroAntdModule, NzAffixComponent, NzAffixModule, NzAlertComponent, NzAlertModule, NzAnchorLinkComponent, NzAnchorComponent, NzAnchorModule, NzAvatarComponent, NzAvatarModule, NzBackTopComponent, NzBackTopModule, NzBadgeComponent, NzBadgeModule, NzBreadCrumbItemComponent, NZ_ROUTE_DATA_BREADCRUMB, NzBreadCrumbComponent, NzBreadCrumbModule, NzButtonComponent, NzButtonGroupComponent, NzButtonModule, NzCalendarComponent, NzCalendarModule, NzCardGridDirective, NzCardComponent, NzCardModule, NzCardLoadingComponent, NzCardMetaComponent, NzCardTabComponent, NzCarouselModule, NzCarouselComponent, NzCarouselContentDirective, NzCheckboxComponent, NzCheckboxModule, NzCheckboxGroupComponent, NzCheckboxWrapperComponent, NzCollapsePanelComponent, NzCollapseComponent, NzCollapseModule, NzCommentModule, NzCommentComponent, NzCommentAvatarDirective, NzCommentContentDirective, NzCommentActionHostDirective, NzCommentActionComponent, CandyDate, NzDatePickerModule, NzDatePickerComponent, NzRangePickerComponent, NzMonthPickerComponent, NzWeekPickerComponent, NzDividerComponent, NzDividerModule, DRAWER_ANIMATE_DURATION, NzDrawerComponent, NzDrawerModule, DrawerBuilderForService$$1 as DrawerBuilderForService, NzDrawerService$$1 as NzDrawerService, NzDrawerRef, NzDropdownContextComponent, NzDropDownComponent, NzDropDownDirective, NzDropdownService$$1 as NzDropdownService, NzDropDownButtonComponent, NzDropDownModule, NzEmbedEmptyComponent, NzEmptyComponent, NzEmptyModule, NzEmptyService$$1 as NzEmptyService, NZ_DEFAULT_EMPTY_CONTENT, NZ_EMPTY_COMPONENT_NAME, emptyImage, simpleEmptyImage, NzFormModule, NzFormDirective, NzFormControlComponent, NzFormExplainComponent, NzFormItemComponent, NzFormExtraComponent, NzFormLabelComponent, NzFormSplitComponent, NzFormTextComponent, Breakpoint, NzRowDirective, NzColDirective, NzGridModule, NzI18nModule, NzI18nService$$1 as NzI18nService, NZ_DATE_CONFIG, DateHelperService$$1 as DateHelperService, ar_EG, bg_BG, ca_ES, cs_CZ, da_DK, de_DE, el_GR, en_GB, en_US, es_ES, et_EE, fa_IR, fi_FI, fr_BE, fr_FR, is_IS, it_IT, ja_JP, ko_KR, nb_NO, nl_BE, nl_NL, pl_PL, pt_BR, pt_PT, ru_RU, sk_SK, sl_SI, sr_RS, sv_SE, th_TH, tr_TR, uk_UA, vi_VN, zh_CN, zh_TW, NZ_I18N, NZ_DATE_LOCALE, NzIconModule, NzIconDirective, NZ_ICONS$$1 as NZ_ICONS, NZ_ICON_DEFAULT_TWOTONE_COLOR$$1 as NZ_ICON_DEFAULT_TWOTONE_COLOR, DEFAULT_TWOTONE_COLOR$$1 as DEFAULT_TWOTONE_COLOR, NZ_ICONS_USED_BY_ZORRO$$1 as NZ_ICONS_USED_BY_ZORRO, NzIconService$$1 as NzIconService, NzInputGroupComponent, NzInputModule, NzInputDirective, NzInputNumberComponent, NzInputNumberModule, NzContentComponent, NzFooterComponent, NzHeaderComponent, NzLayoutComponent, NzSiderComponent, NzLayoutModule, NzListItemMetaComponent, NzListItemComponent, NzListComponent, NzListModule, NzMentionModule, NzMentionComponent, NZ_MENTION_TRIGGER_ACCESSOR, NzMentionTriggerDirective, NzMentionSuggestionDirective, NzMenuFactory, NzMenuDirective, NzMenuGroupComponent, NzMenuDividerDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuModule, NzPaginationComponent, NzPaginationModule, NzProgressModule, NzProgressComponent, NzRadioButtonComponent, NzRadioGroupComponent, NzRadioComponent, NzRadioModule, NzRateComponent, NzRateModule, NzOptionGroupComponent, NzOptionContainerComponent, NzOptionComponent, NzSelectComponent, NzSelectModule, NzSpinComponent, NzSpinModule, NzCountdownComponent, NzStatisticComponent, NzStatisticModule, NzStepsComponent, NzStepComponent, NzStepsModule, NzSwitchComponent, NzSwitchModule, NzTableComponent, NzTableModule, NzTbodyDirective, NzTdComponent, NzThComponent, NzTheadComponent, NzTrDirective, NzTabBodyComponent, NzTabLabelDirective, NzTabComponent, NzTabsInkBarDirective, NzTabsModule, NzTabsNavComponent, NzTabChangeEvent, NzTabSetComponent, NzTimelineItemComponent, NzTimelineComponent, NzTimelineModule, NzTransferListComponent, NzTransferSearchComponent, NzTransferComponent, NzTransferModule, NzUploadBtnComponent, NzUploadListComponent, NzUploadComponent, NzUploadModule, NzTagComponent, NzTagModule, NzAutocompleteModule, NzAutocompleteComponent, getNzAutocompleteMissingPanelError, NZ_AUTOCOMPLETE_VALUE_ACCESSOR, NzAutocompleteTriggerDirective, NzOptionSelectionChange, NzAutocompleteOptionComponent, NzAutocompleteOptgroupComponent, NzMessageBaseService$$1 as NzMessageBaseService, NzMessageService$$1 as NzMessageService, NzMessageModule, NzMessageComponent, NzMessageContainerComponent, NZ_MESSAGE_DEFAULT_CONFIG, NZ_MESSAGE_CONFIG, NZ_MESSAGE_DEFAULT_CONFIG_PROVIDER, NzTimePickerComponent, NzTimePickerModule, NzToolTipComponent, NzTooltipDirective, NzToolTipModule, NzSkeletonComponent, NzSkeletonModule, NzSliderComponent, NzSliderModule, NzSliderHandleComponent, NzSliderMarksComponent, NzSliderStepComponent, NzSliderTrackComponent, isValueARange, isConfigAObject, Marks, NzPopoverComponent, NzPopoverDirective, NzPopoverModule, NZ_NOTIFICATION_DEFAULT_CONFIG, NZ_NOTIFICATION_CONFIG, NZ_NOTIFICATION_DEFAULT_CONFIG_PROVIDER, NzNotificationComponent, NzNotificationModule, NzNotificationService$$1 as NzNotificationService, NzNotificationContainerComponent, NzPopconfirmComponent, NzPopconfirmDirective, NzPopconfirmModule, NzModalComponent, NzModalRef, NzModalModule, NzModalService, NZ_MODAL_CONFIG, NzCascaderModule, NzCascaderComponent, NzTreeModule, NzTreeServiceFactory, NzTreeComponent, NzTreeNodeComponent, NzTreeNode, NzTreeBaseService, isCheckDisabled, isInArray, NzTreeSelectComponent, NzTreeSelectModule, VERSION, NzWaveRenderer, NZ_WAVE_GLOBAL_CONFIG_FACTORY, NZ_WAVE_GLOBAL_DEFAULT_CONFIG, NZ_WAVE_GLOBAL_CONFIG, NzWaveDirective, NzWaveModule, isNotNil, shallowEqual, isInteger, isEmpty, filterNotEmptyNode, isNonEmptyString, isTemplateRef, isComponent, toBoolean, toNumber, toCssPixel, valueFunctionProp, InputBoolean, InputCssPixel, InputNumber, getRegExp, getMentions, padStart, padEnd, getRepeatedElement, getCaretCoordinates, createDebugEle, properties, throttleByAnimationFrameDecorator, timeUnits, NzNoAnimationModule, NzNoAnimationDirective, NzAffixComponent as ɵea, NzAffixModule as ɵdz, NzAlertComponent as ɵfv, NzAlertModule as ɵfu, NzAnchorLinkComponent as ɵdy, NzAnchorComponent as ɵdu, NzAnchorModule as ɵdt, NzAutocompleteOptgroupComponent as ɵjx, NzAutocompleteOptionComponent as ɵju, NZ_AUTOCOMPLETE_VALUE_ACCESSOR as ɵjv, NzAutocompleteTriggerDirective as ɵjw, NzAutocompleteComponent as ɵjt, NzAutocompleteModule as ɵjs, NzAvatarComponent as ɵgp, NzAvatarModule as ɵgo, NzBackTopComponent as ɵlj, NzBackTopModule as ɵli, NzBadgeComponent as ɵft, NzBadgeModule as ɵfs, NzBreadCrumbItemComponent as ɵeq, NzBreadCrumbComponent as ɵep, NzBreadCrumbModule as ɵeo, NzButtonGroupComponent as ɵp, NzButtonComponent as ɵb, NzButtonModule as ɵa, NzDateCellDirective as ɵbe, NzDateFullCellDirective as ɵbg, NzMonthCellDirective as ɵbf, NzMonthFullCellDirective as ɵbh, NzCalendarHeaderComponent as ɵt, NzCalendarComponent as ɵbd, NzCalendarModule as ɵs, NzCardGridDirective as ɵgl, NzCardLoadingComponent as ɵgn, NzCardMetaComponent as ɵgm, NzCardTabComponent as ɵgk, NzCardComponent as ɵgj, NzCardModule as ɵgi, NzCarouselContentDirective as ɵgz, NzCarouselComponent as ɵgy, NzCarouselModule as ɵgx, NzCascaderOptionComponent as ɵlm, NzCascaderComponent as ɵll, NzCascaderModule as ɵlk, NzCheckboxGroupComponent as ɵfd, NzCheckboxWrapperComponent as ɵfc, NzCheckboxComponent as ɵfb, NzCheckboxModule as ɵfa, NzCollapsePanelComponent as ɵhb, NzCollapseComponent as ɵhc, NzCollapseModule as ɵha, NzCommentActionComponent as ɵhi, NzCommentActionHostDirective as ɵhh, NzCommentAvatarDirective as ɵhf, NzCommentContentDirective as ɵhg, NzCommentComponent as ɵhe, NzCommentModule as ɵhd, NzAddOnModule as ɵbu, NzClassListAddDirective as ɵbw, NzStringTemplateOutletDirective as ɵbv, AnimationCurves as ɵco, AnimationDuration as ɵcn, collapseMotion as ɵdl, fadeMotion as ɵka, helpMotion as ɵjf, moveUpMotion as ɵki, notificationMotion as ɵkn, slideAlertMotion as ɵcm, slideMotion as ɵcl, zoomBadgeMotion as ɵcs, zoomBigMotion as ɵcr, zoomMotion as ɵcq, NzNoAnimationDirective as ɵcf, NzNoAnimationModule as ɵce, NzConnectedOverlayDirective as ɵcd, NzOverlayModule as ɵcc, NzScrollService as ɵdv, SCROLL_SERVICE_PROVIDER as ɵdx, SCROLL_SERVICE_PROVIDER_FACTORY as ɵdw, NzMeasureScrollbarService as ɵhn, NzUpdateHostClassService as ɵc, InputBoolean as ɵe, InputBoolean as ɵi, InputNumber as ɵj, LoggerModule as ɵbj, LOGGER_SERVICE_PROVIDER as ɵbn, LOGGER_SERVICE_PROVIDER_FACTORY as ɵbm, LoggerService as ɵbl, NZ_LOGGER_STATE as ɵbk, throttleByAnimationFrameDecorator as ɵeb, NZ_WAVE_GLOBAL_CONFIG as ɵm, NZ_WAVE_GLOBAL_CONFIG_FACTORY as ɵn, NZ_WAVE_GLOBAL_DEFAULT_CONFIG as ɵl, NzWaveDirective as ɵo, NzWaveModule as ɵq, AbstractPickerComponent as ɵin, NzDatePickerComponent as ɵil, NzDatePickerModule as ɵhs, DateRangePickerComponent as ɵim, HeaderPickerComponent as ɵir, CalendarFooterComponent as ɵia, CalendarHeaderComponent as ɵhy, CalendarInputComponent as ɵhz, OkButtonComponent as ɵib, TimePickerButtonComponent as ɵic, TodayButtonComponent as ɵid, DateTableComponent as ɵie, DecadePanelComponent as ɵii, LibPackerModule as ɵht, MonthPanelComponent as ɵig, MonthTableComponent as ɵih, DateRangePopupComponent as ɵik, InnerPopupComponent as ɵij, YearPanelComponent as ɵif, NzMonthPickerComponent as ɵiq, NzPickerComponent as ɵio, NzRangePickerComponent as ɵip, NzWeekPickerComponent as ɵit, NzYearPickerComponent as ɵis, NzDividerComponent as ɵiv, NzDividerModule as ɵiu, NzDrawerRef as ɵiy, NzDrawerComponent as ɵix, NzDrawerModule as ɵiw, NzDrawerService$$1 as ɵiz, NzDropDownADirective as ɵeh, NzDropDownButtonComponent as ɵeg, NzDropdownContextComponent as ɵed, NzDropDownComponent as ɵee, NzDropDownDirective as ɵef, NzDropDownModule as ɵec, NzMenuDropdownService as ɵdh, NzEmbedEmptyComponent as ɵbz, NZ_DEFAULT_EMPTY_CONTENT as ɵcb, NzEmptyComponent as ɵby, NzEmptyModule as ɵbx, NzEmptyService$$1 as ɵca, NzFormControlComponent as ɵjh, NzFormExplainComponent as ɵje, NzFormExtraComponent as ɵjb, NzFormItemComponent as ɵjd, NzFormLabelComponent as ɵjc, NzFormSplitComponent as ɵjj, NzFormTextComponent as ɵji, NzFormDirective as ɵjg, NzFormModule as ɵja, NzColDirective as ɵcy, NzGridModule as ɵcx, NzRowDirective as ɵcz, NZ_DATE_CONFIG as ɵbb, DATE_HELPER_SERVICE_FACTORY as ɵz, DateHelperService$$1 as ɵba, NzI18nModule as ɵbi, NzI18nPipe as ɵbo, NzI18nService$$1 as ɵu, NZ_DATE_LOCALE as ɵw, NZ_I18N as ɵv, NzIconDirective as ɵd, NzIconModule as ɵr, NZ_ICONS$$1 as ɵf, NZ_ICON_DEFAULT_TWOTONE_COLOR$$1 as ɵg, NzIconService$$1 as ɵh, NzInputNumberComponent as ɵff, NzInputNumberModule as ɵfe, NzAutoResizeDirective as ɵez, NzInputGroupComponent as ɵey, NzInputDirective as ɵex, NzInputModule as ɵew, NzContentComponent as ɵel, NzFooterComponent as ɵem, NzHeaderComponent as ɵek, NzLayoutComponent as ɵej, NzLayoutModule as ɵei, NzSiderComponent as ɵen, NzListItemMetaComponent as ɵjn, NzListItemComponent as ɵjm, NzListComponent as ɵjl, NzListModule as ɵjk, NzMentionSuggestionDirective as ɵds, NZ_MENTION_TRIGGER_ACCESSOR as ɵdq, NzMentionTriggerDirective as ɵdr, NzMentionComponent as ɵdp, NzMentionModule as ɵdo, NzMenuDividerDirective as ɵdm, NzMenuGroupComponent as ɵdn, NzMenuItemDirective as ɵdi, NzMenuMenuService as ɵdf, NzMenuDirective as ɵde, NzMenuFactory as ɵdd, NzMenuModule as ɵdc, NzMenuService as ɵdg, NzSubMenuComponent as ɵdk, NzSubmenuService as ɵdj, NZ_MESSAGE_CONFIG as ɵkf, NZ_MESSAGE_DEFAULT_CONFIG as ɵke, NZ_MESSAGE_DEFAULT_CONFIG_PROVIDER as ɵkg, NzMessageContainerComponent as ɵkc, NzMessageComponent as ɵkh, NzMessageModule as ɵkb, NzMessageBaseService$$1 as ɵkj, NzMessageService$$1 as ɵkk, CssUnitPipe as ɵlg, NZ_MODAL_CONFIG as ɵld, NzModalControlService as ɵlf, NzModalRef as ɵlc, NzModalComponent as ɵlb, NzModalModule as ɵla, NzModalService as ɵlh, NZ_NOTIFICATION_CONFIG as ɵkr, NZ_NOTIFICATION_DEFAULT_CONFIG as ɵkq, NZ_NOTIFICATION_DEFAULT_CONFIG_PROVIDER as ɵks, NzNotificationContainerComponent as ɵko, NzNotificationComponent as ɵkm, NzNotificationModule as ɵkl, NzNotificationService$$1 as ɵkt, NzPaginationComponent as ɵes, NzPaginationModule as ɵer, NzPopconfirmComponent as ɵky, NzPopconfirmDirective as ɵkz, NzPopconfirmModule as ɵkx, NzPopoverComponent as ɵkv, NzPopoverDirective as ɵkw, NzPopoverModule as ɵku, NzProgressComponent as ɵfz, NzProgressModule as ɵfy, NzRadioButtonComponent as ɵbr, NzRadioGroupComponent as ɵbs, NzRadioComponent as ɵbq, NzRadioModule as ɵbp, NzRateItemComponent as ɵfr, NzRateComponent as ɵfq, NzRateModule as ɵfp, NzOptionContainerComponent as ɵcu, NzOptionGroupComponent as ɵct, NzOptionLiComponent as ɵcv, NzOptionComponent as ɵci, NzFilterGroupOptionPipe as ɵch, NzFilterOptionPipe as ɵcg, NzSelectTopControlComponent as ɵcp, NzSelectUnselectableDirective as ɵcw, NzSelectComponent as ɵcj, NzSelectModule as ɵbt, NzSelectService as ɵck, NzSkeletonComponent as ɵlx, NzSkeletonModule as ɵlw, NzSliderHandleComponent as ɵfj, NzSliderMarksComponent as ɵfm, NzSliderStepComponent as ɵfl, NzSliderTrackComponent as ɵfi, NzSliderComponent as ɵfh, NzSliderModule as ɵfg, NzSpinComponent as ɵfx, NzSpinModule as ɵfw, NzCountdownComponent as ɵma, NzStatisticNumberComponent as ɵmb, NzStatisticComponent as ɵlz, NzStatisticModule as ɵly, NzTimeRangePipe as ɵmc, NzStepComponent as ɵev, NzStepsComponent as ɵeu, NzStepsModule as ɵet, NzSwitchComponent as ɵdb, NzSwitchModule as ɵda, NzTableComponent as ɵhk, NzTableModule as ɵhj, NzTbodyDirective as ɵhq, NzTdComponent as ɵho, NzThComponent as ɵhl, NzTheadComponent as ɵhp, NzTrDirective as ɵhr, NzVirtualScrollDirective as ɵhm, NzTabBodyComponent as ɵgh, NzTabLabelDirective as ɵgf, NzTabComponent as ɵgb, NzTabDirective as ɵgc, NzTabsInkBarDirective as ɵgg, NzTabsNavComponent as ɵge, NzTabsModule as ɵga, NzTabSetComponent as ɵgd, NzTagComponent as ɵjz, NzTagModule as ɵjy, NzTimePickerPanelComponent as ɵhw, NzTimePickerComponent as ɵhv, NzTimePickerModule as ɵhu, NzTimeValueAccessorDirective as ɵhx, NzTimelineItemComponent as ɵgr, NzTimelineComponent as ɵgs, NzTimelineModule as ɵgq, NzToolTipComponent as ɵfk, NzTooltipDirective as ɵfo, NzToolTipModule as ɵfn, NzTransferListComponent as ɵgv, NzTransferSearchComponent as ɵgw, NzTransferComponent as ɵgu, NzTransferModule as ɵgt, NzTreeSelectComponent as ɵlv, NzTreeSelectModule as ɵlu, NzTreeSelectService as ɵls, NzTreeBaseService as ɵlr, NzTreeNodeComponent as ɵlt, NzTreeComponent as ɵlp, NzTreeServiceFactory as ɵlo, NzTreeModule as ɵln, NzTreeService as ɵlq, NzUploadBtnComponent as ɵjq, NzUploadListComponent as ɵjr, NzUploadComponent as ɵjp, NzUploadModule as ɵjo };
//# sourceMappingURL=ng-zorro-antd.js.map