@3kles/kles-material-dynamicforms 14.0.15 → 14.1.0

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,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, EventEmitter, Component, Output, Injectable, NgModule, HostBinding, Pipe, ViewChild, ViewChildren, forwardRef, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
2
+ import { Injector, Directive, Input, EventEmitter, Component, Output, Injectable, NgModule, HostBinding, Pipe, ViewChild, ViewChildren, forwardRef, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
6
  import { Validators, NG_VALUE_ACCESSOR, UntypedFormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
7
7
  import * as i7$1 from '@angular/material/core';
8
- import { MatNativeDateModule, MatOption, ErrorStateMatcher } from '@angular/material/core';
8
+ import { MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatNativeDateModule, MatOption, ErrorStateMatcher } from '@angular/material/core';
9
9
  import { MatSliderModule } from '@angular/material/slider';
10
10
  import * as i4$1 from '@angular/material/button';
11
11
  import { MatButtonModule } from '@angular/material/button';
@@ -121,8 +121,15 @@ class KlesDynamicFieldDirective {
121
121
  if (this.componentRef) {
122
122
  this.componentRef.destroy();
123
123
  }
124
+ const options = {
125
+ providers: this.field.dateOptions ? [
126
+ { provide: MAT_DATE_LOCALE, useValue: this.field.dateOptions.language },
127
+ { provide: MAT_DATE_FORMATS, useValue: this.field.dateOptions.dateFormat },
128
+ ] : []
129
+ };
130
+ const injector = Injector.create(options);
124
131
  this.componentRef = this.container.createComponent(this.field.component
125
- || componentMapper.find(element => element.type === this.field.type)?.component);
132
+ || componentMapper.find(element => element.type === this.field.type)?.component, { injector });
126
133
  this.componentRef.instance.field = this.field;
127
134
  this.componentRef.instance.group = this.group;
128
135
  this.componentRef.instance.siblingFields = this.siblingFields;
@@ -2298,7 +2305,6 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
2298
2305
  }
2299
2306
  }))
2300
2307
  .subscribe((options) => {
2301
- console.log('options', options);
2302
2308
  this.options$.next(options);
2303
2309
  this.isLoading = false;
2304
2310
  this.ref.markForCheck();