@suntelecoms/ngx-dynamic-form 1.7.7 → 1.7.14

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.
@@ -22,6 +22,7 @@ export declare class DynamicFieldComponent implements OnInit {
22
22
  private dataApiUrl;
23
23
  private globalDateLocale;
24
24
  private dateAdapter;
25
+ private cdr;
25
26
  resolvedOptions: SelectOption[];
26
27
  loadingOptions: boolean;
27
28
  lookupLoading: boolean;
@@ -37,6 +38,23 @@ export declare class DynamicFieldComponent implements OnInit {
37
38
  key: string;
38
39
  value: any;
39
40
  }>;
41
+ isoCountrySearchCtrl: FormControl<string | null>;
42
+ get filteredIsoCountries(): PhoneCountry[];
43
+ displayIsoCountry: (value: PhoneCountry | string | null) => string;
44
+ onIsoCountrySelected(event: MatAutocompleteSelectedEvent): void;
45
+ dialCodeSearchCtrl: FormControl<string | null>;
46
+ get filteredDialCodeCountries(): PhoneCountry[];
47
+ displayDialCode: (value: PhoneCountry | string | null) => string;
48
+ onDialCodeSelected(event: MatAutocompleteSelectedEvent): void;
49
+ fileDragging: boolean;
50
+ get selectedFiles(): File[];
51
+ onFileInputChange(event: Event): void;
52
+ onFileDragOver(event: DragEvent): void;
53
+ onFileDragLeave(event: DragEvent): void;
54
+ onFileDrop(event: DragEvent): void;
55
+ removeFile(index: number, input: HTMLInputElement): void;
56
+ formatFileSize(bytes: number): string;
57
+ private setFiles;
40
58
  locating: boolean;
41
59
  locationError: string;
42
60
  readonly phoneCountries: PhoneCountry[];
@@ -65,6 +83,9 @@ export declare class DynamicFieldComponent implements OnInit {
65
83
  * tant que l'utilisateur ne tape pas, contrairement à `resolveOptions()`. */
66
84
  private setupRemoteSearch;
67
85
  private fetchRemoteSearch;
86
+ /** Applique field.optionsFilter (ex: ne garder que status === 'ACTIF') aux items bruts
87
+ * reçus de l'API, avant leur mapping en {label, value}. No-op si non configuré. */
88
+ private filterItems;
68
89
  /** @param cacheRaw Conserve la réponse brute dans `rawRemoteItems` pour un filtrage local ultérieur, au lieu de la mapper directement dans `resolvedOptions`. */
69
90
  private loadRemoteOptions;
70
91
  /**
@@ -95,6 +95,11 @@ export declare class FormBuilderComponent {
95
95
  addCondition(): void;
96
96
  removeCondition(index: number): void;
97
97
  updateCondition(index: number, key: keyof FieldCondition, value: any): void;
98
+ getOptionsFilterConditions(): FieldCondition[];
99
+ setOptionsFilterLogic(logic: 'AND' | 'OR'): void;
100
+ addOptionsFilterCondition(): void;
101
+ removeOptionsFilterCondition(index: number): void;
102
+ updateOptionsFilterCondition(index: number, key: keyof FieldCondition, value: any): void;
98
103
  toggleUniqueCheck(enabled: boolean): void;
99
104
  setUniqueCheckProp(key: 'url' | 'message', value: string): void;
100
105
  toggleLookup(enabled: boolean): void;
@@ -12,6 +12,8 @@ export declare class MesFormulairesComponent {
12
12
  private snack;
13
13
  readonly savedForms: import("@angular/core").Signal<SavedFormSchema[]>;
14
14
  readonly loadError: import("@angular/core").WritableSignal<string | null>;
15
+ searchTerm: import("@angular/core").WritableSignal<string>;
16
+ filteredForms: import("@angular/core").Signal<SavedFormSchema[]>;
15
17
  selectedId: import("@angular/core").WritableSignal<string | null>;
16
18
  submitted: import("@angular/core").WritableSignal<boolean>;
17
19
  submitData: import("@angular/core").WritableSignal<Record<string, unknown>>;
@@ -1,4 +1,4 @@
1
- export type FieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'multiselect' | 'checkbox' | 'radio' | 'switch' | 'date' | 'datetime-local' | 'time' | 'month' | 'week' | 'range' | 'color' | 'location' | 'file' | 'hidden' | 'phone' | 'divider' | 'heading';
1
+ export type FieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'multiselect' | 'checkbox' | 'radio' | 'switch' | 'date' | 'datetime-local' | 'time' | 'month' | 'week' | 'range' | 'color' | 'location' | 'file' | 'hidden' | 'phone' | 'iso-country' | 'country-dial-code' | 'divider' | 'heading';
2
2
  export interface SelectOption {
3
3
  label: string;
4
4
  value: any;
@@ -100,6 +100,12 @@ export interface DynamicFormField {
100
100
  lookup?: FieldLookup;
101
101
  /** type: 'select' only — remote-search typeahead instead of eager-loading `url`. */
102
102
  remoteSearch?: RemoteSearchConfig;
103
+ /** Filtre les items reçus de `url` avant leur mapping en {label, value} (ex: ne garder que
104
+ * status === 'ACTIF'). Même forme que showWhen, mais évalué contre les propriétés BRUTES
105
+ * de chaque item API (ex: item.status) — pas les valeurs d'un autre champ du formulaire. */
106
+ optionsFilter?: FieldCondition | FieldCondition[];
107
+ /** Logique entre les conditions de optionsFilter (indépendante de conditionLogic, qui régit showWhen/requiredWhen). @default 'AND' */
108
+ optionsFilterLogic?: 'AND' | 'OR';
103
109
  col?: 1 | 2 | 3 | 4 | 6 | 8 | 9 | 12;
104
110
  cssClass?: string;
105
111
  showWhen?: FieldCondition | FieldCondition[];
@@ -4,6 +4,12 @@ import * as i0 from "@angular/core";
4
4
  export declare class ConditionEvaluatorService {
5
5
  isVisible(field: DynamicFormField, form: FormGroup): boolean;
6
6
  evaluate(condition: FieldCondition, form: FormGroup): boolean;
7
+ /** Comme evaluate(), mais contre les propriétés d'un objet brut (ex: un item de réponse API)
8
+ * plutôt que les valeurs d'un FormGroup — utilisé par optionsFilter. */
9
+ evaluateItem(condition: FieldCondition, item: Record<string, any>): boolean;
10
+ /** condition(s) + logique ET/OU, contre un item brut — voir optionsFilter sur DynamicFormField. */
11
+ matchesItem(conditions: FieldCondition | FieldCondition[], logic: 'AND' | 'OR' | undefined, item: Record<string, any>): boolean;
12
+ private compare;
7
13
  static ɵfac: i0.ɵɵFactoryDeclaration<ConditionEvaluatorService, never>;
8
14
  static ɵprov: i0.ɵɵInjectableDeclaration<ConditionEvaluatorService>;
9
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suntelecoms/ngx-dynamic-form",
3
- "version": "1.7.7",
3
+ "version": "1.7.14",
4
4
  "description": "Générateur de formulaires Angular dynamiques — SUNTELECOMS",
5
5
  "author": "Amadou Diallo <amadoumacbookpro38@gmail.com>",
6
6
  "license": "MIT",