zek 19.0.7 → 19.0.10

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.
package/fesm2022/zek.mjs CHANGED
@@ -1835,10 +1835,9 @@ class CrudService extends BaseService {
1835
1835
  return this.api.post(`api/${this.controller}/batch`, model).pipe(catchError(this.handleError(this.batch.name, null)));
1836
1836
  }
1837
1837
  export(model, fileTypeId) {
1838
- if (Convert.isNumber(model)) {
1839
- return this.api.getBlob(`api/${this.controller}/${model}/export/${fileTypeId}`).pipe(catchError(this.handleError('export', null)));
1840
- }
1841
- return this.api.getBlob(`api/${this.controller}/export/${fileTypeId}`, model).pipe(catchError(this.handleError('export', null)));
1838
+ return Convert.isNumber(model)
1839
+ ? this.api.getBlob(`api/${this.controller}/${model}/export/${fileTypeId}`).pipe(catchError(this.handleError('export', null)))
1840
+ : this.api.getBlob(`api/${this.controller}/export/${fileTypeId}`, model).pipe(catchError(this.handleError('export', null)));
1842
1841
  }
1843
1842
  }
1844
1843
 
@@ -4051,6 +4050,8 @@ class DateValueAccessor {
4051
4050
  //@Input() ngModel: any;
4052
4051
  datepicker;
4053
4052
  oldValue = null;
4053
+ min;
4054
+ max;
4054
4055
  constructor(el, format, language, env) {
4055
4056
  this.el = el;
4056
4057
  if (env) {
@@ -4086,16 +4087,16 @@ class DateValueAccessor {
4086
4087
  el.nativeElement.addEventListener('changeDate', (e) => {
4087
4088
  this.onChangeDate(e); //execude
4088
4089
  });
4089
- setTimeout(() => {
4090
- const min = this.el.nativeElement.getAttribute('min');
4091
- const max = this.el.nativeElement.getAttribute('max');
4092
- const minDate = min ? DateHelper.toDate(min) : null;
4093
- const maxDate = max ? DateHelper.toDate(max) : null;
4094
- this.datepicker.setOptions({
4095
- minDate: minDate, //String|Date|Number
4096
- maxDate: maxDate, //String|Date|Number
4097
- });
4098
- }, 0);
4090
+ // setTimeout(() => {
4091
+ // const min = this.el.nativeElement.getAttribute('min');
4092
+ // const max = this.el.nativeElement.getAttribute('max');
4093
+ // const minDate = min ? DateHelper.toDate(min) : null;
4094
+ // const maxDate = max ? DateHelper.toDate(max) : null;
4095
+ // this.datepicker.setOptions({
4096
+ // minDate: minDate,//String|Date|Number
4097
+ // maxDate: maxDate,//String|Date|Number
4098
+ // });
4099
+ // }, 0);
4099
4100
  }
4100
4101
  // onKeyUp(e: any) {
4101
4102
  // if (e && e.target) {
@@ -4118,6 +4119,24 @@ class DateValueAccessor {
4118
4119
  this.datepicker.destroy();
4119
4120
  }
4120
4121
  }
4122
+ ngOnChanges(changes) {
4123
+ if (changes['min']) {
4124
+ const minDate = this.min ? DateHelper.toDate(this.min) : null;
4125
+ if (this.datepicker) {
4126
+ this.datepicker.setOptions({
4127
+ minDate: minDate,
4128
+ });
4129
+ }
4130
+ }
4131
+ if (changes['max']) {
4132
+ const maxDate = this.max ? DateHelper.toDate(this.max) : null;
4133
+ if (this.datepicker) {
4134
+ this.datepicker.setOptions({
4135
+ maxDate: maxDate
4136
+ });
4137
+ }
4138
+ }
4139
+ }
4121
4140
  /**
4122
4141
  * Fires when user choose date in datepicker
4123
4142
  * @param e Custom event
@@ -4204,7 +4223,7 @@ class DateValueAccessor {
4204
4223
  this.onTouched = fn;
4205
4224
  }
4206
4225
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateValueAccessor, deps: [{ token: i0.ElementRef }, { token: DATE_FORMAT }, { token: LANGUAGE }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Directive });
4207
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: DateValueAccessor, isStandalone: false, selector: "[zek-date],input[type=date][formControlName],input[type=date][formControl],input[type=date][ngModel]", providers: [DATE_VALUE_ACCESSOR], ngImport: i0 });
4226
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: DateValueAccessor, isStandalone: false, selector: "[zek-date],input[type=date][formControlName],input[type=date][formControl],input[type=date][ngModel]", inputs: { min: "min", max: "max" }, providers: [DATE_VALUE_ACCESSOR], usesOnChanges: true, ngImport: i0 });
4208
4227
  }
4209
4228
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateValueAccessor, decorators: [{
4210
4229
  type: Directive,
@@ -4226,7 +4245,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
4226
4245
  }] }, { type: undefined, decorators: [{
4227
4246
  type: Inject,
4228
4247
  args: ['env']
4229
- }] }] });
4248
+ }] }], propDecorators: { min: [{
4249
+ type: Input
4250
+ }], max: [{
4251
+ type: Input
4252
+ }] } });
4230
4253
 
4231
4254
  class DatepickerModule {
4232
4255
  static forRoot(config, environment) {