ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
60 lines • 7 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { forwardRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Host, Optional, Renderer2, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive';
import { DateHelperService } from '../i18n/date-helper.service';
import { NzI18nService } from '../i18n/nz-i18n.service';
import { DateRangePickerComponent } from './date-range-picker.component';
export 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 },
{ type: ChangeDetectorRef },
{ type: DateHelperService },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
if (false) {
/** @type {?} */
NzDatePickerComponent.prototype.isRange;
/** @type {?} */
NzDatePickerComponent.prototype.noAnimation;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1waWNrZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC15ai8iLCJzb3VyY2VzIjpbImRhdGUtcGlja2VyL2RhdGUtcGlja2VyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUNMLFVBQVUsRUFDVix1QkFBdUIsRUFDdkIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxVQUFVLEVBQ1YsSUFBSSxFQUNKLFFBQVEsRUFDUixTQUFTLEVBQ1QsaUJBQWlCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQ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