@ng-nest/ui 15.0.2 → 15.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, HostListener, ViewChild, NgModule } from '@angular/core';
3
3
  import { __decorate } from 'tslib';
4
4
  import * as i2 from '@ng-nest/ui/core';
5
- import { XWithConfig, XInputBoolean, XDataConvert, XProperty, XIsChange, chunk, XIsEmpty, XAddDays, XConnectBaseAnimation, XIsDate, XIsNumber, XIsString, XClearClass, XAddMonths, XAddYears, XIsUndefined } from '@ng-nest/ui/core';
5
+ import { XWithConfig, XInputBoolean, XDataConvert, XProperty, XIsChange, chunk, XIsEmpty, XAddDays, XConnectBaseAnimation, XIsDate, XIsNumber, XIsString, XIsNull, XClearClass, XAddMonths, XAddYears, XIsUndefined } from '@ng-nest/ui/core';
6
6
  import { XControlValueAccessor, XValueAccessor, XBaseFormModule } from '@ng-nest/ui/base-form';
7
7
  import { Subject } from 'rxjs';
8
8
  import { map, takeUntil } from 'rxjs/operators';
@@ -911,7 +911,7 @@ class XDatePickerComponent extends XDatePickerProperty {
911
911
  const valueTime = new Date(value).getTime();
912
912
  this.numberValue = !isNaN(valueTime) ? valueTime : '';
913
913
  }
914
- else if (XIsEmpty(value)) {
914
+ else if (XIsEmpty(value) || XIsNull(value)) {
915
915
  this.numberValue = '';
916
916
  }
917
917
  this.value = value;
@@ -991,11 +991,11 @@ class XDatePickerComponent extends XDatePickerProperty {
991
991
  }
992
992
  }
993
993
  clearEmit() {
994
- this.value = '';
994
+ this.value = null;
995
995
  this.numberValue = '';
996
996
  this.displayValue = '';
997
997
  this.mleave();
998
- this.valueChange.next(this.numberValue);
998
+ this.valueChange.next(this.value);
999
999
  this.modelChange();
1000
1000
  }
1001
1001
  modelChange() {
@@ -1005,6 +1005,8 @@ class XDatePickerComponent extends XDatePickerProperty {
1005
1005
  this.formControlValidator();
1006
1006
  }
1007
1007
  getValue() {
1008
+ if (this.numberValue === '')
1009
+ return null;
1008
1010
  return ['date', 'string'].includes(this.modelType) ? new Date(this.numberValue) : this.numberValue;
1009
1011
  }
1010
1012
  portalAttached() {
@@ -1736,4 +1738,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
1736
1738
 
1737
1739
  export { XDatePickerComponent, XDatePickerModule, XDatePickerPortalComponent, XDatePickerPortalPrefix, XDatePickerPrefix, XDatePickerProperty, XDateRangeComponent, XDateRangePortalComponent, XDateRangePortalPrefix, XDateRangePrefix, XDateRangeProperty, XPickerDateComponent, XPickerDatePrefix, XPickerDateProperty, XPickerMonthComponent, XPickerMonthPrefix, XPickerMonthProperty, XPickerYearComponent, XPickerYearPrefix, XPickerYearProperty };
1738
1740
  //# sourceMappingURL=ng-nest-ui-date-picker.mjs.map
1739
- //# sourceMappingURL=ng-nest-ui-date-picker.mjs.map