@suntelecoms/ngx-dynamic-form 1.2.5 → 1.2.8

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.
@@ -5,19 +5,39 @@ import * as i0 from "@angular/core";
5
5
  export declare class DynamicFieldComponent implements OnInit {
6
6
  field: DynamicFormField;
7
7
  form: FormGroup;
8
+ /** Apparence héritée du formulaire parent — surchargeable par field.appearance */
9
+ formAppearance: 'outline' | 'fill' | 'simple';
10
+ /** Comportement du label hérité du parent — surchargeable par field.floatLabel */
11
+ formFloatLabel: 'auto' | 'always';
12
+ get resolvedAppearance(): 'outline' | 'fill' | 'simple';
13
+ /** Apparence passée à mat-form-field : 'simple' est géré côté template, ne jamais le passer à Material */
14
+ get matAppearance(): 'outline' | 'fill';
15
+ get isSimple(): boolean;
16
+ get resolvedFloatLabel(): 'auto' | 'always';
8
17
  private builder;
9
18
  private http;
10
19
  private dataApiUrl;
11
20
  resolvedOptions: SelectOption[];
12
21
  loadingOptions: boolean;
22
+ locating: boolean;
23
+ locationError: string;
24
+ getLocation(): void;
25
+ private _geoError;
26
+ get hostStyle(): Record<string, string>;
27
+ get hostClass(): string;
13
28
  ngOnInit(): void;
14
29
  private resolveStaticOptions;
15
30
  private loadRemoteOptions;
16
31
  get formControl(): FormControl;
32
+ /**
33
+ * Masque de saisie : # = chiffre, tout autre caractère = séparateur littéral.
34
+ * Ex : '## ## ## ## ##' → téléphone, '##/##/####' → date.
35
+ */
36
+ applyMask(event: Event): void;
17
37
  get isInputField(): boolean;
18
38
  get hasOptions(): boolean;
19
39
  get hasError(): boolean;
20
40
  get errorMessage(): string | null;
21
41
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldComponent, "ngx-dynamic-field", never, { "field": { "alias": "field"; "required": true; }; "form": { "alias": "form"; "required": true; }; }, {}, never, never, true, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldComponent, "ngx-dynamic-field", never, { "field": { "alias": "field"; "required": true; }; "form": { "alias": "form"; "required": true; }; "formAppearance": { "alias": "formAppearance"; "required": false; }; "formFloatLabel": { "alias": "formFloatLabel"; "required": false; }; }, {}, never, never, true, never>;
23
43
  }
@@ -29,6 +29,12 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
29
29
  getForm(): FormGroup;
30
30
  /** Public API: patch values from outside */
31
31
  patchValues(values: Record<string, any>): void;
32
+ /**
33
+ * For URL-based select/multiselect/radio fields, the API may return nested objects
34
+ * (e.g. ville: { id: 9, nom: "Dakar" }) instead of a primitive value (9).
35
+ * Extract the displayValue key so the select control matches the correct option.
36
+ */
37
+ private normalizeValues;
32
38
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
33
39
  static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "ngx-dynamic-form", never, { "config": { "alias": "config"; "required": true; }; "initialValues": { "alias": "initialValues"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; "formReset": "formReset"; }, never, never, true, never>;
34
40
  }
