ngx-ode-ui 4.8.0-dev.0develop-b2school.14 → 4.8.0-dev.2

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.
@@ -1,8 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, forwardRef, EventEmitter, Component, ViewChild, Input, Output, HostBinding, Directive, Pipe, TemplateRef, ContentChild, ChangeDetectionStrategy, HostListener, ContentChildren, Injector, NgModule } from '@angular/core';
3
- import { throwError, Observable, Subject, fromEvent } from 'rxjs';
3
+ import { throwError, Observable, Subject } from 'rxjs';
4
4
  import { OdeComponent } from 'ngx-ode-core';
5
- import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
6
5
  import * as i2 from '@angular/forms';
7
6
  import { NG_VALUE_ACCESSOR, NgModel, FormsModule } from '@angular/forms';
8
7
  import Flatpickr from 'flatpickr';
@@ -13,6 +12,7 @@ import * as i2$1 from 'ngx-ode-sijil';
13
12
  import { NgxOdeSijilModule } from 'ngx-ode-sijil';
14
13
  import * as i2$2 from 'ngx-infinite-scroll';
15
14
  import { InfiniteScrollModule } from 'ngx-infinite-scroll';
15
+ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
16
16
 
17
17
  class DynamicModuleImportsService {
18
18
  constructor() {
@@ -203,6 +203,7 @@ class DatepickerComponent extends OdeComponent {
203
203
  this.onChangeCallback = NOOP;
204
204
  this.onTouchedCallback = NOOP;
205
205
  this.onInputChangeObserver = null;
206
+ this.debounceTimer = null;
206
207
  }
207
208
  get value() {
208
209
  return this.innerValue;
@@ -273,11 +274,8 @@ class DatepickerComponent extends OdeComponent {
273
274
  this.datePickerInst.toggle();
274
275
  }
275
276
  });
276
- // Add input handler for manual entry with debounce
277
- this.onInputChangeObserver = fromEvent(this.datePickerInst.altInput, 'input')
278
- .pipe(debounceTime(300))
279
- .subscribe(() => {
280
- // when user input a date manually, we try to parse it and set it as selected date
277
+ // Add blur handler for manual entry
278
+ this.datePickerInst.altInput.addEventListener('blur', e => {
281
279
  const inputDate = this.datePickerInst.parseDate(this.datePickerInst.altInput.value, options.altFormat);
282
280
  if (inputDate) {
283
281
  this.datePickerInst.setDate(inputDate, true);
@@ -290,9 +288,6 @@ class DatepickerComponent extends OdeComponent {
290
288
  ngOnDestroy() {
291
289
  super.ngOnDestroy();
292
290
  this.datePickerInst.destroy();
293
- if (this.onInputChangeObserver) {
294
- this.onInputChangeObserver.unsubscribe();
295
- }
296
291
  }
297
292
  writeValue(value) {
298
293
  if (value !== this.innerValue && this.datePickerInst) {