ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
410 lines • 28.1 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { InputBoolean } from '../core/util/convert';
import { CandyDate } from './lib/candy-date';
import { NzPickerComponent } from './picker.component';
/** @type {?} */
var 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
*/
var AbstractPickerComponent = /** @class */ (function () {
function AbstractPickerComponent(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 {?}
*/
function () { return void 0; });
this.onTouchedFn = (/**
* @return {?}
*/
function () { return void 0; });
}
Object.defineProperty(AbstractPickerComponent.prototype, "realOpenState", {
get:
// Indicate whether the value is a range value
/**
* @return {?}
*/
function () {
return this.picker.animationOpenState;
} // Use picker's real open state to let re-render the picker's content when shown up
,
enumerable: true,
configurable: true
});
// Use picker's real open state to let re-render the picker's content when shown up
/**
* @return {?}
*/
AbstractPickerComponent.prototype.initValue =
// Use picker's real open state to let re-render the picker's content when shown up
/**
* @return {?}
*/
function () {
this.nzValue = this.isRange ? [] : null;
};
/**
* @return {?}
*/
AbstractPickerComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
// 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 {?}
*/
function () { return _this.setLocale(); }));
}
// Default value
this.initValue();
};
/**
* @param {?} changes
* @return {?}
*/
AbstractPickerComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes.nzPopupStyle) {
// Always assign the popup style patch
this.nzPopupStyle = this.nzPopupStyle ? tslib_1.__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 {?}
*/
AbstractPickerComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroyed$.next();
this.destroyed$.complete();
};
/**
* @return {?}
*/
AbstractPickerComponent.prototype.closeOverlay = /**
* @return {?}
*/
function () {
this.picker.hideOverlay();
};
/**
* Common handle for value changes
* @param value changed value
*/
/**
* Common handle for value changes
* @param {?} value changed value
* @return {?}
*/
AbstractPickerComponent.prototype.onValueChange = /**
* Common handle for value changes
* @param {?} value changed value
* @return {?}
*/
function (value) {
this.nzValue = value;
if (this.isRange) {
/** @type {?} */
var vAsRange = (/** @type {?} */ (this.nzValue));
if (vAsRange.length) {
this.onChangeFn([vAsRange[0].nativeDate, vAsRange[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
*/
/**
* Triggered when overlayOpen changes (different with realOpenState)
* @param {?} open The overlayOpen in picker component
* @return {?}
*/
AbstractPickerComponent.prototype.onOpenChange = /**
* Triggered when overlayOpen changes (different with realOpenState)
* @param {?} open The overlayOpen in picker component
* @return {?}
*/
function (open) {
this.nzOnOpenChange.emit(open);
};
/**
* @param {?} value
* @return {?}
*/
AbstractPickerComponent.prototype.writeValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
this.setValue(value);
this.cdr.markForCheck();
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {?} fn
* @return {?}
*/
AbstractPickerComponent.prototype.registerOnChange =
// tslint:disable-next-line:no-any
/**
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onChangeFn = fn;
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {?} fn
* @return {?}
*/
AbstractPickerComponent.prototype.registerOnTouched =
// tslint:disable-next-line:no-any
/**
* @param {?} fn
* @return {?}
*/
function (fn) {
this.onTouchedFn = fn;
};
/**
* @param {?} disabled
* @return {?}
*/
AbstractPickerComponent.prototype.setDisabledState = /**
* @param {?} disabled
* @return {?}
*/
function (disabled) {
this.nzDisabled = disabled;
this.cdr.markForCheck();
};
// ------------------------------------------------------------------------
// | Internal methods
// ------------------------------------------------------------------------
// Reload locale from i18n with side effects
// ------------------------------------------------------------------------
// | Internal methods
// ------------------------------------------------------------------------
// Reload locale from i18n with side effects
/**
* @private
* @return {?}
*/
AbstractPickerComponent.prototype.setLocale =
// ------------------------------------------------------------------------
// | Internal methods
// ------------------------------------------------------------------------
// Reload locale from i18n with side effects
/**
* @private
* @return {?}
*/
function () {
this.nzLocale = this.i18n.getLocaleData('DatePicker', {});
this.setDefaultPlaceHolder();
this.cdr.markForCheck();
};
/**
* @private
* @return {?}
*/
AbstractPickerComponent.prototype.setDefaultPlaceHolder = /**
* @private
* @return {?}
*/
function () {
if (!this.isCustomPlaceHolder && this.nzLocale) {
this.nzPlaceHolder = this.isRange ? this.nzLocale.lang.rangePlaceholder : this.nzLocale.lang.placeholder;
}
};
// Safe way of setting value with default
// Safe way of setting value with default
/**
* @private
* @param {?} value
* @return {?}
*/
AbstractPickerComponent.prototype.setValue =
// Safe way of setting value with default
/**
* @private
* @param {?} value
* @return {?}
*/
function (value) {
if (this.isRange) {
this.nzValue = value ? ((/** @type {?} */ (value))).map((/**
* @param {?} val
* @return {?}
*/
function (val) { return 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 }],
nzFormat: [{ type: Input }],
nzValue: [{ type: Input }],
nzOnOpenChange: [{ type: Output }],
picker: [{ type: ViewChild, args: [NzPickerComponent,] }]
};
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzAllowClear", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzAutoFocus", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzDisabled", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Boolean)
], AbstractPickerComponent.prototype, "nzOpen", void 0);
return AbstractPickerComponent;
}());
export { AbstractPickerComponent };
if (false) {
/** @type {?} */
AbstractPickerComponent.prototype.nzAllowClear;
/** @type {?} */
AbstractPickerComponent.prototype.nzAutoFocus;
/** @type {?} */
AbstractPickerComponent.prototype.nzDisabled;
/** @type {?} */
AbstractPickerComponent.prototype.nzOpen;
/** @type {?} */
AbstractPickerComponent.prototype.nzClassName;
/** @type {?} */
AbstractPickerComponent.prototype.nzDisabledDate;
/** @type {?} */
AbstractPickerComponent.prototype.nzLocale;
/** @type {?} */
AbstractPickerComponent.prototype.nzPlaceHolder;
/** @type {?} */
AbstractPickerComponent.prototype.nzPopupStyle;
/** @type {?} */
AbstractPickerComponent.prototype.nzDropdownClassName;
/** @type {?} */
AbstractPickerComponent.prototype.nzSize;
/** @type {?} */
AbstractPickerComponent.prototype.nzStyle;
/** @type {?} */
AbstractPickerComponent.prototype.nzFormat;
/** @type {?} */
AbstractPickerComponent.prototype.nzValue;
/** @type {?} */
AbstractPickerComponent.prototype.nzOnOpenChange;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.picker;
/** @type {?} */
AbstractPickerComponent.prototype.isRange;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.destroyed$;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.isCustomPlaceHolder;
/** @type {?} */
AbstractPickerComponent.prototype.onChangeFn;
/** @type {?} */
AbstractPickerComponent.prototype.onTouchedFn;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.i18n;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.cdr;
/**
* @type {?}
* @protected
*/
AbstractPickerComponent.prototype.dateHelper;
/** @type {?} */
AbstractPickerComponent.prototype.noAnimation;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QtcGlja2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLXpvcnJvLWFudGQteWovIiwic291cmNlcyI6WyJkYXRlLXBpY2tlci9hYnN0cmFjdC1waWNrZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUVMLFlBQVksRUFDWixL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