@@ -32,6 +32,8 @@ export declare class FormBuilderComponent {
32
32
  resetLabel: import("@angular/core").WritableSignal<string>;
33
33
  showReset: import("@angular/core").WritableSignal<boolean>;
34
34
  stepperShowSummary: import("@angular/core").WritableSignal<boolean>;
35
+ formAppearance: import("@angular/core").WritableSignal<"outline" | "fill" | "simple">;
36
+ formFloatLabel: import("@angular/core").WritableSignal<"auto" | "always">;
35
37
  currentId: import("@angular/core").WritableSignal<string | null>;
36
38
  showExport: import("@angular/core").WritableSignal<boolean>;
37
39
  exportContent: import("@angular/core").WritableSignal<string>;
@@ -74,6 +76,18 @@ export declare class FormBuilderComponent {
74
76
  removeOption(idx: number): void;
75
77
  setOptionsSource(useUrl: boolean): void;
76
78
  private deleteProp;
79
+ /** Presets de masques de saisie courants */
80
+ readonly maskPresets: {
81
+ label: string;
82
+ value: string;
83
+ }[];
84
+ isCustomMask(): boolean;
85
+ setMaskPreset(value: string): void;
86
+ getMaskPresetValue(): string;
87
+ /** Convertit le Record<string,string> en texte CSS pour l'éditeur */
88
+ getStylesText(): string;
89
+ /** Parse le texte CSS et met à jour la propriété styles */
90
+ setStylesText(cssText: string): void;
77
91
  setMode(stepper: boolean): void;
78
92
  selectStep(i: number): void;
79
93
  addStep(): void;
@@ -29,6 +29,7 @@ export declare class StepperFormComponent implements OnInit, OnChanges {
29
29
  ngOnInit(): void;
30
30
  ngOnChanges(changes: SimpleChanges): void;
31
31
  private buildForms;
32
+ private normalizeValues;
32
33
  isVisible(field: DynamicFormField, form: FormGroup): boolean;
33
34
  nextStep(i: number): void;
34
35
  goToStep(i: number): void;
@@ -1,4 +1,4 @@
1
- export type FieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'multiselect' | 'checkbox' | 'radio' | 'date' | 'datetime-local' | 'file' | 'hidden' | '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' | 'divider' | 'heading';
2
2
  export interface SelectOption {
3
3
  label: string;
4
4
  value: any;
@@ -50,10 +50,28 @@ export interface DynamicFormField {
50
50
  accept?: string;
51
51
  multiple?: boolean;
52
52
  rows?: number;
53
+ min?: number;
54
+ max?: number;
55
+ step?: number;
56
+ showValue?: boolean;
53
57
  text?: string;
54
58
  level?: 1 | 2 | 3 | 4 | 5 | 6;
55
59
  icon?: string;
56
60
  iconSuffix?: string;
61
+ appearance?: 'outline' | 'fill' | 'simple';
62
+ floatLabel?: 'auto' | 'always';
63
+ prefix?: string;
64
+ suffix?: string;
65
+ mask?: string;
66
+ fontSize?: string;
67
+ textAlign?: 'left' | 'center' | 'right';
68
+ color?: string;
69
+ backgroundColor?: string;
70
+ borderColor?: string;
71
+ labelColor?: string;
72
+ fontWeight?: 'normal' | 'bold';
73
+ fontStyle?: 'normal' | 'italic';
74
+ styles?: Record<string, string>;
57
75
  attrs?: Record<string, any>;
58
76
  }
59
77
  export interface DynamicFormConfig {
@@ -64,6 +82,8 @@ export interface DynamicFormConfig {
64
82
  layout?: 'vertical' | 'horizontal' | 'inline';
65
83
  cssClass?: string;
66
84
  debug?: boolean;
85
+ appearance?: 'outline' | 'fill' | 'simple';
86
+ floatLabel?: 'auto' | 'always';
67
87
  }
68
88
  export interface FormStep {
69
89
  label: string;
@@ -82,6 +102,8 @@ export interface StepperFormConfig {
82
102
  summaryLabel?: string;
83
103
  cssClass?: string;
84
104
  debug?: boolean;
105
+ appearance?: 'outline' | 'fill' | 'simple';
106
+ floatLabel?: 'auto' | 'always';
85
107
  }
86
108
  export interface DynamicFormSubmitEvent {
87
109
  value: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suntelecoms/ngx-dynamic-form",
3
- "version": "1.2.5",
3
+ "version": "1.2.8",
4
4
  "description": "Générateur de formulaires Angular dynamiques — SUNTELECOMS",
5
5
  "author": "Amadou Diallo <amadoumacbookpro38@gmail.com>",
6
6
  "license": "MIT",