@elite.framework/ng.core 1.0.40 → 1.0.42
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,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, Output, Input, Component, InjectionToken, inject, Inject, Injectable, ViewChild, ChangeDetectionStrategy, NgModule, Directive, Pipe, PLATFORM_ID, Optional } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/forms';
|
|
4
|
-
import { FormGroup, FormsModule, ReactiveFormsModule, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
|
|
4
|
+
import { FormGroup, FormsModule, ReactiveFormsModule, UntypedFormGroup, FormArray, UntypedFormControl } from '@angular/forms';
|
|
5
5
|
import * as i1$8 from '@ngx-formly/core';
|
|
6
6
|
import { FormlyForm, FieldType, FormlyAttributes, FormlyModule, FormlyField, FieldWrapper, FieldArrayType, provideFormlyCore } from '@ngx-formly/core';
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
@@ -4136,7 +4136,7 @@ class GenericSelectorTypeComponent extends FieldType {
|
|
|
4136
4136
|
loadDefaultValue() {
|
|
4137
4137
|
this.loading = true;
|
|
4138
4138
|
const vf = this.to['valueField'] || 'id';
|
|
4139
|
-
const fixedFilters = this.
|
|
4139
|
+
const fixedFilters = this.getFixedFilters();
|
|
4140
4140
|
const lf = this.to['loadDefaultField'] || 'isDefault';
|
|
4141
4141
|
const lfValue = this.to['loadDefaultValue'] || true;
|
|
4142
4142
|
const searchParams = {
|
|
@@ -4252,10 +4252,18 @@ class GenericSelectorTypeComponent extends FieldType {
|
|
|
4252
4252
|
});
|
|
4253
4253
|
}
|
|
4254
4254
|
}
|
|
4255
|
+
getFixedFilters() {
|
|
4256
|
+
const fixedFilters = this.to['fixedFilters'];
|
|
4257
|
+
if (typeof fixedFilters === 'function') {
|
|
4258
|
+
// Call with current model (and optionally field)
|
|
4259
|
+
return fixedFilters(this.model);
|
|
4260
|
+
}
|
|
4261
|
+
return fixedFilters || {};
|
|
4262
|
+
}
|
|
4255
4263
|
search(event) {
|
|
4256
4264
|
const q = event.query?.toString().toLowerCase() || '';
|
|
4257
4265
|
const lf = this.to['labelField'] || 'name';
|
|
4258
|
-
const fixedFilters = this.
|
|
4266
|
+
const fixedFilters = this.getFixedFilters();
|
|
4259
4267
|
if (this.to['offline']) {
|
|
4260
4268
|
this.options_ = this.to['offlineDataFn']
|
|
4261
4269
|
? this.to['offlineDataFn'](q)
|
|
@@ -4747,11 +4755,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
4747
4755
|
}] });
|
|
4748
4756
|
|
|
4749
4757
|
class RepeatTypeComponent extends FieldArrayType {
|
|
4758
|
+
cdr;
|
|
4750
4759
|
// Return columns of the first row (for table headers)
|
|
4751
4760
|
getFirstRowColumns() {
|
|
4752
4761
|
return this.field.fieldGroup?.[0]?.fieldGroup ?? [];
|
|
4753
4762
|
}
|
|
4754
|
-
|
|
4763
|
+
constructor(cdr) {
|
|
4764
|
+
super();
|
|
4765
|
+
this.cdr = cdr;
|
|
4766
|
+
}
|
|
4767
|
+
ngOnInit() {
|
|
4768
|
+
// Subscribe to each FormArray changes
|
|
4769
|
+
if (this.formControl instanceof FormArray) {
|
|
4770
|
+
this.formControl.valueChanges.subscribe(() => {
|
|
4771
|
+
// Force Angular to detect changes
|
|
4772
|
+
this.cdr.detectChanges();
|
|
4773
|
+
});
|
|
4774
|
+
}
|
|
4775
|
+
}
|
|
4776
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RepeatTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4755
4777
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: RepeatTypeComponent, isStandalone: true, selector: "formly-repeat-section", usesInheritance: true, ngImport: i0, template: `
|
|
4756
4778
|
<div class="overflow-auto bg-gray-100 border border-gray-300">
|
|
4757
4779
|
<table *ngIf="(field.fieldGroup ?? []).length > 0" class="table-auto w-full border border-gray-300">
|
|
@@ -4850,7 +4872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
4850
4872
|
</div>
|
|
4851
4873
|
`,
|
|
4852
4874
|
}]
|
|
4853
|
-
}] });
|
|
4875
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
4854
4876
|
|
|
4855
4877
|
class TabsTypeComponent extends FieldType {
|
|
4856
4878
|
isValid(field) {
|